@twinfinity/twin 6.0.1 → 6.0.2
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/BuildInfo.js +3 -3
- package/dist/TwinClient.d.ts +227 -0
- package/dist/TwinClient.d.ts.map +1 -1
- package/dist/TwinClient.js +474 -28
- package/dist/TwinClient.js.map +1 -1
- package/dist/errors.d.ts +122 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +156 -0
- package/dist/errors.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/asset-attachment-api.d.ts +51 -0
- package/dist/types/asset-attachment-api.d.ts.map +1 -0
- package/dist/types/asset-attachment-api.js +8 -0
- package/dist/types/asset-attachment-api.js.map +1 -0
- package/dist/types/asset-types-api.d.ts +76 -0
- package/dist/types/asset-types-api.d.ts.map +1 -0
- package/dist/types/asset-types-api.js +5 -0
- package/dist/types/asset-types-api.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/twin-permissions-api.d.ts +20 -0
- package/dist/types/twin-permissions-api.d.ts.map +1 -0
- package/dist/types/twin-permissions-api.js +2 -0
- package/dist/types/twin-permissions-api.js.map +1 -0
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/AssetAttachmentConflictError.html +3 -0
- package/docs/classes/AssetAttachmentNotFoundError.html +2 -0
- package/docs/classes/AssetBatchError.html +1 -1
- package/docs/classes/AssetCatalogTooLargeError.html +16 -0
- package/docs/classes/AssetCategoryConflictError.html +3 -0
- package/docs/classes/AssetCategoryForbiddenError.html +2 -0
- package/docs/classes/AssetCategoryNotFoundError.html +2 -0
- package/docs/classes/AssetCategoryValidationError.html +3 -0
- package/docs/classes/AssetConflictError.html +1 -1
- package/docs/classes/AssetForbiddenError.html +1 -1
- package/docs/classes/AssetNotFoundError.html +1 -1
- package/docs/classes/AssetTypeConflictError.html +3 -0
- package/docs/classes/AssetTypeForbiddenError.html +2 -0
- package/docs/classes/AssetTypeNotFoundError.html +2 -0
- package/docs/classes/AssetTypeValidationError.html +3 -0
- package/docs/classes/AssetValidationError.html +1 -1
- package/docs/classes/ProcessorNotFoundError.html +1 -1
- package/docs/classes/TwinClient.html +154 -48
- package/docs/classes/TwinConflictError.html +1 -1
- package/docs/classes/TwinFileConflictError.html +1 -1
- package/docs/classes/TwinFileNotFoundError.html +1 -1
- package/docs/classes/TwinFileValidationError.html +1 -1
- package/docs/classes/TwinNotFoundError.html +1 -1
- package/docs/classes/TwinUnauthenticatedError.html +6 -0
- package/docs/classes/TwinValidationError.html +1 -1
- package/docs/functions/isAssetCatalogTooLargeErrorBody.html +6 -0
- package/docs/functions/readErrorBody.html +10 -0
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/ApiCreateUploadSessionResponse.html +7 -0
- package/docs/interfaces/AssetAttachmentPut.html +6 -0
- package/docs/interfaces/AssetCatalogCategory.html +7 -0
- package/docs/interfaces/AssetCatalogResponse.html +6 -0
- package/docs/interfaces/AssetCatalogTooLargeErrorBody.html +15 -0
- package/docs/interfaces/AssetCategoryDelete.html +2 -0
- package/docs/interfaces/AssetCategoryGet.html +14 -0
- package/docs/interfaces/AssetCategoryPut.html +7 -0
- package/docs/interfaces/AssetTypeDelete.html +2 -0
- package/docs/interfaces/AssetTypeGet.html +16 -0
- package/docs/interfaces/AssetTypePut.html +9 -0
- package/docs/interfaces/AttachmentGet.html +20 -0
- package/docs/interfaces/AttachmentPost.html +4 -0
- package/docs/interfaces/ITwinClient.html +155 -49
- package/docs/interfaces/MyPermissions.html +7 -0
- package/docs/interfaces/TwinErrorBody.html +2 -2
- package/docs/interfaces/TwinSpecification.html +1 -1
- package/docs/interfaces/UploadStatusGet.html +3 -0
- package/docs/modules.html +1 -1
- package/docs/types/TwinCapability.html +6 -0
- package/docs/types/TwinErrorCause.html +8 -0
- package/docs/types/TwinErrorItemKind.html +4 -0
- package/docs/types/UploadStatus.html +1 -0
- package/package.json +3 -3
- package/src/BuildInfo.ts +41 -41
- package/src/TwinClient.ts +2334 -1496
- package/src/errors.ts +379 -117
- package/src/index.ts +3 -3
- package/src/types/Twin.ts +7 -7
- package/src/types/TwinGeometryInfo.ts +7 -7
- package/src/types/asset-api.ts +60 -60
- package/src/types/asset-attachment-api.ts +56 -0
- package/src/types/asset-batch-api.ts +88 -88
- package/src/types/asset-types-api.ts +86 -0
- package/src/types/common.ts +10 -10
- package/src/types/generated.ts +574 -574
- package/src/types/index.ts +9 -6
- package/src/types/twin-api.ts +99 -99
- package/src/types/twin-file-api.ts +67 -67
- package/src/types/twin-permissions-api.ts +20 -0
package/src/types/index.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
export * from './common';
|
|
2
|
-
export * from './twin-api';
|
|
3
|
-
export * from './asset-api';
|
|
4
|
-
export * from './asset-batch-api';
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
1
|
+
export * from './common';
|
|
2
|
+
export * from './twin-api';
|
|
3
|
+
export * from './asset-api';
|
|
4
|
+
export * from './asset-batch-api';
|
|
5
|
+
export * from './asset-types-api';
|
|
6
|
+
export * from './asset-attachment-api';
|
|
7
|
+
export * from './twin-permissions-api';
|
|
8
|
+
export * from './twin-file-api';
|
|
9
|
+
export * from './generated';
|
package/src/types/twin-api.ts
CHANGED
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
import type { PropertySet, ElementQuantities, TwinSpecification, Diagnostics } from './generated';
|
|
2
|
-
|
|
3
|
-
export interface TwinFileReference {
|
|
4
|
-
fileId: string;
|
|
5
|
-
fileVersion: number;
|
|
6
|
-
twinNodeId?: string;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface ListTwinItem {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
etag: string;
|
|
13
|
-
propertySets?: PropertySet[];
|
|
14
|
-
computedPropertySets?: PropertySet[];
|
|
15
|
-
elementQuantities?: ElementQuantities[];
|
|
16
|
-
relatedContainerIds: string[];
|
|
17
|
-
version: number;
|
|
18
|
-
isDeleted?: boolean;
|
|
19
|
-
createdBy: string;
|
|
20
|
-
createdUtc: string;
|
|
21
|
-
modifiedBy: string;
|
|
22
|
-
modifiedUtc: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface TwinGet extends TwinSpecification {
|
|
26
|
-
id: string;
|
|
27
|
-
etag: string;
|
|
28
|
-
relatedContainerIds: string[];
|
|
29
|
-
version: number;
|
|
30
|
-
isDeleted?: boolean;
|
|
31
|
-
createdBy: string;
|
|
32
|
-
createdUtc: string;
|
|
33
|
-
modifiedBy: string;
|
|
34
|
-
modifiedUtc: string;
|
|
35
|
-
fileReferences: TwinFileReference[];
|
|
36
|
-
computedPropertySets?: PropertySet[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface TwinPut extends TwinSpecification {
|
|
40
|
-
etag?: string;
|
|
41
|
-
relatedContainerIds: string[];
|
|
42
|
-
fileReferences?: TwinFileReference[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface TwinDelete {
|
|
46
|
-
etag: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface TwinVersionContentResponse {
|
|
50
|
-
twinId: string;
|
|
51
|
-
twinVersion: number;
|
|
52
|
-
status: string;
|
|
53
|
-
processors: TwinProcessorResponse[];
|
|
54
|
-
content: TwinContentResponse[];
|
|
55
|
-
computedPropertySets: TwinComputedPropertySetsResponse[];
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface TwinProcessorResponse {
|
|
59
|
-
processorId: string;
|
|
60
|
-
processorName: string;
|
|
61
|
-
processorDescription?: string;
|
|
62
|
-
status: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface TwinContentResponse {
|
|
66
|
-
id: string;
|
|
67
|
-
processorId: string;
|
|
68
|
-
format: string;
|
|
69
|
-
description?: string;
|
|
70
|
-
receivedAt: string;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface TwinComputedPropertySetsResponse {
|
|
74
|
-
processorId: string;
|
|
75
|
-
propertySets: PropertySet[];
|
|
76
|
-
receivedAt: string;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface TwinProcessorEvent {
|
|
80
|
-
id: string;
|
|
81
|
-
processorId: string;
|
|
82
|
-
eventType: string;
|
|
83
|
-
eventTimestampUtc: string;
|
|
84
|
-
details?: unknown;
|
|
85
|
-
message?: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface DiagnosticsSummary {
|
|
89
|
-
fatalCount: number;
|
|
90
|
-
errorCount: number;
|
|
91
|
-
warningCount: number;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface TwinDiagnosticsResponse {
|
|
95
|
-
twinId: string;
|
|
96
|
-
twinVersion: number;
|
|
97
|
-
summary: DiagnosticsSummary;
|
|
98
|
-
diagnostics: Diagnostics;
|
|
99
|
-
}
|
|
1
|
+
import type { PropertySet, ElementQuantities, TwinSpecification, Diagnostics } from './generated';
|
|
2
|
+
|
|
3
|
+
export interface TwinFileReference {
|
|
4
|
+
fileId: string;
|
|
5
|
+
fileVersion: number;
|
|
6
|
+
twinNodeId?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ListTwinItem {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
etag: string;
|
|
13
|
+
propertySets?: PropertySet[];
|
|
14
|
+
computedPropertySets?: PropertySet[];
|
|
15
|
+
elementQuantities?: ElementQuantities[];
|
|
16
|
+
relatedContainerIds: string[];
|
|
17
|
+
version: number;
|
|
18
|
+
isDeleted?: boolean;
|
|
19
|
+
createdBy: string;
|
|
20
|
+
createdUtc: string;
|
|
21
|
+
modifiedBy: string;
|
|
22
|
+
modifiedUtc: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface TwinGet extends TwinSpecification {
|
|
26
|
+
id: string;
|
|
27
|
+
etag: string;
|
|
28
|
+
relatedContainerIds: string[];
|
|
29
|
+
version: number;
|
|
30
|
+
isDeleted?: boolean;
|
|
31
|
+
createdBy: string;
|
|
32
|
+
createdUtc: string;
|
|
33
|
+
modifiedBy: string;
|
|
34
|
+
modifiedUtc: string;
|
|
35
|
+
fileReferences: TwinFileReference[];
|
|
36
|
+
computedPropertySets?: PropertySet[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface TwinPut extends TwinSpecification {
|
|
40
|
+
etag?: string;
|
|
41
|
+
relatedContainerIds: string[];
|
|
42
|
+
fileReferences?: TwinFileReference[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface TwinDelete {
|
|
46
|
+
etag: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface TwinVersionContentResponse {
|
|
50
|
+
twinId: string;
|
|
51
|
+
twinVersion: number;
|
|
52
|
+
status: string;
|
|
53
|
+
processors: TwinProcessorResponse[];
|
|
54
|
+
content: TwinContentResponse[];
|
|
55
|
+
computedPropertySets: TwinComputedPropertySetsResponse[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface TwinProcessorResponse {
|
|
59
|
+
processorId: string;
|
|
60
|
+
processorName: string;
|
|
61
|
+
processorDescription?: string;
|
|
62
|
+
status: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface TwinContentResponse {
|
|
66
|
+
id: string;
|
|
67
|
+
processorId: string;
|
|
68
|
+
format: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
receivedAt: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface TwinComputedPropertySetsResponse {
|
|
74
|
+
processorId: string;
|
|
75
|
+
propertySets: PropertySet[];
|
|
76
|
+
receivedAt: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface TwinProcessorEvent {
|
|
80
|
+
id: string;
|
|
81
|
+
processorId: string;
|
|
82
|
+
eventType: string;
|
|
83
|
+
eventTimestampUtc: string;
|
|
84
|
+
details?: unknown;
|
|
85
|
+
message?: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface DiagnosticsSummary {
|
|
89
|
+
fatalCount: number;
|
|
90
|
+
errorCount: number;
|
|
91
|
+
warningCount: number;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface TwinDiagnosticsResponse {
|
|
95
|
+
twinId: string;
|
|
96
|
+
twinVersion: number;
|
|
97
|
+
summary: DiagnosticsSummary;
|
|
98
|
+
diagnostics: Diagnostics;
|
|
99
|
+
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
export interface TwinFileTransform {
|
|
2
|
-
qx?: number;
|
|
3
|
-
qy?: number;
|
|
4
|
-
qz?: number;
|
|
5
|
-
qw?: number;
|
|
6
|
-
sx?: number;
|
|
7
|
-
sy?: number;
|
|
8
|
-
sz?: number;
|
|
9
|
-
x?: number;
|
|
10
|
-
y?: number;
|
|
11
|
-
z?: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface TwinFileGet {
|
|
15
|
-
id: string;
|
|
16
|
-
twinId: string;
|
|
17
|
-
version: number;
|
|
18
|
-
source: TwinFileSource;
|
|
19
|
-
name: string;
|
|
20
|
-
comment?: string;
|
|
21
|
-
quality: number;
|
|
22
|
-
etag: string;
|
|
23
|
-
isDeleted: boolean;
|
|
24
|
-
createdBy: string;
|
|
25
|
-
createdUtc: string;
|
|
26
|
-
modifiedBy: string;
|
|
27
|
-
modifiedUtc: string;
|
|
28
|
-
transform?: TwinFileTransform;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface TwinFileSource {
|
|
32
|
-
changeId: string;
|
|
33
|
-
changeVersion: number;
|
|
34
|
-
sourceType: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface TwinFilePut {
|
|
38
|
-
source: TwinFileSource;
|
|
39
|
-
name: string;
|
|
40
|
-
comment?: string;
|
|
41
|
-
quality: number | null;
|
|
42
|
-
etag?: string;
|
|
43
|
-
isDeleted?: boolean;
|
|
44
|
-
transform?: TwinFileTransform;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface TwinFileDelete {
|
|
48
|
-
etag: string;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface TwinFileRestore {
|
|
52
|
-
etag: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface TwinFileListOptions {
|
|
56
|
-
includeDeleted?: boolean;
|
|
57
|
-
checkedIn?: boolean;
|
|
58
|
-
version?: number;
|
|
59
|
-
page?: string;
|
|
60
|
-
limit?: number;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface TwinFileVersionListOptions {
|
|
64
|
-
includeDeleted?: boolean;
|
|
65
|
-
offset?: number;
|
|
66
|
-
limit?: number;
|
|
67
|
-
}
|
|
1
|
+
export interface TwinFileTransform {
|
|
2
|
+
qx?: number;
|
|
3
|
+
qy?: number;
|
|
4
|
+
qz?: number;
|
|
5
|
+
qw?: number;
|
|
6
|
+
sx?: number;
|
|
7
|
+
sy?: number;
|
|
8
|
+
sz?: number;
|
|
9
|
+
x?: number;
|
|
10
|
+
y?: number;
|
|
11
|
+
z?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TwinFileGet {
|
|
15
|
+
id: string;
|
|
16
|
+
twinId: string;
|
|
17
|
+
version: number;
|
|
18
|
+
source: TwinFileSource;
|
|
19
|
+
name: string;
|
|
20
|
+
comment?: string;
|
|
21
|
+
quality: number;
|
|
22
|
+
etag: string;
|
|
23
|
+
isDeleted: boolean;
|
|
24
|
+
createdBy: string;
|
|
25
|
+
createdUtc: string;
|
|
26
|
+
modifiedBy: string;
|
|
27
|
+
modifiedUtc: string;
|
|
28
|
+
transform?: TwinFileTransform;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface TwinFileSource {
|
|
32
|
+
changeId: string;
|
|
33
|
+
changeVersion: number;
|
|
34
|
+
sourceType: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TwinFilePut {
|
|
38
|
+
source: TwinFileSource;
|
|
39
|
+
name: string;
|
|
40
|
+
comment?: string;
|
|
41
|
+
quality: number | null;
|
|
42
|
+
etag?: string;
|
|
43
|
+
isDeleted?: boolean;
|
|
44
|
+
transform?: TwinFileTransform;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface TwinFileDelete {
|
|
48
|
+
etag: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TwinFileRestore {
|
|
52
|
+
etag: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface TwinFileListOptions {
|
|
56
|
+
includeDeleted?: boolean;
|
|
57
|
+
checkedIn?: boolean;
|
|
58
|
+
version?: number;
|
|
59
|
+
page?: string;
|
|
60
|
+
limit?: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface TwinFileVersionListOptions {
|
|
64
|
+
includeDeleted?: boolean;
|
|
65
|
+
offset?: number;
|
|
66
|
+
limit?: number;
|
|
67
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named, customer-scoped capability the caller can exercise against the
|
|
3
|
+
* Twin service. Returned by `GET /twins/permissions/me`. Forward-compatible:
|
|
4
|
+
* unknown strings should be treated as "not granted" and ignored, so adding
|
|
5
|
+
* a new capability on the backend is a non-breaking change for clients
|
|
6
|
+
* compiled against older types.
|
|
7
|
+
*/
|
|
8
|
+
export type TwinCapability = 'ViewAssetTypes' | 'EditAssetTypes';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Response body for `GET /twins/permissions/me`. The `permissions` array
|
|
12
|
+
* lists only capabilities the caller actually holds; absence means "not
|
|
13
|
+
* granted." Use `permissions.includes('EditAssetTypes')` etc. for gating.
|
|
14
|
+
*
|
|
15
|
+
* Wrapped under a key (rather than a bare array) so future fields — an
|
|
16
|
+
* etag, an identity echo, expiry — can be added without a shape break.
|
|
17
|
+
*/
|
|
18
|
+
export interface MyPermissions {
|
|
19
|
+
permissions: TwinCapability[];
|
|
20
|
+
}
|