@alliumcloud/configurator-service 1.5.10 → 1.5.12

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
@@ -18,6 +18,7 @@ Official TypeScript SDK for the Allium Configurator backend. Provides a fully ty
18
18
  - [API Reference](#api-reference)
19
19
  - [Media](#media)
20
20
  - [Sketchfab](#sketchfab)
21
+ - [Bounding Box](#bounding-box)
21
22
  - [Transform](#transform)
22
23
  - [Layer](#layer)
23
24
  - [Configurator Items](#configurator-items)
@@ -27,6 +28,7 @@ Official TypeScript SDK for the Allium Configurator backend. Provides a fully ty
27
28
  - [Common](#common)
28
29
  - [Media Types](#media-types)
29
30
  - [Sketchfab Types](#sketchfab-types)
31
+ - [Bounding Box Types](#bounding-box-types)
30
32
  - [Transform Types](#transform-types)
31
33
  - [Layer Types](#layer-types)
32
34
  - [Configurator Item Types](#configurator-item-types)
@@ -110,6 +112,7 @@ createConfiguratorSDK({ apiKey })
110
112
  │
111
113
  ├── sdk.media → /media
112
114
  ├── sdk.sketchfab → /sketchfab
115
+ ├── sdk.boundingBox → /boundingbox
113
116
  ├── sdk.transform → /transform
114
117
  ├── sdk.layer → /layer
115
118
  ├── sdk.configuratorItems → /configurator_items
@@ -443,6 +446,105 @@ await sdk.sketchfab.updateObject("item-id", {
443
446
 
444
447
  ---
445
448
 
449
+ ### Bounding Box
450
+
451
+ There are two distinct Unreal item types under this endpoint family:
452
+
453
+ - **`BoundingBoxRuntimeModel`** — one model, `gltfUrl`.
454
+ - **`MultiModelBoundingBox`** — several models, `gltfUrls`, and there is no singular `gltfUrl` for this type. Unreal shows every model in `gltfUrls` side by side. To page, replace `gltfUrls` with the next page's models via `updateObject`.
455
+
456
+ The wireframe collider is fitted to the loaded mesh(es) by Unreal — you never send an extent.
457
+
458
+ `disableClick` controls whether the box can be clicked in-world. Unreal's default is `false`, so an **omitted value means clickable**.
459
+
460
+ #### `sdk.boundingBox.addObject(data)`
461
+
462
+ Add a bounding box 3D model to a space.
463
+
464
+ ```typescript
465
+ await sdk.boundingBox.addObject({
466
+ orgId: "org-id",
467
+ spaceId: "space-id",
468
+ spaceItemId: "item-id",
469
+ name: "Living Room Bounding Box",
470
+ type: "BoundingBoxRuntimeModel",
471
+ gltfUrl: "https://.../chair.glb",
472
+ materialOverrideId: "None",
473
+ scale: { x: 1, y: 1, z: 1 },
474
+ autoScale: false,
475
+ offsetUpPosition: 0,
476
+ offsetUniformScale: 1,
477
+ collisionsEnabled: true,
478
+ position: { x: 0, y: 300, z: 90 },
479
+ rotation: { x: 0, y: 0, z: 0 },
480
+ offsetUpRotation: 0,
481
+ disableClick: false,
482
+ gltfUrls: [],
483
+ });
484
+ ```
485
+
486
+ A multi-model box instead sends `type: "MultiModelBoundingBox"` and a non-empty `gltfUrls`, and omits `gltfUrl`, `currentAnimation` and `availableAnimations` — Unreal's struct for this type doesn't carry them.
487
+
488
+ | Field | Type | Required | Description |
489
+ | -------------------- | ---------- | -------- | ------------------------------------------------------------------ |
490
+ | `orgId` | `string` | Yes | Organization ID. |
491
+ | `spaceId` | `string` | Yes | Space ID. |
492
+ | `type` | `string` | Yes | `"BoundingBoxRuntimeModel"` or `"MultiModelBoundingBox"`. |
493
+ | `gltfUrl` | `string` | No | What a `BoundingBoxRuntimeModel` loads. Unused otherwise. |
494
+ | `position` | `Vector3` | Yes | World location, Unreal units (cm). |
495
+ | `rotation` | `Vector3` | Yes | Euler degrees. |
496
+ | `scale` | `Vector3` | No | Per-axis scale. Defaults to `{ x: 1, y: 1, z: 1 }`. |
497
+ | `autoScale` | `boolean` | No | Let Unreal normalize the model to a target size. Defaults `false`. |
498
+ | `offsetUpPosition` | `number` | No | Vertical offset on top of `position`. Defaults `0`. |
499
+ | `offsetUniformScale` | `number` | No | Uniform multiplier on top of `scale`. Defaults `1`. |
500
+ | `collisionsEnabled` | `boolean` | No | Defaults `true`. |
501
+ | `materialOverrideId` | `string` | No | Defaults `"None"`. Carried, not yet applied to the mesh. |
502
+ | `currentAnimation` | `string` | No | Animation name. `BoundingBoxRuntimeModel` only, not driven. |
503
+ | `disableClick` | `boolean` | No | Turns off in-world clicking. Defaults `false` (clickable). |
504
+ | `gltfUrls` | `string[]` | No | What a `MultiModelBoundingBox` loads. |
505
+
506
+ > Send every field explicitly. The service declares defaults but never applies them — an omitted field is absent all the way through to Unreal, which falls back to its own struct defaults.
507
+
508
+ > 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.
509
+
510
+ **Returns:** `Promise<void>`
511
+
512
+ ---
513
+
514
+ #### `sdk.boundingBox.updateObject(spaceItemId, data)`
515
+
516
+ Update an existing bounding box. Changing `gltfUrl` swaps the mesh in place and refits the collider.
517
+
518
+ ```typescript
519
+ await sdk.boundingBox.updateObject("item-id", {
520
+ orgId: "org-id",
521
+ spaceId: "space-id",
522
+ spaceItemId: "item-id",
523
+ collisionsEnabled: false,
524
+ });
525
+ ```
526
+
527
+ | Field | Type | Required | Description |
528
+ | -------------------- | ---------- | -------- | ----------------------------- |
529
+ | `orgId` | `string` | Yes | Organization ID. |
530
+ | `spaceId` | `string` | Yes | Space ID. |
531
+ | `spaceItemId` | `string` | Yes | Space item ID. |
532
+ | `gltfUrl` | `string` | No | Swap the model. |
533
+ | `materialOverrideId` | `string` | No | Material override id. |
534
+ | `scale` | `Vector3` | No | Per-axis scale. |
535
+ | `autoScale` | `boolean` | No | Auto-fit toggle. |
536
+ | `offsetUniformScale` | `number` | No | Uniform scale multiplier. |
537
+ | `collisionsEnabled` | `boolean` | No | Enable or disable collisions. |
538
+ | `currentAnimation` | `string` | No | Name of the animation. |
539
+ | `disableClick` | `boolean` | No | In-world click on or off. |
540
+ | `gltfUrls` | `string[]` | No | Replace the model list. |
541
+
542
+ Only the fields you send are changed — the backend merges them into the stored item before pushing the full payload to Unreal.
543
+
544
+ **Returns:** `Promise<void>`
545
+
546
+ ---
547
+
446
548
  ### Transform
447
549
 
448
550
  #### `sdk.transform.updatePosition(spaceItemId, data)`
@@ -747,7 +849,8 @@ type SpaceItemType =
747
849
  | "RuntimeStream"
748
850
  | "BridgeToolkitSettings"
749
851
  | "Configurator"
750
- | "ConfiguratorObject";
852
+ | "ConfiguratorObject"
853
+ | "BoundingBoxRuntimeModel";
751
854
 
752
855
  type ConfiguratorType =
753
856
  | "string"
@@ -948,6 +1051,57 @@ type UpdateSketchfabObjectInput = {
948
1051
 
949
1052
  ---
950
1053
 
1054
+ ### Bounding Box Types
1055
+
1056
+ ```typescript
1057
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
1058
+
1059
+ type CreateBoundingBoxObjectInput = {
1060
+ orgId: string;
1061
+ spaceId: string;
1062
+ spaceItemId: string;
1063
+ name: string;
1064
+ type: BoundingBoxType;
1065
+ // Required for BoundingBoxRuntimeModel; unused by MultiModelBoundingBox.
1066
+ gltfUrl?: string;
1067
+ materialOverrideId: string;
1068
+ scale: Vector3;
1069
+ autoScale: boolean;
1070
+ offsetUpPosition: number;
1071
+ offsetUniformScale: number;
1072
+ collisionsEnabled: boolean;
1073
+ disableClick: boolean;
1074
+ // Not on the multi-model struct — Unreal never reads or writes these for it.
1075
+ currentAnimation?: string;
1076
+ availableAnimations?: string[];
1077
+ thumb?: string;
1078
+ // Required (non-empty) for MultiModelBoundingBox; empty for BoundingBoxRuntimeModel.
1079
+ gltfUrls: string[];
1080
+ position: Vector3;
1081
+ rotation: Vector3;
1082
+ offsetUpRotation: number;
1083
+ isLocked?: boolean;
1084
+ user?: string;
1085
+ };
1086
+
1087
+ type UpdateBoundingBoxObjectInput = {
1088
+ orgId: string;
1089
+ spaceId: string;
1090
+ spaceItemId: string;
1091
+ gltfUrl?: string;
1092
+ materialOverrideId?: string;
1093
+ scale?: Vector3;
1094
+ autoScale?: boolean;
1095
+ offsetUniformScale?: number;
1096
+ collisionsEnabled?: boolean;
1097
+ currentAnimation?: string;
1098
+ disableClick?: boolean;
1099
+ gltfUrls?: string[];
1100
+ };
1101
+ ```
1102
+
1103
+ ---
1104
+
951
1105
  ### Transform Types
952
1106
 
953
1107
  ```typescript
package/dist/index.d.mts CHANGED
@@ -9,7 +9,7 @@ type ConfiguratorServiceSDKConfig = {
9
9
  /** @internal - dev only, not for production use */
10
10
  _devBaseUrl?: string;
11
11
  };
12
- type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject";
12
+ type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject" | "BoundingBoxRuntimeModel";
13
13
  type ConfiguratorType = "string" | "number" | "boolean" | "enum" | "trigger" | "image" | "String" | "Number" | "Bool" | "Enum" | "Trigger" | "Image";
14
14
  type Vector3 = {
15
15
  x: number;
@@ -29,6 +29,47 @@ type SpaceContext = {
29
29
  user?: string;
30
30
  };
31
31
 
32
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
33
+ type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
34
+ spaceItemId: string;
35
+ type: BoundingBoxType;
36
+ gltfUrl?: string;
37
+ materialOverrideId: string;
38
+ scale: Vector3;
39
+ autoScale: boolean;
40
+ offsetUpPosition: number;
41
+ offsetUniformScale: number;
42
+ collisionsEnabled: boolean;
43
+ disableClick: boolean;
44
+ currentAnimation?: string;
45
+ availableAnimations?: string[];
46
+ thumb?: string;
47
+ gltfUrls: string[];
48
+ };
49
+ type UpdateBoundingBoxObjectInput = {
50
+ orgId: string;
51
+ spaceId: string;
52
+ spaceItemId: string;
53
+ gltfUrl?: string;
54
+ materialOverrideId?: string;
55
+ scale?: Vector3;
56
+ autoScale?: boolean;
57
+ offsetUniformScale?: number;
58
+ collisionsEnabled?: boolean;
59
+ currentAnimation?: string;
60
+ disableClick?: boolean;
61
+ gltfUrls?: string[];
62
+ };
63
+
64
+ /**
65
+ * Bounding Box Module - Bounding Box 3D Object Operations
66
+ */
67
+
68
+ interface BoundingBoxHandle {
69
+ addObject(data: CreateBoundingBoxObjectInput): Promise<void>;
70
+ updateObject(spaceItemId: string, data: UpdateBoundingBoxObjectInput): Promise<void>;
71
+ }
72
+
32
73
  type SpatialMediaTypes = "video" | "link";
33
74
  type SpatialMediaBase = Omit<SpaceContext, "type"> & {
34
75
  type: "SpatialMedia";
@@ -335,6 +376,7 @@ interface ConfiguratorSDKHandle {
335
376
  readonly serviceType: "CONFIGURATOR_SERVICE";
336
377
  media: MediaHandle;
337
378
  sketchfab: SketchfabHandle;
379
+ boundingBox: BoundingBoxHandle;
338
380
  transform: TransformHandle;
339
381
  layer: LayerHandle;
340
382
  configuratorItems: ConfiguratorItemsHandle;
@@ -349,4 +391,4 @@ declare const ConfiguratorSDK: {
349
391
  readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
350
392
  };
351
393
 
352
- export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
394
+ export { type AlliumError, type BoundingBoxType, 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 };
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ type ConfiguratorServiceSDKConfig = {
9
9
  /** @internal - dev only, not for production use */
10
10
  _devBaseUrl?: string;
11
11
  };
12
- type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject";
12
+ type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject" | "BoundingBoxRuntimeModel";
13
13
  type ConfiguratorType = "string" | "number" | "boolean" | "enum" | "trigger" | "image" | "String" | "Number" | "Bool" | "Enum" | "Trigger" | "Image";
14
14
  type Vector3 = {
15
15
  x: number;
@@ -29,6 +29,47 @@ type SpaceContext = {
29
29
  user?: string;
30
30
  };
31
31
 
32
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
33
+ type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
34
+ spaceItemId: string;
35
+ type: BoundingBoxType;
36
+ gltfUrl?: string;
37
+ materialOverrideId: string;
38
+ scale: Vector3;
39
+ autoScale: boolean;
40
+ offsetUpPosition: number;
41
+ offsetUniformScale: number;
42
+ collisionsEnabled: boolean;
43
+ disableClick: boolean;
44
+ currentAnimation?: string;
45
+ availableAnimations?: string[];
46
+ thumb?: string;
47
+ gltfUrls: string[];
48
+ };
49
+ type UpdateBoundingBoxObjectInput = {
50
+ orgId: string;
51
+ spaceId: string;
52
+ spaceItemId: string;
53
+ gltfUrl?: string;
54
+ materialOverrideId?: string;
55
+ scale?: Vector3;
56
+ autoScale?: boolean;
57
+ offsetUniformScale?: number;
58
+ collisionsEnabled?: boolean;
59
+ currentAnimation?: string;
60
+ disableClick?: boolean;
61
+ gltfUrls?: string[];
62
+ };
63
+
64
+ /**
65
+ * Bounding Box Module - Bounding Box 3D Object Operations
66
+ */
67
+
68
+ interface BoundingBoxHandle {
69
+ addObject(data: CreateBoundingBoxObjectInput): Promise<void>;
70
+ updateObject(spaceItemId: string, data: UpdateBoundingBoxObjectInput): Promise<void>;
71
+ }
72
+
32
73
  type SpatialMediaTypes = "video" | "link";
33
74
  type SpatialMediaBase = Omit<SpaceContext, "type"> & {
34
75
  type: "SpatialMedia";
@@ -335,6 +376,7 @@ interface ConfiguratorSDKHandle {
335
376
  readonly serviceType: "CONFIGURATOR_SERVICE";
336
377
  media: MediaHandle;
337
378
  sketchfab: SketchfabHandle;
379
+ boundingBox: BoundingBoxHandle;
338
380
  transform: TransformHandle;
339
381
  layer: LayerHandle;
340
382
  configuratorItems: ConfiguratorItemsHandle;
@@ -349,4 +391,4 @@ declare const ConfiguratorSDK: {
349
391
  readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
350
392
  };
351
393
 
352
- export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
394
+ export { type AlliumError, type BoundingBoxType, 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 };
package/dist/index.js CHANGED
@@ -130,6 +130,19 @@ function createHttpClient(config) {
130
130
  return client;
131
131
  }
132
132
 
133
+ // src/modules/boundingBox.ts
134
+ function createBoundingBoxModule(http) {
135
+ async function addObject(data) {
136
+ await http.post("/boundingbox/object", data);
137
+ debugLog();
138
+ }
139
+ async function updateObject(spaceItemId, data) {
140
+ await http.patch(`/boundingbox/${spaceItemId}`, data);
141
+ debugLog();
142
+ }
143
+ return { addObject, updateObject };
144
+ }
145
+
133
146
  // src/modules/media.ts
134
147
  function createMediaModule(http) {
135
148
  async function addVideo(data) {
@@ -261,6 +274,7 @@ function createConfiguratorSDK(config) {
261
274
  serviceType: "CONFIGURATOR_SERVICE",
262
275
  media: createMediaModule(http),
263
276
  sketchfab: createSketchfabModule(http),
277
+ boundingBox: createBoundingBoxModule(http),
264
278
  transform: createTransformModule(http),
265
279
  layer: createLayerModule(http),
266
280
  configuratorItems: createConfiguratorItemsModule(http),
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/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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KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,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.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 * 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 { 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 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 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// 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":["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,CAA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,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.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 BoundingBoxType,\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"]}
package/dist/index.mjs CHANGED
@@ -122,6 +122,19 @@ function createHttpClient(config) {
122
122
  return client;
123
123
  }
124
124
 
125
+ // src/modules/boundingBox.ts
126
+ function createBoundingBoxModule(http) {
127
+ async function addObject(data) {
128
+ await http.post("/boundingbox/object", data);
129
+ debugLog();
130
+ }
131
+ async function updateObject(spaceItemId, data) {
132
+ await http.patch(`/boundingbox/${spaceItemId}`, data);
133
+ debugLog();
134
+ }
135
+ return { addObject, updateObject };
136
+ }
137
+
125
138
  // src/modules/media.ts
126
139
  function createMediaModule(http) {
127
140
  async function addVideo(data) {
@@ -253,6 +266,7 @@ function createConfiguratorSDK(config) {
253
266
  serviceType: "CONFIGURATOR_SERVICE",
254
267
  media: createMediaModule(http),
255
268
  sketchfab: createSketchfabModule(http),
269
+ boundingBox: createBoundingBoxModule(http),
256
270
  transform: createTransformModule(http),
257
271
  layer: createLayerModule(http),
258
272
  configuratorItems: createConfiguratorItemsModule(http),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.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,iB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AAA,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 * 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 { 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 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 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// 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,CAAU,uBAAA,EAAyB,kBAAA,EAAoB,OAAA,EAAS,KAAK,CAAA;AAC9E;AAGO,SAAS,iBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,mBAAA,EAAqB,cAAA,EAAgB,OAAA,EAAS,KAAK,CAAA;AACtE;AAGO,SAAS,iBAAA,CACd,SACA,KAAA,EACa;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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 BoundingBoxType,\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alliumcloud/configurator-service",
3
- "version": "1.5.10",
3
+ "version": "1.5.12",
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",