@preference-sl/prefconfigurator-wasm 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/_framework/{PrefConfigurator.Abstractions.1yznk6sqco.wasm → PrefConfigurator.Abstractions.fwvejvdcq3.wasm} +0 -0
  2. package/_framework/PrefConfigurator.Abstractions.fwvejvdcq3.wasm.br +0 -0
  3. package/_framework/{PrefConfigurator.Abstractions.1yznk6sqco.wasm.gz → PrefConfigurator.Abstractions.fwvejvdcq3.wasm.gz} +0 -0
  4. package/_framework/PrefConfigurator.Application.94zainehgq.wasm +0 -0
  5. package/_framework/PrefConfigurator.Application.94zainehgq.wasm.br +0 -0
  6. package/_framework/PrefConfigurator.Application.94zainehgq.wasm.gz +0 -0
  7. package/_framework/{PrefConfigurator.Infrastructure.0259fp5kaj.wasm → PrefConfigurator.Infrastructure.n5sneeto1e.wasm} +0 -0
  8. package/_framework/PrefConfigurator.Infrastructure.n5sneeto1e.wasm.br +0 -0
  9. package/_framework/PrefConfigurator.Infrastructure.n5sneeto1e.wasm.gz +0 -0
  10. package/_framework/{PrefConfigurator.Wasm.pxmidb5bkr.wasm → PrefConfigurator.Wasm.zfpvrzjrju.wasm} +0 -0
  11. package/_framework/PrefConfigurator.Wasm.zfpvrzjrju.wasm.br +0 -0
  12. package/_framework/PrefConfigurator.Wasm.zfpvrzjrju.wasm.gz +0 -0
  13. package/_framework/blazor.boot.json +9 -9
  14. package/_framework/blazor.boot.json.br +0 -0
  15. package/_framework/blazor.boot.json.gz +0 -0
  16. package/js/prefconfigurator-api.d.ts +127 -4
  17. package/package.json +1 -1
  18. package/_framework/PrefConfigurator.Abstractions.1yznk6sqco.wasm.br +0 -0
  19. package/_framework/PrefConfigurator.Application.lr3i5lxos0.wasm +0 -0
  20. package/_framework/PrefConfigurator.Application.lr3i5lxos0.wasm.br +0 -0
  21. package/_framework/PrefConfigurator.Application.lr3i5lxos0.wasm.gz +0 -0
  22. package/_framework/PrefConfigurator.Infrastructure.0259fp5kaj.wasm.br +0 -0
  23. package/_framework/PrefConfigurator.Infrastructure.0259fp5kaj.wasm.gz +0 -0
  24. package/_framework/PrefConfigurator.Wasm.pxmidb5bkr.wasm.br +0 -0
  25. package/_framework/PrefConfigurator.Wasm.pxmidb5bkr.wasm.gz +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "mainAssemblyName": "PrefConfigurator.Wasm",
3
3
  "resources": {
4
- "hash": "sha256-LSGqJM+DP6K6vtEns5Ay4P3VJxGPpyjxm54jX1/QI/Y=",
4
+ "hash": "sha256-wXkSwU8CGcQ2OQBdThgqd0sg5HEt7uiNzIvSEwzu6ws=",
5
5
  "fingerprinting": {
6
6
  "Microsoft.CSharp.soa7iupusj.wasm": "Microsoft.CSharp.wasm",
7
7
  "Microsoft.Extensions.Caching.Abstractions.9tfokavdri.wasm": "Microsoft.Extensions.Caching.Abstractions.wasm",
@@ -34,10 +34,10 @@
34
34
  "Microsoft.Extensions.Options.bzdoshyjeq.wasm": "Microsoft.Extensions.Options.wasm",
35
35
  "Microsoft.Extensions.Primitives.ii8zcoqmmf.wasm": "Microsoft.Extensions.Primitives.wasm",
36
36
  "Newtonsoft.Json.ou6h2ikg0u.wasm": "Newtonsoft.Json.wasm",
37
- "PrefConfigurator.Abstractions.1yznk6sqco.wasm": "PrefConfigurator.Abstractions.wasm",
38
- "PrefConfigurator.Application.lr3i5lxos0.wasm": "PrefConfigurator.Application.wasm",
39
- "PrefConfigurator.Infrastructure.0259fp5kaj.wasm": "PrefConfigurator.Infrastructure.wasm",
40
- "PrefConfigurator.Wasm.pxmidb5bkr.wasm": "PrefConfigurator.Wasm.wasm",
37
+ "PrefConfigurator.Abstractions.fwvejvdcq3.wasm": "PrefConfigurator.Abstractions.wasm",
38
+ "PrefConfigurator.Application.94zainehgq.wasm": "PrefConfigurator.Application.wasm",
39
+ "PrefConfigurator.Infrastructure.n5sneeto1e.wasm": "PrefConfigurator.Infrastructure.wasm",
40
+ "PrefConfigurator.Wasm.zfpvrzjrju.wasm": "PrefConfigurator.Wasm.wasm",
41
41
  "Preference.Hydra.OpenApi.oba396x8m7.wasm": "Preference.Hydra.OpenApi.wasm",
42
42
  "System.Collections.Concurrent.kq7l3koqtq.wasm": "System.Collections.Concurrent.wasm",
43
43
  "System.Collections.NonGeneric.u4veqqwbpo.wasm": "System.Collections.NonGeneric.wasm",
@@ -134,10 +134,10 @@
134
134
  "Microsoft.Extensions.Options.bzdoshyjeq.wasm": "sha256-OUMXYxUKhNC6l0LAh4xpi+gy+X9b0XXW3pZh9YdZ9C8=",
135
135
  "Microsoft.Extensions.Primitives.ii8zcoqmmf.wasm": "sha256-Jt5QBSXSDEahiZ89Pn1MhJ9A3C/ftN8ZXaBGV9JgqwQ=",
136
136
  "Newtonsoft.Json.ou6h2ikg0u.wasm": "sha256-8EZ4H5Mb5yxuavrUzuw5k75ewxJQbdU+Y1rksETqPVo=",
137
- "PrefConfigurator.Abstractions.1yznk6sqco.wasm": "sha256-ucEFR8XJ6GtADcJ4t8HtMj1u+x59+zR+ndQfewl4jyE=",
138
- "PrefConfigurator.Application.lr3i5lxos0.wasm": "sha256-kYw/Thx6DmVT6MvO3NydXdYBeeTfYLRRSI2GR8JpTZ0=",
139
- "PrefConfigurator.Infrastructure.0259fp5kaj.wasm": "sha256-KLugSeR45UutfU01vVgmAgia7csLdX4DK+Nmil5VMG0=",
140
- "PrefConfigurator.Wasm.pxmidb5bkr.wasm": "sha256-nY1XwGNNnClZM0N1c+hqaAm/zcM8D/uxKuWqzW5aF2A=",
137
+ "PrefConfigurator.Abstractions.fwvejvdcq3.wasm": "sha256-AcjPdHc2v0fmc9D/vTd09C83tF40ncbSYXyunacoQxk=",
138
+ "PrefConfigurator.Application.94zainehgq.wasm": "sha256-Sf6GbUAIVedWGFXKPUOsDl0zinmnmH6EwtevGbgaxjQ=",
139
+ "PrefConfigurator.Infrastructure.n5sneeto1e.wasm": "sha256-S4RQVQtx1BZJLlEUS3NUTUwgNVpD2AxiVSx5sP928xo=",
140
+ "PrefConfigurator.Wasm.zfpvrzjrju.wasm": "sha256-cRa3stJ7A6Kp/4PU80OVWvD4s1G73D3xz0FkqePFr0w=",
141
141
  "Preference.Hydra.OpenApi.oba396x8m7.wasm": "sha256-BOitG9XqTGoVdagU40GvNefDuOylKCPs3Gp5VG0M3oY=",
142
142
  "System.Collections.Concurrent.kq7l3koqtq.wasm": "sha256-lDJetX8MOCPfYgq+j+JjNEwEFA9oW7BLaaNmAFUZQaE=",
143
143
  "System.Collections.NonGeneric.u4veqqwbpo.wasm": "sha256-Hlfxail2eLYOSROomwSdgZ3zfxPgxeQCs+6AiZn4uBE=",
Binary file
Binary file
@@ -89,16 +89,19 @@ export interface SetOptionValueResponse {
89
89
  message?: string | null;
90
90
  optionChanged?: boolean | null;
91
91
  }
92
+
92
93
  export interface SetOptionValueRequest {
93
94
  optionName: string;
94
95
  optionValue: string;
95
96
  }
97
+
96
98
  export interface SetOptionValueBatchResult {
97
99
  optionName: string;
98
100
  sent: boolean;
99
101
  reason?: string | null;
100
102
  response?: SetOptionValueResponse | null;
101
103
  }
104
+
102
105
  export interface SetOptionsResponse {
103
106
  requestedCount: number;
104
107
  sentCount: number;
@@ -155,6 +158,98 @@ export interface Scene {
155
158
  WallDatas: SceneWallData[];
156
159
  }
157
160
 
161
+ export interface EnvJson {
162
+ version?: number | null;
163
+
164
+ services: {
165
+ baseUrl: string;
166
+ hydraBaseUrl?: string | null;
167
+ prefWebBaseUrl?: string | null;
168
+ kbApiBaseUrl?: string | null;
169
+ cloudPrefWebBaseUrl?: string | null;
170
+ kbUiBaseUrl?: string | null;
171
+ wallGeneratorBaseUrl?: string | null;
172
+ };
173
+
174
+ maker: {
175
+ name?: string | null;
176
+ prefix?: string | null;
177
+ };
178
+
179
+ ui: {
180
+ definitionName?: string | null;
181
+ optionListName?: string | null;
182
+ };
183
+
184
+ auth: {
185
+ username?: string | null;
186
+ password?: string | null;
187
+ };
188
+
189
+ images: {
190
+ model: {
191
+ onlyModelImage: boolean;
192
+ type2D: number;
193
+ type3D: number;
194
+ width: number;
195
+ height: number;
196
+ daysToLive: number;
197
+ };
198
+ scene: {
199
+ name: string;
200
+ format: string;
201
+ };
202
+ materials: {
203
+ daysToLive: number;
204
+ };
205
+ };
206
+
207
+ storage: {
208
+ gltf: {
209
+ dbName: string;
210
+ storeName: string;
211
+ };
212
+ };
213
+
214
+ runtime: {
215
+ logLevel: string;
216
+ };
217
+
218
+ flags?: Record<string, boolean> | null;
219
+ extra?: Record<string, any | null> | null;
220
+ }
221
+
222
+ export enum ViewMode {
223
+ _0, _1, _2, _3
224
+ }
225
+
226
+ export enum ImageType {
227
+ _0, _1, _2, _3, _4, _5, _6, _7, _8, _9,
228
+ _10, _11, _12, _13, _14, _15, _16, _17
229
+ }
230
+
231
+ export interface CadRendererData {
232
+ viewMode: ViewMode;
233
+ cameraProjection?: number | null;
234
+ cameraPosition?: number | null;
235
+ predefinedView?: string | null;
236
+ backgroundColor?: number | null;
237
+ customProperties?: string | null;
238
+ texturesRootPath?: string | null;
239
+ base64Textures?: boolean | null;
240
+ }
241
+
242
+ export interface ModelImageConfig {
243
+ imageType: ImageType;
244
+ width: number;
245
+ height: number;
246
+ units: number;
247
+ usePrefOne: boolean;
248
+ languageId: number;
249
+ visualPropertiesXML?: string | null;
250
+ cadRenderer?: CadRendererData | null;
251
+ }
252
+
158
253
  export interface JsInteropApiRaw {
159
254
  InitializeFromEnvJson(json: string): void;
160
255
  GetOptions<T = EnhancedOptionList>(): Promise<OperationResult<T> | string>;
@@ -162,7 +257,7 @@ export interface JsInteropApiRaw {
162
257
  CreateItem<T = CreateItemResponse>(modelCode: string, isPersistable: boolean): Promise<OperationResult<T> | string>;
163
258
  GetDimensions<T = DimensionsResponse>(modelId: string): Promise<OperationResult<T> | string>;
164
259
  SetDimensions<T = SetDimensionsResponse>(modelId: string, dimensionName: string, dimensionValue: number): Promise<OperationResult<T> | string>;
165
- SetOptions<T = SetOptionsResponse>(modelId: string, options: SetOptionValueRequest[]): Promise<OperationResult<T> | string>;
260
+ SetOptions<T = SetOptionsResponse>(modelId: string, optionsJson: string): Promise<OperationResult<T> | string>;
166
261
  GetModelOptions<T = OptionInfo[]>(modelId: string): Promise<OperationResult<T> | string>;
167
262
  GetScene<T = Scene>(sceneName?: string, sceneFormat?: string, texturesRootPath?: string): Promise<OperationResult<T> | string>;
168
263
  GetModelImage(modelId: string, modelImageConfigJson: string, sceneName?: string): Promise<OperationResult<string> | string>;
@@ -186,11 +281,39 @@ export function ensureOk<T = JsonValue>(raw: RawOperation<T>): T;
186
281
 
187
282
  type AwaitedReturn<T> = T extends Promise<infer R> ? R : T;
188
283
  type ExtractData<R> = AwaitedReturn<R> extends OperationResult<infer D> ? D : JsonValue;
189
- type BoundMethod<F> = F extends (...args: infer A) => Promise<infer R>
284
+
285
+ type BoundMethod<F> =
286
+ F extends (...args: infer A) => Promise<infer R>
190
287
  ? (...args: A) => Promise<ExtractData<R>>
191
288
  : F;
192
- export type BoundApi<TRaw> = {
193
- [K in keyof TRaw]: TRaw[K] extends Function ? BoundMethod<TRaw[K]> : TRaw[K];
289
+
290
+ //
291
+ // BOUND API � PUBLIC API CORRECTLY TYPED
292
+ //
293
+
294
+ export type BoundApi<TRaw extends JsInteropApiRaw> = {
295
+ [K in keyof TRaw]: TRaw[K] extends Function
296
+ ? BoundMethod<TRaw[K]>
297
+ : TRaw[K];
298
+ } & {
299
+
300
+ InitializeFromEnvJson(config: EnvJson): void;
301
+
302
+ UpdateOptions(
303
+ optionList: OptionList,
304
+ changedOptionName: string
305
+ ): Promise<EnhancedOptionList>;
306
+
307
+ SetOptions(
308
+ modelId: string,
309
+ updates: SetOptionValueRequest[]
310
+ ): Promise<SetOptionsResponse>;
311
+
312
+ GetModelImage(
313
+ modelId: string,
314
+ config: ModelImageConfig,
315
+ sceneName?: string
316
+ ): Promise<string>;
194
317
  };
195
318
 
196
319
  export function bindApi<TRaw extends JsInteropApiRaw>(rawApi: TRaw): BoundApi<TRaw>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "postinstall": "node scripts/postinstall.js"
4
4
  },
5
5
  "description": ".NET WebAssembly runtime package that centralizes logic for building product configurators, exposing a simple API for integration into ecommerce platforms.",
6
- "version": "2.0.0",
6
+ "version": "2.0.2",
7
7
  "files": [
8
8
  "_framework/**",
9
9
  "**/*.js",