@twinfinity/twin 5.0.3-ci.27942
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.d.ts +25 -0
- package/dist/BuildInfo.d.ts.map +1 -0
- package/dist/BuildInfo.js +15 -0
- package/dist/BuildInfo.js.map +1 -0
- package/dist/TwinClient.d.ts +156 -0
- package/dist/TwinClient.d.ts.map +1 -0
- package/dist/TwinClient.js +682 -0
- package/dist/TwinClient.js.map +1 -0
- package/dist/errors.d.ts +51 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +79 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/Twin.d.ts +7 -0
- package/dist/types/Twin.d.ts.map +1 -0
- package/dist/types/Twin.js +6 -0
- package/dist/types/Twin.js.map +1 -0
- package/dist/types/TwinGeometryInfo.d.ts +7 -0
- package/dist/types/TwinGeometryInfo.d.ts.map +1 -0
- package/dist/types/TwinGeometryInfo.js +2 -0
- package/dist/types/TwinGeometryInfo.js.map +1 -0
- package/dist/types/asset-api.d.ts +57 -0
- package/dist/types/asset-api.d.ts.map +1 -0
- package/dist/types/asset-api.js +2 -0
- package/dist/types/asset-api.js.map +1 -0
- package/dist/types/asset-batch-api.d.ts +71 -0
- package/dist/types/asset-batch-api.d.ts.map +1 -0
- package/dist/types/asset-batch-api.js +2 -0
- package/dist/types/asset-batch-api.js.map +1 -0
- package/dist/types/common.d.ts +10 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/generated.d.ts +388 -0
- package/dist/types/generated.d.ts.map +1 -0
- package/dist/types/generated.js +2 -0
- package/dist/types/generated.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/twin-api.d.ts +88 -0
- package/dist/types/twin-api.d.ts.map +1 -0
- package/dist/types/twin-api.js +2 -0
- package/dist/types/twin-api.js.map +1 -0
- package/dist/types/twin-file-api.d.ts +61 -0
- package/dist/types/twin-file-api.d.ts.map +1 -0
- package/dist/types/twin-file-api.js +2 -0
- package/dist/types/twin-file-api.js.map +1 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +22 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/AssetBatchError.html +3 -0
- package/docs/classes/AssetConflictError.html +3 -0
- package/docs/classes/AssetNotFoundError.html +2 -0
- package/docs/classes/AssetValidationError.html +2 -0
- package/docs/classes/ProcessorNotFoundError.html +2 -0
- package/docs/classes/TwinClient.html +59 -0
- package/docs/classes/TwinConflictError.html +3 -0
- package/docs/classes/TwinFileConflictError.html +3 -0
- package/docs/classes/TwinFileNotFoundError.html +2 -0
- package/docs/classes/TwinFileValidationError.html +3 -0
- package/docs/classes/TwinNotFoundError.html +2 -0
- package/docs/classes/TwinValidationError.html +3 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +1 -0
- package/docs/interfaces/AssetBatchDeleteOperation.html +4 -0
- package/docs/interfaces/AssetBatchGetRequest.html +2 -0
- package/docs/interfaces/AssetBatchGetResponse.html +3 -0
- package/docs/interfaces/AssetBatchRequest.html +2 -0
- package/docs/interfaces/AssetBatchResponse.html +3 -0
- package/docs/interfaces/AssetBatchRestoreOperation.html +4 -0
- package/docs/interfaces/AssetBatchUpsertItem.html +10 -0
- package/docs/interfaces/AssetBatchUpsertOperation.html +4 -0
- package/docs/interfaces/AssetGet.html +16 -0
- package/docs/interfaces/AssetListItem.html +11 -0
- package/docs/interfaces/AssetPosition.html +4 -0
- package/docs/interfaces/AssetPost.html +10 -0
- package/docs/interfaces/AssetPut.html +10 -0
- package/docs/interfaces/BatchItemError.html +4 -0
- package/docs/interfaces/BatchItemResult.html +6 -0
- package/docs/interfaces/BatchSummary.html +4 -0
- package/docs/interfaces/Diagnostics.html +4 -0
- package/docs/interfaces/DiagnosticsSummary.html +4 -0
- package/docs/interfaces/ElementQuantities.html +3 -0
- package/docs/interfaces/EntityCollection.html +10 -0
- package/docs/interfaces/Facility.html +15 -0
- package/docs/interfaces/FacilityPart.html +14 -0
- package/docs/interfaces/FilePatch.html +7 -0
- package/docs/interfaces/FilePatchSet.html +5 -0
- package/docs/interfaces/GenericDiagnosticEntry.html +4 -0
- package/docs/interfaces/ITwinClient.html +34 -0
- package/docs/interfaces/IfcDiagnosticEntry.html +5 -0
- package/docs/interfaces/IfcDiagnosticNode.html +6 -0
- package/docs/interfaces/IfcDiagnosticNodeData.html +6 -0
- package/docs/interfaces/ListTwinItem.html +14 -0
- package/docs/interfaces/Location.html +10 -0
- package/docs/interfaces/PaginatedResponse.html +3 -0
- package/docs/interfaces/Pagination.html +4 -0
- package/docs/interfaces/Property.html +4 -0
- package/docs/interfaces/PropertySet.html +6 -0
- package/docs/interfaces/SimpleQuantity.html +6 -0
- package/docs/interfaces/SinglePropertyValue.html +5 -0
- package/docs/interfaces/Site.html +18 -0
- package/docs/interfaces/Space.html +11 -0
- package/docs/interfaces/TwinComputedPropertySetsResponse.html +4 -0
- package/docs/interfaces/TwinContentResponse.html +6 -0
- package/docs/interfaces/TwinDelete.html +2 -0
- package/docs/interfaces/TwinDiagnosticEntry.html +5 -0
- package/docs/interfaces/TwinDiagnosticNode.html +4 -0
- package/docs/interfaces/TwinDiagnosticNodeData.html +9 -0
- package/docs/interfaces/TwinDiagnosticsResponse.html +5 -0
- package/docs/interfaces/TwinErrorBody.html +4 -0
- package/docs/interfaces/TwinFileDelete.html +2 -0
- package/docs/interfaces/TwinFileGet.html +15 -0
- package/docs/interfaces/TwinFileListOptions.html +6 -0
- package/docs/interfaces/TwinFilePut.html +8 -0
- package/docs/interfaces/TwinFileReference.html +4 -0
- package/docs/interfaces/TwinFileRestore.html +2 -0
- package/docs/interfaces/TwinFileSource.html +4 -0
- package/docs/interfaces/TwinFileTransform.html +11 -0
- package/docs/interfaces/TwinFileVersionListOptions.html +4 -0
- package/docs/interfaces/TwinGet.html +30 -0
- package/docs/interfaces/TwinProcessorEvent.html +7 -0
- package/docs/interfaces/TwinProcessorResponse.html +5 -0
- package/docs/interfaces/TwinPut.html +23 -0
- package/docs/interfaces/TwinSpecification.html +20 -0
- package/docs/interfaces/TwinVersionContentResponse.html +7 -0
- package/docs/types/AssetBatchGetStatus.html +1 -0
- package/docs/types/AssetBatchOperation.html +1 -0
- package/docs/types/AssetBatchOperationStatus.html +1 -0
- package/docs/types/DiagnosticCategory.html +2 -0
- package/docs/types/DiagnosticLevel.html +2 -0
- package/docs/types/EpsgType.html +1 -0
- package/docs/types/FacilityClass.html +3 -0
- package/docs/types/FacilityPartClass.html +3 -0
- package/docs/types/IfcDiagnosticCode.html +1 -0
- package/docs/types/Op.html +2 -0
- package/docs/types/SinglePropertyValueType.html +3 -0
- package/docs/types/SingleQuantityValueType.html +3 -0
- package/docs/types/SiteType.html +3 -0
- package/docs/types/SpaceType.html +2 -0
- package/docs/types/TwinDiagnosticCode.html +1 -0
- package/package.json +56 -0
- package/src/BuildInfo.ts +41 -0
- package/src/TwinClient.ts +1274 -0
- package/src/errors.ts +107 -0
- package/src/index.ts +3 -0
- package/src/tsconfig.json +13 -0
- package/src/types/Twin.ts +7 -0
- package/src/types/TwinGeometryInfo.ts +7 -0
- package/src/types/asset-api.ts +60 -0
- package/src/types/asset-batch-api.ts +88 -0
- package/src/types/common.ts +10 -0
- package/src/types/generated.ts +574 -0
- package/src/types/index.ts +6 -0
- package/src/types/twin-api.ts +99 -0
- package/src/types/twin-file-api.ts +67 -0
package/src/errors.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { TwinGet, AssetGet, TwinFileGet, AssetBatchResponse } from './types';
|
|
2
|
+
|
|
3
|
+
export interface TwinErrorBody {
|
|
4
|
+
detail: string;
|
|
5
|
+
cause: string;
|
|
6
|
+
item?: {
|
|
7
|
+
kind: string;
|
|
8
|
+
id: string;
|
|
9
|
+
version?: number;
|
|
10
|
+
field?: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class TwinValidationError extends Error {
|
|
15
|
+
public readonly errorBody?: TwinErrorBody;
|
|
16
|
+
|
|
17
|
+
constructor(message: string, errorBody?: TwinErrorBody) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = 'TwinValidationError';
|
|
20
|
+
this.errorBody = errorBody;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class TwinConflictError extends Error {
|
|
25
|
+
public readonly currentTwin: TwinGet;
|
|
26
|
+
|
|
27
|
+
constructor(message: string, currentTwin: TwinGet) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = 'TwinConflictError';
|
|
30
|
+
this.currentTwin = currentTwin;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export class TwinNotFoundError extends Error {
|
|
35
|
+
constructor(message: string) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.name = 'TwinNotFoundError';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class ProcessorNotFoundError extends Error {
|
|
42
|
+
constructor(message: string) {
|
|
43
|
+
super(message);
|
|
44
|
+
this.name = 'ProcessorNotFoundError';
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export class AssetValidationError extends Error {
|
|
49
|
+
constructor(message: string) {
|
|
50
|
+
super(message);
|
|
51
|
+
this.name = 'AssetValidationError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class AssetConflictError extends Error {
|
|
56
|
+
public readonly currentAsset: AssetGet;
|
|
57
|
+
|
|
58
|
+
constructor(message: string, currentAsset: AssetGet) {
|
|
59
|
+
super(message);
|
|
60
|
+
this.name = 'AssetConflictError';
|
|
61
|
+
this.currentAsset = currentAsset;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class AssetNotFoundError extends Error {
|
|
66
|
+
constructor(message: string) {
|
|
67
|
+
super(message);
|
|
68
|
+
this.name = 'AssetNotFoundError';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export class AssetBatchError extends Error {
|
|
73
|
+
public readonly response: AssetBatchResponse;
|
|
74
|
+
|
|
75
|
+
constructor(message: string, response: AssetBatchResponse) {
|
|
76
|
+
super(message);
|
|
77
|
+
this.name = 'AssetBatchError';
|
|
78
|
+
this.response = response;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export class TwinFileValidationError extends Error {
|
|
83
|
+
public readonly errorBody?: TwinErrorBody;
|
|
84
|
+
|
|
85
|
+
constructor(message: string, errorBody?: TwinErrorBody) {
|
|
86
|
+
super(message);
|
|
87
|
+
this.name = 'TwinFileValidationError';
|
|
88
|
+
this.errorBody = errorBody;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export class TwinFileConflictError extends Error {
|
|
93
|
+
public readonly currentTwinFile: TwinFileGet;
|
|
94
|
+
|
|
95
|
+
constructor(message: string, currentTwinFile: TwinFileGet) {
|
|
96
|
+
super(message);
|
|
97
|
+
this.name = 'TwinFileConflictError';
|
|
98
|
+
this.currentTwinFile = currentTwinFile;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export class TwinFileNotFoundError extends Error {
|
|
103
|
+
constructor(message: string) {
|
|
104
|
+
super(message);
|
|
105
|
+
this.name = 'TwinFileNotFoundError';
|
|
106
|
+
}
|
|
107
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.common.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"experimentalDecorators": true,
|
|
5
|
+
"noEmit": false,
|
|
6
|
+
"outDir": "../dist"
|
|
7
|
+
},
|
|
8
|
+
"include": ["**/*.ts"],
|
|
9
|
+
"references": [
|
|
10
|
+
{ "path": "../../twinfinity-authentication/src" },
|
|
11
|
+
{ "path": "../../twinfinity-t8-client-model/src" }
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export interface AssetListItem {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
category?: string;
|
|
5
|
+
type?: string;
|
|
6
|
+
twinReference?: string;
|
|
7
|
+
parentIfcGid?: string;
|
|
8
|
+
ifcGid?: string;
|
|
9
|
+
etag: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
isDeleted?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface AssetPosition {
|
|
15
|
+
x?: number;
|
|
16
|
+
y?: number;
|
|
17
|
+
z?: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface AssetGet {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
category?: string;
|
|
24
|
+
type?: string;
|
|
25
|
+
ifcGid?: string;
|
|
26
|
+
twinReference?: string;
|
|
27
|
+
position?: AssetPosition;
|
|
28
|
+
parentIfcGid?: string;
|
|
29
|
+
metadata?: Record<string, unknown>;
|
|
30
|
+
etag: string;
|
|
31
|
+
createdUtc: string;
|
|
32
|
+
createdBy: string;
|
|
33
|
+
modifiedUtc: string;
|
|
34
|
+
modifiedBy: string;
|
|
35
|
+
isDeleted?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AssetPost {
|
|
39
|
+
id?: string;
|
|
40
|
+
name: string;
|
|
41
|
+
category?: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
ifcGid?: string;
|
|
44
|
+
position?: AssetPosition;
|
|
45
|
+
parentIfcGid?: string;
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
twinReference?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface AssetPut {
|
|
51
|
+
etag: string;
|
|
52
|
+
name: string;
|
|
53
|
+
category?: string;
|
|
54
|
+
type?: string;
|
|
55
|
+
ifcGid?: string;
|
|
56
|
+
position?: AssetPosition;
|
|
57
|
+
parentIfcGid?: string;
|
|
58
|
+
metadata?: Record<string, unknown>;
|
|
59
|
+
twinReference?: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { AssetGet, AssetPosition } from './asset-api';
|
|
2
|
+
|
|
3
|
+
export type AssetBatchOperation = AssetBatchUpsertOperation | AssetBatchDeleteOperation | AssetBatchRestoreOperation;
|
|
4
|
+
|
|
5
|
+
export interface AssetBatchUpsertOperation {
|
|
6
|
+
operation: 'upsert';
|
|
7
|
+
id: string;
|
|
8
|
+
item: AssetBatchUpsertItem;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface AssetBatchDeleteOperation {
|
|
12
|
+
operation: 'delete';
|
|
13
|
+
id: string;
|
|
14
|
+
item: { etag: string };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface AssetBatchRestoreOperation {
|
|
18
|
+
operation: 'restore';
|
|
19
|
+
id: string;
|
|
20
|
+
item: { etag: string };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface AssetBatchUpsertItem {
|
|
24
|
+
etag?: string | null;
|
|
25
|
+
name: string;
|
|
26
|
+
category?: string;
|
|
27
|
+
type?: string;
|
|
28
|
+
ifcGid?: string;
|
|
29
|
+
position?: AssetPosition;
|
|
30
|
+
parentIfcGid?: string;
|
|
31
|
+
metadata?: Record<string, unknown>;
|
|
32
|
+
twinReference?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface AssetBatchRequest {
|
|
36
|
+
operations: AssetBatchOperation[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface AssetBatchGetRequest {
|
|
40
|
+
ids: string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type AssetBatchOperationStatus =
|
|
44
|
+
| 'upserted'
|
|
45
|
+
| 'deleted'
|
|
46
|
+
| 'restored'
|
|
47
|
+
| 'reverted'
|
|
48
|
+
| 'conflicted'
|
|
49
|
+
| 'notFound'
|
|
50
|
+
| 'forbidden'
|
|
51
|
+
| 'badRequest';
|
|
52
|
+
|
|
53
|
+
export type AssetBatchGetStatus = 'found' | 'notFound';
|
|
54
|
+
|
|
55
|
+
export interface BatchSummary {
|
|
56
|
+
total: number;
|
|
57
|
+
succeeded: number;
|
|
58
|
+
failed: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface BatchItemError {
|
|
62
|
+
detail: string;
|
|
63
|
+
cause: string;
|
|
64
|
+
referencedItem?: {
|
|
65
|
+
kind: string;
|
|
66
|
+
id?: string;
|
|
67
|
+
field?: string;
|
|
68
|
+
version?: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface BatchItemResult<TStatus extends string> {
|
|
73
|
+
index: number;
|
|
74
|
+
status: TStatus;
|
|
75
|
+
statusCode?: number;
|
|
76
|
+
item?: AssetGet;
|
|
77
|
+
error?: BatchItemError;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface AssetBatchResponse {
|
|
81
|
+
summary?: BatchSummary;
|
|
82
|
+
results: BatchItemResult<AssetBatchOperationStatus>[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface AssetBatchGetResponse {
|
|
86
|
+
summary: BatchSummary;
|
|
87
|
+
results: BatchItemResult<AssetBatchGetStatus>[];
|
|
88
|
+
}
|