diff --git a/packages/cli/src/public-api/v1/handlers/source-control/spec/paths/sourceControl.yml b/packages/cli/src/public-api/v1/handlers/source-control/spec/paths/sourceControl.yml index 67ef8b278b6..9eaac46dada 100644 --- a/packages/cli/src/public-api/v1/handlers/source-control/spec/paths/sourceControl.yml +++ b/packages/cli/src/public-api/v1/handlers/source-control/spec/paths/sourceControl.yml @@ -14,12 +14,17 @@ post: $ref: '../schemas/pull.yml' responses: '200': - description: Import result + description: Pull result containing the list of files that were pulled from the remote repository. content: application/json: schema: - $ref: '../schemas/importResult.yml' + $ref: '../schemas/pullResult.yml' '400': $ref: '../../../../shared/spec/responses/badRequest.yml' '409': - $ref: '../../../../shared/spec/responses/conflict.yml' + description: | + Conflict due to uncommitted local changes or merge conflicts. The response body lists every file in the pull diff; files causing the conflict have `conflict: true` or `status: modified`. Retry with `force=true` to discard local changes. + content: + application/json: + schema: + $ref: '../schemas/pullResult.yml' diff --git a/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/importResult.yml b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/importResult.yml deleted file mode 100644 index ea726f42493..00000000000 --- a/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/importResult.yml +++ /dev/null @@ -1,55 +0,0 @@ -type: object -additionalProperties: true -properties: - variables: - type: object - properties: - added: - type: array - items: - type: string - changed: - type: array - items: - type: string - credentials: - type: array - items: - type: object - properties: - id: - type: string - name: - type: string - type: - type: string - workflows: - type: array - items: - type: object - properties: - id: - type: string - name: - type: string - tags: - type: object - properties: - tags: - type: array - items: - type: object - properties: - id: - type: string - name: - type: string - mappings: - type: array - items: - type: object - properties: - workflowId: - type: string - tagId: - type: string diff --git a/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pull.yml b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pull.yml index 88dbf476ea3..b952cf1d68e 100644 --- a/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pull.yml +++ b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pull.yml @@ -13,6 +13,3 @@ properties: - `all`: Publish all imported workflows - `published`: Publish only workflows that were published locally before import example: published - variables: - type: object - example: { 'foo': 'bar' } diff --git a/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pullResult.yml b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pullResult.yml new file mode 100644 index 00000000000..ac33d0ff950 --- /dev/null +++ b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/pullResult.yml @@ -0,0 +1,3 @@ +type: array +items: + $ref: './sourceControlledFile.yml' diff --git a/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/sourceControlledFile.yml b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/sourceControlledFile.yml new file mode 100644 index 00000000000..359324801b8 --- /dev/null +++ b/packages/cli/src/public-api/v1/handlers/source-control/spec/schemas/sourceControlledFile.yml @@ -0,0 +1,80 @@ +type: object +required: + - file + - id + - name + - type + - status + - location + - conflict + - updatedAt +properties: + file: + type: string + id: + type: string + name: + type: string + type: + type: string + enum: + - credential + - workflow + - tags + - variables + - file + - folders + - project + - datatable + status: + type: string + enum: + - new + - modified + - deleted + - created + - renamed + - conflicted + - ignored + - staged + - unknown + location: + type: string + enum: + - local + - remote + conflict: + type: boolean + updatedAt: + type: string + pushed: + type: boolean + isLocalPublished: + type: boolean + isRemoteArchived: + type: boolean + parentFolderId: + type: string + nullable: true + folderPath: + type: array + items: + type: string + owner: + type: object + required: + - type + - projectId + - projectName + properties: + type: + type: string + enum: + - personal + - team + projectId: + type: string + projectName: + type: string + publishingError: + type: string diff --git a/packages/cli/src/public-api/v1/shared/spec/schemas/_index.yml b/packages/cli/src/public-api/v1/shared/spec/schemas/_index.yml index 0e268f2acc2..f37446c2b8d 100644 --- a/packages/cli/src/public-api/v1/shared/spec/schemas/_index.yml +++ b/packages/cli/src/public-api/v1/shared/spec/schemas/_index.yml @@ -24,8 +24,10 @@ Audit: $ref: './../../../handlers/audit/spec/schemas/audit.yml' Pull: $ref: './../../../handlers/source-control/spec/schemas/pull.yml' -ImportResult: - $ref: './../../../handlers/source-control/spec/schemas/importResult.yml' +PullResult: + $ref: './../../../handlers/source-control/spec/schemas/pullResult.yml' +SourceControlledFile: + $ref: './../../../handlers/source-control/spec/schemas/sourceControlledFile.yml' UserList: $ref: './../../../handlers/users/spec/schemas/userList.yml' User: