@alliumcloud/configurator-service 1.5.11 → 1.5.13

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/README.md CHANGED
@@ -448,14 +448,18 @@ await sdk.sketchfab.updateObject("item-id", {
448
448
 
449
449
  ### Bounding Box
450
450
 
451
- Bounding box models are a distinct Unreal item type (`BoundingBoxRuntimeModel`). The wireframe collider is fitted to the loaded mesh by Unreal — you never send an extent.
451
+ There are two distinct Unreal item types under this endpoint family: single bounding boxes (`BoundingBoxRuntimeModel`) and multi bounding boxes (`MultiModelBoundingBox`).
452
452
 
453
- #### `sdk.boundingBox.addObject(data)`
453
+ The wireframe collider is fitted to the loaded mesh(es) by Unreal — you never send an extent.
454
454
 
455
- Add a bounding box 3D model to a space.
455
+ `disableClick` controls whether the box can be clicked in-world. Unreal's default is `false`, so an **omitted value means clickable**.
456
+
457
+ #### `sdk.boundingBox.addSingle(data)`
458
+
459
+ Add a single bounding box 3D model to a space.
456
460
 
457
461
  ```typescript
458
- await sdk.boundingBox.addObject({
462
+ await sdk.boundingBox.addSingle({
459
463
  orgId: "org-id",
460
464
  spaceId: "space-id",
461
465
  spaceItemId: "item-id",
@@ -471,37 +475,50 @@ await sdk.boundingBox.addObject({
471
475
  position: { x: 0, y: 300, z: 90 },
472
476
  rotation: { x: 0, y: 0, z: 0 },
473
477
  offsetUpRotation: 0,
478
+ disableClick: false,
474
479
  });
475
480
  ```
476
481
 
477
- | Field | Type | Required | Description |
478
- | -------------------- | --------- | -------- | ------------------------------------------------------------------ |
479
- | `orgId` | `string` | Yes | Organization ID. |
480
- | `spaceId` | `string` | Yes | Space ID. |
481
- | `type` | `string` | Yes | Must be `"BoundingBoxRuntimeModel"`. |
482
- | `gltfUrl` | `string` | Yes | The `.glb` / `.gltf` to load. |
483
- | `position` | `Vector3` | Yes | World location, Unreal units (cm). |
484
- | `rotation` | `Vector3` | Yes | Euler degrees. |
485
- | `scale` | `Vector3` | No | Per-axis scale. Defaults to `{ x: 1, y: 1, z: 1 }`. |
486
- | `autoScale` | `boolean` | No | Let Unreal normalize the model to a target size. Defaults `false`. |
487
- | `offsetUpPosition` | `number` | No | Vertical offset on top of `position`. Defaults `0`. |
488
- | `offsetUniformScale` | `number` | No | Uniform multiplier on top of `scale`. Defaults `1`. |
489
- | `collisionsEnabled` | `boolean` | No | Defaults `true`. |
490
- | `materialOverrideId` | `string` | No | Defaults `"None"`. Carried, not yet applied to the mesh. |
491
- | `currentAnimation` | `string` | No | Animation name. Carried, not driven. |
492
-
493
- > The transform positions the **centre of the fitted box**, not the glTF's own origin. A model authored with an off-centre or foot-level pivot will not land where an origin-relative caller expects.
482
+ **Returns:** `Promise<void>`
483
+
484
+ ---
485
+
486
+ #### `sdk.boundingBox.addMulti(data)`
487
+
488
+ Add a multi bounding box 3D model to a space.
489
+
490
+ ```typescript
491
+ await sdk.boundingBox.addMulti({
492
+ orgId: "org-id",
493
+ spaceId: "space-id",
494
+ spaceItemId: "item-id",
495
+ name: "Multi Bounding Box",
496
+ type: "MultiModelBoundingBox",
497
+ gltfUrls: ["https://.../chair1.glb", "https://.../chair2.glb"],
498
+ highlightedGltfUrl: "https://.../chair1.glb",
499
+ materialOverrideId: "None",
500
+ scale: { x: 1, y: 1, z: 1 },
501
+ autoScale: false,
502
+ offsetUpPosition: 0,
503
+ offsetUniformScale: 1,
504
+ collisionsEnabled: true,
505
+ position: { x: 0, y: 300, z: 90 },
506
+ rotation: { x: 0, y: 0, z: 0 },
507
+ offsetUpRotation: 0,
508
+ disableClick: false,
509
+ });
510
+ ```
494
511
 
495
512
  **Returns:** `Promise<void>`
496
513
 
497
514
  ---
498
515
 
499
- #### `sdk.boundingBox.updateObject(spaceItemId, data)`
516
+ #### `sdk.boundingBox.updateSingle(spaceItemId, data)`
500
517
 
501
- Update an existing bounding box. Changing `gltfUrl` swaps the mesh in place and refits the collider.
518
+ Update an existing single bounding box. Changing `gltfUrl` swaps the mesh in place and refits the collider.
502
519
 
503
520
  ```typescript
504
- await sdk.boundingBox.updateObject("item-id", {
521
+ await sdk.boundingBox.updateSingle("item-id", {
505
522
  orgId: "org-id",
506
523
  spaceId: "space-id",
507
524
  spaceItemId: "item-id",
@@ -509,18 +526,22 @@ await sdk.boundingBox.updateObject("item-id", {
509
526
  });
510
527
  ```
511
528
 
512
- | Field | Type | Required | Description |
513
- | -------------------- | --------- | -------- | ----------------------------- |
514
- | `orgId` | `string` | Yes | Organization ID. |
515
- | `spaceId` | `string` | Yes | Space ID. |
516
- | `spaceItemId` | `string` | Yes | Space item ID. |
517
- | `gltfUrl` | `string` | No | Swap the model. |
518
- | `materialOverrideId` | `string` | No | Material override id. |
519
- | `scale` | `Vector3` | No | Per-axis scale. |
520
- | `autoScale` | `boolean` | No | Auto-fit toggle. |
521
- | `offsetUniformScale` | `number` | No | Uniform scale multiplier. |
522
- | `collisionsEnabled` | `boolean` | No | Enable or disable collisions. |
523
- | `currentAnimation` | `string` | No | Name of the animation. |
529
+ **Returns:** `Promise<void>`
530
+
531
+ ---
532
+
533
+ #### `sdk.boundingBox.updateMulti(spaceItemId, data)`
534
+
535
+ Update an existing multi bounding box.
536
+
537
+ ```typescript
538
+ await sdk.boundingBox.updateMulti("item-id", {
539
+ orgId: "org-id",
540
+ spaceId: "space-id",
541
+ spaceItemId: "item-id",
542
+ gltfUrls: ["https://.../chair3.glb"],
543
+ });
544
+ ```
524
545
 
525
546
  Only the fields you send are changed — the backend merges them into the stored item before pushing the full payload to Unreal.
526
547
 
@@ -1037,40 +1058,51 @@ type UpdateSketchfabObjectInput = {
1037
1058
  ### Bounding Box Types
1038
1059
 
1039
1060
  ```typescript
1040
- type CreateBoundingBoxObjectInput = {
1041
- orgId: string;
1042
- spaceId: string;
1061
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
1062
+
1063
+ type BaseCreateBoundingBoxInput = Omit<SpaceContext, "type"> & {
1043
1064
  spaceItemId: string;
1044
- name: string;
1045
- type: "BoundingBoxRuntimeModel";
1046
- gltfUrl: string;
1047
1065
  materialOverrideId: string;
1048
1066
  scale: Vector3;
1049
1067
  autoScale: boolean;
1050
1068
  offsetUpPosition: number;
1051
1069
  offsetUniformScale: number;
1052
1070
  collisionsEnabled: boolean;
1053
- currentAnimation?: string;
1054
- availableAnimations?: string[];
1071
+ disableClick: boolean;
1055
1072
  thumb?: string;
1056
- position: Vector3;
1057
- rotation: Vector3;
1058
- offsetUpRotation: number;
1059
- isLocked?: boolean;
1060
- user?: string;
1061
1073
  };
1062
1074
 
1063
- type UpdateBoundingBoxObjectInput = {
1075
+ export type CreateSingleBoundingBoxInput = BaseCreateBoundingBoxInput & {
1076
+ type: "BoundingBoxRuntimeModel";
1077
+ gltfUrl?: string;
1078
+ };
1079
+
1080
+ export type CreateMultiBoundingBoxInput = BaseCreateBoundingBoxInput & {
1081
+ type: "MultiModelBoundingBox";
1082
+ gltfUrls: string[];
1083
+ highlightedGltfUrl: string;
1084
+ };
1085
+
1086
+ type BaseUpdateBoundingBoxInput = {
1064
1087
  orgId: string;
1065
1088
  spaceId: string;
1066
1089
  spaceItemId: string;
1067
- gltfUrl?: string;
1068
1090
  materialOverrideId?: string;
1069
1091
  scale?: Vector3;
1070
1092
  autoScale?: boolean;
1071
1093
  offsetUniformScale?: number;
1072
1094
  collisionsEnabled?: boolean;
1073
- currentAnimation?: string;
1095
+ disableClick?: boolean;
1096
+ };
1097
+
1098
+ export type UpdateSingleBoundingBoxInput = BaseUpdateBoundingBoxInput & {
1099
+ gltfUrl?: string;
1100
+ highlightedPartNames?: string[];
1101
+ };
1102
+
1103
+ export type UpdateMultiBoundingBoxInput = BaseUpdateBoundingBoxInput & {
1104
+ gltfUrls?: string[];
1105
+ highlightedGltfUrl?: string;
1074
1106
  };
1075
1107
  ```
1076
1108
 
package/dist/index.d.mts CHANGED
@@ -3,7 +3,6 @@
3
3
  */
4
4
  type ConfiguratorServiceSDKConfig = {
5
5
  apiKey: string;
6
- jwksUri: string;
7
6
  accessTokenProvider: () => string | Promise<string>;
8
7
  timeout?: number;
9
8
  /** @internal - dev only, not for production use */
@@ -29,31 +28,45 @@ type SpaceContext = {
29
28
  user?: string;
30
29
  };
31
30
 
32
- type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
31
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
32
+ type BaseCreateBoundingBoxInput = Omit<SpaceContext, "type"> & {
33
33
  spaceItemId: string;
34
- type: "BoundingBoxRuntimeModel";
35
- gltfUrl: string;
36
34
  materialOverrideId: string;
37
35
  scale: Vector3;
38
36
  autoScale: boolean;
39
37
  offsetUpPosition: number;
40
38
  offsetUniformScale: number;
41
39
  collisionsEnabled: boolean;
42
- currentAnimation?: string;
43
- availableAnimations?: string[];
40
+ disableClick: boolean;
44
41
  thumb?: string;
45
42
  };
46
- type UpdateBoundingBoxObjectInput = {
43
+ type CreateSingleBoundingBoxInput = BaseCreateBoundingBoxInput & {
44
+ type: "BoundingBoxRuntimeModel";
45
+ gltfUrl?: string;
46
+ highlightedPartNames?: string[];
47
+ };
48
+ type CreateMultiBoundingBoxInput = BaseCreateBoundingBoxInput & {
49
+ type: "MultiModelBoundingBox";
50
+ gltfUrls: string[];
51
+ highlightedGltfUrl?: string;
52
+ };
53
+ type BaseUpdateBoundingBoxInput = {
47
54
  orgId: string;
48
55
  spaceId: string;
49
- spaceItemId: string;
50
- gltfUrl?: string;
51
56
  materialOverrideId?: string;
52
57
  scale?: Vector3;
53
58
  autoScale?: boolean;
54
59
  offsetUniformScale?: number;
55
60
  collisionsEnabled?: boolean;
56
- currentAnimation?: string;
61
+ disableClick?: boolean;
62
+ };
63
+ type UpdateSingleBoundingBoxInput = BaseUpdateBoundingBoxInput & {
64
+ gltfUrl?: string;
65
+ highlightedPartNames?: string[];
66
+ };
67
+ type UpdateMultiBoundingBoxInput = BaseUpdateBoundingBoxInput & {
68
+ gltfUrls?: string[];
69
+ highlightedGltfUrl?: string;
57
70
  };
58
71
 
59
72
  /**
@@ -61,8 +74,10 @@ type UpdateBoundingBoxObjectInput = {
61
74
  */
62
75
 
63
76
  interface BoundingBoxHandle {
64
- addObject(data: CreateBoundingBoxObjectInput): Promise<void>;
65
- updateObject(spaceItemId: string, data: UpdateBoundingBoxObjectInput): Promise<void>;
77
+ addSingle(data: CreateSingleBoundingBoxInput): Promise<void>;
78
+ addMulti(data: CreateMultiBoundingBoxInput): Promise<void>;
79
+ updateSingle(spaceItemId: string, data: UpdateSingleBoundingBoxInput): Promise<void>;
80
+ updateMulti(spaceItemId: string, data: UpdateMultiBoundingBoxInput): Promise<void>;
66
81
  }
67
82
 
68
83
  type SpatialMediaTypes = "video" | "link";
@@ -386,4 +401,4 @@ declare const ConfiguratorSDK: {
386
401
  readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
387
402
  };
388
403
 
389
- export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateBoundingBoxObjectInput, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateBoundingBoxObjectInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
404
+ export { type AlliumError, type BoundingBoxType, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateMultiBoundingBoxInput, type CreateSingleBoundingBoxInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdateMultiBoundingBoxInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSingleBoundingBoxInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@
3
3
  */
4
4
  type ConfiguratorServiceSDKConfig = {
5
5
  apiKey: string;
6
- jwksUri: string;
7
6
  accessTokenProvider: () => string | Promise<string>;
8
7
  timeout?: number;
9
8
  /** @internal - dev only, not for production use */
@@ -29,31 +28,45 @@ type SpaceContext = {
29
28
  user?: string;
30
29
  };
31
30
 
32
- type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
31
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
32
+ type BaseCreateBoundingBoxInput = Omit<SpaceContext, "type"> & {
33
33
  spaceItemId: string;
34
- type: "BoundingBoxRuntimeModel";
35
- gltfUrl: string;
36
34
  materialOverrideId: string;
37
35
  scale: Vector3;
38
36
  autoScale: boolean;
39
37
  offsetUpPosition: number;
40
38
  offsetUniformScale: number;
41
39
  collisionsEnabled: boolean;
42
- currentAnimation?: string;
43
- availableAnimations?: string[];
40
+ disableClick: boolean;
44
41
  thumb?: string;
45
42
  };
46
- type UpdateBoundingBoxObjectInput = {
43
+ type CreateSingleBoundingBoxInput = BaseCreateBoundingBoxInput & {
44
+ type: "BoundingBoxRuntimeModel";
45
+ gltfUrl?: string;
46
+ highlightedPartNames?: string[];
47
+ };
48
+ type CreateMultiBoundingBoxInput = BaseCreateBoundingBoxInput & {
49
+ type: "MultiModelBoundingBox";
50
+ gltfUrls: string[];
51
+ highlightedGltfUrl?: string;
52
+ };
53
+ type BaseUpdateBoundingBoxInput = {
47
54
  orgId: string;
48
55
  spaceId: string;
49
- spaceItemId: string;
50
- gltfUrl?: string;
51
56
  materialOverrideId?: string;
52
57
  scale?: Vector3;
53
58
  autoScale?: boolean;
54
59
  offsetUniformScale?: number;
55
60
  collisionsEnabled?: boolean;
56
- currentAnimation?: string;
61
+ disableClick?: boolean;
62
+ };
63
+ type UpdateSingleBoundingBoxInput = BaseUpdateBoundingBoxInput & {
64
+ gltfUrl?: string;
65
+ highlightedPartNames?: string[];
66
+ };
67
+ type UpdateMultiBoundingBoxInput = BaseUpdateBoundingBoxInput & {
68
+ gltfUrls?: string[];
69
+ highlightedGltfUrl?: string;
57
70
  };
58
71
 
59
72
  /**
@@ -61,8 +74,10 @@ type UpdateBoundingBoxObjectInput = {
61
74
  */
62
75
 
63
76
  interface BoundingBoxHandle {
64
- addObject(data: CreateBoundingBoxObjectInput): Promise<void>;
65
- updateObject(spaceItemId: string, data: UpdateBoundingBoxObjectInput): Promise<void>;
77
+ addSingle(data: CreateSingleBoundingBoxInput): Promise<void>;
78
+ addMulti(data: CreateMultiBoundingBoxInput): Promise<void>;
79
+ updateSingle(spaceItemId: string, data: UpdateSingleBoundingBoxInput): Promise<void>;
80
+ updateMulti(spaceItemId: string, data: UpdateMultiBoundingBoxInput): Promise<void>;
66
81
  }
67
82
 
68
83
  type SpatialMediaTypes = "video" | "link";
@@ -386,4 +401,4 @@ declare const ConfiguratorSDK: {
386
401
  readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
387
402
  };
388
403
 
389
- export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateBoundingBoxObjectInput, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateBoundingBoxObjectInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
404
+ export { type AlliumError, type BoundingBoxType, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateMultiBoundingBoxInput, type CreateSingleBoundingBoxInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdateMultiBoundingBoxInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSingleBoundingBoxInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
package/dist/index.js CHANGED
@@ -71,8 +71,7 @@ function createHttpClient(config) {
71
71
  timeout: config.timeout ?? 3e4,
72
72
  headers: {
73
73
  "Content-Type": "application/json",
74
- "x-sdk-key": config.apiKey.trim(),
75
- ...config.jwksUri?.trim() && { "x-jwks-uri": config.jwksUri.trim() }
74
+ "x-allium-key": config.apiKey.trim()
76
75
  }
77
76
  });
78
77
  client.interceptors.request.use(async (req) => {
@@ -132,15 +131,23 @@ function createHttpClient(config) {
132
131
 
133
132
  // src/modules/boundingBox.ts
134
133
  function createBoundingBoxModule(http) {
135
- async function addObject(data) {
136
- await http.post("/boundingbox/object", data);
134
+ async function addSingle(data) {
135
+ await http.post("/boundingbox/single", data);
137
136
  debugLog();
138
137
  }
139
- async function updateObject(spaceItemId, data) {
140
- await http.patch(`/boundingbox/${spaceItemId}`, data);
138
+ async function addMulti(data) {
139
+ await http.post("/boundingbox/multi", data);
141
140
  debugLog();
142
141
  }
143
- return { addObject, updateObject };
142
+ async function updateSingle(spaceItemId, data) {
143
+ await http.patch(`/boundingbox/single/${spaceItemId}`, data);
144
+ debugLog();
145
+ }
146
+ async function updateMulti(spaceItemId, data) {
147
+ await http.patch(`/boundingbox/multi/${spaceItemId}`, data);
148
+ debugLog();
149
+ }
150
+ return { addSingle, addMulti, updateSingle, updateMulti };
144
151
  }
145
152
 
146
153
  // src/modules/media.ts
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":["axios"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,SAAS,eAAA,CAAgB,SAAiB,KAAA,EAA8B;AAC7E,EAAA,OAAO,SAAA,CAAU,iBAAA,EAAmB,YAAA,EAAc,OAAA,EAAS,KAAK,CAAA;AAClE;AAGO,SAAS,kBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,oBAAA,EAAsB,eAAA,EAAiB,OAAA,EAAS,KAAK,CAAA;AACxE;AAGO,SAAS,qBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,uBAAA,EAAyB,kBAAA,EAAoB,OAAA,EAAS,KAAK,CAAA;AAC9E;AAGO,SAAS,iBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA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IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-sdk-key\": config.apiKey.trim(),\n ...(config.jwksUri?.trim() && { \"x-jwks-uri\": config.jwksUri.trim() }),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addObject(data: CreateBoundingBoxObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addObject(data: CreateBoundingBoxObjectInput): Promise<void> {\n await http.post(\"/boundingbox/object\", data);\n debugLog(\"BoundingBox\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"./types/boundingBox\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":["ax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error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-allium-key\": config.apiKey.trim(),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSingleBoundingBoxInput,\n CreateMultiBoundingBoxInput,\n UpdateSingleBoundingBoxInput,\n UpdateMultiBoundingBoxInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addSingle(data: CreateSingleBoundingBoxInput): Promise<void>;\n addMulti(data: CreateMultiBoundingBoxInput): Promise<void>;\n updateSingle(\n spaceItemId: string,\n data: UpdateSingleBoundingBoxInput,\n ): Promise<void>;\n updateMulti(\n spaceItemId: string,\n data: UpdateMultiBoundingBoxInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addSingle(data: CreateSingleBoundingBoxInput): Promise<void> {\n await http.post(\"/boundingbox/single\", data);\n debugLog(\"BoundingBox\", \"addSingle\", data);\n }\n\n async function addMulti(data: CreateMultiBoundingBoxInput): Promise<void> {\n await http.post(\"/boundingbox/multi\", data);\n debugLog(\"BoundingBox\", \"addMulti\", data);\n }\n\n async function updateSingle(\n spaceItemId: string,\n data: UpdateSingleBoundingBoxInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/single/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateSingle\", data);\n }\n\n async function updateMulti(\n spaceItemId: string,\n data: UpdateMultiBoundingBoxInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/multi/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateMulti\", data);\n }\n\n return { addSingle, addMulti, updateSingle, updateMulti };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n BoundingBoxType,\n CreateSingleBoundingBoxInput,\n CreateMultiBoundingBoxInput,\n UpdateSingleBoundingBoxInput,\n UpdateMultiBoundingBoxInput,\n} from \"./types/boundingBox\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
package/dist/index.mjs CHANGED
@@ -63,8 +63,7 @@ function createHttpClient(config) {
63
63
  timeout: config.timeout ?? 3e4,
64
64
  headers: {
65
65
  "Content-Type": "application/json",
66
- "x-sdk-key": config.apiKey.trim(),
67
- ...config.jwksUri?.trim() && { "x-jwks-uri": config.jwksUri.trim() }
66
+ "x-allium-key": config.apiKey.trim()
68
67
  }
69
68
  });
70
69
  client.interceptors.request.use(async (req) => {
@@ -124,15 +123,23 @@ function createHttpClient(config) {
124
123
 
125
124
  // src/modules/boundingBox.ts
126
125
  function createBoundingBoxModule(http) {
127
- async function addObject(data) {
128
- await http.post("/boundingbox/object", data);
126
+ async function addSingle(data) {
127
+ await http.post("/boundingbox/single", data);
129
128
  debugLog();
130
129
  }
131
- async function updateObject(spaceItemId, data) {
132
- await http.patch(`/boundingbox/${spaceItemId}`, data);
130
+ async function addMulti(data) {
131
+ await http.post("/boundingbox/multi", data);
133
132
  debugLog();
134
133
  }
135
- return { addObject, updateObject };
134
+ async function updateSingle(spaceItemId, data) {
135
+ await http.patch(`/boundingbox/single/${spaceItemId}`, data);
136
+ debugLog();
137
+ }
138
+ async function updateMulti(spaceItemId, data) {
139
+ await http.patch(`/boundingbox/multi/${spaceItemId}`, data);
140
+ debugLog();
141
+ }
142
+ return { addSingle, addMulti, updateSingle, updateMulti };
136
143
  }
137
144
 
138
145
  // src/modules/media.ts
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,G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,MAAA,EACuB;AACvB,EAAA,MAAM,IAAA,GAAO,iBAAiB,MAAM,CAAA;AAEpC,EAAA,QAAA,CAAS,mBAAmB,aAAA,EAAe;AAAA,IACzC,OAAA,EAAS,OAAO,OAAA,IAAW;AAAA,GAC5B,CAAA;AAED,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,IAAA,EAAK;AAAA,IAC3B,WAAA,EAAa,sBAAA;AAAA,IACb,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,WAAA,EAAa,wBAAwB,IAAI,CAAA;AAAA,IACzC,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,iBAAA,EAAmB,8BAA8B,IAAI,CAAA;AAAA,IACrD,mBAAA,EAAqB,gCAAgC,IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.mjs","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-sdk-key\": config.apiKey.trim(),\n ...(config.jwksUri?.trim() && { \"x-jwks-uri\": config.jwksUri.trim() }),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addObject(data: CreateBoundingBoxObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addObject(data: CreateBoundingBoxObjectInput): Promise<void> {\n await http.post(\"/boundingbox/object\", data);\n debugLog(\"BoundingBox\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"./types/boundingBox\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,SAAS,eAAA,CAAgB,SAAiB,KAAA,EAA8B;AAC7E,EAAA,OAAO,SAAA,CAAU,iBAAA,EAAmB,YAAA,EAAc,OAAA,EAAS,KAAK,CAAA;AAClE;AAGO,SAAS,kBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,oBAAA,EAAsB,eAAA,EAAiB,OAAA,EAAS,KAAK,CAAA;AACxE;AAGO,SAAS,qBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CA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O,IAAA,EAAK;AAAA,IAC3B,WAAA,EAAa,sBAAA;AAAA,IACb,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,WAAA,EAAa,wBAAwB,IAAI,CAAA;AAAA,IACzC,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,iBAAA,EAAmB,8BAA8B,IAAI,CAAA;AAAA,IACrD,mBAAA,EAAqB,gCAAgC,IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.mjs","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-allium-key\": config.apiKey.trim(),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSingleBoundingBoxInput,\n CreateMultiBoundingBoxInput,\n UpdateSingleBoundingBoxInput,\n UpdateMultiBoundingBoxInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addSingle(data: CreateSingleBoundingBoxInput): Promise<void>;\n addMulti(data: CreateMultiBoundingBoxInput): Promise<void>;\n updateSingle(\n spaceItemId: string,\n data: UpdateSingleBoundingBoxInput,\n ): Promise<void>;\n updateMulti(\n spaceItemId: string,\n data: UpdateMultiBoundingBoxInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addSingle(data: CreateSingleBoundingBoxInput): Promise<void> {\n await http.post(\"/boundingbox/single\", data);\n debugLog(\"BoundingBox\", \"addSingle\", data);\n }\n\n async function addMulti(data: CreateMultiBoundingBoxInput): Promise<void> {\n await http.post(\"/boundingbox/multi\", data);\n debugLog(\"BoundingBox\", \"addMulti\", data);\n }\n\n async function updateSingle(\n spaceItemId: string,\n data: UpdateSingleBoundingBoxInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/single/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateSingle\", data);\n }\n\n async function updateMulti(\n spaceItemId: string,\n data: UpdateMultiBoundingBoxInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/multi/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateMulti\", data);\n }\n\n return { addSingle, addMulti, updateSingle, updateMulti };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n BoundingBoxType,\n CreateSingleBoundingBoxInput,\n CreateMultiBoundingBoxInput,\n UpdateSingleBoundingBoxInput,\n UpdateMultiBoundingBoxInput,\n} from \"./types/boundingBox\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alliumcloud/configurator-service",
3
- "version": "1.5.11",
3
+ "version": "1.5.13",
4
4
  "description": "Allium Configurator SDK - manages sketchfab 3D object , manages live stream, video and links and manages position,scale,rotation of all objects",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",