@alliumcloud/configurator-service 1.5.10 → 1.5.11
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 +129 -1
- package/dist/index.d.mts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Official TypeScript SDK for the Allium Configurator backend. Provides a fully ty
|
|
|
18
18
|
- [API Reference](#api-reference)
|
|
19
19
|
- [Media](#media)
|
|
20
20
|
- [Sketchfab](#sketchfab)
|
|
21
|
+
- [Bounding Box](#bounding-box)
|
|
21
22
|
- [Transform](#transform)
|
|
22
23
|
- [Layer](#layer)
|
|
23
24
|
- [Configurator Items](#configurator-items)
|
|
@@ -27,6 +28,7 @@ Official TypeScript SDK for the Allium Configurator backend. Provides a fully ty
|
|
|
27
28
|
- [Common](#common)
|
|
28
29
|
- [Media Types](#media-types)
|
|
29
30
|
- [Sketchfab Types](#sketchfab-types)
|
|
31
|
+
- [Bounding Box Types](#bounding-box-types)
|
|
30
32
|
- [Transform Types](#transform-types)
|
|
31
33
|
- [Layer Types](#layer-types)
|
|
32
34
|
- [Configurator Item Types](#configurator-item-types)
|
|
@@ -110,6 +112,7 @@ createConfiguratorSDK({ apiKey })
|
|
|
110
112
|
│
|
|
111
113
|
├── sdk.media → /media
|
|
112
114
|
├── sdk.sketchfab → /sketchfab
|
|
115
|
+
├── sdk.boundingBox → /boundingbox
|
|
113
116
|
├── sdk.transform → /transform
|
|
114
117
|
├── sdk.layer → /layer
|
|
115
118
|
├── sdk.configuratorItems → /configurator_items
|
|
@@ -443,6 +446,88 @@ await sdk.sketchfab.updateObject("item-id", {
|
|
|
443
446
|
|
|
444
447
|
---
|
|
445
448
|
|
|
449
|
+
### Bounding Box
|
|
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.
|
|
452
|
+
|
|
453
|
+
#### `sdk.boundingBox.addObject(data)`
|
|
454
|
+
|
|
455
|
+
Add a bounding box 3D model to a space.
|
|
456
|
+
|
|
457
|
+
```typescript
|
|
458
|
+
await sdk.boundingBox.addObject({
|
|
459
|
+
orgId: "org-id",
|
|
460
|
+
spaceId: "space-id",
|
|
461
|
+
spaceItemId: "item-id",
|
|
462
|
+
name: "Living Room Bounding Box",
|
|
463
|
+
type: "BoundingBoxRuntimeModel",
|
|
464
|
+
gltfUrl: "https://.../chair.glb",
|
|
465
|
+
materialOverrideId: "None",
|
|
466
|
+
scale: { x: 1, y: 1, z: 1 },
|
|
467
|
+
autoScale: false,
|
|
468
|
+
offsetUpPosition: 0,
|
|
469
|
+
offsetUniformScale: 1,
|
|
470
|
+
collisionsEnabled: true,
|
|
471
|
+
position: { x: 0, y: 300, z: 90 },
|
|
472
|
+
rotation: { x: 0, y: 0, z: 0 },
|
|
473
|
+
offsetUpRotation: 0,
|
|
474
|
+
});
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
| Field | Type | Required | Description |
|
|
478
|
+
| -------------------- | --------- | -------- | ------------------------------------------------------------------ |
|
|
479
|
+
| `orgId` | `string` | Yes | Organization ID. |
|
|
480
|
+
| `spaceId` | `string` | Yes | Space ID. |
|
|
481
|
+
| `type` | `string` | Yes | Must be `"BoundingBoxRuntimeModel"`. |
|
|
482
|
+
| `gltfUrl` | `string` | Yes | The `.glb` / `.gltf` to load. |
|
|
483
|
+
| `position` | `Vector3` | Yes | World location, Unreal units (cm). |
|
|
484
|
+
| `rotation` | `Vector3` | Yes | Euler degrees. |
|
|
485
|
+
| `scale` | `Vector3` | No | Per-axis scale. Defaults to `{ x: 1, y: 1, z: 1 }`. |
|
|
486
|
+
| `autoScale` | `boolean` | No | Let Unreal normalize the model to a target size. Defaults `false`. |
|
|
487
|
+
| `offsetUpPosition` | `number` | No | Vertical offset on top of `position`. Defaults `0`. |
|
|
488
|
+
| `offsetUniformScale` | `number` | No | Uniform multiplier on top of `scale`. Defaults `1`. |
|
|
489
|
+
| `collisionsEnabled` | `boolean` | No | Defaults `true`. |
|
|
490
|
+
| `materialOverrideId` | `string` | No | Defaults `"None"`. Carried, not yet applied to the mesh. |
|
|
491
|
+
| `currentAnimation` | `string` | No | Animation name. Carried, not driven. |
|
|
492
|
+
|
|
493
|
+
> The transform positions the **centre of the fitted box**, not the glTF's own origin. A model authored with an off-centre or foot-level pivot will not land where an origin-relative caller expects.
|
|
494
|
+
|
|
495
|
+
**Returns:** `Promise<void>`
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
#### `sdk.boundingBox.updateObject(spaceItemId, data)`
|
|
500
|
+
|
|
501
|
+
Update an existing bounding box. Changing `gltfUrl` swaps the mesh in place and refits the collider.
|
|
502
|
+
|
|
503
|
+
```typescript
|
|
504
|
+
await sdk.boundingBox.updateObject("item-id", {
|
|
505
|
+
orgId: "org-id",
|
|
506
|
+
spaceId: "space-id",
|
|
507
|
+
spaceItemId: "item-id",
|
|
508
|
+
collisionsEnabled: false,
|
|
509
|
+
});
|
|
510
|
+
```
|
|
511
|
+
|
|
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. |
|
|
524
|
+
|
|
525
|
+
Only the fields you send are changed — the backend merges them into the stored item before pushing the full payload to Unreal.
|
|
526
|
+
|
|
527
|
+
**Returns:** `Promise<void>`
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
446
531
|
### Transform
|
|
447
532
|
|
|
448
533
|
#### `sdk.transform.updatePosition(spaceItemId, data)`
|
|
@@ -747,7 +832,8 @@ type SpaceItemType =
|
|
|
747
832
|
| "RuntimeStream"
|
|
748
833
|
| "BridgeToolkitSettings"
|
|
749
834
|
| "Configurator"
|
|
750
|
-
| "ConfiguratorObject"
|
|
835
|
+
| "ConfiguratorObject"
|
|
836
|
+
| "BoundingBoxRuntimeModel";
|
|
751
837
|
|
|
752
838
|
type ConfiguratorType =
|
|
753
839
|
| "string"
|
|
@@ -948,6 +1034,48 @@ type UpdateSketchfabObjectInput = {
|
|
|
948
1034
|
|
|
949
1035
|
---
|
|
950
1036
|
|
|
1037
|
+
### Bounding Box Types
|
|
1038
|
+
|
|
1039
|
+
```typescript
|
|
1040
|
+
type CreateBoundingBoxObjectInput = {
|
|
1041
|
+
orgId: string;
|
|
1042
|
+
spaceId: string;
|
|
1043
|
+
spaceItemId: string;
|
|
1044
|
+
name: string;
|
|
1045
|
+
type: "BoundingBoxRuntimeModel";
|
|
1046
|
+
gltfUrl: string;
|
|
1047
|
+
materialOverrideId: string;
|
|
1048
|
+
scale: Vector3;
|
|
1049
|
+
autoScale: boolean;
|
|
1050
|
+
offsetUpPosition: number;
|
|
1051
|
+
offsetUniformScale: number;
|
|
1052
|
+
collisionsEnabled: boolean;
|
|
1053
|
+
currentAnimation?: string;
|
|
1054
|
+
availableAnimations?: string[];
|
|
1055
|
+
thumb?: string;
|
|
1056
|
+
position: Vector3;
|
|
1057
|
+
rotation: Vector3;
|
|
1058
|
+
offsetUpRotation: number;
|
|
1059
|
+
isLocked?: boolean;
|
|
1060
|
+
user?: string;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
type UpdateBoundingBoxObjectInput = {
|
|
1064
|
+
orgId: string;
|
|
1065
|
+
spaceId: string;
|
|
1066
|
+
spaceItemId: string;
|
|
1067
|
+
gltfUrl?: string;
|
|
1068
|
+
materialOverrideId?: string;
|
|
1069
|
+
scale?: Vector3;
|
|
1070
|
+
autoScale?: boolean;
|
|
1071
|
+
offsetUniformScale?: number;
|
|
1072
|
+
collisionsEnabled?: boolean;
|
|
1073
|
+
currentAnimation?: string;
|
|
1074
|
+
};
|
|
1075
|
+
```
|
|
1076
|
+
|
|
1077
|
+
---
|
|
1078
|
+
|
|
951
1079
|
### Transform Types
|
|
952
1080
|
|
|
953
1081
|
```typescript
|
package/dist/index.d.mts
CHANGED
|
@@ -9,7 +9,7 @@ type ConfiguratorServiceSDKConfig = {
|
|
|
9
9
|
/** @internal - dev only, not for production use */
|
|
10
10
|
_devBaseUrl?: string;
|
|
11
11
|
};
|
|
12
|
-
type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject";
|
|
12
|
+
type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject" | "BoundingBoxRuntimeModel";
|
|
13
13
|
type ConfiguratorType = "string" | "number" | "boolean" | "enum" | "trigger" | "image" | "String" | "Number" | "Bool" | "Enum" | "Trigger" | "Image";
|
|
14
14
|
type Vector3 = {
|
|
15
15
|
x: number;
|
|
@@ -29,6 +29,42 @@ type SpaceContext = {
|
|
|
29
29
|
user?: string;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
|
|
33
|
+
spaceItemId: string;
|
|
34
|
+
type: "BoundingBoxRuntimeModel";
|
|
35
|
+
gltfUrl: string;
|
|
36
|
+
materialOverrideId: string;
|
|
37
|
+
scale: Vector3;
|
|
38
|
+
autoScale: boolean;
|
|
39
|
+
offsetUpPosition: number;
|
|
40
|
+
offsetUniformScale: number;
|
|
41
|
+
collisionsEnabled: boolean;
|
|
42
|
+
currentAnimation?: string;
|
|
43
|
+
availableAnimations?: string[];
|
|
44
|
+
thumb?: string;
|
|
45
|
+
};
|
|
46
|
+
type UpdateBoundingBoxObjectInput = {
|
|
47
|
+
orgId: string;
|
|
48
|
+
spaceId: string;
|
|
49
|
+
spaceItemId: string;
|
|
50
|
+
gltfUrl?: string;
|
|
51
|
+
materialOverrideId?: string;
|
|
52
|
+
scale?: Vector3;
|
|
53
|
+
autoScale?: boolean;
|
|
54
|
+
offsetUniformScale?: number;
|
|
55
|
+
collisionsEnabled?: boolean;
|
|
56
|
+
currentAnimation?: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Bounding Box Module - Bounding Box 3D Object Operations
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
interface BoundingBoxHandle {
|
|
64
|
+
addObject(data: CreateBoundingBoxObjectInput): Promise<void>;
|
|
65
|
+
updateObject(spaceItemId: string, data: UpdateBoundingBoxObjectInput): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
type SpatialMediaTypes = "video" | "link";
|
|
33
69
|
type SpatialMediaBase = Omit<SpaceContext, "type"> & {
|
|
34
70
|
type: "SpatialMedia";
|
|
@@ -335,6 +371,7 @@ interface ConfiguratorSDKHandle {
|
|
|
335
371
|
readonly serviceType: "CONFIGURATOR_SERVICE";
|
|
336
372
|
media: MediaHandle;
|
|
337
373
|
sketchfab: SketchfabHandle;
|
|
374
|
+
boundingBox: BoundingBoxHandle;
|
|
338
375
|
transform: TransformHandle;
|
|
339
376
|
layer: LayerHandle;
|
|
340
377
|
configuratorItems: ConfiguratorItemsHandle;
|
|
@@ -349,4 +386,4 @@ declare const ConfiguratorSDK: {
|
|
|
349
386
|
readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
|
|
350
387
|
};
|
|
351
388
|
|
|
352
|
-
export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ type ConfiguratorServiceSDKConfig = {
|
|
|
9
9
|
/** @internal - dev only, not for production use */
|
|
10
10
|
_devBaseUrl?: string;
|
|
11
11
|
};
|
|
12
|
-
type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject";
|
|
12
|
+
type SpaceItemType = "RuntimeModel" | "SpatialMedia" | "LibraryModel" | "RuntimeStream" | "BridgeToolkitSettings" | "Configurator" | "ConfiguratorObject" | "BoundingBoxRuntimeModel";
|
|
13
13
|
type ConfiguratorType = "string" | "number" | "boolean" | "enum" | "trigger" | "image" | "String" | "Number" | "Bool" | "Enum" | "Trigger" | "Image";
|
|
14
14
|
type Vector3 = {
|
|
15
15
|
x: number;
|
|
@@ -29,6 +29,42 @@ type SpaceContext = {
|
|
|
29
29
|
user?: string;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
type CreateBoundingBoxObjectInput = Omit<SpaceContext, "type"> & {
|
|
33
|
+
spaceItemId: string;
|
|
34
|
+
type: "BoundingBoxRuntimeModel";
|
|
35
|
+
gltfUrl: string;
|
|
36
|
+
materialOverrideId: string;
|
|
37
|
+
scale: Vector3;
|
|
38
|
+
autoScale: boolean;
|
|
39
|
+
offsetUpPosition: number;
|
|
40
|
+
offsetUniformScale: number;
|
|
41
|
+
collisionsEnabled: boolean;
|
|
42
|
+
currentAnimation?: string;
|
|
43
|
+
availableAnimations?: string[];
|
|
44
|
+
thumb?: string;
|
|
45
|
+
};
|
|
46
|
+
type UpdateBoundingBoxObjectInput = {
|
|
47
|
+
orgId: string;
|
|
48
|
+
spaceId: string;
|
|
49
|
+
spaceItemId: string;
|
|
50
|
+
gltfUrl?: string;
|
|
51
|
+
materialOverrideId?: string;
|
|
52
|
+
scale?: Vector3;
|
|
53
|
+
autoScale?: boolean;
|
|
54
|
+
offsetUniformScale?: number;
|
|
55
|
+
collisionsEnabled?: boolean;
|
|
56
|
+
currentAnimation?: string;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Bounding Box Module - Bounding Box 3D Object Operations
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
interface BoundingBoxHandle {
|
|
64
|
+
addObject(data: CreateBoundingBoxObjectInput): Promise<void>;
|
|
65
|
+
updateObject(spaceItemId: string, data: UpdateBoundingBoxObjectInput): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
type SpatialMediaTypes = "video" | "link";
|
|
33
69
|
type SpatialMediaBase = Omit<SpaceContext, "type"> & {
|
|
34
70
|
type: "SpatialMedia";
|
|
@@ -335,6 +371,7 @@ interface ConfiguratorSDKHandle {
|
|
|
335
371
|
readonly serviceType: "CONFIGURATOR_SERVICE";
|
|
336
372
|
media: MediaHandle;
|
|
337
373
|
sketchfab: SketchfabHandle;
|
|
374
|
+
boundingBox: BoundingBoxHandle;
|
|
338
375
|
transform: TransformHandle;
|
|
339
376
|
layer: LayerHandle;
|
|
340
377
|
configuratorItems: ConfiguratorItemsHandle;
|
|
@@ -349,4 +386,4 @@ declare const ConfiguratorSDK: {
|
|
|
349
386
|
readonly create: (config: ConfiguratorServiceSDKConfig) => ConfiguratorSDKHandle;
|
|
350
387
|
};
|
|
351
388
|
|
|
352
|
-
export { type AlliumError, type ConfiguratorSDKHandle, type ConfiguratorServiceSDKConfig, type CreateConfiguratorItemInput, type CreateConfiguratorObjectInput, type CreateLinkInput, type CreateSketchfabObjectInput, type CreateStreamInput, type CreateVideoInput, type DeleteAllLayerItemsInput, type DeleteLayerItemInput, type LockLayerItemInput, type RenameLayerItemInput, type SnapToGroundInput, type UpdateConfiguratorItemStateInput, type UpdateConfiguratorObjectConfigInput, type UpdateLinkInput, type UpdatePositionInput, type UpdateRotationInput, type UpdateScaleInput, type UpdateSketchfabObjectInput, type UpdateStreamInput, type UpdateVideoInput, createConfiguratorSDK, ConfiguratorSDK as default, isAlliumError };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -130,6 +130,19 @@ function createHttpClient(config) {
|
|
|
130
130
|
return client;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
// src/modules/boundingBox.ts
|
|
134
|
+
function createBoundingBoxModule(http) {
|
|
135
|
+
async function addObject(data) {
|
|
136
|
+
await http.post("/boundingbox/object", data);
|
|
137
|
+
debugLog();
|
|
138
|
+
}
|
|
139
|
+
async function updateObject(spaceItemId, data) {
|
|
140
|
+
await http.patch(`/boundingbox/${spaceItemId}`, data);
|
|
141
|
+
debugLog();
|
|
142
|
+
}
|
|
143
|
+
return { addObject, updateObject };
|
|
144
|
+
}
|
|
145
|
+
|
|
133
146
|
// src/modules/media.ts
|
|
134
147
|
function createMediaModule(http) {
|
|
135
148
|
async function addVideo(data) {
|
|
@@ -261,6 +274,7 @@ function createConfiguratorSDK(config) {
|
|
|
261
274
|
serviceType: "CONFIGURATOR_SERVICE",
|
|
262
275
|
media: createMediaModule(http),
|
|
263
276
|
sketchfab: createSketchfabModule(http),
|
|
277
|
+
boundingBox: createBoundingBoxModule(http),
|
|
264
278
|
transform: createTransformModule(http),
|
|
265
279
|
layer: createLayerModule(http),
|
|
266
280
|
configuratorItems: createConfiguratorItemsModule(http),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":["axios"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa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AAI,CAAA;AAAA,IAC7B,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,SAAA,EAAW,sBAAsB,IAAI,CAAA;AAAA,IACrC,KAAA,EAAO,kBAAkB,IAAI,CAAA;AAAA,IAC7B,iBAAA,EAAmB,8BAA8B,IAAI,CAAA;AAAA,IACrD,mBAAA,EAAqB,gCAAgC,IAAI;AAAA,GAC3D;AACF;AAIA,IAAM,eAAA,GAAkB;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,OAAO,MAAA,EAA6D;AAClE,IAAA,OAAO,sBAAsB,MAAM,CAAA;AAAA,EACrC;AACF,CAAA;AAEA,IAAO,aAAA,GAAQ","file":"index.js","sourcesContent":["/**\n * SDK Error factories.\n */\n\nexport interface AlliumError extends Error {\n readonly code: string;\n}\n\nfunction makeError(\n name: string,\n code: string,\n message: string,\n cause?: unknown,\n): AlliumError {\n const err = new Error(message) as AlliumError;\n err.name = name;\n (err as any).code = code;\n if (cause !== undefined) (err as any).cause = cause;\n return err;\n}\n\n/** Generic SDK error — use when no specific category fits */\nexport function createSDKError(\n message: string,\n code = \"SDK_ERROR\",\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumSDKError\", code, message, cause);\n}\n\n/** Thrown when the API key is missing, invalid, or rejected by the server */\nexport function createAuthError(message: string, cause?: unknown): AlliumError {\n return makeError(\"AlliumAuthError\", \"AUTH_ERROR\", message, cause);\n}\n\n/** Thrown when the HTTP request itself fails (network, timeout, 5xx) */\nexport function createRequestError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumRequestError\", \"REQUEST_ERROR\", message, cause);\n}\n\n/** Thrown when the server returns a 4xx for bad input data */\nexport function createValidationError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumValidationError\", \"VALIDATION_ERROR\", message, cause);\n}\n\n/** Thrown for upload-specific failures (initiate, complete, abort) */\nexport function createUploadError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumUploadError\", \"UPLOAD_ERROR\", message, cause);\n}\n\n/** Thrown when SDK_BASE_URL or apiKey is not configured correctly */\nexport function createConfigError(\n message: string,\n cause?: unknown,\n): AlliumError {\n return makeError(\"AlliumConfigError\", \"INVALID_CONFIG\", message, cause);\n}\n\n/** Type guard — works for all Allium error factories */\nexport function isAlliumError(err: unknown): err is AlliumError {\n return err instanceof Error && \"code\" in err;\n}\n","/**\n * Centralised debug logging utility.\n */\n\ndeclare global {\n interface Window {\n ALLIUM_DEBUG?: boolean;\n }\n}\n\nexport const isDebugEnabled = (): boolean => {\n // Node.js environment\n if (typeof process !== \"undefined\" && process.env?.ALLIUM_DEBUG === \"true\") {\n return true;\n }\n // Browser environment\n if (typeof window !== \"undefined\" && window.ALLIUM_DEBUG === true) {\n return true;\n }\n return false;\n};\n\nexport const debugLog = (\n category: string,\n message: string,\n data?: unknown,\n): void => {\n if (!isDebugEnabled()) return;\n const timestamp = new Date().toISOString().slice(11, 23);\n if (data !== undefined) {\n } else {\n }\n};\n","/**\n * HTTP client factory.\n *\n * Creates and configures the axios instance used by all modules.\n * Handles:\n * - Base URL (baked in at build time)\n * - API key injection on every request via header\n * - Timeout\n * - Response unwrapping (your backend wraps all responses in { data: ... })\n * - Error normalization into AlliumError types\n */\n\nimport axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { ConfiguratorServiceSDKConfig } from \"../types/common\";\nimport {\n createAuthError,\n createConfigError,\n createRequestError,\n createValidationError,\n createUploadError,\n} from \"../errors\";\nimport { debugLog } from \"../utils\";\n\n// ─── Build-time URL ───────────────────────────────────────────────────────────\n\ndeclare const process: { env: { CONFIGURATOR_SERVICE_BASE_URL: string } };\nconst PROD_BASE_URL: string = process.env.CONFIGURATOR_SERVICE_BASE_URL;\n\n// ─── Factory ──────────────────────────────────────────────────────────────────\n\nexport function createHttpClient(\n config: ConfiguratorServiceSDKConfig,\n): AxiosInstance {\n const BASE_URL = config._devBaseUrl ?? PROD_BASE_URL;\n if (!BASE_URL) {\n throw createConfigError(\n \"[SDK] Base URL not configured. This SDK build is missing CONFIGURATOR_SERVICE_BASE_URL.\",\n );\n }\n\n if (\n !config.apiKey ||\n typeof config.apiKey !== \"string\" ||\n !config.apiKey.trim()\n ) {\n throw createConfigError(\"[SDK] A valid apiKey is required.\");\n }\n\n if (typeof config.accessTokenProvider !== \"function\")\n throw createConfigError(\"[SDK] accessTokenProvider must be a function.\");\n\n const client = axios.create({\n baseURL: BASE_URL,\n timeout: config.timeout ?? 30_000,\n headers: {\n \"Content-Type\": \"application/json\",\n \"x-sdk-key\": config.apiKey.trim(),\n ...(config.jwksUri?.trim() && { \"x-jwks-uri\": config.jwksUri.trim() }),\n },\n });\n\n // ── Request interceptor — debug logging ───────────────────────────────────\n client.interceptors.request.use(async (req) => {\n const token = await config.accessTokenProvider();\n if (token) {\n req.headers[\"Authorization\"] = `Bearer ${token}`;\n }\n debugLog(\n \"HTTP\",\n `→ ${req.method?.toUpperCase()} ${req.url}`,\n req.params ?? req.data,\n );\n return req;\n });\n\n // ── Response interceptor — unwrap + normalize errors ──────────────────────\n client.interceptors.response.use(\n (res) => {\n debugLog(\"HTTP\", `← ${res.status} ${res.config.url}`);\n return res;\n },\n (err: AxiosError) => {\n const status = err.response?.status;\n const message =\n (err.response?.data as any)?.message ?? err.message ?? \"Unknown error\";\n const url = err.config?.url ?? \"\";\n\n debugLog(\"HTTP\", `← ERROR ${status ?? \"network\"} ${url}`, message);\n\n if (!status) {\n // Network error — no response received at all\n throw createRequestError(\n `[SDK] Network error reaching ${url}: ${message}`,\n err,\n );\n }\n\n if (status === 401 || status === 403) {\n throw createAuthError(\n `[SDK] Authentication failed (${status}): ${message}`,\n err,\n );\n }\n\n if (status === 422 || status === 400) {\n throw createValidationError(\n `[SDK] Validation error (${status}): ${message}`,\n err,\n );\n }\n\n if (url.includes(\"/uploader\")) {\n throw createUploadError(\n `[SDK] Upload operation failed (${status}): ${message}`,\n err,\n );\n }\n\n throw createRequestError(\n `[SDK] Request failed (${status}): ${message}`,\n err,\n );\n },\n );\n\n return client;\n}\n","/**\n * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":["axios"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,SAAS,eAAA,CAAgB,SAAiB,KAAA,EAA8B;AAC7E,EAAA,OAAO,SAAA,CAAU,iBAAA,EAAmB,YAAA,EAAc,OAAA,EAAS,KAAK,CAAA;AAClE;AAGO,SAAS,kBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,oBAAA,EAAs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,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"]}
|
package/dist/index.mjs
CHANGED
|
@@ -122,6 +122,19 @@ function createHttpClient(config) {
|
|
|
122
122
|
return client;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// src/modules/boundingBox.ts
|
|
126
|
+
function createBoundingBoxModule(http) {
|
|
127
|
+
async function addObject(data) {
|
|
128
|
+
await http.post("/boundingbox/object", data);
|
|
129
|
+
debugLog();
|
|
130
|
+
}
|
|
131
|
+
async function updateObject(spaceItemId, data) {
|
|
132
|
+
await http.patch(`/boundingbox/${spaceItemId}`, data);
|
|
133
|
+
debugLog();
|
|
134
|
+
}
|
|
135
|
+
return { addObject, updateObject };
|
|
136
|
+
}
|
|
137
|
+
|
|
125
138
|
// src/modules/media.ts
|
|
126
139
|
function createMediaModule(http) {
|
|
127
140
|
async function addVideo(data) {
|
|
@@ -253,6 +266,7 @@ function createConfiguratorSDK(config) {
|
|
|
253
266
|
serviceType: "CONFIGURATOR_SERVICE",
|
|
254
267
|
media: createMediaModule(http),
|
|
255
268
|
sketchfab: createSketchfabModule(http),
|
|
269
|
+
boundingBox: createBoundingBoxModule(http),
|
|
256
270
|
transform: createTransformModule(http),
|
|
257
271
|
layer: createLayerModule(http),
|
|
258
272
|
configuratorItems: createConfiguratorItemsModule(http),
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":[],"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,IA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,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 * Media Module - Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateLinkInput,\n CreateStreamInput,\n CreateVideoInput,\n UpdateLinkInput,\n UpdateStreamInput,\n UpdateVideoInput,\n} from \"../types/media\";\nimport { debugLog } from \"../utils\";\n\nexport interface MediaHandle {\n addVideo(data: CreateVideoInput): Promise<void>;\n updateVideo(spaceItemId: string, data: UpdateVideoInput): Promise<void>;\n addStream(data: CreateStreamInput): Promise<void>;\n updateStream(spaceItemId: string, data: UpdateStreamInput): Promise<void>;\n addLink(data: CreateLinkInput): Promise<void>;\n updateLink(spaceItemId: string, data: UpdateLinkInput): Promise<void>;\n}\n\nexport function createMediaModule(http: AxiosInstance): MediaHandle {\n async function addVideo(data: CreateVideoInput): Promise<void> {\n await http.post(\"/media/video\", data);\n debugLog(\"Media\", \"addVideo\", data);\n }\n\n async function updateVideo(\n spaceItemId: string,\n data: UpdateVideoInput,\n ): Promise<void> {\n await http.patch(`/media/video/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateVideo\", data);\n }\n\n async function addStream(data: CreateStreamInput): Promise<void> {\n await http.post(\"/media/stream\", data);\n debugLog(\"Media\", \"addStream\", data);\n }\n\n async function updateStream(\n spaceItemId: string,\n data: UpdateStreamInput,\n ): Promise<void> {\n await http.patch(`/media/stream/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateStream\", data);\n }\n\n async function addLink(data: CreateLinkInput): Promise<void> {\n await http.post(\"/media/link\", data);\n debugLog(\"Media\", \"addLink\", data);\n }\n\n async function updateLink(\n spaceItemId: string,\n data: UpdateLinkInput,\n ): Promise<void> {\n await http.patch(`/media/link/${spaceItemId}`, data);\n debugLog(\"Media\", \"updateLink\", data);\n }\n\n return {\n addVideo,\n updateVideo,\n addStream,\n updateStream,\n addLink,\n updateLink,\n };\n}\n","/**\n * Sketchfab Module - 3D Object Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"../types/sketchfab\";\nimport { debugLog } from \"../utils\";\n\nexport interface SketchfabHandle {\n addObject(data: CreateSketchfabObjectInput): Promise<void>;\n updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void>;\n}\n\nexport function createSketchfabModule(http: AxiosInstance): SketchfabHandle {\n async function addObject(data: CreateSketchfabObjectInput): Promise<void> {\n await http.post(\"/sketchfab/object\", data);\n debugLog(\"Sketchfab\", \"addObject\", data);\n }\n\n async function updateObject(\n spaceItemId: string,\n data: UpdateSketchfabObjectInput,\n ): Promise<void> {\n await http.patch(`/sketchfab/${spaceItemId}`, data);\n debugLog(\"Sketchfab\", \"updateObject\", data);\n }\n\n return { addObject, updateObject };\n}\n","/**\n * Transform Module - Position, Rotation, Scale Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"../types/transform\";\nimport { debugLog } from \"../utils\";\n\nexport interface TransformHandle {\n updatePosition(spaceItemId: string, data: UpdatePositionInput): Promise<void>;\n updateRotation(spaceItemId: string, data: UpdateRotationInput): Promise<void>;\n updateScale(spaceItemId: string, data: UpdateScaleInput): Promise<void>;\n snapToGround(spaceItemId: string, data: SnapToGroundInput): Promise<void>;\n}\n\nexport function createTransformModule(http: AxiosInstance): TransformHandle {\n async function updatePosition(\n spaceItemId: string,\n data: UpdatePositionInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/position`, data);\n debugLog(\"Transform\", \"updatePosition\", data);\n }\n\n async function updateRotation(\n spaceItemId: string,\n data: UpdateRotationInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/rotation`, data);\n debugLog(\"Transform\", \"updateRotation\", data);\n }\n\n async function updateScale(\n spaceItemId: string,\n data: UpdateScaleInput,\n ): Promise<void> {\n await http.patch(`/transform/${spaceItemId}/scale`, data);\n debugLog(\"Transform\", \"updateScale\", data);\n }\n\n async function snapToGround(\n spaceItemId: string,\n data: SnapToGroundInput,\n ): Promise<void> {\n await http.post(`/transform/${spaceItemId}/snap`, data);\n debugLog(\"Transform\", \"snapToGround\", data);\n }\n\n return { updatePosition, updateRotation, updateScale, snapToGround };\n}\n","/**\n * Layer Module - Lock, Rename, Delete Operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"../types/layer\";\nimport { debugLog } from \"../utils\";\n\nexport interface LayerHandle {\n lockItem(spaceItemId: string, data: LockLayerItemInput): Promise<void>;\n renameItem(spaceItemId: string, data: RenameLayerItemInput): Promise<void>;\n deleteItem(spaceItemId: string, data: DeleteLayerItemInput): Promise<void>;\n deleteAll(data: DeleteAllLayerItemsInput): Promise<void>;\n}\n\nexport function createLayerModule(http: AxiosInstance): LayerHandle {\n async function lockItem(\n spaceItemId: string,\n data: LockLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/lock`, data);\n debugLog(\"Layer\", \"lockItem\", data);\n }\n\n async function renameItem(\n spaceItemId: string,\n data: RenameLayerItemInput,\n ): Promise<void> {\n await http.patch(`/layer/${spaceItemId}/rename`, data);\n debugLog(\"Layer\", \"renameItem\", data);\n }\n\n async function deleteItem(\n spaceItemId: string,\n data: DeleteLayerItemInput,\n ): Promise<void> {\n await http.delete(`/layer/${spaceItemId}`, { data });\n debugLog(\"Layer\", \"deleteItem\", data);\n }\n\n async function deleteAll(data: DeleteAllLayerItemsInput): Promise<void> {\n await http.delete(\"/layer\", { data });\n debugLog(\"Layer\", \"deleteAll\", data);\n }\n\n return { lockItem, renameItem, deleteItem, deleteAll };\n}\n","/**\n * Configurator Items Module - Level-wide property operations\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"../types/configuratorItems\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorItemsHandle {\n create(data: CreateConfiguratorItemInput): Promise<void>;\n updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorItemsModule(\n http: AxiosInstance,\n): ConfiguratorItemsHandle {\n async function create(data: CreateConfiguratorItemInput): Promise<void> {\n await http.post(\"/configurator_items\", data);\n debugLog(\"ConfiguratorItems\", \"create\", data);\n }\n\n async function updateState(\n spaceItemId: string,\n data: UpdateConfiguratorItemStateInput,\n ): Promise<void> {\n await http.patch(`/configurator_items/${spaceItemId}/state`, data);\n debugLog(\"ConfiguratorItems\", \"updateState\", data);\n }\n\n return { create, updateState };\n}\n","/**\n * Configurator Objects Module - UE Actor placement and configuration\n */\n\nimport { AxiosInstance } from \"axios\";\nimport {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"../types/configuratorObjects\";\nimport { debugLog } from \"../utils\";\n\nexport interface ConfiguratorObjectsHandle {\n create(data: CreateConfiguratorObjectInput): Promise<void>;\n updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void>;\n}\n\nexport function createConfiguratorObjectsModule(\n http: AxiosInstance,\n): ConfiguratorObjectsHandle {\n async function create(data: CreateConfiguratorObjectInput): Promise<void> {\n await http.post(\"/configurator_objects\", data);\n debugLog(\"ConfiguratorObjects\", \"create\", data);\n }\n\n async function updateConfiguration(\n spaceItemId: string,\n data: UpdateConfiguratorObjectConfigInput,\n ): Promise<void> {\n await http.patch(\n `/configurator_objects/${spaceItemId}/configuration`,\n data,\n );\n debugLog(\"ConfiguratorObjects\", \"updateConfiguration\", data);\n }\n\n return { create, updateConfiguration };\n}\n","import { createHttpClient } from \"./core/http\";\nimport { createMediaModule, MediaHandle } from \"./modules/media\";\nimport { createSketchfabModule, SketchfabHandle } from \"./modules/sketchfab\";\nimport { createTransformModule, TransformHandle } from \"./modules/transform\";\nimport { createLayerModule, LayerHandle } from \"./modules/layer\";\nimport {\n createConfiguratorItemsModule,\n ConfiguratorItemsHandle,\n} from \"./modules/configuratorItems\";\nimport {\n createConfiguratorObjectsModule,\n ConfiguratorObjectsHandle,\n} from \"./modules/configuratorObjects\";\nimport { ConfiguratorServiceSDKConfig } from \"./types/common\";\nimport { debugLog } from \"./utils\";\n\n// ─── Public handle interface ──────────────────────────────────────────────────\n\nexport interface ConfiguratorSDKHandle {\n readonly sdkKey: string;\n readonly serviceType: \"CONFIGURATOR_SERVICE\";\n media: MediaHandle;\n sketchfab: SketchfabHandle;\n transform: TransformHandle;\n layer: LayerHandle;\n configuratorItems: ConfiguratorItemsHandle;\n configuratorObjects: ConfiguratorObjectsHandle;\n}\n\n// ─── Factory function ─────────────────────────────────────────────────────────\n\nexport function createConfiguratorSDK(\n config: ConfiguratorServiceSDKConfig,\n): ConfiguratorSDKHandle {\n const http = createHttpClient(config);\n\n debugLog(\"ConfiguratorSDK\", \"Initialized\", {\n timeout: config.timeout ?? 30_000,\n });\n\n return {\n sdkKey: config.apiKey.trim(),\n serviceType: \"CONFIGURATOR_SERVICE\" as const,\n media: createMediaModule(http),\n sketchfab: createSketchfabModule(http),\n transform: createTransformModule(http),\n layer: createLayerModule(http),\n configuratorItems: createConfiguratorItemsModule(http),\n configuratorObjects: createConfiguratorObjectsModule(http),\n };\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst ConfiguratorSDK = {\n /**\n * Create a new SDK client instance.\n * @param config SDK configuration — apiKey is required, timeout is optional.\n */\n create(config: ConfiguratorServiceSDKConfig): ConfiguratorSDKHandle {\n return createConfiguratorSDK(config);\n },\n} as const;\n\nexport default ConfiguratorSDK;\n\n// ─── Type exports ─────────────────────────────────────────────────────────────\n\nexport type { ConfiguratorServiceSDKConfig } from \"./types/common\";\n\n// Media\nexport type {\n CreateVideoInput,\n UpdateVideoInput,\n CreateLinkInput,\n UpdateLinkInput,\n CreateStreamInput,\n UpdateStreamInput,\n} from \"./types/media\";\n\n// Sketchfab\nexport type {\n CreateSketchfabObjectInput,\n UpdateSketchfabObjectInput,\n} from \"./types/sketchfab\";\n\n// Transform\nexport type {\n UpdatePositionInput,\n UpdateRotationInput,\n UpdateScaleInput,\n SnapToGroundInput,\n} from \"./types/transform\";\n\n// Layer\nexport type {\n LockLayerItemInput,\n RenameLayerItemInput,\n DeleteLayerItemInput,\n DeleteAllLayerItemsInput,\n} from \"./types/layer\";\n\n// Configurator\nexport type {\n CreateConfiguratorItemInput,\n UpdateConfiguratorItemStateInput,\n} from \"./types/configuratorItems\";\n\nexport type {\n CreateConfiguratorObjectInput,\n UpdateConfiguratorObjectConfigInput,\n} from \"./types/configuratorObjects\";\n\nexport { isAlliumError } from \"./errors\";\nexport type { AlliumError } from \"./errors\";\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts","../src/utils/debug.ts","../src/core/http.ts","../src/modules/boundingBox.ts","../src/modules/media.ts","../src/modules/sketchfab.ts","../src/modules/transform.ts","../src/modules/layer.ts","../src/modules/configuratorItems.ts","../src/modules/configuratorObjects.ts","../src/index.ts"],"names":[],"mappings":";;;;;AAQA,SAAS,SAAA,CACP,IAAA,EACA,IAAA,EACA,OAAA,EACA,KAAA,EACa;AACb,EAAA,MAAM,GAAA,GAAM,IAAI,KAAA,CAAM,OAAO,CAAA;AAC7B,EAAA,GAAA,CAAI,IAAA,GAAO,IAAA;AACX,EAAC,IAAY,IAAA,GAAO,IAAA;AACpB,EAAA,IAAI,KAAA,KAAU,MAAA,EAAY,GAAA,CAAY,KAAA,GAAQ,KAAA;AAC9C,EAAA,OAAO,GAAA;AACT;AAYO,SAAS,eAAA,CAAgB,SAAiB,KAAA,EAA8B;AAC7E,EAAA,OAAO,SAAA,CAAU,iBAAA,EAAmB,YAAA,EAAc,OAAA,EAAS,KAAK,CAAA;AAClE;AAGO,SAAS,kBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,oBAAA,EAAsB,eAAA,EAAiB,OAAA,EAAS,KAAK,CAAA;AACxE;AAGO,SAAS,qBAAA,CACd,SACA,KAAA,EACa;AACb,EAAA,OAAO,SAAA,CAAU,uBAAA,EAAyB,kBAAA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AAA;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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alliumcloud/configurator-service",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.11",
|
|
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",
|