@alliumcloud/configurator-service 1.5.11 → 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
@@ -448,7 +448,14 @@ await sdk.sketchfab.updateObject("item-id", {
448
448
 
449
449
  ### Bounding Box
450
450
 
451
- Bounding box models are a distinct Unreal item type (`BoundingBoxRuntimeModel`). The wireframe collider is fitted to the loaded mesh by Unreal — you never send an extent.
451
+ There are two distinct Unreal item types under this endpoint family:
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**.
452
459
 
453
460
  #### `sdk.boundingBox.addObject(data)`
454
461
 
@@ -471,24 +478,32 @@ await sdk.boundingBox.addObject({
471
478
  position: { x: 0, y: 300, z: 90 },
472
479
  rotation: { x: 0, y: 0, z: 0 },
473
480
  offsetUpRotation: 0,
481
+ disableClick: false,
482
+ gltfUrls: [],
474
483
  });
475
484
  ```
476
485
 
477
- | Field | Type | Required | Description |
478
- | -------------------- | --------- | -------- | ------------------------------------------------------------------ |
479
- | `orgId` | `string` | Yes | Organization ID. |
480
- | `spaceId` | `string` | Yes | Space ID. |
481
- | `type` | `string` | Yes | Must be `"BoundingBoxRuntimeModel"`. |
482
- | `gltfUrl` | `string` | Yes | The `.glb` / `.gltf` to load. |
483
- | `position` | `Vector3` | Yes | World location, Unreal units (cm). |
484
- | `rotation` | `Vector3` | Yes | Euler degrees. |
485
- | `scale` | `Vector3` | No | Per-axis scale. Defaults to `{ x: 1, y: 1, z: 1 }`. |
486
- | `autoScale` | `boolean` | No | Let Unreal normalize the model to a target size. Defaults `false`. |
487
- | `offsetUpPosition` | `number` | No | Vertical offset on top of `position`. Defaults `0`. |
488
- | `offsetUniformScale` | `number` | No | Uniform multiplier on top of `scale`. Defaults `1`. |
489
- | `collisionsEnabled` | `boolean` | No | Defaults `true`. |
490
- | `materialOverrideId` | `string` | No | Defaults `"None"`. Carried, not yet applied to the mesh. |
491
- | `currentAnimation` | `string` | No | Animation name. Carried, not driven. |
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.
492
507
 
493
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.
494
509
 
@@ -509,18 +524,20 @@ await sdk.boundingBox.updateObject("item-id", {
509
524
  });
510
525
  ```
511
526
 
512
- | Field | Type | Required | Description |
513
- | -------------------- | --------- | -------- | ----------------------------- |
514
- | `orgId` | `string` | Yes | Organization ID. |
515
- | `spaceId` | `string` | Yes | Space ID. |
516
- | `spaceItemId` | `string` | Yes | Space item ID. |
517
- | `gltfUrl` | `string` | No | Swap the model. |
518
- | `materialOverrideId` | `string` | No | Material override id. |
519
- | `scale` | `Vector3` | No | Per-axis scale. |
520
- | `autoScale` | `boolean` | No | Auto-fit toggle. |
521
- | `offsetUniformScale` | `number` | No | Uniform scale multiplier. |
522
- | `collisionsEnabled` | `boolean` | No | Enable or disable collisions. |
523
- | `currentAnimation` | `string` | No | Name of the animation. |
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. |
524
541
 
525
542
  Only the fields you send are changed — the backend merges them into the stored item before pushing the full payload to Unreal.
526
543
 
@@ -1037,22 +1054,29 @@ type UpdateSketchfabObjectInput = {
1037
1054
  ### Bounding Box Types
1038
1055
 
1039
1056
  ```typescript
1057
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
1058
+
1040
1059
  type CreateBoundingBoxObjectInput = {
1041
1060
  orgId: string;
1042
1061
  spaceId: string;
1043
1062
  spaceItemId: string;
1044
1063
  name: string;
1045
- type: "BoundingBoxRuntimeModel";
1046
- gltfUrl: string;
1064
+ type: BoundingBoxType;
1065
+ // Required for BoundingBoxRuntimeModel; unused by MultiModelBoundingBox.
1066
+ gltfUrl?: string;
1047
1067
  materialOverrideId: string;
1048
1068
  scale: Vector3;
1049
1069
  autoScale: boolean;
1050
1070
  offsetUpPosition: number;
1051
1071
  offsetUniformScale: number;
1052
1072
  collisionsEnabled: boolean;
1073
+ disableClick: boolean;
1074
+ // Not on the multi-model struct — Unreal never reads or writes these for it.
1053
1075
  currentAnimation?: string;
1054
1076
  availableAnimations?: string[];
1055
1077
  thumb?: string;
1078
+ // Required (non-empty) for MultiModelBoundingBox; empty for BoundingBoxRuntimeModel.
1079
+ gltfUrls: string[];
1056
1080
  position: Vector3;
1057
1081
  rotation: Vector3;
1058
1082
  offsetUpRotation: number;
@@ -1071,6 +1095,8 @@ type UpdateBoundingBoxObjectInput = {
1071
1095
  offsetUniformScale?: number;
1072
1096
  collisionsEnabled?: boolean;
1073
1097
  currentAnimation?: string;
1098
+ disableClick?: boolean;
1099
+ gltfUrls?: string[];
1074
1100
  };
1075
1101
  ```
1076
1102
 
package/dist/index.d.mts CHANGED
@@ -29,19 +29,22 @@ type SpaceContext = {
29
29
  user?: string;
30
30
  };
31
31
 
32
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
32
33
  type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
33
34
  spaceItemId: string;
34
- type: "BoundingBoxRuntimeModel";
35
- gltfUrl: string;
35
+ type: BoundingBoxType;
36
+ gltfUrl?: string;
36
37
  materialOverrideId: string;
37
38
  scale: Vector3;
38
39
  autoScale: boolean;
39
40
  offsetUpPosition: number;
40
41
  offsetUniformScale: number;
41
42
  collisionsEnabled: boolean;
43
+ disableClick: boolean;
42
44
  currentAnimation?: string;
43
45
  availableAnimations?: string[];
44
46
  thumb?: string;
47
+ gltfUrls: string[];
45
48
  };
46
49
  type UpdateBoundingBoxObjectInput = {
47
50
  orgId: string;
@@ -54,6 +57,8 @@ type UpdateBoundingBoxObjectInput = {
54
57
  offsetUniformScale?: number;
55
58
  collisionsEnabled?: boolean;
56
59
  currentAnimation?: string;
60
+ disableClick?: boolean;
61
+ gltfUrls?: string[];
57
62
  };
58
63
 
59
64
  /**
@@ -386,4 +391,4 @@ declare const ConfiguratorSDK: {
386
391
  readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
387
392
  };
388
393
 
389
- export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateBoundingBoxObjectInput, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateBoundingBoxObjectInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
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
@@ -29,19 +29,22 @@ type SpaceContext = {
29
29
  user?: string;
30
30
  };
31
31
 
32
+ type BoundingBoxType = "BoundingBoxRuntimeModel" | "MultiModelBoundingBox";
32
33
  type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
33
34
  spaceItemId: string;
34
- type: "BoundingBoxRuntimeModel";
35
- gltfUrl: string;
35
+ type: BoundingBoxType;
36
+ gltfUrl?: string;
36
37
  materialOverrideId: string;
37
38
  scale: Vector3;
38
39
  autoScale: boolean;
39
40
  offsetUpPosition: number;
40
41
  offsetUniformScale: number;
41
42
  collisionsEnabled: boolean;
43
+ disableClick: boolean;
42
44
  currentAnimation?: string;
43
45
  availableAnimations?: string[];
44
46
  thumb?: string;
47
+ gltfUrls: string[];
45
48
  };
46
49
  type UpdateBoundingBoxObjectInput = {
47
50
  orgId: string;
@@ -54,6 +57,8 @@ type UpdateBoundingBoxObjectInput = {
54
57
  offsetUniformScale?: number;
55
58
  collisionsEnabled?: boolean;
56
59
  currentAnimation?: string;
60
+ disableClick?: boolean;
61
+ gltfUrls?: string[];
57
62
  };
58
63
 
59
64
  /**
@@ -386,4 +391,4 @@ declare const ConfiguratorSDK: {
386
391
  readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
387
392
  };
388
393
 
389
- export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateBoundingBoxObjectInput, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateBoundingBoxObjectInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
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.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":["axios"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,S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A,GAC5B,CAAA;AAED,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,IAAA,EAAK;AAAA,IAC3B,WAAA,EAAa,sBAAA;AAAA,IACb,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,WAAA,EAAa,wBAAwB,IAAI,CAAA;AAAA,IACzC,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,iBAAA,EAAmB,8BAA8B,IAAI,CAAA;AAAA,IACrD,mBAAA,EAAqB,gCAAgC,IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-sdk-key\": config.apiKey.trim(),\n ...(config.jwksUri?.trim() && { \"x-jwks-uri\": config.jwksUri.trim() }),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addObject(data: CreateBoundingBoxObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addObject(data: CreateBoundingBoxObjectInput): Promise<void> {\n await http.post(\"/boundingbox/object\", data);\n debugLog(\"BoundingBox\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"./types/boundingBox\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":["axios"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,SAAS,eAAA,CAAgB,SAAiB,KAAA,EAA8B;AAC7E,EAAA,OAAO,SAAA,CAAU,iBAAA,EAAmB,YAAA,EAAc,OAAA,EAAS,KAAK,CAAA;AAClE;AAGO,SAAS,kBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,oBAAA,EAAsB,eAAA,EAAiB,OAAA,EAAS,KAAK,CAAA;AACxE;AAGO,SAAS,qBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,uBAAA,EAAyB,kBAAA,EAAoB,OAAA,EAAS,KAAK,CAAA;AAC9E;AAGO,SAAS,iBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,mBAAA,EAAq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AAM,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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":[],"mappings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yB,WAAW,CAAA,cAAA,CAAA;AAAA,MACpC;AAAA,KACF;AACA,IAAA,QAAA,CAA2D,CAAA;AAAA,EAC7D;AAEA,EAAA,OAAO,EAAE,QAAQ,mBAAA,EAAoB;AACvC;;;ACHO,SAAS,sBACd,MAAA,EACuB;AACvB,EAAA,MAAM,IAAA,GAAO,iBAAiB,MAAM,CAAA;AAEpC,EAAA,QAAA,CAAS,mBAAmB,aAAA,EAAe;AAAA,IACzC,OAAA,EAAS,OAAO,OAAA,IAAW;AAAA,GAC5B,CAAA;AAED,EAAA,OAAO;AAAA,IACL,MAAA,EAAQ,MAAA,CAAO,MAAA,CAAO,IAAA,EAAK;AAAA,IAC3B,WAAA,EAAa,sBAAA;AAAA,IACb,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,WAAA,EAAa,wBAAwB,IAAI,CAAA;AAAA,IACzC,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,iBAAA,EAAmB,8BAA8B,IAAI,CAAA;AAAA,IACrD,mBAAA,EAAqB,gCAAgC,IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.mjs","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-sdk-key\": config.apiKey.trim(),\n ...(config.jwksUri?.trim() && { \"x-jwks-uri\": config.jwksUri.trim() }),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addObject(data: CreateBoundingBoxObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addObject(data: CreateBoundingBoxObjectInput): Promise<void> {\n await http.post(\"/boundingbox/object\", data);\n debugLog(\"BoundingBox\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"./types/boundingBox\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
1
+ {"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,SAAS,eAAA,CAAgB,SAAiB,KAAA,EAA8B;AAC7E,EAAA,OAAO,SAAA,CAAU,iBAAA,EAAmB,YAAA,EAAc,OAAA,EAAS,KAAK,CAAA;AAClE;AAGO,SAAS,kBAAA,CACd,SAC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B,IAAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,WAAA,EAAa,wBAAwB,IAAI,CAAA;AAAA,IACzC,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,iBAAA,EAAmB,8BAA8B,IAAI,CAAA;AAAA,IACrD,mBAAA,EAAqB,gCAAgC,IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.mjs","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-sdk-key\": config.apiKey.trim(),\n ...(config.jwksUri?.trim() && { \"x-jwks-uri\": config.jwksUri.trim() }),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Bounding Box Module - Bounding Box 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateBoundingBoxObjectInput,\n UpdateBoundingBoxObjectInput,\n} from \"../types/boundingBox\";\nimport { debugLog } from \"../utils\";\n\nexport interface BoundingBoxHandle {\n addObject(data: CreateBoundingBoxObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void>;\n}\n\nexport function createBoundingBoxModule(\n http: AxiosInstance,\n): BoundingBoxHandle {\n async function addObject(data: CreateBoundingBoxObjectInput): Promise<void> {\n await http.post(\"/boundingbox/object\", data);\n debugLog(\"BoundingBox\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateBoundingBoxObjectInput,\n ): Promise<void> {\n await http.patch(`/boundingbox/${spaceItemId}`, data);\n debugLog(\"BoundingBox\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport {\n createBoundingBoxModule,\n BoundingBoxHandle,\n} from \"./modules/boundingBox\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n boundingBox: BoundingBoxHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n boundingBox: createBoundingBoxModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Bounding Box\nexport type {\n 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.11",
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",