diff --git a/.repository-projection.json b/.repository-projection.json index 2f289aa..557c6eb 100644 --- a/.repository-projection.json +++ b/.repository-projection.json @@ -3,11 +3,11 @@ "projection": "api", "projectionSchemaVersion": 1, "sourceRepository": "dx-corp/mono", - "sourceSha": "e2e8bfa24848edcccdf5f7e5f5dda61c979e6607", + "sourceSha": "2a7522b52a13fe770f480745fa7b41ac2188a9e7", "destinationRepository": "dx-corp/api", - "priorProjectedBase": "1181b4fe81f4ffae275c0ce94de6995c9649e9a9", + "priorProjectedBase": "65020664845801c739014b317649009eb2e93deb", "definitionDigest": "4c1601bee99ccc8305013324608e9c146999b21427179d25fd342f69aebd37bd", - "toolDigest": "d0c2f4acb3916b1207c5c9b7b2b8e6e5c772938c", - "contentDigest": "7028ebed59e745cb6279bfbc73ec3684a7099551d20f9793d0ddf819c0c2d13d", + "toolDigest": "0b559427b4956119349f84f6b203c0877aaec738", + "contentDigest": "f1362d89f3cac276bd3d7addc592b4934dc40c2b67cbe218b232949e2350d928", "publicationEligible": true } diff --git a/openapi/deixicpublic/v1/sdk.openapi.yaml b/openapi/deixicpublic/v1/sdk.openapi.yaml index 5856c70..e6c031d 100644 --- a/openapi/deixicpublic/v1/sdk.openapi.yaml +++ b/openapi/deixicpublic/v1/sdk.openapi.yaml @@ -739,6 +739,116 @@ paths: application/json: schema: $ref: '#/components/schemas/deixicpublic.v1.ListBusinessObjectTypesResponse' + /deixicpublic.v1.DeixicPublicService/DefineBusinessObjectType: + post: + tags: + - deixicpublic.v1.DeixicPublicService + summary: DefineBusinessObjectType + description: Publishes a workspace type revision; expected_revision 0 creates the type. + operationId: deixicpublic.v1.DeixicPublicService.DefineBusinessObjectType + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/deixicpublic.v1.DefineBusinessObjectTypeRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/deixicpublic.v1.DefineBusinessObjectTypeResponse' + /deixicpublic.v1.DeixicPublicService/GetBusinessObjectType: + post: + tags: + - deixicpublic.v1.DeixicPublicService + summary: GetBusinessObjectType + description: Reads one immutable published revision of a type. + operationId: deixicpublic.v1.DeixicPublicService.GetBusinessObjectType + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/deixicpublic.v1.GetBusinessObjectTypeRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/deixicpublic.v1.GetBusinessObjectTypeResponse' + /deixicpublic.v1.DeixicPublicService/UpsertBusinessObject: + post: + tags: + - deixicpublic.v1.DeixicPublicService + summary: UpsertBusinessObject + description: |- + Creates the record whose declared unique field holds the given value, or + updates the one that already does, atomically on the server. + operationId: deixicpublic.v1.DeixicPublicService.UpsertBusinessObject + parameters: + - name: Connect-Protocol-Version + in: header + required: true + schema: + $ref: '#/components/schemas/connect-protocol-version' + - name: Connect-Timeout-Ms + in: header + schema: + $ref: '#/components/schemas/connect-timeout-header' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/deixicpublic.v1.UpsertBusinessObjectRequest' + required: true + responses: + default: + description: Error + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + "200": + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/deixicpublic.v1.UpsertBusinessObjectResponse' /deixicpublic.v1.DeixicPublicService/ListBusinessBlueprints: post: tags: @@ -1524,6 +1634,22 @@ paths: $ref: '#/components/schemas/deixicpublic.v1.GetAuditRequestItemResponse' components: schemas: + deixicpublic.v1.BusinessFieldKind: + type: string + title: BusinessFieldKind + enum: + - BUSINESS_FIELD_KIND_UNSPECIFIED + - BUSINESS_FIELD_KIND_TEXT + - BUSINESS_FIELD_KIND_INTEGER + - BUSINESS_FIELD_KIND_BOOLEAN + - BUSINESS_FIELD_KIND_DECIMAL + - BUSINESS_FIELD_KIND_MONEY + - BUSINESS_FIELD_KIND_ENUM + - BUSINESS_FIELD_KIND_DATE + - BUSINESS_FIELD_KIND_TIMESTAMP + - BUSINESS_FIELD_KIND_REFERENCE + - BUSINESS_FIELD_KIND_ARTIFACT + - BUSINESS_FIELD_KIND_TEXT_LIST deixicpublic.v1.BusinessSourceFieldProperty: type: string title: BusinessSourceFieldProperty @@ -2298,8 +2424,10 @@ components: - string title: revision format: int64 + description: 'Output only: the published revision.' blueprintOrigin: title: blueprint_origin + description: 'Output only: assigned when a built-in blueprint member is cloned.' $ref: '#/components/schemas/deixicpublic.v1.BusinessBlueprintOrigin' displayFieldId: type: string @@ -2309,6 +2437,17 @@ components: items: $ref: '#/components/schemas/deixicpublic.v1.BusinessObjectTypeField' title: fields + relationships: + type: array + items: + $ref: '#/components/schemas/deixicpublic.v1.BusinessObjectTypeRelationship' + title: relationships + pluralName: + type: string + title: plural_name + description: + type: string + title: description title: BusinessObjectType additionalProperties: false deixicpublic.v1.BusinessObjectTypeField: @@ -2323,8 +2462,52 @@ components: sourceMappable: type: boolean title: source_mappable + description: 'Output only: derived from the field kind.' + name: + type: string + title: name + kind: + title: kind + $ref: '#/components/schemas/deixicpublic.v1.BusinessFieldKind' + required: + type: boolean + title: required + unique: + type: boolean + title: unique + description: At most one live record of the type holds a given value. + enumValues: + type: array + items: + type: string + title: enum_values + referenceTypeId: + type: string + title: reference_type_id + description: + type: string + title: description + maxLength: + type: integer + title: max_length + description: 'TEXT only: maximum Unicode code points, from 1 through 8192.' + nullable: true title: BusinessObjectTypeField additionalProperties: false + deixicpublic.v1.BusinessObjectTypeRelationship: + type: object + properties: + relationshipId: + type: string + title: relationship_id + name: + type: string + title: name + targetTypeId: + type: string + title: target_type_id + title: BusinessObjectTypeRelationship + additionalProperties: false deixicpublic.v1.BusinessSourceFieldMapping: type: object properties: @@ -2688,6 +2871,38 @@ components: $ref: '#/components/schemas/deixicpublic.v1.Program' title: CreateProgramResponse additionalProperties: false + deixicpublic.v1.DefineBusinessObjectTypeRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + idempotencyKey: + type: string + title: idempotency_key + definition: + title: definition + $ref: '#/components/schemas/deixicpublic.v1.BusinessObjectType' + expectedRevision: + type: + - integer + - string + title: expected_revision + format: int64 + description: The revision this change replaces; 0 creates the type. + title: DefineBusinessObjectTypeRequest + additionalProperties: false + deixicpublic.v1.DefineBusinessObjectTypeResponse: + type: object + properties: + definition: + title: definition + $ref: '#/components/schemas/deixicpublic.v1.BusinessObjectType' + title: DefineBusinessObjectTypeResponse + additionalProperties: false deixicpublic.v1.DeleteBusinessObjectRelationshipRequest: type: object properties: @@ -2948,6 +3163,35 @@ components: $ref: '#/components/schemas/deixicpublic.v1.BusinessObject' title: GetBusinessObjectResponse additionalProperties: false + deixicpublic.v1.GetBusinessObjectTypeRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + typeId: + type: string + title: type_id + revision: + type: + - integer + - string + title: revision + format: int64 + description: A published revision, from DefineBusinessObjectType or ListBusinessObjectTypes. + title: GetBusinessObjectTypeRequest + additionalProperties: false + deixicpublic.v1.GetBusinessObjectTypeResponse: + type: object + properties: + definition: + title: definition + $ref: '#/components/schemas/deixicpublic.v1.BusinessObjectType' + title: GetBusinessObjectTypeResponse + additionalProperties: false deixicpublic.v1.GetClientSetupRequest: type: object properties: @@ -4522,6 +4766,51 @@ components: $ref: '#/components/schemas/deixicpublic.v1.Program' title: UpdateProgramResponse additionalProperties: false + deixicpublic.v1.UpsertBusinessObjectRequest: + type: object + properties: + organizationId: + type: string + title: organization_id + workspaceId: + type: string + title: workspace_id + idempotencyKey: + type: string + title: idempotency_key + typeId: + type: string + title: type_id + schemaRevision: + type: + - integer + - string + title: schema_revision + format: int64 + description: Published schema revision for a new record; zero keeps an existing record's. + uniqueFieldId: + type: string + title: unique_field_id + description: A field the type declares unique; `values` must carry it. + values: + type: array + items: + $ref: '#/components/schemas/deixicpublic.v1.BusinessFieldValue' + title: values + title: UpsertBusinessObjectRequest + additionalProperties: false + deixicpublic.v1.UpsertBusinessObjectResponse: + type: object + properties: + object: + title: object + $ref: '#/components/schemas/deixicpublic.v1.BusinessObject' + created: + type: boolean + title: created + description: True when this call created the record, false when it updated one. + title: UpsertBusinessObjectResponse + additionalProperties: false deixicpublic.v1.VoiceSelection: type: object properties: diff --git a/proto/deixicpublic/v1/sdk.proto b/proto/deixicpublic/v1/sdk.proto index 5c334bf..e19566a 100644 --- a/proto/deixicpublic/v1/sdk.proto +++ b/proto/deixicpublic/v1/sdk.proto @@ -32,6 +32,13 @@ service DeixicPublicService { rpc DeleteBusinessObject(DeleteBusinessObjectRequest) returns (DeleteBusinessObjectResponse); rpc ListBusinessObjects(ListBusinessObjectsRequest) returns (ListBusinessObjectsResponse); rpc ListBusinessObjectTypes(ListBusinessObjectTypesRequest) returns (ListBusinessObjectTypesResponse); + // Publishes a workspace type revision; expected_revision 0 creates the type. + rpc DefineBusinessObjectType(DefineBusinessObjectTypeRequest) returns (DefineBusinessObjectTypeResponse); + // Reads one immutable published revision of a type. + rpc GetBusinessObjectType(GetBusinessObjectTypeRequest) returns (GetBusinessObjectTypeResponse); + // Creates the record whose declared unique field holds the given value, or + // updates the one that already does, atomically on the server. + rpc UpsertBusinessObject(UpsertBusinessObjectRequest) returns (UpsertBusinessObjectResponse); rpc ListBusinessBlueprints(ListBusinessBlueprintsRequest) returns (ListBusinessBlueprintsResponse); rpc BindBusinessObjectSource(BindBusinessObjectSourceRequest) returns (BindBusinessObjectSourceResponse); rpc ListBusinessObjectRelationships(ListBusinessObjectRelationshipsRequest) returns (ListBusinessObjectRelationshipsResponse); @@ -483,18 +490,90 @@ message BusinessBlueprintOrigin { int64 version = 2; string source_type_id = 3; } +enum BusinessFieldKind { + BUSINESS_FIELD_KIND_UNSPECIFIED = 0; + BUSINESS_FIELD_KIND_TEXT = 1; + BUSINESS_FIELD_KIND_INTEGER = 2; + BUSINESS_FIELD_KIND_BOOLEAN = 3; + BUSINESS_FIELD_KIND_DECIMAL = 4; + BUSINESS_FIELD_KIND_MONEY = 5; + BUSINESS_FIELD_KIND_ENUM = 6; + BUSINESS_FIELD_KIND_DATE = 7; + BUSINESS_FIELD_KIND_TIMESTAMP = 8; + BUSINESS_FIELD_KIND_REFERENCE = 9; + BUSINESS_FIELD_KIND_ARTIFACT = 10; + BUSINESS_FIELD_KIND_TEXT_LIST = 11; +} message BusinessObjectTypeField { string field_id = 1; string group_id = 2; + // Output only: derived from the field kind. bool source_mappable = 3; + string name = 4; + BusinessFieldKind kind = 5; + bool required = 6; + // At most one live record of the type holds a given value. + bool unique = 7; + repeated string enum_values = 8; + string reference_type_id = 9; + string description = 10; + // TEXT only: maximum Unicode code points, from 1 through 8192. + optional uint32 max_length = 11; +} +message BusinessObjectTypeRelationship { + string relationship_id = 1; + string name = 2; + string target_type_id = 3; } message BusinessObjectType { string type_id = 1; string name = 2; + // Output only: the published revision. int64 revision = 3; + // Output only: assigned when a built-in blueprint member is cloned. BusinessBlueprintOrigin blueprint_origin = 4; string display_field_id = 5; repeated BusinessObjectTypeField fields = 6; + repeated BusinessObjectTypeRelationship relationships = 7; + string plural_name = 8; + string description = 9; +} +message DefineBusinessObjectTypeRequest { + string organization_id = 1; + string workspace_id = 2; + string idempotency_key = 3; + BusinessObjectType definition = 4; + // The revision this change replaces; 0 creates the type. + int64 expected_revision = 5; +} +message DefineBusinessObjectTypeResponse { + BusinessObjectType definition = 1; +} +message GetBusinessObjectTypeRequest { + string organization_id = 1; + string workspace_id = 2; + string type_id = 3; + // A published revision, from DefineBusinessObjectType or ListBusinessObjectTypes. + int64 revision = 4; +} +message GetBusinessObjectTypeResponse { + BusinessObjectType definition = 1; +} +message UpsertBusinessObjectRequest { + string organization_id = 1; + string workspace_id = 2; + string idempotency_key = 3; + string type_id = 4; + // Published schema revision for a new record; zero keeps an existing record's. + int64 schema_revision = 5; + // A field the type declares unique; `values` must carry it. + string unique_field_id = 6; + repeated BusinessFieldValue values = 7; +} +message UpsertBusinessObjectResponse { + BusinessObject object = 1; + // True when this call created the record, false when it updated one. + bool created = 2; } message ListBusinessObjectTypesRequest { string organization_id = 1; @@ -933,6 +1012,7 @@ message GetControlRequest { string workspace_id = 2; string control_id = 3; } + // One framework requirement a control maps to. message ControlRequirement { string framework_id = 1; @@ -940,6 +1020,7 @@ message ControlRequirement { // automatic, reviewed or proposed; proposed mappings do not count. string review_state = 3; } + // One test that verifies a control, with its own state. message ControlTestState { string test_id = 1; @@ -988,6 +1069,7 @@ message ListTestsResponse { // False when an owner source was unavailable or the read was truncated. bool complete = 4; } + // A resource's latest result for one test. enum TestResultState { TEST_RESULT_STATE_UNSPECIFIED = 0; @@ -1176,6 +1258,7 @@ message GetAuditRequest { message GetAuditResponse { Audit audit = 1; } + // One item on an audit's request list (the auditor's information request list). message AuditRequestItem { string item_id = 1;