@twinfinity/twin 6.0.1 → 6.0.2-ci.29168

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.
Files changed (84) hide show
  1. package/dist/BuildInfo.js +3 -3
  2. package/dist/TwinClient.d.ts +159 -0
  3. package/dist/TwinClient.d.ts.map +1 -1
  4. package/dist/TwinClient.js +323 -28
  5. package/dist/TwinClient.js.map +1 -1
  6. package/dist/errors.d.ts +114 -3
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +142 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/tsconfig.tsbuildinfo +1 -1
  11. package/dist/types/asset-types-api.d.ts +76 -0
  12. package/dist/types/asset-types-api.d.ts.map +1 -0
  13. package/dist/types/asset-types-api.js +5 -0
  14. package/dist/types/asset-types-api.js.map +1 -0
  15. package/dist/types/index.d.ts +2 -0
  16. package/dist/types/index.d.ts.map +1 -1
  17. package/dist/types/index.js +2 -0
  18. package/dist/types/index.js.map +1 -1
  19. package/dist/types/twin-permissions-api.d.ts +20 -0
  20. package/dist/types/twin-permissions-api.d.ts.map +1 -0
  21. package/dist/types/twin-permissions-api.js +2 -0
  22. package/dist/types/twin-permissions-api.js.map +1 -0
  23. package/docs/assets/hierarchy.js +1 -1
  24. package/docs/assets/navigation.js +1 -1
  25. package/docs/assets/search.js +1 -1
  26. package/docs/classes/AssetBatchError.html +1 -1
  27. package/docs/classes/AssetCatalogTooLargeError.html +16 -0
  28. package/docs/classes/AssetCategoryConflictError.html +3 -0
  29. package/docs/classes/AssetCategoryForbiddenError.html +2 -0
  30. package/docs/classes/AssetCategoryNotFoundError.html +2 -0
  31. package/docs/classes/AssetCategoryValidationError.html +3 -0
  32. package/docs/classes/AssetConflictError.html +1 -1
  33. package/docs/classes/AssetForbiddenError.html +1 -1
  34. package/docs/classes/AssetNotFoundError.html +1 -1
  35. package/docs/classes/AssetTypeConflictError.html +3 -0
  36. package/docs/classes/AssetTypeForbiddenError.html +2 -0
  37. package/docs/classes/AssetTypeNotFoundError.html +2 -0
  38. package/docs/classes/AssetTypeValidationError.html +3 -0
  39. package/docs/classes/AssetValidationError.html +1 -1
  40. package/docs/classes/ProcessorNotFoundError.html +1 -1
  41. package/docs/classes/TwinClient.html +114 -41
  42. package/docs/classes/TwinConflictError.html +1 -1
  43. package/docs/classes/TwinFileConflictError.html +1 -1
  44. package/docs/classes/TwinFileNotFoundError.html +1 -1
  45. package/docs/classes/TwinFileValidationError.html +1 -1
  46. package/docs/classes/TwinNotFoundError.html +1 -1
  47. package/docs/classes/TwinUnauthenticatedError.html +6 -0
  48. package/docs/classes/TwinValidationError.html +1 -1
  49. package/docs/functions/isAssetCatalogTooLargeErrorBody.html +6 -0
  50. package/docs/functions/readErrorBody.html +10 -0
  51. package/docs/hierarchy.html +1 -1
  52. package/docs/interfaces/AssetCatalogCategory.html +7 -0
  53. package/docs/interfaces/AssetCatalogResponse.html +6 -0
  54. package/docs/interfaces/AssetCatalogTooLargeErrorBody.html +15 -0
  55. package/docs/interfaces/AssetCategoryDelete.html +2 -0
  56. package/docs/interfaces/AssetCategoryGet.html +14 -0
  57. package/docs/interfaces/AssetCategoryPut.html +7 -0
  58. package/docs/interfaces/AssetTypeDelete.html +2 -0
  59. package/docs/interfaces/AssetTypeGet.html +16 -0
  60. package/docs/interfaces/AssetTypePut.html +9 -0
  61. package/docs/interfaces/ITwinClient.html +115 -42
  62. package/docs/interfaces/MyPermissions.html +7 -0
  63. package/docs/interfaces/TwinErrorBody.html +2 -2
  64. package/docs/interfaces/TwinSpecification.html +1 -1
  65. package/docs/modules.html +1 -1
  66. package/docs/types/TwinCapability.html +6 -0
  67. package/docs/types/TwinErrorCause.html +8 -0
  68. package/docs/types/TwinErrorItemKind.html +4 -0
  69. package/package.json +3 -3
  70. package/src/BuildInfo.ts +41 -41
  71. package/src/TwinClient.ts +2010 -1496
  72. package/src/errors.ts +360 -117
  73. package/src/index.ts +3 -3
  74. package/src/types/Twin.ts +7 -7
  75. package/src/types/TwinGeometryInfo.ts +7 -7
  76. package/src/types/asset-api.ts +60 -60
  77. package/src/types/asset-batch-api.ts +88 -88
  78. package/src/types/asset-types-api.ts +86 -0
  79. package/src/types/common.ts +10 -10
  80. package/src/types/generated.ts +574 -574
  81. package/src/types/index.ts +8 -6
  82. package/src/types/twin-api.ts +99 -99
  83. package/src/types/twin-file-api.ts +67 -67
  84. package/src/types/twin-permissions-api.ts +20 -0
@@ -1,88 +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
- }
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
+ }
@@ -0,0 +1,86 @@
1
+ // Wire types for asset categories and asset types (TWINS-3643).
2
+ // See backend/services/Twinfinity.Twin/Controllers/Model/AssetCategoryDtos.cs
3
+ // and AssetTypeDtos.cs.
4
+
5
+ export interface AssetCategoryGet {
6
+ id: string;
7
+ stringId: string;
8
+ /** Latest version pointer. Server-assigned, increments on every successful upsert/delete/restore. */
9
+ version: number;
10
+ title: string;
11
+ description?: string | null;
12
+ etag: string;
13
+ /** Always present — see backend AssetCategoryGet.IsDeleted JSDoc. */
14
+ isDeleted: boolean;
15
+ createdBy: string;
16
+ createdUtc: string;
17
+ modifiedBy: string;
18
+ modifiedUtc: string;
19
+ }
20
+
21
+ export interface AssetCategoryPut {
22
+ /** Empty/missing for first writes; required to match on subsequent updates. */
23
+ etag?: string | null;
24
+ /** Slug `^[A-Za-z0-9_][A-Za-z0-9_-]*$`, unique across categories. */
25
+ stringId: string;
26
+ title: string;
27
+ description?: string | null;
28
+ }
29
+
30
+ export interface AssetCategoryDelete {
31
+ etag: string;
32
+ }
33
+
34
+ export interface AssetTypeGet {
35
+ id: string;
36
+ categoryId: string;
37
+ stringId: string;
38
+ /** Latest version pointer. Server-assigned, increments on every successful upsert. */
39
+ version: number;
40
+ title: string;
41
+ description?: string | null;
42
+ metadataSchema: Record<string, unknown>;
43
+ etag: string;
44
+ /** Always present — see backend AssetTypeGet.IsDeleted JSDoc. */
45
+ isDeleted: boolean;
46
+ createdBy: string;
47
+ createdUtc: string;
48
+ modifiedBy: string;
49
+ modifiedUtc: string;
50
+ }
51
+
52
+ export interface AssetTypePut {
53
+ /** Empty/missing for first writes; required to match on subsequent updates. */
54
+ etag?: string | null;
55
+ /** Slug `^[A-Za-z0-9_][A-Za-z0-9_-]*$`, unique within the parent category. */
56
+ stringId: string;
57
+ title: string;
58
+ description?: string | null;
59
+ /** TwinfinityMetadataSchema document. Validated against the meta-schema at the API boundary. */
60
+ metadataSchema: Record<string, unknown>;
61
+ }
62
+
63
+ export interface AssetTypeDelete {
64
+ etag: string;
65
+ }
66
+
67
+ /**
68
+ * One entry in an {@link AssetCatalogResponse}: a category and its latest
69
+ * non-deleted types in title order. The wire shapes for category/type rows
70
+ * are reused from the standalone CRUD endpoints so the same components can
71
+ * render rows from either source.
72
+ */
73
+ export interface AssetCatalogCategory {
74
+ category: AssetCategoryGet;
75
+ types: AssetTypeGet[];
76
+ }
77
+
78
+ /**
79
+ * Wire shape of `GET /asset-type-catalog`: the customer's asset-type
80
+ * catalog, categories nested with their latest non-deleted types and full
81
+ * metadata schemas. One round-trip is enough to populate a picker dropdown
82
+ * and the per-type metadata form.
83
+ */
84
+ export interface AssetCatalogResponse {
85
+ categories: AssetCatalogCategory[];
86
+ }
@@ -1,10 +1,10 @@
1
- export interface Pagination {
2
- limit: number;
3
- maxLimit: number;
4
- nextPage: string;
5
- }
6
-
7
- export interface PaginatedResponse<T> {
8
- data: T[];
9
- pagination: Pagination;
10
- }
1
+ export interface Pagination {
2
+ limit: number;
3
+ maxLimit: number;
4
+ nextPage: string;
5
+ }
6
+
7
+ export interface PaginatedResponse<T> {
8
+ data: T[];
9
+ pagination: Pagination;
10
+ }