From 30533175a6ab850aa1bf2e4c103b2cd974327283 Mon Sep 17 00:00:00 2001 From: Jeff Murray Date: Tue, 9 Dec 2025 09:34:41 -0600 Subject: [PATCH 1/3] Update to latest spec --- api.ts | 221 ++++++++++++++++++++++++++++++++++++++- client/helpers/scenes.ts | 18 +++- client/utils.ts | 8 ++ spec.yml | 206 +++++++++++++++++++++++++++++++----- 4 files changed, 421 insertions(+), 32 deletions(-) diff --git a/api.ts b/api.ts index c62b81c..8d8af29 100644 --- a/api.ts +++ b/api.ts @@ -522,10 +522,10 @@ export interface Batch { export interface BatchOperation { /** * Operation\'s primary data. - * @type {CreateSceneItemRequestData} + * @type {CreateSceneItemRequestData | RelationshipData} * @memberof BatchOperation */ - data: CreateSceneItemRequestData; + data: CreateSceneItemRequestData | RelationshipData; /** * Batch operation type type. * @type {string} @@ -542,6 +542,7 @@ export interface BatchOperation { export const BatchOperationOpEnum = { Add: 'add', + Remove: 'remove', } as const; export type BatchOperationOpEnum = @@ -2558,6 +2559,12 @@ export interface CreateSceneViewRequestDataAttributes { * @memberof CreateSceneViewRequestDataAttributes */ excludePrunedItems?: boolean; + /** + * Number of seconds before expiration. Defaults to 24 hours in seconds. Max is 7 days in seconds + * @type {number} + * @memberof CreateSceneViewRequestDataAttributes + */ + expiry?: number; } /** * @@ -4932,6 +4939,19 @@ export interface PartRevision { */ links?: { [key: string]: Link }; } +/** + * + * @export + * @interface PartRevisionChildren + */ +export interface PartRevisionChildren { + /** + * ID of a uploaded file that contains assembly children in JSON format. The file content MUST be a JSON object with a \"children\" array matching the PartAssemblyInstance schema. Each child must include the UUID of the revision. The optional transform may be included to position the child relative to the parent. See the Matrix4 schema for details. Note: The ordinal will not be used even if specified. The children will be ordered as they appear in the array. Also, the suppliedRevisionId will be ignored as it has been deprecated in the PartAssemblyInstance schema. Example file content: { \"children\": [ { \"revisionId\": \"00000000-0000-0000-0000-000000000001\" }, { \"revisionId\": \"00000000-0000-0000-0000-000000000002\", \"transform\": { \"r0\": {\"x\": 1, \"y\": 0, \"z\": 0, \"w\": 0 }, \"r1\": {\"x\": 0, \"y\": 1, \"z\": 0, \"w\": 0 }, \"r2\": {\"x\": 0, \"y\": 0, \"z\": 1, \"w\": 0 }, \"r3\": {\"x\": 0, \"y\": 0, \"z\": 0, \"w\": 1 } }} ] } + * @type {FileRelationshipData} + * @memberof PartRevisionChildren + */ + data: FileRelationshipData; +} /** * * @export @@ -6004,6 +6024,32 @@ export const QueryBySceneItemMetadataTypeEnum = { export type QueryBySceneItemMetadataTypeEnum = (typeof QueryBySceneItemMetadataTypeEnum)[keyof typeof QueryBySceneItemMetadataTypeEnum]; +/** + * + * @export + * @interface QueryTranslationJobs + */ +export interface QueryTranslationJobs { + /** + * + * @type {QueryTranslationJobsFilter} + * @memberof QueryTranslationJobs + */ + filter: QueryTranslationJobsFilter; +} +/** + * + * @export + * @interface QueryTranslationJobsFilter + */ +export interface QueryTranslationJobsFilter { + /** + * + * @type {Array} + * @memberof QueryTranslationJobsFilter + */ + jobId: Array; +} /** * * @export @@ -6216,6 +6262,19 @@ export interface QueuedTranslationJobDataRelationships { */ partRendition?: PartRenditionRelationship; } +/** + * + * @export + * @interface QueuedTranslationJobList + */ +export interface QueuedTranslationJobList { + /** + * + * @type {Array} + * @memberof QueuedTranslationJobList + */ + data: Array; +} /** * * @export @@ -9053,6 +9112,12 @@ export interface UpdatePartRevisionRequestDataRelationships { * @memberof UpdatePartRevisionRequestDataRelationships */ defaultPartRendition?: PartRenditionRelationship; + /** + * + * @type {PartRevisionChildren} + * @memberof UpdatePartRevisionRequestDataRelationships + */ + children?: PartRevisionChildren; } /** * @@ -24727,6 +24792,7 @@ export const SceneItemsApiAxiosParamCreator = function ( * @param {string} [filterParent] Parent ID to filter on. * @param {boolean} [filterHasChildren] Filter scene-items based on whether they are the parent of at least one other scene-item * @param {boolean} [filterHasGeometrySet] Filter scene-items based on whether they have an associated geometry-set. + * @param {string} [sort] A sort to apply to the collection. A \"minus\" prefixed before the field name is used to specify descending sort order. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -24739,6 +24805,7 @@ export const SceneItemsApiAxiosParamCreator = function ( filterParent?: string, filterHasChildren?: boolean, filterHasGeometrySet?: boolean, + sort?: string, options: AxiosRequestConfig = {} ): Promise => { // verify required parameter 'id' is not null or undefined @@ -24799,6 +24866,10 @@ export const SceneItemsApiAxiosParamCreator = function ( localVarQueryParameter['filter[hasGeometrySet]'] = filterHasGeometrySet; } + if (sort !== undefined) { + localVarQueryParameter['sort'] = sort; + } + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions?.headers ?? {}; localVarRequestOptions.headers = { @@ -25018,6 +25089,7 @@ export const SceneItemsApiFp = function (configuration?: Configuration) { * @param {string} [filterParent] Parent ID to filter on. * @param {boolean} [filterHasChildren] Filter scene-items based on whether they are the parent of at least one other scene-item * @param {boolean} [filterHasGeometrySet] Filter scene-items based on whether they have an associated geometry-set. + * @param {string} [sort] A sort to apply to the collection. A \"minus\" prefixed before the field name is used to specify descending sort order. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -25030,6 +25102,7 @@ export const SceneItemsApiFp = function (configuration?: Configuration) { filterParent?: string, filterHasChildren?: boolean, filterHasGeometrySet?: boolean, + sort?: string, options?: AxiosRequestConfig ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise @@ -25043,6 +25116,7 @@ export const SceneItemsApiFp = function (configuration?: Configuration) { filterParent, filterHasChildren, filterHasGeometrySet, + sort, options ); return createRequestFunction( @@ -25170,6 +25244,7 @@ export const SceneItemsApiFactory = function ( * @param {string} [filterParent] Parent ID to filter on. * @param {boolean} [filterHasChildren] Filter scene-items based on whether they are the parent of at least one other scene-item * @param {boolean} [filterHasGeometrySet] Filter scene-items based on whether they have an associated geometry-set. + * @param {string} [sort] A sort to apply to the collection. A \"minus\" prefixed before the field name is used to specify descending sort order. * @param {*} [options] Override http request option. * @throws {RequiredError} */ @@ -25182,6 +25257,7 @@ export const SceneItemsApiFactory = function ( filterParent?: string, filterHasChildren?: boolean, filterHasGeometrySet?: boolean, + sort?: string, options?: any ): AxiosPromise { return localVarFp @@ -25194,6 +25270,7 @@ export const SceneItemsApiFactory = function ( filterParent, filterHasChildren, filterHasGeometrySet, + sort, options ) .then((request) => request(axios, basePath)); @@ -25362,6 +25439,13 @@ export interface SceneItemsApiGetSceneItemsRequest { * @memberof SceneItemsApiGetSceneItems */ readonly filterHasGeometrySet?: boolean; + + /** + * A sort to apply to the collection. A \"minus\" prefixed before the field name is used to specify descending sort order. + * @type {string} + * @memberof SceneItemsApiGetSceneItems + */ + readonly sort?: string; } /** @@ -25501,6 +25585,7 @@ export class SceneItemsApi extends BaseAPI { requestParameters.filterParent, requestParameters.filterHasChildren, requestParameters.filterHasGeometrySet, + requestParameters.sort, options ) .then((request) => request(this.axios, this.basePath)); @@ -31012,6 +31097,67 @@ export const TranslationInspectionsApiAxiosParamCreator = function ( ...options.headers, }; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Get all the specified translation jobs. + * @param {QueryTranslationJobs} queryTranslationJobs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postQueryTranslationJobs: async ( + queryTranslationJobs: QueryTranslationJobs, + options: AxiosRequestConfig = {} + ): Promise => { + // verify required parameter 'queryTranslationJobs' is not null or undefined + assertParamExists( + 'postQueryTranslationJobs', + 'queryTranslationJobs', + queryTranslationJobs + ); + const localVarPath = `/query-translation-jobs`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { + method: 'POST', + ...baseOptions, + ...options, + }; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication OAuth2 required + // oauth required + await setOAuthToObject( + localVarHeaderParameter, + 'OAuth2', + [], + configuration + ); + + localVarHeaderParameter['Content-Type'] = 'application/vnd.api+json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions?.headers ?? {}; + localVarRequestOptions.headers = { + ...localVarHeaderParameter, + ...headersFromBaseOptions, + ...options.headers, + }; + localVarRequestOptions.data = serializeDataIfNeeded( + queryTranslationJobs, + localVarRequestOptions, + configuration + ); + return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, @@ -31194,6 +31340,33 @@ export const TranslationInspectionsApiFp = function ( configuration ); }, + /** + * Get all the specified translation jobs. + * @param {QueryTranslationJobs} queryTranslationJobs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async postQueryTranslationJobs( + queryTranslationJobs: QueryTranslationJobs, + options?: AxiosRequestConfig + ): Promise< + ( + axios?: AxiosInstance, + basePath?: string + ) => AxiosPromise + > { + const localVarAxiosArgs = + await localVarAxiosParamCreator.postQueryTranslationJobs( + queryTranslationJobs, + options + ); + return createRequestFunction( + localVarAxiosArgs, + globalAxios, + BASE_PATH, + configuration + ); + }, }; }; @@ -31313,6 +31486,20 @@ export const TranslationInspectionsApiFactory = function ( .getQueuedTranslations(pageCursor, pageSize, filterStatus, options) .then((request) => request(axios, basePath)); }, + /** + * Get all the specified translation jobs. + * @param {QueryTranslationJobs} queryTranslationJobs + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + postQueryTranslationJobs( + queryTranslationJobs: QueryTranslationJobs, + options?: any + ): AxiosPromise { + return localVarFp + .postQueryTranslationJobs(queryTranslationJobs, options) + .then((request) => request(axios, basePath)); + }, }; }; @@ -31442,6 +31629,20 @@ export interface TranslationInspectionsApiGetQueuedTranslationsRequest { readonly filterStatus?: string; } +/** + * Request parameters for postQueryTranslationJobs operation in TranslationInspectionsApi. + * @export + * @interface TranslationInspectionsApiPostQueryTranslationJobsRequest + */ +export interface TranslationInspectionsApiPostQueryTranslationJobsRequest { + /** + * + * @type {QueryTranslationJobs} + * @memberof TranslationInspectionsApiPostQueryTranslationJobs + */ + readonly queryTranslationJobs: QueryTranslationJobs; +} + /** * TranslationInspectionsApi - object-oriented interface * @export @@ -31561,6 +31762,22 @@ export class TranslationInspectionsApi extends BaseAPI { ) .then((request) => request(this.axios, this.basePath)); } + + /** + * Get all the specified translation jobs. + * @param {TranslationInspectionsApiPostQueryTranslationJobsRequest} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof TranslationInspectionsApi + */ + public postQueryTranslationJobs( + requestParameters: TranslationInspectionsApiPostQueryTranslationJobsRequest, + options?: AxiosRequestConfig + ) { + return TranslationInspectionsApiFp(this.configuration) + .postQueryTranslationJobs(requestParameters.queryTranslationJobs, options) + .then((request) => request(this.axios, this.basePath)); + } } /** diff --git a/client/helpers/scenes.ts b/client/helpers/scenes.ts index 9dab762..f3d108c 100644 --- a/client/helpers/scenes.ts +++ b/client/helpers/scenes.ts @@ -519,7 +519,12 @@ export const createSceneItemBatch = async ({ itemResults = batchRes.flatMap((b, i) => isBatch(b.res) ? b.res['vertexvis/batch:results'].map((r, j) => { - return { req: batchOps[i].ops[j].data, res: r }; + return { + // `batchOps[i].ops[j].data` is guaranteed to be of type `CreateSceneItemRequestData`, as the + // `createSceneItems` used to construct operations only deals with this type of payload. + req: batchOps[i].ops[j].data as CreateSceneItemRequestData, + res: r, + }; }) : [] ); @@ -532,9 +537,14 @@ export const createSceneItemBatch = async ({ errors.forEach((error) => { console.log(error); error.ops.forEach((op) => { - // `error.res` guaranteed to be non-null due to `isApiError()` condition above - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - itemErrors.push({ req: op.data, res: error.res! }); + itemErrors.push({ + // `op.data` is guaranteed to be of type `CreateSceneItemRequestData`, as the + // `createSceneItems` used to construct operations only deals with this type of payload. + req: op.data as CreateSceneItemRequestData, + // `error.res` guaranteed to be non-null due to `isApiError()` condition above + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + res: error.res!, + }); }); }); diff --git a/client/utils.ts b/client/utils.ts index 2a315bb..8a97256 100644 --- a/client/utils.ts +++ b/client/utils.ts @@ -5,6 +5,7 @@ import { parse, ParsedUrlQuery } from 'querystring'; import { DUMMY_BASE_URL } from '../common'; import { ApiError, + CreateSceneItemRequestData, Failure, ImageType, Matrix4, @@ -288,6 +289,13 @@ export function isQueuedJob(obj: unknown): obj is QueuedJob { ); } +export function isCreateSceneItemRequestData( + obj: unknown +): obj is CreateSceneItemRequestData { + const rd = obj as CreateSceneItemRequestData; + return defined(rd.attributes), defined(rd.relationships), defined(rd.type); +} + export function hasVertexError(error: unknown): error is VertexError { const ve = error as VertexError; return defined(ve.vertexError); diff --git a/spec.yml b/spec.yml index feb81a7..7cba270 100644 --- a/spec.yml +++ b/spec.yml @@ -29,7 +29,8 @@ tags: - name: accounts - name: applications - name: batches - - name: collaboration-contexts + - description: Requires Engage Module + name: collaboration-contexts - name: exports - name: files - name: file-collections @@ -42,8 +43,12 @@ tags: - name: part-revisions - name: part-revision-instances - name: parts - - name: pmi + - name: permission-grants + - description: Requires Engage Module + name: pmi - name: property-entries + - description: Requires Engage Module + name: replies - name: scene-alterations - name: scene-annotations - name: scene-item-overrides @@ -54,12 +59,12 @@ tags: - name: scene-view-states - name: search-sessions - name: stream-keys - - name: threads + - description: Requires Engage Module + name: threads - name: translation-inspections - name: users - name: user-groups - name: webhook-subscriptions - - name: permission-grants paths: /accounts: post: @@ -5778,6 +5783,17 @@ paths: example: true type: boolean style: form + - description: + A sort to apply to the collection. A "minus" prefixed before + the field name is used to specify descending sort order. + explode: true + in: query + name: sort + required: false + schema: + example: -age,name + type: string + style: form responses: '200': content: @@ -8464,6 +8480,73 @@ paths: - OAuth2: [] tags: - translation-inspections + /query-translation-jobs: + post: + description: Get all the specified translation jobs. + operationId: postQueryTranslationJobs + requestBody: + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/QueryTranslationJobs' + required: true + responses: + '200': + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/QueuedTranslationJobList' + description: OK + '400': + content: + application/vnd.api+json: + example: + errors: + - status: '400' + code: BadRequest + title: Invalid, missing, or out-of-range request parameters. + schema: + $ref: '#/components/schemas/Failure' + description: Bad Request + '401': + content: + application/vnd.api+json: + example: + errors: + - status: '401' + code: Unauthorized + title: Invalid or missing credentials. + schema: + $ref: '#/components/schemas/Failure' + description: Unauthorized + '404': + content: + application/vnd.api+json: + example: + errors: + - status: '404' + code: NotFound + title: The requested resource was not found. + schema: + $ref: '#/components/schemas/Failure' + description: Not Found + '415': + content: + application/vnd.api+json: + example: + errors: + - status: '415' + code: UnsupportedMediaType + title: + The provided media type is not supported. Update the Content-Type + header to application/vnd.api+json and try again. + schema: + $ref: '#/components/schemas/Failure' + description: Unsupported Media Type + security: + - OAuth2: [] + tags: + - translation-inspections /queued-translation-jobs/{id}: get: description: @@ -12178,6 +12261,24 @@ components: - data - links type: object + QueryTranslationJobs: + additionalProperties: false + properties: + filter: + $ref: '#/components/schemas/QueryTranslationJobs_filter' + required: + - filter + type: object + QueuedTranslationJobList: + additionalProperties: false + properties: + data: + items: + $ref: '#/components/schemas/QueuedTranslationJob' + type: array + required: + - data + type: object QueuedTranslationJob: additionalProperties: false properties: @@ -12549,13 +12650,15 @@ components: additionalProperties: false properties: data: - anyOf: - - $ref: '#/components/schemas/CreateSceneItemRequestData' description: Operation's primary data. + oneOf: + - $ref: '#/components/schemas/CreateSceneItemRequestData' + - $ref: '#/components/schemas/RelationshipData' op: description: Batch operation type type. enum: - add + - remove example: add maxLength: 32 type: string @@ -12878,7 +12981,7 @@ components: description: Relationship to a `file`. properties: data: - $ref: '#/components/schemas/FileRelationship_data' + $ref: '#/components/schemas/FileRelationshipData' required: - data type: object @@ -13126,6 +13229,36 @@ components: required: - data type: object + PartRevisionChildren: + additionalProperties: false + properties: + data: + allOf: + - $ref: '#/components/schemas/FileRelationshipData' + description: | + ID of a uploaded file that contains assembly children in JSON format. + The file content MUST be a JSON object with a "children" array matching the + PartAssemblyInstance schema. + Each child must include the UUID of the revision. The optional transform may be included + to position the child relative to the parent. See the Matrix4 schema for details. + Note: The ordinal will not be used even if specified. The children will be ordered as + they appear in the array. Also, the suppliedRevisionId will be ignored as it has been + deprecated in the PartAssemblyInstance schema. + Example file content: + { + "children": [ + { "revisionId": "00000000-0000-0000-0000-000000000001" }, + { "revisionId": "00000000-0000-0000-0000-000000000002", "transform": { + "r0": {"x": 1, "y": 0, "z": 0, "w": 0 }, + "r1": {"x": 0, "y": 1, "z": 0, "w": 0 }, + "r2": {"x": 0, "y": 0, "z": 1, "w": 0 }, + "r3": {"x": 0, "y": 0, "z": 0, "w": 1 } + }} + ] + } + required: + - data + type: object PartRevisionInstanceData: additionalProperties: false properties: @@ -14471,6 +14604,26 @@ components: required: - selector type: object + FileRelationshipData: + additionalProperties: false + properties: + type: + description: Resource object type. + enum: + - file + example: file + maxLength: 32 + type: string + id: + description: ID of the resource. + example: f79d4760-0b71-44e4-ad0b-22743fdd4ca3 + format: uuid + maxLength: 36 + type: string + required: + - id + - type + type: object ThreadRelationship: additionalProperties: false properties: @@ -16027,6 +16180,8 @@ components: $ref: '#/components/schemas/FileRelationship' defaultPartRendition: $ref: '#/components/schemas/PartRenditionRelationship' + children: + $ref: '#/components/schemas/PartRevisionChildren' type: object UpdatePartRevisionRequest_data: description: | @@ -16501,6 +16656,12 @@ components: description: Whether to exclude non-visible items in the view example: true type: boolean + expiry: + description: + Number of seconds before expiration. Defaults to 24 hours in + seconds. Max is 7 days in seconds + example: 600 + type: integer type: object CreateSceneViewRequest_data_relationships: properties: @@ -16882,6 +17043,18 @@ components: - id - type type: object + QueryTranslationJobs_filter: + properties: + jobId: + items: + format: uuid + type: string + maxItems: 1000 + minItems: 0 + type: array + required: + - jobId + type: object CreateExportRequest_data_attributes: properties: config: @@ -17329,25 +17502,6 @@ components: required: - created type: object - FileRelationship_data: - properties: - type: - description: Resource object type. - enum: - - file - example: file - maxLength: 32 - type: string - id: - description: ID of the resource. - example: f79d4760-0b71-44e4-ad0b-22743fdd4ca3 - format: uuid - maxLength: 36 - type: string - required: - - id - - type - type: object ReplyData_attributes: properties: createdAt: From 40fe423e68ea9417e7fd88aaea3704bb506655ae Mon Sep 17 00:00:00 2001 From: Jeff Murray Date: Tue, 9 Dec 2025 15:39:22 -0600 Subject: [PATCH 2/3] v0.34.0 --- client/version.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/version.ts b/client/version.ts index fcde66c..025feba 100644 --- a/client/version.ts +++ b/client/version.ts @@ -1 +1 @@ -export const version = '0.33.2'; +export const version = '0.34.0'; diff --git a/package.json b/package.json index 624ec5f..c5cfabf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vertexvis/api-client-node", - "version": "0.33.2", + "version": "0.34.0", "description": "The Vertex REST API client for Node.js.", "license": "MIT", "author": "Vertex Developers (https://developer.vertexvis.com)", From 7c86f08f0aa00ebc6c52ed1e62fe1e02bc42d19f Mon Sep 17 00:00:00 2001 From: Jeff Murray Date: Tue, 9 Dec 2025 15:44:11 -0600 Subject: [PATCH 3/3] Remove unnecessary helper --- client/utils.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/client/utils.ts b/client/utils.ts index 8a97256..2a315bb 100644 --- a/client/utils.ts +++ b/client/utils.ts @@ -5,7 +5,6 @@ import { parse, ParsedUrlQuery } from 'querystring'; import { DUMMY_BASE_URL } from '../common'; import { ApiError, - CreateSceneItemRequestData, Failure, ImageType, Matrix4, @@ -289,13 +288,6 @@ export function isQueuedJob(obj: unknown): obj is QueuedJob { ); } -export function isCreateSceneItemRequestData( - obj: unknown -): obj is CreateSceneItemRequestData { - const rd = obj as CreateSceneItemRequestData; - return defined(rd.attributes), defined(rd.relationships), defined(rd.type); -} - export function hasVertexError(error: unknown): error is VertexError { const ve = error as VertexError; return defined(ve.vertexError);