@vertexvis/api-client-node 0.20.0 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api.d.ts +98 -29
- package/dist/cjs/api.js +15 -16
- package/dist/cjs/client/helpers/queued-jobs.js +11 -4
- package/dist/cjs/client/helpers/scenes.d.ts +19 -3
- package/dist/cjs/client/helpers/scenes.js +104 -54
- package/dist/cjs/client/version.d.ts +1 -1
- package/dist/cjs/client/version.js +1 -1
- package/dist/esm/api.d.ts +98 -29
- package/dist/esm/api.js +12 -13
- package/dist/esm/client/helpers/queued-jobs.js +11 -4
- package/dist/esm/client/helpers/scenes.d.ts +19 -3
- package/dist/esm/client/helpers/scenes.js +104 -54
- package/dist/esm/client/version.d.ts +1 -1
- package/dist/esm/client/version.js +1 -1
- package/package.json +1 -1
package/dist/cjs/api.d.ts
CHANGED
|
@@ -671,7 +671,7 @@ export interface Color3 {
|
|
|
671
671
|
*/
|
|
672
672
|
export interface ColorMaterial {
|
|
673
673
|
/**
|
|
674
|
-
*
|
|
674
|
+
* An opacity value from 0 to 255.
|
|
675
675
|
* @type {number}
|
|
676
676
|
* @memberof ColorMaterial
|
|
677
677
|
*/
|
|
@@ -714,7 +714,7 @@ export interface ColorMaterial {
|
|
|
714
714
|
*/
|
|
715
715
|
export interface ColorMaterialNullable {
|
|
716
716
|
/**
|
|
717
|
-
*
|
|
717
|
+
* An opacity value from 0 to 255.
|
|
718
718
|
* @type {number}
|
|
719
719
|
* @memberof ColorMaterialNullable
|
|
720
720
|
*/
|
|
@@ -1107,11 +1107,19 @@ export interface CreatePartRequestDataAttributes {
|
|
|
1107
1107
|
*/
|
|
1108
1108
|
suppliedRevisionId?: string;
|
|
1109
1109
|
/**
|
|
1110
|
-
* Whether or not to index metadata in the part file.
|
|
1110
|
+
* Whether or not to index metadata in the part file. To ignore metadata from the part file and add your own, pass `false` for `indexMetadata` and supply custom metadata using the `metadata` field.
|
|
1111
1111
|
* @type {boolean}
|
|
1112
1112
|
* @memberof CreatePartRequestDataAttributes
|
|
1113
1113
|
*/
|
|
1114
1114
|
indexMetadata?: boolean;
|
|
1115
|
+
/**
|
|
1116
|
+
* Additional metadata about the `part` and/or `part-revision`. This metadata will take precedence over any metadata that belongs to the part file if `indexMetadata` is specified.
|
|
1117
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
1118
|
+
* @memberof CreatePartRequestDataAttributes
|
|
1119
|
+
*/
|
|
1120
|
+
metadata?: {
|
|
1121
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
1122
|
+
};
|
|
1115
1123
|
/**
|
|
1116
1124
|
* Name to be used for the root part.
|
|
1117
1125
|
* @type {string}
|
|
@@ -1356,6 +1364,14 @@ export interface CreateSceneItemRequestDataAttributes {
|
|
|
1356
1364
|
* @memberof CreateSceneItemRequestDataAttributes
|
|
1357
1365
|
*/
|
|
1358
1366
|
visible?: boolean;
|
|
1367
|
+
/**
|
|
1368
|
+
* Additional metadata for the scene-item. This metadata will take precedence over any metadata that belongs to the part file.
|
|
1369
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
1370
|
+
* @memberof CreateSceneItemRequestDataAttributes
|
|
1371
|
+
*/
|
|
1372
|
+
metadata?: {
|
|
1373
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
1374
|
+
};
|
|
1359
1375
|
}
|
|
1360
1376
|
/**
|
|
1361
1377
|
*
|
|
@@ -1590,6 +1606,12 @@ export interface CreateSceneViewStateRequestDataAttributes {
|
|
|
1590
1606
|
* @memberof CreateSceneViewStateRequestDataAttributes
|
|
1591
1607
|
*/
|
|
1592
1608
|
name?: string;
|
|
1609
|
+
/**
|
|
1610
|
+
* ID provided for correlation. For example, an existing ID from a PLM system.
|
|
1611
|
+
* @type {string}
|
|
1612
|
+
* @memberof CreateSceneViewStateRequestDataAttributes
|
|
1613
|
+
*/
|
|
1614
|
+
suppliedId?: string;
|
|
1593
1615
|
}
|
|
1594
1616
|
/**
|
|
1595
1617
|
*
|
|
@@ -2577,30 +2599,54 @@ export interface Matrix4Nullable {
|
|
|
2577
2599
|
/**
|
|
2578
2600
|
*
|
|
2579
2601
|
* @export
|
|
2580
|
-
* @interface
|
|
2602
|
+
* @interface MetadataFloatType
|
|
2581
2603
|
*/
|
|
2582
|
-
export interface
|
|
2604
|
+
export interface MetadataFloatType {
|
|
2583
2605
|
/**
|
|
2584
|
-
*
|
|
2606
|
+
* Type of metadata value.
|
|
2585
2607
|
* @type {string}
|
|
2586
|
-
* @memberof
|
|
2608
|
+
* @memberof MetadataFloatType
|
|
2587
2609
|
*/
|
|
2588
|
-
|
|
2610
|
+
type: string;
|
|
2611
|
+
/**
|
|
2612
|
+
* A numerical floating-point value.
|
|
2613
|
+
* @type {number}
|
|
2614
|
+
* @memberof MetadataFloatType
|
|
2615
|
+
*/
|
|
2616
|
+
value: number;
|
|
2617
|
+
}
|
|
2618
|
+
/**
|
|
2619
|
+
*
|
|
2620
|
+
* @export
|
|
2621
|
+
* @interface MetadataNullType
|
|
2622
|
+
*/
|
|
2623
|
+
export interface MetadataNullType {
|
|
2589
2624
|
/**
|
|
2590
2625
|
* Type of metadata value.
|
|
2591
2626
|
* @type {string}
|
|
2592
|
-
* @memberof
|
|
2627
|
+
* @memberof MetadataNullType
|
|
2593
2628
|
*/
|
|
2594
|
-
type:
|
|
2629
|
+
type: string;
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
*
|
|
2633
|
+
* @export
|
|
2634
|
+
* @interface MetadataStringType
|
|
2635
|
+
*/
|
|
2636
|
+
export interface MetadataStringType {
|
|
2637
|
+
/**
|
|
2638
|
+
* Type of metadata value.
|
|
2639
|
+
* @type {string}
|
|
2640
|
+
* @memberof MetadataStringType
|
|
2641
|
+
*/
|
|
2642
|
+
type: string;
|
|
2643
|
+
/**
|
|
2644
|
+
* A string value.
|
|
2645
|
+
* @type {string}
|
|
2646
|
+
* @memberof MetadataStringType
|
|
2647
|
+
*/
|
|
2648
|
+
value: string;
|
|
2595
2649
|
}
|
|
2596
|
-
export declare const MetadataValueTypeEnum: {
|
|
2597
|
-
readonly String: "string";
|
|
2598
|
-
readonly Long: "long";
|
|
2599
|
-
readonly Float: "float";
|
|
2600
|
-
readonly Date: "date";
|
|
2601
|
-
readonly Null: "null";
|
|
2602
|
-
};
|
|
2603
|
-
export declare type MetadataValueTypeEnum = typeof MetadataValueTypeEnum[keyof typeof MetadataValueTypeEnum];
|
|
2604
2650
|
/**
|
|
2605
2651
|
*
|
|
2606
2652
|
* @export
|
|
@@ -2958,11 +3004,11 @@ export interface PartRevisionDataAttributes {
|
|
|
2958
3004
|
created?: string;
|
|
2959
3005
|
/**
|
|
2960
3006
|
*
|
|
2961
|
-
* @type {{ [key: string]:
|
|
3007
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
2962
3008
|
* @memberof PartRevisionDataAttributes
|
|
2963
3009
|
*/
|
|
2964
3010
|
metadata?: {
|
|
2965
|
-
[key: string]:
|
|
3011
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
2966
3012
|
};
|
|
2967
3013
|
/**
|
|
2968
3014
|
*
|
|
@@ -3694,11 +3740,11 @@ export interface SceneItemDataAttributes {
|
|
|
3694
3740
|
materialOverride?: ColorMaterial;
|
|
3695
3741
|
/**
|
|
3696
3742
|
*
|
|
3697
|
-
* @type {{ [key: string]:
|
|
3743
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
3698
3744
|
* @memberof SceneItemDataAttributes
|
|
3699
3745
|
*/
|
|
3700
3746
|
metadata?: {
|
|
3701
|
-
[key: string]:
|
|
3747
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
3702
3748
|
};
|
|
3703
3749
|
/**
|
|
3704
3750
|
*
|
|
@@ -4296,6 +4342,12 @@ export interface SceneViewStateDataAttributes {
|
|
|
4296
4342
|
* @memberof SceneViewStateDataAttributes
|
|
4297
4343
|
*/
|
|
4298
4344
|
noDefaultLights?: boolean;
|
|
4345
|
+
/**
|
|
4346
|
+
*
|
|
4347
|
+
* @type {string}
|
|
4348
|
+
* @memberof SceneViewStateDataAttributes
|
|
4349
|
+
*/
|
|
4350
|
+
suppliedId?: string;
|
|
4299
4351
|
}
|
|
4300
4352
|
/**
|
|
4301
4353
|
*
|
|
@@ -4737,15 +4789,15 @@ export interface UpdatePartRevisionRequestData {
|
|
|
4737
4789
|
*/
|
|
4738
4790
|
export interface UpdatePartRevisionRequestDataAttributes {
|
|
4739
4791
|
/**
|
|
4740
|
-
* Metadata about the `part` and/or `part-revision`.
|
|
4741
|
-
* @type {{ [key: string]:
|
|
4792
|
+
* Metadata about the `part` and/or `part-revision`. This metadata will take precedence over any metadata that belongs to the part file if `indexMetadata` is specified.
|
|
4793
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
4742
4794
|
* @memberof UpdatePartRevisionRequestDataAttributes
|
|
4743
4795
|
*/
|
|
4744
4796
|
metadata?: {
|
|
4745
|
-
[key: string]:
|
|
4797
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
4746
4798
|
};
|
|
4747
4799
|
/**
|
|
4748
|
-
* Whether or not to index metadata in the part file when sending a file relationship - not used otherwise.
|
|
4800
|
+
* Whether or not to index metadata in the part file when sending a file relationship - not used otherwise. To ignore metadata from the part file and add your own, pass `false` for `indexMetadata` and supply custom metadata using the `metadata` field.
|
|
4749
4801
|
* @type {boolean}
|
|
4750
4802
|
* @memberof UpdatePartRevisionRequestDataAttributes
|
|
4751
4803
|
*/
|
|
@@ -4918,6 +4970,14 @@ export interface UpdateSceneItemRequestDataAttributes {
|
|
|
4918
4970
|
* @memberof UpdateSceneItemRequestDataAttributes
|
|
4919
4971
|
*/
|
|
4920
4972
|
suppliedId?: string;
|
|
4973
|
+
/**
|
|
4974
|
+
* Additional metadata for the scene-item. This metadata will take precedence over any metadata that belongs to the part file.
|
|
4975
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
4976
|
+
* @memberof UpdateSceneItemRequestDataAttributes
|
|
4977
|
+
*/
|
|
4978
|
+
metadata?: {
|
|
4979
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
4980
|
+
};
|
|
4921
4981
|
}
|
|
4922
4982
|
/**
|
|
4923
4983
|
*
|
|
@@ -8710,10 +8770,11 @@ export declare const SceneViewStatesApiAxiosParamCreator: (configuration?: Confi
|
|
|
8710
8770
|
* @param {number} [pageSize] The number of items to return.
|
|
8711
8771
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
8712
8772
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
8773
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
8713
8774
|
* @param {*} [options] Override http request option.
|
|
8714
8775
|
* @throws {RequiredError}
|
|
8715
8776
|
*/
|
|
8716
|
-
getSceneViewStates: (id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
8777
|
+
getSceneViewStates: (id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, filterSuppliedId?: string | undefined, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
8717
8778
|
/**
|
|
8718
8779
|
* Update a `scene-view-state`.
|
|
8719
8780
|
* @param {string} id The `scene-view-state` ID.
|
|
@@ -8758,10 +8819,11 @@ export declare const SceneViewStatesApiFp: (configuration?: Configuration | unde
|
|
|
8758
8819
|
* @param {number} [pageSize] The number of items to return.
|
|
8759
8820
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
8760
8821
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
8822
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
8761
8823
|
* @param {*} [options] Override http request option.
|
|
8762
8824
|
* @throws {RequiredError}
|
|
8763
8825
|
*/
|
|
8764
|
-
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<SceneViewStateList>>;
|
|
8826
|
+
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, filterSuppliedId?: string | undefined, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<SceneViewStateList>>;
|
|
8765
8827
|
/**
|
|
8766
8828
|
* Update a `scene-view-state`.
|
|
8767
8829
|
* @param {string} id The `scene-view-state` ID.
|
|
@@ -8806,10 +8868,11 @@ export declare const SceneViewStatesApiFactory: (configuration?: Configuration |
|
|
|
8806
8868
|
* @param {number} [pageSize] The number of items to return.
|
|
8807
8869
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
8808
8870
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
8871
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
8809
8872
|
* @param {*} [options] Override http request option.
|
|
8810
8873
|
* @throws {RequiredError}
|
|
8811
8874
|
*/
|
|
8812
|
-
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, options?: any): AxiosPromise<SceneViewStateList>;
|
|
8875
|
+
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, filterSuppliedId?: string | undefined, options?: any): AxiosPromise<SceneViewStateList>;
|
|
8813
8876
|
/**
|
|
8814
8877
|
* Update a `scene-view-state`.
|
|
8815
8878
|
* @param {string} id The `scene-view-state` ID.
|
|
@@ -8906,6 +8969,12 @@ export interface SceneViewStatesApiGetSceneViewStatesRequest {
|
|
|
8906
8969
|
* @memberof SceneViewStatesApiGetSceneViewStates
|
|
8907
8970
|
*/
|
|
8908
8971
|
readonly filterId?: string;
|
|
8972
|
+
/**
|
|
8973
|
+
* Comma-separated list of supplied IDs to filter on.
|
|
8974
|
+
* @type {string}
|
|
8975
|
+
* @memberof SceneViewStatesApiGetSceneViewStates
|
|
8976
|
+
*/
|
|
8977
|
+
readonly filterSuppliedId?: string;
|
|
8909
8978
|
}
|
|
8910
8979
|
/**
|
|
8911
8980
|
* Request parameters for updateSceneViewState operation in SceneViewStatesApi.
|
package/dist/cjs/api.js
CHANGED
|
@@ -25,9 +25,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
25
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
exports.FilesApiFactory = exports.FilesApiFp = exports.FilesApiAxiosParamCreator = exports.ExportsApi = exports.ExportsApiFactory = exports.ExportsApiFp = exports.ExportsApiAxiosParamCreator = exports.BatchesApi = exports.BatchesApiFactory = exports.BatchesApiFp = exports.BatchesApiAxiosParamCreator = exports.ApplicationsApi = exports.ApplicationsApiFactory = exports.ApplicationsApiFp = exports.ApplicationsApiAxiosParamCreator = exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiAxiosParamCreator = exports.WebhookSubscriptionDataAttributesStatusEnum = exports.WebhookEventDataRelationshipsOwnerDataTypeEnum = exports.UpdateWebhookSubscriptionRequestDataAttributesStatusEnum = exports.UpdateSceneRequestDataAttributesStateEnum = exports.UpdateAccountRequestDataAttributesStatusEnum = exports.SelectOperationTypeEnum = exports.SceneViewStateRelationshipDataTypeEnum = exports.SceneViewRelationshipDataTypeEnum = exports.SceneRelationshipDataTypeEnum = exports.SceneItemRelationshipDataTypeEnum = exports.QueryByIdDataAttributesTypeEnum = exports.QueryByIdDataTypeEnum = exports.QueryByCollectionDataAttributesTypeEnum = exports.QueryByCollectionDataTypeEnum = exports.QueryAll = exports.PartRelationshipDataTypeEnum = exports.PartDataRelationshipsPartRevisionsTypeEnum = exports.
|
|
29
|
-
exports.TranslationInspectionsApiAxiosParamCreator = exports.StreamKeysApi = exports.StreamKeysApiFactory = exports.StreamKeysApiFp = exports.StreamKeysApiAxiosParamCreator = exports.ScenesApi = exports.ScenesApiFactory = exports.ScenesApiFp = exports.ScenesApiAxiosParamCreator = exports.SceneViewsApi = exports.SceneViewsApiFactory = exports.SceneViewsApiFp = exports.SceneViewsApiAxiosParamCreator = exports.SceneViewStatesApi = exports.SceneViewStatesApiFactory = exports.SceneViewStatesApiFp = exports.SceneViewStatesApiAxiosParamCreator = exports.SceneItemsApi = exports.SceneItemsApiFactory = exports.SceneItemsApiFp = exports.SceneItemsApiAxiosParamCreator = exports.SceneItemOverridesApi = exports.SceneItemOverridesApiFactory = exports.SceneItemOverridesApiFp = exports.SceneItemOverridesApiAxiosParamCreator = exports.SceneAlterationsApi = exports.SceneAlterationsApiFactory = exports.SceneAlterationsApiFp = exports.SceneAlterationsApiAxiosParamCreator = exports.PartsApi = exports.PartsApiFactory = exports.PartsApiFp = exports.PartsApiAxiosParamCreator = exports.PartRevisionsApi = exports.PartRevisionsApiFactory = exports.PartRevisionsApiFp = exports.PartRevisionsApiAxiosParamCreator = exports.Oauth2Api = exports.Oauth2ApiFactory = exports.Oauth2ApiFp = exports.Oauth2ApiAxiosParamCreator = exports.HitsApi = exports.HitsApiFactory = exports.HitsApiFp = exports.HitsApiAxiosParamCreator = exports.GeometrySetsApi = exports.GeometrySetsApiFactory = exports.GeometrySetsApiFp = exports.GeometrySetsApiAxiosParamCreator =
|
|
30
|
-
exports.WebhookSubscriptionsApi = exports.WebhookSubscriptionsApiFactory = exports.WebhookSubscriptionsApiFp = exports.WebhookSubscriptionsApiAxiosParamCreator = exports.TranslationInspectionsApi = exports.TranslationInspectionsApiFactory =
|
|
28
|
+
exports.FilesApi = exports.FilesApiFactory = exports.FilesApiFp = exports.FilesApiAxiosParamCreator = exports.ExportsApi = exports.ExportsApiFactory = exports.ExportsApiFp = exports.ExportsApiAxiosParamCreator = exports.BatchesApi = exports.BatchesApiFactory = exports.BatchesApiFp = exports.BatchesApiAxiosParamCreator = exports.ApplicationsApi = exports.ApplicationsApiFactory = exports.ApplicationsApiFp = exports.ApplicationsApiAxiosParamCreator = exports.AccountsApi = exports.AccountsApiFactory = exports.AccountsApiFp = exports.AccountsApiAxiosParamCreator = exports.WebhookSubscriptionDataAttributesStatusEnum = exports.WebhookEventDataRelationshipsOwnerDataTypeEnum = exports.UpdateWebhookSubscriptionRequestDataAttributesStatusEnum = exports.UpdateSceneRequestDataAttributesStateEnum = exports.UpdateAccountRequestDataAttributesStatusEnum = exports.SelectOperationTypeEnum = exports.SceneViewStateRelationshipDataTypeEnum = exports.SceneViewRelationshipDataTypeEnum = exports.SceneRelationshipDataTypeEnum = exports.SceneItemRelationshipDataTypeEnum = exports.QueryByIdDataAttributesTypeEnum = exports.QueryByIdDataTypeEnum = exports.QueryByCollectionDataAttributesTypeEnum = exports.QueryByCollectionDataTypeEnum = exports.QueryAll = exports.PartRelationshipDataTypeEnum = exports.PartDataRelationshipsPartRevisionsTypeEnum = exports.GeometrySetRelationshipDataTypeEnum = exports.FileRelationshipDataTypeEnum = exports.ExportStateRelationshipDataTypeEnum = exports.ExportRelationshipDataTypeEnum = exports.DeselectOperationTypeEnum = exports.ClearTransformOperationTypeEnum = exports.ClearMaterialOperationTypeEnum = exports.ChangeVisibilityOperationTypeEnum = exports.ChangeTransformOperationTypeEnum = exports.ChangeMaterialOperationTypeEnum = exports.CameraFitTypeEnum = exports.BatchOperationRefTypeEnum = exports.BatchOperationOpEnum = void 0;
|
|
29
|
+
exports.TranslationInspectionsApiFp = exports.TranslationInspectionsApiAxiosParamCreator = exports.StreamKeysApi = exports.StreamKeysApiFactory = exports.StreamKeysApiFp = exports.StreamKeysApiAxiosParamCreator = exports.ScenesApi = exports.ScenesApiFactory = exports.ScenesApiFp = exports.ScenesApiAxiosParamCreator = exports.SceneViewsApi = exports.SceneViewsApiFactory = exports.SceneViewsApiFp = exports.SceneViewsApiAxiosParamCreator = exports.SceneViewStatesApi = exports.SceneViewStatesApiFactory = exports.SceneViewStatesApiFp = exports.SceneViewStatesApiAxiosParamCreator = exports.SceneItemsApi = exports.SceneItemsApiFactory = exports.SceneItemsApiFp = exports.SceneItemsApiAxiosParamCreator = exports.SceneItemOverridesApi = exports.SceneItemOverridesApiFactory = exports.SceneItemOverridesApiFp = exports.SceneItemOverridesApiAxiosParamCreator = exports.SceneAlterationsApi = exports.SceneAlterationsApiFactory = exports.SceneAlterationsApiFp = exports.SceneAlterationsApiAxiosParamCreator = exports.PartsApi = exports.PartsApiFactory = exports.PartsApiFp = exports.PartsApiAxiosParamCreator = exports.PartRevisionsApi = exports.PartRevisionsApiFactory = exports.PartRevisionsApiFp = exports.PartRevisionsApiAxiosParamCreator = exports.Oauth2Api = exports.Oauth2ApiFactory = exports.Oauth2ApiFp = exports.Oauth2ApiAxiosParamCreator = exports.HitsApi = exports.HitsApiFactory = exports.HitsApiFp = exports.HitsApiAxiosParamCreator = exports.GeometrySetsApi = exports.GeometrySetsApiFactory = exports.GeometrySetsApiFp = exports.GeometrySetsApiAxiosParamCreator = void 0;
|
|
30
|
+
exports.WebhookSubscriptionsApi = exports.WebhookSubscriptionsApiFactory = exports.WebhookSubscriptionsApiFp = exports.WebhookSubscriptionsApiAxiosParamCreator = exports.TranslationInspectionsApi = exports.TranslationInspectionsApiFactory = void 0;
|
|
31
31
|
const axios_1 = __importDefault(require("axios"));
|
|
32
32
|
// Some imports not used depending on template conditions
|
|
33
33
|
// @ts-ignore
|
|
@@ -74,13 +74,6 @@ exports.FileRelationshipDataTypeEnum = {
|
|
|
74
74
|
exports.GeometrySetRelationshipDataTypeEnum = {
|
|
75
75
|
GeometrySet: 'geometry-set',
|
|
76
76
|
};
|
|
77
|
-
exports.MetadataValueTypeEnum = {
|
|
78
|
-
String: 'string',
|
|
79
|
-
Long: 'long',
|
|
80
|
-
Float: 'float',
|
|
81
|
-
Date: 'date',
|
|
82
|
-
Null: 'null',
|
|
83
|
-
};
|
|
84
77
|
exports.PartDataRelationshipsPartRevisionsTypeEnum = {
|
|
85
78
|
PartRevision: 'part-revision',
|
|
86
79
|
};
|
|
@@ -4759,10 +4752,11 @@ const SceneViewStatesApiAxiosParamCreator = function (configuration) {
|
|
|
4759
4752
|
* @param {number} [pageSize] The number of items to return.
|
|
4760
4753
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
4761
4754
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
4755
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
4762
4756
|
* @param {*} [options] Override http request option.
|
|
4763
4757
|
* @throws {RequiredError}
|
|
4764
4758
|
*/
|
|
4765
|
-
getSceneViewStates: (id, pageCursor, pageSize, fieldsSceneViewState, filterId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
4759
|
+
getSceneViewStates: (id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
4766
4760
|
// verify required parameter 'id' is not null or undefined
|
|
4767
4761
|
(0, common_1.assertParamExists)('getSceneViewStates', 'id', id);
|
|
4768
4762
|
const localVarPath = `/scenes/{id}/scene-view-states`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
|
|
@@ -4791,6 +4785,9 @@ const SceneViewStatesApiAxiosParamCreator = function (configuration) {
|
|
|
4791
4785
|
if (filterId !== undefined) {
|
|
4792
4786
|
localVarQueryParameter['filter[id]'] = filterId;
|
|
4793
4787
|
}
|
|
4788
|
+
if (filterSuppliedId !== undefined) {
|
|
4789
|
+
localVarQueryParameter['filter[suppliedId]'] = filterSuppliedId;
|
|
4790
|
+
}
|
|
4794
4791
|
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
4795
4792
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4796
4793
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -4889,12 +4886,13 @@ const SceneViewStatesApiFp = function (configuration) {
|
|
|
4889
4886
|
* @param {number} [pageSize] The number of items to return.
|
|
4890
4887
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
4891
4888
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
4889
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
4892
4890
|
* @param {*} [options] Override http request option.
|
|
4893
4891
|
* @throws {RequiredError}
|
|
4894
4892
|
*/
|
|
4895
|
-
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options) {
|
|
4893
|
+
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options) {
|
|
4896
4894
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4897
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options);
|
|
4895
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options);
|
|
4898
4896
|
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
|
|
4899
4897
|
});
|
|
4900
4898
|
},
|
|
@@ -4963,12 +4961,13 @@ const SceneViewStatesApiFactory = function (configuration, basePath, axios) {
|
|
|
4963
4961
|
* @param {number} [pageSize] The number of items to return.
|
|
4964
4962
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
4965
4963
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
4964
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
4966
4965
|
* @param {*} [options] Override http request option.
|
|
4967
4966
|
* @throws {RequiredError}
|
|
4968
4967
|
*/
|
|
4969
|
-
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options) {
|
|
4968
|
+
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options) {
|
|
4970
4969
|
return localVarFp
|
|
4971
|
-
.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options)
|
|
4970
|
+
.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options)
|
|
4972
4971
|
.then((request) => request(axios, basePath));
|
|
4973
4972
|
},
|
|
4974
4973
|
/**
|
|
@@ -5038,7 +5037,7 @@ class SceneViewStatesApi extends base_1.BaseAPI {
|
|
|
5038
5037
|
*/
|
|
5039
5038
|
getSceneViewStates(requestParameters, options) {
|
|
5040
5039
|
return (0, exports.SceneViewStatesApiFp)(this.configuration)
|
|
5041
|
-
.getSceneViewStates(requestParameters.id, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.fieldsSceneViewState, requestParameters.filterId, options)
|
|
5040
|
+
.getSceneViewStates(requestParameters.id, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.fieldsSceneViewState, requestParameters.filterId, requestParameters.filterSuppliedId, options)
|
|
5042
5041
|
.then((request) => request(this.axios, this.basePath));
|
|
5043
5042
|
}
|
|
5044
5043
|
/**
|
|
@@ -74,9 +74,10 @@ function pollQueuedJob({ id, getQueuedJob, allow404 = false, limit, polling: { i
|
|
|
74
74
|
let attempts = 1;
|
|
75
75
|
let pollRes = yield poll(attempts);
|
|
76
76
|
/* eslint-disable no-await-in-loop */
|
|
77
|
-
while ((
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
while (!completeJob(pollRes.res) &&
|
|
78
|
+
(allowed404(allow404, pollRes.status) ||
|
|
79
|
+
validJob(pollRes.res) ||
|
|
80
|
+
isClientError(pollRes.res)) &&
|
|
80
81
|
attempts <= maxAttempts) {
|
|
81
82
|
attempts += 1;
|
|
82
83
|
yield (0, utils_1.delay)(intervalMs);
|
|
@@ -85,7 +86,7 @@ function pollQueuedJob({ id, getQueuedJob, allow404 = false, limit, polling: { i
|
|
|
85
86
|
/* eslint-enable no-await-in-loop */
|
|
86
87
|
// At this point, the result is one of the following,
|
|
87
88
|
// - An item of type `T` after being redirected to it
|
|
88
|
-
// - A QueuedJob (after either exceeding `maxAttempts` or with `error` status)
|
|
89
|
+
// - A QueuedJob (after either exceeding `maxAttempts` or with `complete` or `error` status)
|
|
89
90
|
// - A Failure
|
|
90
91
|
return Object.assign(Object.assign({}, pollRes), { attempts, id });
|
|
91
92
|
});
|
|
@@ -115,10 +116,16 @@ function allowed404(allow404, status) {
|
|
|
115
116
|
function validJob(r) {
|
|
116
117
|
return (0, utils_1.isQueuedJob)(r) && !isStatusError(r);
|
|
117
118
|
}
|
|
119
|
+
function completeJob(r) {
|
|
120
|
+
return (0, utils_1.isQueuedJob)(r) && isStatusComplete(r);
|
|
121
|
+
}
|
|
118
122
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
119
123
|
function isQueuedJobError(obj) {
|
|
120
124
|
return (0, utils_1.isQueuedJob)(obj) && isStatusError(obj);
|
|
121
125
|
}
|
|
126
|
+
function isStatusComplete(job) {
|
|
127
|
+
return job.data.attributes.status === 'complete';
|
|
128
|
+
}
|
|
122
129
|
function isStatusError(job) {
|
|
123
130
|
return job.data.attributes.status === 'error';
|
|
124
131
|
}
|
|
@@ -17,6 +17,22 @@ export interface CreateSceneAndSceneItemsReq extends BaseReq {
|
|
|
17
17
|
/** Whether or not to return queued scene items. */
|
|
18
18
|
readonly returnQueued?: boolean;
|
|
19
19
|
}
|
|
20
|
+
export interface CreateSceneAndSceneItemsReqEXPERIMENTAL extends BaseReq {
|
|
21
|
+
/** A list of {@link CreateSceneItemRequest}. */
|
|
22
|
+
readonly createSceneItemReqs: Array<Array<CreateSceneItemRequest>>;
|
|
23
|
+
/** Function returning a {@link CreateSceneRequest}. */
|
|
24
|
+
readonly createSceneReq: () => CreateSceneRequest;
|
|
25
|
+
/** Whether or not to fail if any scene item fails initial validation. */
|
|
26
|
+
readonly failFast?: boolean;
|
|
27
|
+
/** How many requests to run in parallel. */
|
|
28
|
+
readonly parallelism: number;
|
|
29
|
+
/** {@link Polling} */
|
|
30
|
+
readonly polling?: Polling;
|
|
31
|
+
/** Callback with total number of requests and number complete. */
|
|
32
|
+
onProgress?: (complete: number, total: number) => void;
|
|
33
|
+
/** Whether or not to return queued scene items. */
|
|
34
|
+
readonly returnQueued?: boolean;
|
|
35
|
+
}
|
|
20
36
|
export interface CreateSceneAndSceneItemsRes {
|
|
21
37
|
readonly errors: QueuedSceneItem[];
|
|
22
38
|
readonly scene: Scene;
|
|
@@ -90,13 +106,13 @@ export declare function createSceneAndSceneItems({ client, createSceneItemReqs,
|
|
|
90
106
|
*/
|
|
91
107
|
export declare function createSceneItems({ client, createSceneItemReqs, failFast, onProgress, parallelism, sceneId, }: CreateSceneItemsReq): Promise<CreateSceneItemsRes>;
|
|
92
108
|
/**
|
|
93
|
-
* Create a scene with scene items.
|
|
109
|
+
* Create a scene with scene items using experimental strategy.
|
|
94
110
|
*/
|
|
95
|
-
export declare function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, createSceneReq, failFast, onMsg, onProgress, parallelism, polling, returnQueued, verbose, }:
|
|
111
|
+
export declare function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, createSceneReq, failFast, onMsg, onProgress, parallelism, polling, returnQueued, verbose, }: CreateSceneAndSceneItemsReqEXPERIMENTAL): Promise<CreateSceneAndSceneItemsResEXPERIMENTAL>;
|
|
96
112
|
/**
|
|
97
113
|
* Create scene items within a scene.
|
|
98
114
|
*/
|
|
99
|
-
export declare function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast,
|
|
115
|
+
export declare function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast, parallelism, sceneId, }: CreateSceneItemsReq): Promise<CreateSceneItemsResEXPERIMENTAL>;
|
|
100
116
|
/**
|
|
101
117
|
* Delete all scenes.
|
|
102
118
|
*
|
|
@@ -14,6 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.updateScene = exports.renderScene = exports.pollSceneReady = exports.deleteAllScenes = exports.createSceneItemsEXPERIMENTAL = exports.createSceneAndSceneItemsEXPERIMENTAL = exports.createSceneItems = exports.createSceneAndSceneItems = void 0;
|
|
16
16
|
const p_limit_1 = __importDefault(require("p-limit"));
|
|
17
|
+
const process_1 = require("process");
|
|
17
18
|
const index_1 = require("../../index");
|
|
18
19
|
const index_2 = require("../index");
|
|
19
20
|
const utils_1 = require("../utils");
|
|
@@ -121,45 +122,93 @@ function createSceneItems({ client, createSceneItemReqs, failFast, onProgress, p
|
|
|
121
122
|
}
|
|
122
123
|
exports.createSceneItems = createSceneItems;
|
|
123
124
|
/**
|
|
124
|
-
* Create a scene with scene items.
|
|
125
|
+
* Create a scene with scene items using experimental strategy.
|
|
125
126
|
*/
|
|
126
127
|
function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, createSceneReq, failFast = false, onMsg = console.log, onProgress, parallelism, polling = { intervalMs: index_2.PollIntervalMs, maxAttempts: index_2.MaxAttempts }, returnQueued = false, verbose, }) {
|
|
127
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const startTime = process_1.hrtime.bigint();
|
|
130
|
+
if (verbose)
|
|
131
|
+
onMsg(`Creating scene...`);
|
|
128
132
|
const scene = (yield client.scenes.createScene({ createSceneRequest: createSceneReq() })).data;
|
|
129
133
|
const sceneId = scene.data.id;
|
|
130
|
-
const createRes = yield createSceneItemsEXPERIMENTAL({
|
|
131
|
-
client,
|
|
132
|
-
createSceneItemReqs,
|
|
133
|
-
failFast,
|
|
134
|
-
onProgress,
|
|
135
|
-
parallelism,
|
|
136
|
-
sceneId,
|
|
137
|
-
});
|
|
138
|
-
const { a: queuedOps, b: errors } = (0, index_2.partition)(createRes.queuedBatchOps, (i) => (0, index_2.isQueuedJob)(i.res));
|
|
139
|
-
const queued = returnQueued ? createRes.queuedBatchOps : [];
|
|
140
|
-
// Nothing succeeded, return early as something is likely wrong
|
|
141
|
-
if (queuedOps.length === 0 || errors.length === createRes.chunks) {
|
|
142
|
-
return { errors, queued, scene, sceneItemErrors: [] };
|
|
143
|
-
}
|
|
144
134
|
if (verbose)
|
|
145
|
-
onMsg(`
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
135
|
+
onMsg(`Creating scene items...`);
|
|
136
|
+
let itemCount = 0;
|
|
137
|
+
let batchQueuedOps = [];
|
|
138
|
+
let batchErrors = [];
|
|
139
|
+
let sceneItemErrors = [];
|
|
140
|
+
for (let depth = 0; depth < createSceneItemReqs.length; depth++) {
|
|
141
|
+
const createItemReqs = createSceneItemReqs[depth];
|
|
142
|
+
itemCount += createItemReqs.length;
|
|
143
|
+
if (verbose)
|
|
144
|
+
onMsg(`Creating ${createItemReqs.length} scene items at depth ${depth}...`);
|
|
145
|
+
// Await is used intentionally to defer loop iteration
|
|
146
|
+
// until all scene items have been created at each depth.
|
|
147
|
+
// eslint-disable-next-line no-await-in-loop
|
|
148
|
+
const createRes = yield createSceneItemsEXPERIMENTAL({
|
|
149
|
+
client,
|
|
150
|
+
createSceneItemReqs: createItemReqs,
|
|
151
|
+
failFast,
|
|
152
|
+
onProgress,
|
|
153
|
+
parallelism,
|
|
154
|
+
sceneId,
|
|
160
155
|
});
|
|
156
|
+
const { a: queuedOps, b: errors } = (0, index_2.partition)(createRes.queuedBatchOps, (i) => (0, index_2.isQueuedJob)(i.res));
|
|
157
|
+
batchQueuedOps = batchQueuedOps.concat(queuedOps);
|
|
158
|
+
if (errors.length) {
|
|
159
|
+
batchErrors = batchErrors.concat(errors);
|
|
160
|
+
if (verbose)
|
|
161
|
+
onMsg(`WARNING: ${errors.length} scene item batch errors at depth ${depth}.`);
|
|
162
|
+
}
|
|
163
|
+
// Nothing succeeded, return early as something is likely wrong
|
|
164
|
+
if (queuedOps.length === 0 || errors.length === createRes.chunks) {
|
|
165
|
+
return {
|
|
166
|
+
errors,
|
|
167
|
+
queued: returnQueued ? createRes.queuedBatchOps : [],
|
|
168
|
+
scene,
|
|
169
|
+
sceneItemErrors: [],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
const limit = (0, p_limit_1.default)(Math.min(parallelism, 20));
|
|
173
|
+
function poll({ ops, res, }) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
const r = yield (0, queued_jobs_1.pollQueuedJob)({
|
|
176
|
+
id: res.data.id,
|
|
177
|
+
getQueuedJob: (id, cancelToken) => client.batches.getQueuedBatch({ id }, { cancelToken }),
|
|
178
|
+
allow404: true,
|
|
179
|
+
limit,
|
|
180
|
+
polling,
|
|
181
|
+
});
|
|
182
|
+
if ((0, queued_jobs_1.isPollError)(r.res)) {
|
|
183
|
+
failFast ? (0, queued_jobs_1.throwOnError)(r) : errors.push({ ops, res: r.res });
|
|
184
|
+
}
|
|
185
|
+
return r;
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// eslint-disable-next-line no-await-in-loop
|
|
189
|
+
const batchRes = yield Promise.all(queuedOps.map((is) => limit(poll, is)));
|
|
190
|
+
const batchItemErrors = batchRes
|
|
191
|
+
.flatMap((b, i) => (0, queued_jobs_1.isBatch)(b.res)
|
|
192
|
+
? b.res['vertexvis/batch:results'].map((r, j) => (0, utils_1.isApiError)(r)
|
|
193
|
+
? { req: queuedOps[i].ops[j].data, res: r }
|
|
194
|
+
: undefined)
|
|
195
|
+
: [])
|
|
196
|
+
.filter(index_2.defined);
|
|
197
|
+
if (batchItemErrors.length) {
|
|
198
|
+
sceneItemErrors = sceneItemErrors.concat(batchItemErrors);
|
|
199
|
+
if (verbose)
|
|
200
|
+
onMsg(`WARNING: ${batchItemErrors.length} scene item creation errors at depth ${depth}.`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (verbose) {
|
|
204
|
+
onMsg(`Scene item creation complete for ${itemCount} scene items with max depth of ${createSceneItemReqs.length - 1}.`);
|
|
205
|
+
if (batchErrors.length) {
|
|
206
|
+
onMsg(` Batch errors: ${batchErrors.length}`);
|
|
207
|
+
}
|
|
208
|
+
if (sceneItemErrors.length) {
|
|
209
|
+
onMsg(` Scene item errors: ${sceneItemErrors.length}`);
|
|
210
|
+
}
|
|
161
211
|
}
|
|
162
|
-
const batchRes = yield Promise.all(queuedOps.map((is) => limit(poll, is)));
|
|
163
212
|
if (verbose)
|
|
164
213
|
onMsg(`Committing scene and polling until ready...`);
|
|
165
214
|
yield updateScene({
|
|
@@ -169,24 +218,30 @@ function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, cre
|
|
|
169
218
|
});
|
|
170
219
|
yield pollSceneReady({ client, id: sceneId, onMsg, polling, verbose });
|
|
171
220
|
if (verbose)
|
|
172
|
-
onMsg(`Fitting scene's camera to scene
|
|
221
|
+
onMsg(`Fitting scene's camera to scene items...`);
|
|
222
|
+
const sceneResult = (yield updateScene({
|
|
223
|
+
attributes: {
|
|
224
|
+
camera: { type: index_1.CameraFitTypeEnum.FitVisibleSceneItems },
|
|
225
|
+
},
|
|
226
|
+
client,
|
|
227
|
+
sceneId,
|
|
228
|
+
})).scene;
|
|
229
|
+
if (verbose) {
|
|
230
|
+
const formatTime = (seconds) => {
|
|
231
|
+
const h = Math.floor(seconds / 3600);
|
|
232
|
+
const m = Math.floor((seconds % 3600) / 60);
|
|
233
|
+
const s = Math.round(seconds % 60);
|
|
234
|
+
return [h, m > 9 ? m : h ? '0' + m : m || '0', s > 9 ? s : '0' + s]
|
|
235
|
+
.filter(Boolean)
|
|
236
|
+
.join(':');
|
|
237
|
+
};
|
|
238
|
+
onMsg(`Scene creation completed in ${formatTime(Number(process_1.hrtime.bigint() - startTime) / 1000000000)}.`);
|
|
239
|
+
}
|
|
173
240
|
return {
|
|
174
|
-
errors,
|
|
175
|
-
queued,
|
|
176
|
-
scene:
|
|
177
|
-
|
|
178
|
-
camera: { type: index_1.CameraFitTypeEnum.FitVisibleSceneItems },
|
|
179
|
-
},
|
|
180
|
-
client,
|
|
181
|
-
sceneId,
|
|
182
|
-
})).scene,
|
|
183
|
-
sceneItemErrors: batchRes
|
|
184
|
-
.flatMap((b, i) => (0, queued_jobs_1.isBatch)(b.res)
|
|
185
|
-
? b.res['vertexvis/batch:results'].map((r, j) => (0, utils_1.isApiError)(r)
|
|
186
|
-
? { req: queuedOps[i].ops[j].data, res: r }
|
|
187
|
-
: undefined)
|
|
188
|
-
: [])
|
|
189
|
-
.filter(index_2.defined),
|
|
241
|
+
errors: batchErrors,
|
|
242
|
+
queued: batchQueuedOps,
|
|
243
|
+
scene: sceneResult,
|
|
244
|
+
sceneItemErrors,
|
|
190
245
|
};
|
|
191
246
|
});
|
|
192
247
|
}
|
|
@@ -194,11 +249,10 @@ exports.createSceneAndSceneItemsEXPERIMENTAL = createSceneAndSceneItemsEXPERIMEN
|
|
|
194
249
|
/**
|
|
195
250
|
* Create scene items within a scene.
|
|
196
251
|
*/
|
|
197
|
-
function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast,
|
|
252
|
+
function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast, parallelism, sceneId, }) {
|
|
198
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
254
|
const limit = (0, p_limit_1.default)(parallelism);
|
|
200
255
|
const batchSize = 500;
|
|
201
|
-
let complete = 0;
|
|
202
256
|
const opChunks = (0, utils_1.arrayChunked)(createSceneItemReqs.map((req) => ({
|
|
203
257
|
data: req.data,
|
|
204
258
|
op: index_1.BatchOperationOpEnum.Add,
|
|
@@ -222,10 +276,6 @@ function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast, o
|
|
|
222
276
|
else
|
|
223
277
|
throw error;
|
|
224
278
|
}
|
|
225
|
-
if (onProgress != null) {
|
|
226
|
-
complete += opChunk.length;
|
|
227
|
-
onProgress(complete, createSceneItemReqs.length);
|
|
228
|
-
}
|
|
229
279
|
return { ops, res };
|
|
230
280
|
}), opChunk)));
|
|
231
281
|
return { chunks: opChunks.length, queuedBatchOps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.20.
|
|
1
|
+
export declare const version = "0.20.4";
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -671,7 +671,7 @@ export interface Color3 {
|
|
|
671
671
|
*/
|
|
672
672
|
export interface ColorMaterial {
|
|
673
673
|
/**
|
|
674
|
-
*
|
|
674
|
+
* An opacity value from 0 to 255.
|
|
675
675
|
* @type {number}
|
|
676
676
|
* @memberof ColorMaterial
|
|
677
677
|
*/
|
|
@@ -714,7 +714,7 @@ export interface ColorMaterial {
|
|
|
714
714
|
*/
|
|
715
715
|
export interface ColorMaterialNullable {
|
|
716
716
|
/**
|
|
717
|
-
*
|
|
717
|
+
* An opacity value from 0 to 255.
|
|
718
718
|
* @type {number}
|
|
719
719
|
* @memberof ColorMaterialNullable
|
|
720
720
|
*/
|
|
@@ -1107,11 +1107,19 @@ export interface CreatePartRequestDataAttributes {
|
|
|
1107
1107
|
*/
|
|
1108
1108
|
suppliedRevisionId?: string;
|
|
1109
1109
|
/**
|
|
1110
|
-
* Whether or not to index metadata in the part file.
|
|
1110
|
+
* Whether or not to index metadata in the part file. To ignore metadata from the part file and add your own, pass `false` for `indexMetadata` and supply custom metadata using the `metadata` field.
|
|
1111
1111
|
* @type {boolean}
|
|
1112
1112
|
* @memberof CreatePartRequestDataAttributes
|
|
1113
1113
|
*/
|
|
1114
1114
|
indexMetadata?: boolean;
|
|
1115
|
+
/**
|
|
1116
|
+
* Additional metadata about the `part` and/or `part-revision`. This metadata will take precedence over any metadata that belongs to the part file if `indexMetadata` is specified.
|
|
1117
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
1118
|
+
* @memberof CreatePartRequestDataAttributes
|
|
1119
|
+
*/
|
|
1120
|
+
metadata?: {
|
|
1121
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
1122
|
+
};
|
|
1115
1123
|
/**
|
|
1116
1124
|
* Name to be used for the root part.
|
|
1117
1125
|
* @type {string}
|
|
@@ -1356,6 +1364,14 @@ export interface CreateSceneItemRequestDataAttributes {
|
|
|
1356
1364
|
* @memberof CreateSceneItemRequestDataAttributes
|
|
1357
1365
|
*/
|
|
1358
1366
|
visible?: boolean;
|
|
1367
|
+
/**
|
|
1368
|
+
* Additional metadata for the scene-item. This metadata will take precedence over any metadata that belongs to the part file.
|
|
1369
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
1370
|
+
* @memberof CreateSceneItemRequestDataAttributes
|
|
1371
|
+
*/
|
|
1372
|
+
metadata?: {
|
|
1373
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
1374
|
+
};
|
|
1359
1375
|
}
|
|
1360
1376
|
/**
|
|
1361
1377
|
*
|
|
@@ -1590,6 +1606,12 @@ export interface CreateSceneViewStateRequestDataAttributes {
|
|
|
1590
1606
|
* @memberof CreateSceneViewStateRequestDataAttributes
|
|
1591
1607
|
*/
|
|
1592
1608
|
name?: string;
|
|
1609
|
+
/**
|
|
1610
|
+
* ID provided for correlation. For example, an existing ID from a PLM system.
|
|
1611
|
+
* @type {string}
|
|
1612
|
+
* @memberof CreateSceneViewStateRequestDataAttributes
|
|
1613
|
+
*/
|
|
1614
|
+
suppliedId?: string;
|
|
1593
1615
|
}
|
|
1594
1616
|
/**
|
|
1595
1617
|
*
|
|
@@ -2577,30 +2599,54 @@ export interface Matrix4Nullable {
|
|
|
2577
2599
|
/**
|
|
2578
2600
|
*
|
|
2579
2601
|
* @export
|
|
2580
|
-
* @interface
|
|
2602
|
+
* @interface MetadataFloatType
|
|
2581
2603
|
*/
|
|
2582
|
-
export interface
|
|
2604
|
+
export interface MetadataFloatType {
|
|
2583
2605
|
/**
|
|
2584
|
-
*
|
|
2606
|
+
* Type of metadata value.
|
|
2585
2607
|
* @type {string}
|
|
2586
|
-
* @memberof
|
|
2608
|
+
* @memberof MetadataFloatType
|
|
2587
2609
|
*/
|
|
2588
|
-
|
|
2610
|
+
type: string;
|
|
2611
|
+
/**
|
|
2612
|
+
* A numerical floating-point value.
|
|
2613
|
+
* @type {number}
|
|
2614
|
+
* @memberof MetadataFloatType
|
|
2615
|
+
*/
|
|
2616
|
+
value: number;
|
|
2617
|
+
}
|
|
2618
|
+
/**
|
|
2619
|
+
*
|
|
2620
|
+
* @export
|
|
2621
|
+
* @interface MetadataNullType
|
|
2622
|
+
*/
|
|
2623
|
+
export interface MetadataNullType {
|
|
2589
2624
|
/**
|
|
2590
2625
|
* Type of metadata value.
|
|
2591
2626
|
* @type {string}
|
|
2592
|
-
* @memberof
|
|
2627
|
+
* @memberof MetadataNullType
|
|
2593
2628
|
*/
|
|
2594
|
-
type:
|
|
2629
|
+
type: string;
|
|
2630
|
+
}
|
|
2631
|
+
/**
|
|
2632
|
+
*
|
|
2633
|
+
* @export
|
|
2634
|
+
* @interface MetadataStringType
|
|
2635
|
+
*/
|
|
2636
|
+
export interface MetadataStringType {
|
|
2637
|
+
/**
|
|
2638
|
+
* Type of metadata value.
|
|
2639
|
+
* @type {string}
|
|
2640
|
+
* @memberof MetadataStringType
|
|
2641
|
+
*/
|
|
2642
|
+
type: string;
|
|
2643
|
+
/**
|
|
2644
|
+
* A string value.
|
|
2645
|
+
* @type {string}
|
|
2646
|
+
* @memberof MetadataStringType
|
|
2647
|
+
*/
|
|
2648
|
+
value: string;
|
|
2595
2649
|
}
|
|
2596
|
-
export declare const MetadataValueTypeEnum: {
|
|
2597
|
-
readonly String: "string";
|
|
2598
|
-
readonly Long: "long";
|
|
2599
|
-
readonly Float: "float";
|
|
2600
|
-
readonly Date: "date";
|
|
2601
|
-
readonly Null: "null";
|
|
2602
|
-
};
|
|
2603
|
-
export declare type MetadataValueTypeEnum = typeof MetadataValueTypeEnum[keyof typeof MetadataValueTypeEnum];
|
|
2604
2650
|
/**
|
|
2605
2651
|
*
|
|
2606
2652
|
* @export
|
|
@@ -2958,11 +3004,11 @@ export interface PartRevisionDataAttributes {
|
|
|
2958
3004
|
created?: string;
|
|
2959
3005
|
/**
|
|
2960
3006
|
*
|
|
2961
|
-
* @type {{ [key: string]:
|
|
3007
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
2962
3008
|
* @memberof PartRevisionDataAttributes
|
|
2963
3009
|
*/
|
|
2964
3010
|
metadata?: {
|
|
2965
|
-
[key: string]:
|
|
3011
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
2966
3012
|
};
|
|
2967
3013
|
/**
|
|
2968
3014
|
*
|
|
@@ -3694,11 +3740,11 @@ export interface SceneItemDataAttributes {
|
|
|
3694
3740
|
materialOverride?: ColorMaterial;
|
|
3695
3741
|
/**
|
|
3696
3742
|
*
|
|
3697
|
-
* @type {{ [key: string]:
|
|
3743
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
3698
3744
|
* @memberof SceneItemDataAttributes
|
|
3699
3745
|
*/
|
|
3700
3746
|
metadata?: {
|
|
3701
|
-
[key: string]:
|
|
3747
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
3702
3748
|
};
|
|
3703
3749
|
/**
|
|
3704
3750
|
*
|
|
@@ -4296,6 +4342,12 @@ export interface SceneViewStateDataAttributes {
|
|
|
4296
4342
|
* @memberof SceneViewStateDataAttributes
|
|
4297
4343
|
*/
|
|
4298
4344
|
noDefaultLights?: boolean;
|
|
4345
|
+
/**
|
|
4346
|
+
*
|
|
4347
|
+
* @type {string}
|
|
4348
|
+
* @memberof SceneViewStateDataAttributes
|
|
4349
|
+
*/
|
|
4350
|
+
suppliedId?: string;
|
|
4299
4351
|
}
|
|
4300
4352
|
/**
|
|
4301
4353
|
*
|
|
@@ -4737,15 +4789,15 @@ export interface UpdatePartRevisionRequestData {
|
|
|
4737
4789
|
*/
|
|
4738
4790
|
export interface UpdatePartRevisionRequestDataAttributes {
|
|
4739
4791
|
/**
|
|
4740
|
-
* Metadata about the `part` and/or `part-revision`.
|
|
4741
|
-
* @type {{ [key: string]:
|
|
4792
|
+
* Metadata about the `part` and/or `part-revision`. This metadata will take precedence over any metadata that belongs to the part file if `indexMetadata` is specified.
|
|
4793
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
4742
4794
|
* @memberof UpdatePartRevisionRequestDataAttributes
|
|
4743
4795
|
*/
|
|
4744
4796
|
metadata?: {
|
|
4745
|
-
[key: string]:
|
|
4797
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
4746
4798
|
};
|
|
4747
4799
|
/**
|
|
4748
|
-
* Whether or not to index metadata in the part file when sending a file relationship - not used otherwise.
|
|
4800
|
+
* Whether or not to index metadata in the part file when sending a file relationship - not used otherwise. To ignore metadata from the part file and add your own, pass `false` for `indexMetadata` and supply custom metadata using the `metadata` field.
|
|
4749
4801
|
* @type {boolean}
|
|
4750
4802
|
* @memberof UpdatePartRevisionRequestDataAttributes
|
|
4751
4803
|
*/
|
|
@@ -4918,6 +4970,14 @@ export interface UpdateSceneItemRequestDataAttributes {
|
|
|
4918
4970
|
* @memberof UpdateSceneItemRequestDataAttributes
|
|
4919
4971
|
*/
|
|
4920
4972
|
suppliedId?: string;
|
|
4973
|
+
/**
|
|
4974
|
+
* Additional metadata for the scene-item. This metadata will take precedence over any metadata that belongs to the part file.
|
|
4975
|
+
* @type {{ [key: string]: MetadataStringType | MetadataFloatType | MetadataNullType; }}
|
|
4976
|
+
* @memberof UpdateSceneItemRequestDataAttributes
|
|
4977
|
+
*/
|
|
4978
|
+
metadata?: {
|
|
4979
|
+
[key: string]: MetadataStringType | MetadataFloatType | MetadataNullType;
|
|
4980
|
+
};
|
|
4921
4981
|
}
|
|
4922
4982
|
/**
|
|
4923
4983
|
*
|
|
@@ -8710,10 +8770,11 @@ export declare const SceneViewStatesApiAxiosParamCreator: (configuration?: Confi
|
|
|
8710
8770
|
* @param {number} [pageSize] The number of items to return.
|
|
8711
8771
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
8712
8772
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
8773
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
8713
8774
|
* @param {*} [options] Override http request option.
|
|
8714
8775
|
* @throws {RequiredError}
|
|
8715
8776
|
*/
|
|
8716
|
-
getSceneViewStates: (id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
8777
|
+
getSceneViewStates: (id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, filterSuppliedId?: string | undefined, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
8717
8778
|
/**
|
|
8718
8779
|
* Update a `scene-view-state`.
|
|
8719
8780
|
* @param {string} id The `scene-view-state` ID.
|
|
@@ -8758,10 +8819,11 @@ export declare const SceneViewStatesApiFp: (configuration?: Configuration | unde
|
|
|
8758
8819
|
* @param {number} [pageSize] The number of items to return.
|
|
8759
8820
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
8760
8821
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
8822
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
8761
8823
|
* @param {*} [options] Override http request option.
|
|
8762
8824
|
* @throws {RequiredError}
|
|
8763
8825
|
*/
|
|
8764
|
-
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<SceneViewStateList>>;
|
|
8826
|
+
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, filterSuppliedId?: string | undefined, options?: AxiosRequestConfig<any> | undefined): Promise<(axios?: AxiosInstance | undefined, basePath?: string | undefined) => AxiosPromise<SceneViewStateList>>;
|
|
8765
8827
|
/**
|
|
8766
8828
|
* Update a `scene-view-state`.
|
|
8767
8829
|
* @param {string} id The `scene-view-state` ID.
|
|
@@ -8806,10 +8868,11 @@ export declare const SceneViewStatesApiFactory: (configuration?: Configuration |
|
|
|
8806
8868
|
* @param {number} [pageSize] The number of items to return.
|
|
8807
8869
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
8808
8870
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
8871
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
8809
8872
|
* @param {*} [options] Override http request option.
|
|
8810
8873
|
* @throws {RequiredError}
|
|
8811
8874
|
*/
|
|
8812
|
-
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, options?: any): AxiosPromise<SceneViewStateList>;
|
|
8875
|
+
getSceneViewStates(id: string, pageCursor?: string | undefined, pageSize?: number | undefined, fieldsSceneViewState?: string | undefined, filterId?: string | undefined, filterSuppliedId?: string | undefined, options?: any): AxiosPromise<SceneViewStateList>;
|
|
8813
8876
|
/**
|
|
8814
8877
|
* Update a `scene-view-state`.
|
|
8815
8878
|
* @param {string} id The `scene-view-state` ID.
|
|
@@ -8906,6 +8969,12 @@ export interface SceneViewStatesApiGetSceneViewStatesRequest {
|
|
|
8906
8969
|
* @memberof SceneViewStatesApiGetSceneViewStates
|
|
8907
8970
|
*/
|
|
8908
8971
|
readonly filterId?: string;
|
|
8972
|
+
/**
|
|
8973
|
+
* Comma-separated list of supplied IDs to filter on.
|
|
8974
|
+
* @type {string}
|
|
8975
|
+
* @memberof SceneViewStatesApiGetSceneViewStates
|
|
8976
|
+
*/
|
|
8977
|
+
readonly filterSuppliedId?: string;
|
|
8909
8978
|
}
|
|
8910
8979
|
/**
|
|
8911
8980
|
* Request parameters for updateSceneViewState operation in SceneViewStatesApi.
|
package/dist/esm/api.js
CHANGED
|
@@ -66,13 +66,6 @@ export const FileRelationshipDataTypeEnum = {
|
|
|
66
66
|
export const GeometrySetRelationshipDataTypeEnum = {
|
|
67
67
|
GeometrySet: 'geometry-set',
|
|
68
68
|
};
|
|
69
|
-
export const MetadataValueTypeEnum = {
|
|
70
|
-
String: 'string',
|
|
71
|
-
Long: 'long',
|
|
72
|
-
Float: 'float',
|
|
73
|
-
Date: 'date',
|
|
74
|
-
Null: 'null',
|
|
75
|
-
};
|
|
76
69
|
export const PartDataRelationshipsPartRevisionsTypeEnum = {
|
|
77
70
|
PartRevision: 'part-revision',
|
|
78
71
|
};
|
|
@@ -4699,10 +4692,11 @@ export const SceneViewStatesApiAxiosParamCreator = function (configuration) {
|
|
|
4699
4692
|
* @param {number} [pageSize] The number of items to return.
|
|
4700
4693
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
4701
4694
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
4695
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
4702
4696
|
* @param {*} [options] Override http request option.
|
|
4703
4697
|
* @throws {RequiredError}
|
|
4704
4698
|
*/
|
|
4705
|
-
getSceneViewStates: (id, pageCursor, pageSize, fieldsSceneViewState, filterId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
4699
|
+
getSceneViewStates: (id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options = {}) => __awaiter(this, void 0, void 0, function* () {
|
|
4706
4700
|
// verify required parameter 'id' is not null or undefined
|
|
4707
4701
|
assertParamExists('getSceneViewStates', 'id', id);
|
|
4708
4702
|
const localVarPath = `/scenes/{id}/scene-view-states`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
|
|
@@ -4731,6 +4725,9 @@ export const SceneViewStatesApiAxiosParamCreator = function (configuration) {
|
|
|
4731
4725
|
if (filterId !== undefined) {
|
|
4732
4726
|
localVarQueryParameter['filter[id]'] = filterId;
|
|
4733
4727
|
}
|
|
4728
|
+
if (filterSuppliedId !== undefined) {
|
|
4729
|
+
localVarQueryParameter['filter[suppliedId]'] = filterSuppliedId;
|
|
4730
|
+
}
|
|
4734
4731
|
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
4735
4732
|
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
4736
4733
|
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
@@ -4828,12 +4825,13 @@ export const SceneViewStatesApiFp = function (configuration) {
|
|
|
4828
4825
|
* @param {number} [pageSize] The number of items to return.
|
|
4829
4826
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
4830
4827
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
4828
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
4831
4829
|
* @param {*} [options] Override http request option.
|
|
4832
4830
|
* @throws {RequiredError}
|
|
4833
4831
|
*/
|
|
4834
|
-
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options) {
|
|
4832
|
+
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options) {
|
|
4835
4833
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4836
|
-
const localVarAxiosArgs = yield localVarAxiosParamCreator.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options);
|
|
4834
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options);
|
|
4837
4835
|
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
4838
4836
|
});
|
|
4839
4837
|
},
|
|
@@ -4901,12 +4899,13 @@ export const SceneViewStatesApiFactory = function (configuration, basePath, axio
|
|
|
4901
4899
|
* @param {number} [pageSize] The number of items to return.
|
|
4902
4900
|
* @param {string} [fieldsSceneViewState] Comma-separated list of fields to return in response. An empty value returns no fields. `thumbnails` is only returned if explicitly requested.
|
|
4903
4901
|
* @param {string} [filterId] Comma-separated list of IDs to filter on.
|
|
4902
|
+
* @param {string} [filterSuppliedId] Comma-separated list of supplied IDs to filter on.
|
|
4904
4903
|
* @param {*} [options] Override http request option.
|
|
4905
4904
|
* @throws {RequiredError}
|
|
4906
4905
|
*/
|
|
4907
|
-
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options) {
|
|
4906
|
+
getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options) {
|
|
4908
4907
|
return localVarFp
|
|
4909
|
-
.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, options)
|
|
4908
|
+
.getSceneViewStates(id, pageCursor, pageSize, fieldsSceneViewState, filterId, filterSuppliedId, options)
|
|
4910
4909
|
.then((request) => request(axios, basePath));
|
|
4911
4910
|
},
|
|
4912
4911
|
/**
|
|
@@ -4975,7 +4974,7 @@ export class SceneViewStatesApi extends BaseAPI {
|
|
|
4975
4974
|
*/
|
|
4976
4975
|
getSceneViewStates(requestParameters, options) {
|
|
4977
4976
|
return SceneViewStatesApiFp(this.configuration)
|
|
4978
|
-
.getSceneViewStates(requestParameters.id, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.fieldsSceneViewState, requestParameters.filterId, options)
|
|
4977
|
+
.getSceneViewStates(requestParameters.id, requestParameters.pageCursor, requestParameters.pageSize, requestParameters.fieldsSceneViewState, requestParameters.filterId, requestParameters.filterSuppliedId, options)
|
|
4979
4978
|
.then((request) => request(this.axios, this.basePath));
|
|
4980
4979
|
}
|
|
4981
4980
|
/**
|
|
@@ -68,9 +68,10 @@ export function pollQueuedJob({ id, getQueuedJob, allow404 = false, limit, polli
|
|
|
68
68
|
let attempts = 1;
|
|
69
69
|
let pollRes = yield poll(attempts);
|
|
70
70
|
/* eslint-disable no-await-in-loop */
|
|
71
|
-
while ((
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
while (!completeJob(pollRes.res) &&
|
|
72
|
+
(allowed404(allow404, pollRes.status) ||
|
|
73
|
+
validJob(pollRes.res) ||
|
|
74
|
+
isClientError(pollRes.res)) &&
|
|
74
75
|
attempts <= maxAttempts) {
|
|
75
76
|
attempts += 1;
|
|
76
77
|
yield delay(intervalMs);
|
|
@@ -79,7 +80,7 @@ export function pollQueuedJob({ id, getQueuedJob, allow404 = false, limit, polli
|
|
|
79
80
|
/* eslint-enable no-await-in-loop */
|
|
80
81
|
// At this point, the result is one of the following,
|
|
81
82
|
// - An item of type `T` after being redirected to it
|
|
82
|
-
// - A QueuedJob (after either exceeding `maxAttempts` or with `error` status)
|
|
83
|
+
// - A QueuedJob (after either exceeding `maxAttempts` or with `complete` or `error` status)
|
|
83
84
|
// - A Failure
|
|
84
85
|
return Object.assign(Object.assign({}, pollRes), { attempts, id });
|
|
85
86
|
});
|
|
@@ -105,10 +106,16 @@ function allowed404(allow404, status) {
|
|
|
105
106
|
function validJob(r) {
|
|
106
107
|
return isQueuedJob(r) && !isStatusError(r);
|
|
107
108
|
}
|
|
109
|
+
function completeJob(r) {
|
|
110
|
+
return isQueuedJob(r) && isStatusComplete(r);
|
|
111
|
+
}
|
|
108
112
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
109
113
|
function isQueuedJobError(obj) {
|
|
110
114
|
return isQueuedJob(obj) && isStatusError(obj);
|
|
111
115
|
}
|
|
116
|
+
function isStatusComplete(job) {
|
|
117
|
+
return job.data.attributes.status === 'complete';
|
|
118
|
+
}
|
|
112
119
|
function isStatusError(job) {
|
|
113
120
|
return job.data.attributes.status === 'error';
|
|
114
121
|
}
|
|
@@ -17,6 +17,22 @@ export interface CreateSceneAndSceneItemsReq extends BaseReq {
|
|
|
17
17
|
/** Whether or not to return queued scene items. */
|
|
18
18
|
readonly returnQueued?: boolean;
|
|
19
19
|
}
|
|
20
|
+
export interface CreateSceneAndSceneItemsReqEXPERIMENTAL extends BaseReq {
|
|
21
|
+
/** A list of {@link CreateSceneItemRequest}. */
|
|
22
|
+
readonly createSceneItemReqs: Array<Array<CreateSceneItemRequest>>;
|
|
23
|
+
/** Function returning a {@link CreateSceneRequest}. */
|
|
24
|
+
readonly createSceneReq: () => CreateSceneRequest;
|
|
25
|
+
/** Whether or not to fail if any scene item fails initial validation. */
|
|
26
|
+
readonly failFast?: boolean;
|
|
27
|
+
/** How many requests to run in parallel. */
|
|
28
|
+
readonly parallelism: number;
|
|
29
|
+
/** {@link Polling} */
|
|
30
|
+
readonly polling?: Polling;
|
|
31
|
+
/** Callback with total number of requests and number complete. */
|
|
32
|
+
onProgress?: (complete: number, total: number) => void;
|
|
33
|
+
/** Whether or not to return queued scene items. */
|
|
34
|
+
readonly returnQueued?: boolean;
|
|
35
|
+
}
|
|
20
36
|
export interface CreateSceneAndSceneItemsRes {
|
|
21
37
|
readonly errors: QueuedSceneItem[];
|
|
22
38
|
readonly scene: Scene;
|
|
@@ -90,13 +106,13 @@ export declare function createSceneAndSceneItems({ client, createSceneItemReqs,
|
|
|
90
106
|
*/
|
|
91
107
|
export declare function createSceneItems({ client, createSceneItemReqs, failFast, onProgress, parallelism, sceneId, }: CreateSceneItemsReq): Promise<CreateSceneItemsRes>;
|
|
92
108
|
/**
|
|
93
|
-
* Create a scene with scene items.
|
|
109
|
+
* Create a scene with scene items using experimental strategy.
|
|
94
110
|
*/
|
|
95
|
-
export declare function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, createSceneReq, failFast, onMsg, onProgress, parallelism, polling, returnQueued, verbose, }:
|
|
111
|
+
export declare function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, createSceneReq, failFast, onMsg, onProgress, parallelism, polling, returnQueued, verbose, }: CreateSceneAndSceneItemsReqEXPERIMENTAL): Promise<CreateSceneAndSceneItemsResEXPERIMENTAL>;
|
|
96
112
|
/**
|
|
97
113
|
* Create scene items within a scene.
|
|
98
114
|
*/
|
|
99
|
-
export declare function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast,
|
|
115
|
+
export declare function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast, parallelism, sceneId, }: CreateSceneItemsReq): Promise<CreateSceneItemsResEXPERIMENTAL>;
|
|
100
116
|
/**
|
|
101
117
|
* Delete all scenes.
|
|
102
118
|
*
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import pLimit from 'p-limit';
|
|
11
|
+
import { hrtime } from 'process';
|
|
11
12
|
import { BatchOperationOpEnum, BatchOperationRefTypeEnum, CameraFitTypeEnum, SceneRelationshipDataTypeEnum, UpdateSceneRequestDataAttributesStateEnum, } from '../../index';
|
|
12
13
|
import { defined, getPage, hasVertexError, isQueuedJob, MaxAttempts, partition, PollIntervalMs, tryStream, } from '../index';
|
|
13
14
|
import { arrayChunked, delay, isApiError, toAccept } from '../utils';
|
|
@@ -113,45 +114,93 @@ export function createSceneItems({ client, createSceneItemReqs, failFast, onProg
|
|
|
113
114
|
});
|
|
114
115
|
}
|
|
115
116
|
/**
|
|
116
|
-
* Create a scene with scene items.
|
|
117
|
+
* Create a scene with scene items using experimental strategy.
|
|
117
118
|
*/
|
|
118
119
|
export function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, createSceneReq, failFast = false, onMsg = console.log, onProgress, parallelism, polling = { intervalMs: PollIntervalMs, maxAttempts: MaxAttempts }, returnQueued = false, verbose, }) {
|
|
119
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const startTime = hrtime.bigint();
|
|
122
|
+
if (verbose)
|
|
123
|
+
onMsg(`Creating scene...`);
|
|
120
124
|
const scene = (yield client.scenes.createScene({ createSceneRequest: createSceneReq() })).data;
|
|
121
125
|
const sceneId = scene.data.id;
|
|
122
|
-
const createRes = yield createSceneItemsEXPERIMENTAL({
|
|
123
|
-
client,
|
|
124
|
-
createSceneItemReqs,
|
|
125
|
-
failFast,
|
|
126
|
-
onProgress,
|
|
127
|
-
parallelism,
|
|
128
|
-
sceneId,
|
|
129
|
-
});
|
|
130
|
-
const { a: queuedOps, b: errors } = partition(createRes.queuedBatchOps, (i) => isQueuedJob(i.res));
|
|
131
|
-
const queued = returnQueued ? createRes.queuedBatchOps : [];
|
|
132
|
-
// Nothing succeeded, return early as something is likely wrong
|
|
133
|
-
if (queuedOps.length === 0 || errors.length === createRes.chunks) {
|
|
134
|
-
return { errors, queued, scene, sceneItemErrors: [] };
|
|
135
|
-
}
|
|
136
126
|
if (verbose)
|
|
137
|
-
onMsg(`
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
127
|
+
onMsg(`Creating scene items...`);
|
|
128
|
+
let itemCount = 0;
|
|
129
|
+
let batchQueuedOps = [];
|
|
130
|
+
let batchErrors = [];
|
|
131
|
+
let sceneItemErrors = [];
|
|
132
|
+
for (let depth = 0; depth < createSceneItemReqs.length; depth++) {
|
|
133
|
+
const createItemReqs = createSceneItemReqs[depth];
|
|
134
|
+
itemCount += createItemReqs.length;
|
|
135
|
+
if (verbose)
|
|
136
|
+
onMsg(`Creating ${createItemReqs.length} scene items at depth ${depth}...`);
|
|
137
|
+
// Await is used intentionally to defer loop iteration
|
|
138
|
+
// until all scene items have been created at each depth.
|
|
139
|
+
// eslint-disable-next-line no-await-in-loop
|
|
140
|
+
const createRes = yield createSceneItemsEXPERIMENTAL({
|
|
141
|
+
client,
|
|
142
|
+
createSceneItemReqs: createItemReqs,
|
|
143
|
+
failFast,
|
|
144
|
+
onProgress,
|
|
145
|
+
parallelism,
|
|
146
|
+
sceneId,
|
|
152
147
|
});
|
|
148
|
+
const { a: queuedOps, b: errors } = partition(createRes.queuedBatchOps, (i) => isQueuedJob(i.res));
|
|
149
|
+
batchQueuedOps = batchQueuedOps.concat(queuedOps);
|
|
150
|
+
if (errors.length) {
|
|
151
|
+
batchErrors = batchErrors.concat(errors);
|
|
152
|
+
if (verbose)
|
|
153
|
+
onMsg(`WARNING: ${errors.length} scene item batch errors at depth ${depth}.`);
|
|
154
|
+
}
|
|
155
|
+
// Nothing succeeded, return early as something is likely wrong
|
|
156
|
+
if (queuedOps.length === 0 || errors.length === createRes.chunks) {
|
|
157
|
+
return {
|
|
158
|
+
errors,
|
|
159
|
+
queued: returnQueued ? createRes.queuedBatchOps : [],
|
|
160
|
+
scene,
|
|
161
|
+
sceneItemErrors: [],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
const limit = pLimit(Math.min(parallelism, 20));
|
|
165
|
+
function poll({ ops, res, }) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const r = yield pollQueuedJob({
|
|
168
|
+
id: res.data.id,
|
|
169
|
+
getQueuedJob: (id, cancelToken) => client.batches.getQueuedBatch({ id }, { cancelToken }),
|
|
170
|
+
allow404: true,
|
|
171
|
+
limit,
|
|
172
|
+
polling,
|
|
173
|
+
});
|
|
174
|
+
if (isPollError(r.res)) {
|
|
175
|
+
failFast ? throwOnError(r) : errors.push({ ops, res: r.res });
|
|
176
|
+
}
|
|
177
|
+
return r;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// eslint-disable-next-line no-await-in-loop
|
|
181
|
+
const batchRes = yield Promise.all(queuedOps.map((is) => limit(poll, is)));
|
|
182
|
+
const batchItemErrors = batchRes
|
|
183
|
+
.flatMap((b, i) => isBatch(b.res)
|
|
184
|
+
? b.res['vertexvis/batch:results'].map((r, j) => isApiError(r)
|
|
185
|
+
? { req: queuedOps[i].ops[j].data, res: r }
|
|
186
|
+
: undefined)
|
|
187
|
+
: [])
|
|
188
|
+
.filter(defined);
|
|
189
|
+
if (batchItemErrors.length) {
|
|
190
|
+
sceneItemErrors = sceneItemErrors.concat(batchItemErrors);
|
|
191
|
+
if (verbose)
|
|
192
|
+
onMsg(`WARNING: ${batchItemErrors.length} scene item creation errors at depth ${depth}.`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (verbose) {
|
|
196
|
+
onMsg(`Scene item creation complete for ${itemCount} scene items with max depth of ${createSceneItemReqs.length - 1}.`);
|
|
197
|
+
if (batchErrors.length) {
|
|
198
|
+
onMsg(` Batch errors: ${batchErrors.length}`);
|
|
199
|
+
}
|
|
200
|
+
if (sceneItemErrors.length) {
|
|
201
|
+
onMsg(` Scene item errors: ${sceneItemErrors.length}`);
|
|
202
|
+
}
|
|
153
203
|
}
|
|
154
|
-
const batchRes = yield Promise.all(queuedOps.map((is) => limit(poll, is)));
|
|
155
204
|
if (verbose)
|
|
156
205
|
onMsg(`Committing scene and polling until ready...`);
|
|
157
206
|
yield updateScene({
|
|
@@ -161,35 +210,40 @@ export function createSceneAndSceneItemsEXPERIMENTAL({ client, createSceneItemRe
|
|
|
161
210
|
});
|
|
162
211
|
yield pollSceneReady({ client, id: sceneId, onMsg, polling, verbose });
|
|
163
212
|
if (verbose)
|
|
164
|
-
onMsg(`Fitting scene's camera to scene
|
|
213
|
+
onMsg(`Fitting scene's camera to scene items...`);
|
|
214
|
+
const sceneResult = (yield updateScene({
|
|
215
|
+
attributes: {
|
|
216
|
+
camera: { type: CameraFitTypeEnum.FitVisibleSceneItems },
|
|
217
|
+
},
|
|
218
|
+
client,
|
|
219
|
+
sceneId,
|
|
220
|
+
})).scene;
|
|
221
|
+
if (verbose) {
|
|
222
|
+
const formatTime = (seconds) => {
|
|
223
|
+
const h = Math.floor(seconds / 3600);
|
|
224
|
+
const m = Math.floor((seconds % 3600) / 60);
|
|
225
|
+
const s = Math.round(seconds % 60);
|
|
226
|
+
return [h, m > 9 ? m : h ? '0' + m : m || '0', s > 9 ? s : '0' + s]
|
|
227
|
+
.filter(Boolean)
|
|
228
|
+
.join(':');
|
|
229
|
+
};
|
|
230
|
+
onMsg(`Scene creation completed in ${formatTime(Number(hrtime.bigint() - startTime) / 1000000000)}.`);
|
|
231
|
+
}
|
|
165
232
|
return {
|
|
166
|
-
errors,
|
|
167
|
-
queued,
|
|
168
|
-
scene:
|
|
169
|
-
|
|
170
|
-
camera: { type: CameraFitTypeEnum.FitVisibleSceneItems },
|
|
171
|
-
},
|
|
172
|
-
client,
|
|
173
|
-
sceneId,
|
|
174
|
-
})).scene,
|
|
175
|
-
sceneItemErrors: batchRes
|
|
176
|
-
.flatMap((b, i) => isBatch(b.res)
|
|
177
|
-
? b.res['vertexvis/batch:results'].map((r, j) => isApiError(r)
|
|
178
|
-
? { req: queuedOps[i].ops[j].data, res: r }
|
|
179
|
-
: undefined)
|
|
180
|
-
: [])
|
|
181
|
-
.filter(defined),
|
|
233
|
+
errors: batchErrors,
|
|
234
|
+
queued: batchQueuedOps,
|
|
235
|
+
scene: sceneResult,
|
|
236
|
+
sceneItemErrors,
|
|
182
237
|
};
|
|
183
238
|
});
|
|
184
239
|
}
|
|
185
240
|
/**
|
|
186
241
|
* Create scene items within a scene.
|
|
187
242
|
*/
|
|
188
|
-
export function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast,
|
|
243
|
+
export function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, failFast, parallelism, sceneId, }) {
|
|
189
244
|
return __awaiter(this, void 0, void 0, function* () {
|
|
190
245
|
const limit = pLimit(parallelism);
|
|
191
246
|
const batchSize = 500;
|
|
192
|
-
let complete = 0;
|
|
193
247
|
const opChunks = arrayChunked(createSceneItemReqs.map((req) => ({
|
|
194
248
|
data: req.data,
|
|
195
249
|
op: BatchOperationOpEnum.Add,
|
|
@@ -213,10 +267,6 @@ export function createSceneItemsEXPERIMENTAL({ client, createSceneItemReqs, fail
|
|
|
213
267
|
else
|
|
214
268
|
throw error;
|
|
215
269
|
}
|
|
216
|
-
if (onProgress != null) {
|
|
217
|
-
complete += opChunk.length;
|
|
218
|
-
onProgress(complete, createSceneItemReqs.length);
|
|
219
|
-
}
|
|
220
270
|
return { ops, res };
|
|
221
271
|
}), opChunk)));
|
|
222
272
|
return { chunks: opChunks.length, queuedBatchOps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.20.
|
|
1
|
+
export declare const version = "0.20.4";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.20.
|
|
1
|
+
export const version = '0.20.4';
|
package/package.json
CHANGED