@viu/emporix-sdk 2.21.0 → 2.23.0

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 (114) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/dist/availability.cjs +118 -0
  3. package/dist/availability.cjs.map +1 -1
  4. package/dist/availability.d.cts +178 -2
  5. package/dist/availability.d.ts +178 -2
  6. package/dist/availability.js +1 -1
  7. package/dist/cart.cjs +215 -9
  8. package/dist/cart.cjs.map +1 -1
  9. package/dist/cart.d.cts +281 -3
  10. package/dist/cart.d.ts +281 -3
  11. package/dist/cart.js +1 -1
  12. package/dist/category.cjs +220 -2
  13. package/dist/category.cjs.map +1 -1
  14. package/dist/category.d.cts +408 -1
  15. package/dist/category.d.ts +408 -1
  16. package/dist/category.js +1 -1
  17. package/dist/{chunk-HD5RBCM6.js → chunk-27NLS646.js} +10 -2
  18. package/dist/chunk-27NLS646.js.map +1 -0
  19. package/dist/{chunk-PYLWZZC4.js → chunk-6PJFOX3A.js} +126 -2
  20. package/dist/chunk-6PJFOX3A.js.map +1 -0
  21. package/dist/chunk-HWVFF6B2.js +378 -0
  22. package/dist/chunk-HWVFF6B2.js.map +1 -0
  23. package/dist/chunk-LQFRJSVT.js +224 -0
  24. package/dist/chunk-LQFRJSVT.js.map +1 -0
  25. package/dist/chunk-P7G4LOOV.js +264 -0
  26. package/dist/chunk-P7G4LOOV.js.map +1 -0
  27. package/dist/{chunk-HBEQEIT6.js → chunk-PRN3T6TY.js} +63 -3
  28. package/dist/chunk-PRN3T6TY.js.map +1 -0
  29. package/dist/{chunk-44F52KRE.js → chunk-QQMLN76U.js} +27 -2
  30. package/dist/chunk-QQMLN76U.js.map +1 -0
  31. package/dist/chunk-UNW6SFSB.js +363 -0
  32. package/dist/chunk-UNW6SFSB.js.map +1 -0
  33. package/dist/chunk-V3275BA7.js +181 -0
  34. package/dist/chunk-V3275BA7.js.map +1 -0
  35. package/dist/chunk-W2KBVWJ2.js +323 -0
  36. package/dist/chunk-W2KBVWJ2.js.map +1 -0
  37. package/dist/chunk-YVZ6GOLE.js +399 -0
  38. package/dist/chunk-YVZ6GOLE.js.map +1 -0
  39. package/dist/chunk-ZOFGDNSX.js +305 -0
  40. package/dist/chunk-ZOFGDNSX.js.map +1 -0
  41. package/dist/companies.cjs +25 -0
  42. package/dist/companies.cjs.map +1 -1
  43. package/dist/companies.d.cts +14 -0
  44. package/dist/companies.d.ts +14 -0
  45. package/dist/companies.js +1 -1
  46. package/dist/contacts.cjs +8 -0
  47. package/dist/contacts.cjs.map +1 -1
  48. package/dist/contacts.d.cts +2 -0
  49. package/dist/contacts.d.ts +2 -0
  50. package/dist/contacts.js +1 -1
  51. package/dist/customer-groups-BxSNFHq1.d.cts +706 -0
  52. package/dist/customer-groups-GlzWhDsi.d.ts +706 -0
  53. package/dist/customer-groups.cjs +200 -17
  54. package/dist/customer-groups.cjs.map +1 -1
  55. package/dist/customer-groups.d.cts +2 -110
  56. package/dist/customer-groups.d.ts +2 -110
  57. package/dist/customer-groups.js +1 -1
  58. package/dist/customer.cjs +61 -1
  59. package/dist/customer.cjs.map +1 -1
  60. package/dist/customer.d.cts +48 -1
  61. package/dist/customer.d.ts +48 -1
  62. package/dist/customer.js +1 -1
  63. package/dist/index.cjs +2566 -554
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.d.cts +455 -12
  66. package/dist/index.d.ts +455 -12
  67. package/dist/index.js +687 -342
  68. package/dist/index.js.map +1 -1
  69. package/dist/orders.cjs +160 -2
  70. package/dist/orders.cjs.map +1 -1
  71. package/dist/orders.d.cts +221 -1
  72. package/dist/orders.d.ts +221 -1
  73. package/dist/orders.js +1 -1
  74. package/dist/payment.cjs +124 -0
  75. package/dist/payment.cjs.map +1 -1
  76. package/dist/payment.d.cts +335 -1
  77. package/dist/payment.d.ts +335 -1
  78. package/dist/payment.js +1 -1
  79. package/dist/price.cjs +197 -0
  80. package/dist/price.cjs.map +1 -1
  81. package/dist/price.d.cts +577 -1
  82. package/dist/price.d.ts +577 -1
  83. package/dist/price.js +1 -1
  84. package/dist/product.cjs +190 -0
  85. package/dist/product.cjs.map +1 -1
  86. package/dist/product.d.cts +503 -1
  87. package/dist/product.d.ts +503 -1
  88. package/dist/product.js +1 -1
  89. package/dist/segment.cjs +179 -0
  90. package/dist/segment.cjs.map +1 -1
  91. package/dist/segment.d.cts +181 -1
  92. package/dist/segment.d.ts +181 -1
  93. package/dist/segment.js +1 -1
  94. package/package.json +1 -1
  95. package/dist/chunk-36T4YPQJ.js +0 -106
  96. package/dist/chunk-36T4YPQJ.js.map +0 -1
  97. package/dist/chunk-3BTPX7IJ.js +0 -41
  98. package/dist/chunk-3BTPX7IJ.js.map +0 -1
  99. package/dist/chunk-44F52KRE.js.map +0 -1
  100. package/dist/chunk-A3LYJUD4.js +0 -108
  101. package/dist/chunk-A3LYJUD4.js.map +0 -1
  102. package/dist/chunk-FZMP5NQZ.js +0 -173
  103. package/dist/chunk-FZMP5NQZ.js.map +0 -1
  104. package/dist/chunk-HBEQEIT6.js.map +0 -1
  105. package/dist/chunk-HD5RBCM6.js.map +0 -1
  106. package/dist/chunk-HUEMYP2L.js +0 -193
  107. package/dist/chunk-HUEMYP2L.js.map +0 -1
  108. package/dist/chunk-IVCCGJN5.js +0 -63
  109. package/dist/chunk-IVCCGJN5.js.map +0 -1
  110. package/dist/chunk-NE7MIZPR.js +0 -144
  111. package/dist/chunk-NE7MIZPR.js.map +0 -1
  112. package/dist/chunk-PYLWZZC4.js.map +0 -1
  113. package/dist/chunk-ZNLHLFQM.js +0 -160
  114. package/dist/chunk-ZNLHLFQM.js.map +0 -1
@@ -44,6 +44,61 @@ type ClassificationMixin = {
44
44
  */
45
45
  sourceCategoryId?: string;
46
46
  };
47
+ type BulkAssignmentResponse = Array<{
48
+ /**
49
+ * ID of generated document.
50
+ */
51
+ assignmentId?: string;
52
+ /**
53
+ * ID of the product.
54
+ */
55
+ productId?: string;
56
+ /**
57
+ * Index of the item in the array.
58
+ */
59
+ index?: number;
60
+ /**
61
+ * HTTP status' code.
62
+ */
63
+ code?: number;
64
+ /**
65
+ * HTTP status.
66
+ */
67
+ status?: string;
68
+ /**
69
+ * Error message which is present only when creation of the assignment failed.
70
+ */
71
+ message?: string;
72
+ }>;
73
+ type AssignmentIdResponse = {
74
+ /**
75
+ * ID of generated document.
76
+ */
77
+ id?: string;
78
+ };
79
+ type BulkAssignmentRequest = Array<{
80
+ ref: {
81
+ /**
82
+ * Assignment reference unique identifier, for example product ID.
83
+ */
84
+ id: string;
85
+ /**
86
+ * Assignment reference type, for example 'product'.
87
+ */
88
+ type: 'PRODUCT';
89
+ };
90
+ }>;
91
+ type BulkAssignmentUpsertRequest = Array<{
92
+ ref: {
93
+ /**
94
+ * Assignment reference unique identifier, for example product ID.
95
+ */
96
+ id: string;
97
+ };
98
+ }>;
99
+ type AssignmentRequest = {
100
+ ref: Reference;
101
+ };
47
102
  /**
48
103
  * Definition of category
49
104
  */
@@ -122,6 +177,163 @@ type Category$1 = {
122
177
  metadata: MetadataResponse;
123
178
  media: Array<Media>;
124
179
  };
180
+ /**
181
+ * Definition od category assignment
182
+ */
183
+ type CategoryAssignment$1 = {
184
+ /**
185
+ * Assignment unique identifier generated when the assignment is created.
186
+ */
187
+ id?: string;
188
+ /**
189
+ * Assignment category identifier.
190
+ */
191
+ categoryId?: string;
192
+ ref?: CategoryAssignmentRefQueryDocument & unknown;
193
+ };
194
+ /**
195
+ * Localized category description in a form of a map of translations.
196
+ */
197
+ type CategoryAssignmentRefQueryDocument = {
198
+ /**
199
+ * Assignment reference unique identifier, for example product ID.
200
+ */
201
+ id: string;
202
+ /**
203
+ * Assignment reference type, for example 'product'.
204
+ */
205
+ type: 'PRODUCT';
206
+ /**
207
+ * Assignment reference localized name.
208
+ */
209
+ localizedName: {
210
+ [key: string]: string;
211
+ };
212
+ };
213
+ type CategoryCreateRequest = {
214
+ /**
215
+ * Custom category identifier. If not provided, it is automatically generated
216
+ */
217
+ id?: string;
218
+ /**
219
+ * Category type, by default it is `STANDARD`.
220
+ */
221
+ type?: 'CLASSIFICATION' | 'STANDARD';
222
+ /**
223
+ * Localized category name in a form of a map of translations.
224
+ */
225
+ localizedName: {
226
+ [key: string]: string;
227
+ };
228
+ /**
229
+ * Localized category description in a form of a map of translations.
230
+ */
231
+ localizedDescription?: {
232
+ [key: string]: string;
233
+ };
234
+ /**
235
+ * Unique identifier of the parent category. No parentId in the body indicates that this is a root category.
236
+ */
237
+ parentId?: string | null;
238
+ /**
239
+ * Provides localized category name or code without diacritics for the URL.
240
+ */
241
+ localizedSlug?: {
242
+ [key: string]: string;
243
+ };
244
+ /**
245
+ * List of external category numbers (ECNs) unique for every category.
246
+ */
247
+ ecn?: Array<string> | null;
248
+ /**
249
+ * Unique category identifier, defined by the tenant. Required for category of type `CLASSIFICATION`.
250
+ */
251
+ code?: string | null;
252
+ /**
253
+ * Category validity.
254
+ */
255
+ validity?: {
256
+ [key: string]: string;
257
+ };
258
+ /**
259
+ * Category position, set in relation to the categories on the same level (sharing the same parent) in the tree.
260
+ */
261
+ position?: number | null;
262
+ /**
263
+ * Flag indicating whether the category has been published or not.
264
+ */
265
+ published: boolean;
266
+ /**
267
+ * List of classification mixins defined by this category.
268
+ */
269
+ ownClassificationMixins?: Array<OwnClassificationMixin>;
270
+ /**
271
+ * Custom category attributes that need to be included directly in the mixins object.
272
+ */
273
+ mixins?: {
274
+ [key: string]: unknown;
275
+ };
276
+ metadata?: MetadataCreate;
277
+ };
278
+ type CategoryIdResponse = {
279
+ /**
280
+ * ID of generated document.
281
+ */
282
+ id?: string;
283
+ };
284
+ type CategoryPartialUpdateRequest = {
285
+ /**
286
+ * Localized category name in a form of a map of translations.
287
+ */
288
+ localizedName?: {
289
+ [key: string]: string;
290
+ };
291
+ /**
292
+ * Localized category description in a form of a map of translations.
293
+ */
294
+ localizedDescription?: {
295
+ [key: string]: string;
296
+ };
297
+ /**
298
+ * Unique identifier of the parent category. No parentId in the body indicates that this is a root category.
299
+ */
300
+ parentId?: string | null;
301
+ /**
302
+ * Provides localized category name or code without diacritics for the URL.
303
+ */
304
+ localizedSlug?: {
305
+ [key: string]: string;
306
+ };
307
+ /**
308
+ * List of external category numbers (ECNs) unique for every category.
309
+ */
310
+ ecn?: Array<string> | null;
311
+ /**
312
+ * Unique category identifier, defined by the tenant.
313
+ */
314
+ code?: string | null;
315
+ /**
316
+ * Category validity.
317
+ */
318
+ validity?: {
319
+ [key: string]: string;
320
+ };
321
+ /**
322
+ * Category position, set in relation to the categories on the same level (sharing the same parent) in the tree.
323
+ */
324
+ position?: number | null;
325
+ /**
326
+ * Flag indicating whether the category has been published or not.
327
+ */
328
+ published?: boolean | null;
329
+ /**
330
+ * Custom category attributes that need to be included directly in the mixins object.
331
+ */
332
+ mixins?: {
333
+ [key: string]: unknown;
334
+ };
335
+ metadata: MetadataUpdate;
336
+ };
125
337
  /**
126
338
  * Definition of category tree
127
339
  */
@@ -180,6 +392,59 @@ type CategoryTree = {
180
392
  */
181
393
  subcategories?: Array<CategoryTree>;
182
394
  };
395
+ type CategoryUpdateRequest = {
396
+ /**
397
+ * Localized category name in a form of a map of translations.
398
+ */
399
+ localizedName: {
400
+ [key: string]: string;
401
+ };
402
+ /**
403
+ * Localized category description in a form of a map of translations.
404
+ */
405
+ localizedDescription?: {
406
+ [key: string]: string;
407
+ };
408
+ /**
409
+ * Unique identifier of the parent category. No parentId in the body indicates that this is a root category.
410
+ */
411
+ parentId?: string | null;
412
+ /**
413
+ * Provides localized category name or code without diacritics for the URL.
414
+ */
415
+ localizedSlug?: {
416
+ [key: string]: string;
417
+ };
418
+ /**
419
+ * List of external category numbers (ECNs) unique for every category.
420
+ */
421
+ ecn?: Array<string> | null;
422
+ /**
423
+ * Unique category identifier, defined by the tenant. Required for category of type `CLASSIFICATION`.
424
+ */
425
+ code?: string | null;
426
+ /**
427
+ * Category validity.
428
+ */
429
+ validity?: {
430
+ [key: string]: string;
431
+ };
432
+ /**
433
+ * Category position, set in relation to the categories on the same level (sharing the same parent) in the tree.
434
+ */
435
+ position?: number | null;
436
+ /**
437
+ * Flag indicating whether the category has been published or not.
438
+ */
439
+ published: boolean;
440
+ /**
441
+ * Custom category attributes that need to be included directly in the mixins object.
442
+ */
443
+ mixins?: {
444
+ [key: string]: unknown;
445
+ };
446
+ metadata?: MetadataUpdate;
447
+ };
183
448
  type Media = {
184
449
  /**
185
450
  * Unique identifier of media.
@@ -268,6 +533,25 @@ type MetadataResponse = {
268
533
  */
269
534
  modifiedAt?: string;
270
535
  } & MetadataUpdate;
536
+ type CategoryTreeSearchRequest = {
537
+ /**
538
+ * List of category IDs. If provided, the response returns only the category trees that include at least one of the specified categories.
539
+ */
540
+ categoryIds: Array<string>;
541
+ };
542
+ /**
543
+ * Assignment reference.
544
+ */
545
+ type Reference = {
546
+ /**
547
+ * Assignment reference unique identifier, for example product ID.
548
+ */
549
+ id: string;
550
+ /**
551
+ * Assignment reference type, for example 'product'.
552
+ */
553
+ type: 'PRODUCT';
554
+ };
271
555
  type Validity = {
272
556
  /**
273
557
  * Date and time from which the category is valid compliant with the ISO 8601 standard.
@@ -283,6 +567,28 @@ type Validity = {
283
567
  type Category = Category$1;
284
568
  /** The category tree as returned by the Category service. */
285
569
  type CategoryNode = CategoryTree;
570
+ /** Body for creating a category (`POST /categories`). */
571
+ type CategoryCreateInput = CategoryCreateRequest;
572
+ /** Body for a full category replace (`PUT /categories/{id}`). */
573
+ type CategoryUpdateInput = CategoryUpdateRequest;
574
+ /** Body for a partial category update (`PATCH /categories/{id}`). */
575
+ type CategoryPatchInput = CategoryPartialUpdateRequest;
576
+ /** Id envelope returned when a category is created. */
577
+ type CategoryCreated = CategoryIdResponse;
578
+ /** Body for searching category trees (`POST /category-trees/search`). */
579
+ type CategoryTreeSearchInput = CategoryTreeSearchRequest;
580
+ /** A category assignment (a resource reference bound to a category). */
581
+ type CategoryAssignment = CategoryAssignment$1;
582
+ /** Body for assigning a single resource to a category. */
583
+ type CategoryAssignmentInput = AssignmentRequest;
584
+ /** Body for bulk-assigning resources to a category. */
585
+ type CategoryAssignmentBulkInput = BulkAssignmentRequest;
586
+ /** Body for bulk-upserting assignment references (`ref.id` only). */
587
+ type CategoryAssignmentRefBulkInput = BulkAssignmentUpsertRequest;
588
+ /** Multi-status result of a bulk assignment operation. */
589
+ type CategoryAssignmentBulkResult = BulkAssignmentResponse;
590
+ /** Id envelope returned when an assignment is created. */
591
+ type CategoryAssignmentCreated = AssignmentIdResponse;
286
592
  /** Category reads. Default auth: anonymous. */
287
593
  declare class CategoryService {
288
594
  private readonly ctx;
@@ -350,6 +656,107 @@ declare class CategoryService {
350
656
  searchByIds(ids: string[], options?: {
351
657
  chunkSize?: number;
352
658
  }, auth?: AuthContext): Promise<Category[]>;
659
+ /** Lists a category's ancestor categories (breadcrumb-up). Default auth: anonymous. */
660
+ parents(categoryId: string, auth?: AuthContext): Promise<Category[]>;
661
+ /**
662
+ * Lists a category's direct child categories via the dedicated
663
+ * `…/subcategories` endpoint. (The older `subcategories()` reads `/assignments`
664
+ * and is kept for backward compatibility.) Default auth: anonymous.
665
+ */
666
+ childCategories(categoryId: string, auth?: AuthContext): Promise<Category[]>;
667
+ /** Retrieves one category tree by its root category id. Default auth: anonymous. */
668
+ getTree(categoryId: string, auth?: AuthContext): Promise<CategoryNode>;
669
+ /**
670
+ * Creates a category (`POST /categories`). Default auth: service.
671
+ * `options.publish` sets the `publish` query flag (needs the
672
+ * `category.category_publish` scope).
673
+ */
674
+ create(input: CategoryCreateInput, options?: {
675
+ publish?: boolean;
676
+ }, auth?: AuthContext): Promise<CategoryCreated>;
677
+ /**
678
+ * Full-replaces a category (`PUT /categories/{categoryId}`). This is an
679
+ * upsert: with a caller-supplied id it may create (201, returns the id) or
680
+ * update an existing one (204, returns nothing). Default auth: service.
681
+ */
682
+ update(categoryId: string, input: CategoryUpdateInput, options?: {
683
+ publish?: boolean;
684
+ }, auth?: AuthContext): Promise<CategoryCreated | void>;
685
+ /**
686
+ * Partially updates a category (`PATCH /categories/{categoryId}`). Default
687
+ * auth: service. `options.publish` sets the `publish` query flag.
688
+ */
689
+ patch(categoryId: string, input: CategoryPatchInput, options?: {
690
+ publish?: boolean;
691
+ }, auth?: AuthContext): Promise<void>;
692
+ /** Deletes a category (`DELETE /categories/{categoryId}`). Default auth: service. */
693
+ delete(categoryId: string, auth?: AuthContext): Promise<void>;
694
+ /**
695
+ * Searches categories via `POST /categories/search`. Same query capability
696
+ * as {@link search} (`compoundLogicalQuery: false` — Category rejects `or()`
697
+ * filters); the POST body avoids URL-length limits for large `q` filters.
698
+ * `params.showRoots` / `params.showUnpublished` are POST-only flags. Default
699
+ * auth: anonymous.
700
+ */
701
+ searchByQuery(query: QueryFor<"CATEGORY">, params?: {
702
+ pageNumber?: number;
703
+ pageSize?: number;
704
+ sort?: string;
705
+ showRoots?: boolean;
706
+ showUnpublished?: boolean;
707
+ }, auth?: AuthContext): Promise<PaginatedItems<Category>>;
708
+ /**
709
+ * Searches category trees via `POST /category-trees/search` — returns the
710
+ * trees that include at least one of the given `categoryIds`. Default auth:
711
+ * anonymous.
712
+ */
713
+ searchTrees(input: CategoryTreeSearchInput, options?: {
714
+ showUnpublished?: boolean;
715
+ }, auth?: AuthContext): Promise<CategoryNode[]>;
716
+ /**
717
+ * Category ↔ resource assignments. Writes default to service auth. The
718
+ * assignment `ref.type` is `'PRODUCT'` (per the API); category hierarchy is
719
+ * managed via `parentId` on the category, not via assignments.
720
+ */
721
+ readonly assignments: {
722
+ /** One page of a category's assignments. Default auth: anonymous. */
723
+ list: (categoryId: string, params?: {
724
+ pageNumber?: number;
725
+ pageSize?: number;
726
+ sort?: string;
727
+ expandSupercategoriesIds?: boolean;
728
+ showUnpublished?: boolean;
729
+ }, auth?: AuthContext) => Promise<CategoryAssignment[]>;
730
+ /** Assigns a single resource to a category (`POST …/assignments`). Default auth: service. */
731
+ create: (categoryId: string, input: CategoryAssignmentInput, auth?: AuthContext) => Promise<CategoryAssignmentCreated>;
732
+ /** Bulk-assigns resources to a category (`POST …/assignments/bulk`). Default auth: service. */
733
+ bulkCreate: (categoryId: string, input: CategoryAssignmentBulkInput, auth?: AuthContext) => Promise<CategoryAssignmentBulkResult>;
734
+ /** Removes one assignment by id (`DELETE …/assignments/{assignmentId}`). Default auth: service. */
735
+ remove: (categoryId: string, assignmentId: string, auth?: AuthContext) => Promise<void>;
736
+ /** Removes all of a category's assignments (`DELETE …/assignments`). Default auth: service. */
737
+ removeAll: (categoryId: string, options?: {
738
+ assignmentType?: "PRODUCT";
739
+ }, auth?: AuthContext) => Promise<void>;
740
+ /** Upserts an assignment by reference id — no body (`PUT …/assignments/references/{referenceId}`). Default auth: service. */
741
+ upsertByReference: (categoryId: string, referenceId: string, auth?: AuthContext) => Promise<CategoryAssignmentCreated>;
742
+ /** Removes an assignment by reference id (`DELETE …/assignments/references/{referenceId}`). Default auth: service. */
743
+ removeByReference: (categoryId: string, referenceId: string, auth?: AuthContext) => Promise<void>;
744
+ /** Bulk-upserts assignment references (`PUT …/assignments/references/bulk`). Default auth: service. */
745
+ bulkUpsertByReference: (categoryId: string, input: CategoryAssignmentRefBulkInput, auth?: AuthContext) => Promise<CategoryAssignmentBulkResult>;
746
+ /**
747
+ * Lists every category assigned to the given reference id — tenant-wide
748
+ * (`GET /assignments/references/{referenceId}`). Default auth: anonymous.
749
+ */
750
+ listCategoriesByReference: (referenceId: string, params?: {
751
+ pageNumber?: number;
752
+ pageSize?: number;
753
+ sort?: string;
754
+ showUnpublished?: boolean;
755
+ expandSupercategoriesIds?: boolean;
756
+ }, auth?: AuthContext) => Promise<Category[]>;
757
+ /** Removes all assignments to a given reference id — tenant-wide (`DELETE /assignments/references/{referenceId}`). Default auth: service. */
758
+ removeAllByReference: (referenceId: string, auth?: AuthContext) => Promise<void>;
759
+ };
353
760
  }
354
761
 
355
- export { type Category, type CategoryNode, CategoryService };
762
+ export { type Category, type CategoryAssignment, type CategoryAssignmentBulkInput, type CategoryAssignmentBulkResult, type CategoryAssignmentCreated, type CategoryAssignmentInput, type CategoryAssignmentRefBulkInput, type CategoryCreateInput, type CategoryCreated, type CategoryNode, type CategoryPatchInput, CategoryService, type CategoryTreeSearchInput, type CategoryUpdateInput };
package/dist/category.js CHANGED
@@ -1,4 +1,4 @@
1
- export { CategoryService } from './chunk-ZNLHLFQM.js';
1
+ export { CategoryService } from './chunk-HWVFF6B2.js';
2
2
  import './chunk-GWJ2U2CP.js';
3
3
  import './chunk-S5HEIQDK.js';
4
4
  //# sourceMappingURL=category.js.map
@@ -48,8 +48,16 @@ var ContactsService = class {
48
48
  auth
49
49
  });
50
50
  }
51
+ /** Fetches a single contact assignment by id. */
52
+ async get(contactAssignmentId, auth) {
53
+ return this.ctx.http.request({
54
+ method: "GET",
55
+ path: `${this.base()}/${contactAssignmentId}`,
56
+ auth
57
+ });
58
+ }
51
59
  };
52
60
 
53
61
  export { ContactsService };
54
- //# sourceMappingURL=chunk-HD5RBCM6.js.map
55
- //# sourceMappingURL=chunk-HD5RBCM6.js.map
62
+ //# sourceMappingURL=chunk-27NLS646.js.map
63
+ //# sourceMappingURL=chunk-27NLS646.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/services/contacts.ts"],"names":[],"mappings":";AAeO,IAAM,kBAAN,MAAsB;AAAA,EAE3B,YAA6B,GAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,GAAA,GAAA,GAAA;AAAA,EAAqB;AAAA,EAArB,GAAA;AAAA,EAD7B,OAAgB,OAAA,GAAU,qBAAA;AAAA,EAGlB,IAAA,GAAe;AACrB,IAAA,OAAO,CAAA,qBAAA,EAAwB,IAAA,CAAK,GAAA,CAAI,MAAM,CAAA,oBAAA,CAAA;AAAA,EAChD;AAAA;AAAA,EAGA,MAAM,cAAA,CAAe,aAAA,EAAuB,IAAA,EAAiD;AAC3F,IAAA,OAAO,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,OAAA,CAA6B;AAAA,MAChD,MAAA,EAAQ,KAAA;AAAA,MACR,IAAA,EAAM,KAAK,IAAA,EAAK;AAAA,MAChB,KAAA,EAAO,EAAE,aAAA,EAAc;AAAA,MACvB;AAAA,KACD,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,MAAA,CAAO,KAAA,EAAgC,IAAA,EAA4C;AACvF,IAAA,OAAO,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,OAAA,CAAwB;AAAA,MAC3C,MAAA,EAAQ,MAAA;AAAA,MACR,IAAA,EAAM,KAAK,IAAA,EAAK;AAAA,MAChB,IAAA;AAAA,MACA,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,MAAA,CACJ,mBAAA,EACA,KAAA,EACA,IAAA,EAC4B;AAC5B,IAAA,OAAO,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,OAAA,CAA2B;AAAA,MAC9C,MAAA,EAAQ,KAAA;AAAA,MACR,MAAM,CAAA,EAAG,IAAA,CAAK,IAAA,EAAM,IAAI,mBAAmB,CAAA,CAAA;AAAA,MAC3C,IAAA;AAAA,MACA,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,QAAA,CAAS,mBAAA,EAA6B,IAAA,EAAkC;AAC5E,IAAA,MAAM,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,OAAA,CAAc;AAAA,MAChC,MAAA,EAAQ,QAAA;AAAA,MACR,MAAM,CAAA,EAAG,IAAA,CAAK,IAAA,EAAM,IAAI,mBAAmB,CAAA,CAAA;AAAA,MAC3C;AAAA,KACD,CAAA;AAAA,EACH;AAAA;AAAA,EAGA,MAAM,GAAA,CAAI,mBAAA,EAA6B,IAAA,EAA+C;AACpF,IAAA,OAAO,IAAA,CAAK,GAAA,CAAI,IAAA,CAAK,OAAA,CAA2B;AAAA,MAC9C,MAAA,EAAQ,KAAA;AAAA,MACR,MAAM,CAAA,EAAG,IAAA,CAAK,IAAA,EAAM,IAAI,mBAAmB,CAAA,CAAA;AAAA,MAC3C;AAAA,KACD,CAAA;AAAA,EACH;AACF","file":"chunk-27NLS646.js","sourcesContent":["import type { ClientContext } from \"../core/context\";\nimport type { AuthContext } from \"../core/auth\";\nimport type {\n ContactAssignment,\n ContactAssignmentCreate,\n ContactAssignmentUpdate,\n} from \"../generated/customer-management\";\n\n/**\n * Manages contact assignments linking customers to legal entities.\n *\n * `listForCompany` requires `customermanagement.contactassignment_read`;\n * `assign`/`update`/`unassign` require `_manage`. The query param\n * `legalEntityId` scopes the list to one company.\n */\nexport class ContactsService {\n static readonly channel = \"customer-management\" as const;\n constructor(private readonly ctx: ClientContext) {}\n\n private base(): string {\n return `/customer-management/${this.ctx.tenant}/contact-assignments`;\n }\n\n /** Lists contact assignments for one legal entity. */\n async listForCompany(legalEntityId: string, auth: AuthContext): Promise<ContactAssignment[]> {\n return this.ctx.http.request<ContactAssignment[]>({\n method: \"GET\",\n path: this.base(),\n query: { legalEntityId },\n auth,\n });\n }\n\n /** Creates a contact assignment. */\n async assign(input: ContactAssignmentCreate, auth: AuthContext): Promise<{ id: string }> {\n return this.ctx.http.request<{ id: string }>({\n method: \"POST\",\n path: this.base(),\n auth,\n body: input,\n });\n }\n\n /**\n * Updates a contact assignment via `PUT …/contact-assignments/{id}` (upsert /\n * full replace). The live API rejects `PATCH` on this path with 405; send the\n * complete entity, as the server replaces the resource. The body stays typed\n * as a partial of `ContactAssignmentUpdate` for backward compatibility.\n */\n async update(\n contactAssignmentId: string,\n patch: Partial<ContactAssignmentUpdate>,\n auth: AuthContext,\n ): Promise<ContactAssignment> {\n return this.ctx.http.request<ContactAssignment>({\n method: \"PUT\",\n path: `${this.base()}/${contactAssignmentId}`,\n auth,\n body: patch,\n });\n }\n\n /** Deletes a contact assignment. */\n async unassign(contactAssignmentId: string, auth: AuthContext): Promise<void> {\n await this.ctx.http.request<void>({\n method: \"DELETE\",\n path: `${this.base()}/${contactAssignmentId}`,\n auth,\n });\n }\n\n /** Fetches a single contact assignment by id. */\n async get(contactAssignmentId: string, auth: AuthContext): Promise<ContactAssignment> {\n return this.ctx.http.request<ContactAssignment>({\n method: \"GET\",\n path: `${this.base()}/${contactAssignmentId}`,\n auth,\n });\n }\n}\n"]}
@@ -246,6 +246,7 @@ var DefaultTokenProvider = class {
246
246
 
247
247
  // src/services/payment.ts
248
248
  var ANON = auth.anonymous();
249
+ var SERVICE = auth.service();
249
250
  var PaymentGatewayService = class {
250
251
  constructor(ctx) {
251
252
  this.ctx = ctx;
@@ -273,8 +274,131 @@ var PaymentGatewayService = class {
273
274
  body: input
274
275
  });
275
276
  }
277
+ /** Retrieves a single frontend payment mode by id. Defaults to anonymous (no scope required). */
278
+ async getMode(id, authCtx = ANON) {
279
+ return this.ctx.http.request({
280
+ method: "GET",
281
+ path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/frontend/${id}`,
282
+ auth: authCtx
283
+ });
284
+ }
285
+ /** Initializes a payment from the frontend. Defaults to anonymous (no scope required). */
286
+ async initialize(input, authCtx = ANON) {
287
+ return this.ctx.http.request({
288
+ method: "POST",
289
+ path: `/payment-gateway/${this.ctx.tenant}/payment/frontend/initialize`,
290
+ auth: authCtx,
291
+ body: input
292
+ });
293
+ }
294
+ /**
295
+ * Payment-mode **configuration** (`/paymentmodes/config`) — the admin view.
296
+ * For the storefront view use {@link listPaymentModes} / {@link getMode}.
297
+ * Defaults to service auth.
298
+ */
299
+ modes = {
300
+ /** Lists all configured payment modes. The endpoint takes no query parameters. */
301
+ list: async (authCtx = SERVICE) => this.ctx.http.request({
302
+ method: "GET",
303
+ path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/config`,
304
+ auth: authCtx
305
+ }),
306
+ /** Retrieves one payment-mode configuration by id. */
307
+ get: async (id, authCtx = SERVICE) => this.ctx.http.request({
308
+ method: "GET",
309
+ path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/config/${id}`,
310
+ auth: authCtx
311
+ }),
312
+ /** Creates a payment-mode configuration. Responds 200 with the created mode. */
313
+ create: async (input, authCtx = SERVICE) => this.ctx.http.request({
314
+ method: "POST",
315
+ path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/config`,
316
+ body: input,
317
+ auth: authCtx
318
+ }),
319
+ /** Updates a payment-mode configuration (PUT). Responds 200 with the updated mode. */
320
+ update: async (id, input, authCtx = SERVICE) => this.ctx.http.request({
321
+ method: "PUT",
322
+ path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/config/${id}`,
323
+ body: input,
324
+ auth: authCtx
325
+ }),
326
+ /** Deletes a payment-mode configuration. */
327
+ delete: async (id, authCtx = SERVICE) => {
328
+ await this.ctx.http.request({
329
+ method: "DELETE",
330
+ path: `/payment-gateway/${this.ctx.tenant}/paymentmodes/config/${id}`,
331
+ auth: authCtx
332
+ });
333
+ }
334
+ };
335
+ /**
336
+ * Backend transaction lifecycle and reads. `authorize` creates the transaction
337
+ * that `capture`/`refund`/`cancel` then act on. Business failures are reported
338
+ * in the response body (`successful: false`), not as HTTP errors — always check
339
+ * `successful`. Defaults to service auth.
340
+ */
341
+ transactions = {
342
+ /** One page of payment transactions. */
343
+ list: async (params = {}, authCtx = SERVICE) => {
344
+ const query = {
345
+ ...params.pageNumber === void 0 ? {} : { pageNumber: params.pageNumber },
346
+ ...params.pageSize === void 0 ? {} : { pageSize: params.pageSize },
347
+ ...params.sort === void 0 ? {} : { sort: params.sort }
348
+ };
349
+ return this.ctx.http.request({
350
+ method: "GET",
351
+ path: `/payment-gateway/${this.ctx.tenant}/transactions`,
352
+ ...Object.keys(query).length > 0 ? { query } : {},
353
+ auth: authCtx
354
+ });
355
+ },
356
+ /** Retrieves one payment transaction by id. */
357
+ get: async (transactionId, authCtx = SERVICE) => this.ctx.http.request({
358
+ method: "GET",
359
+ path: `/payment-gateway/${this.ctx.tenant}/transactions/${transactionId}`,
360
+ auth: authCtx
361
+ }),
362
+ /**
363
+ * Authorizes a payment as a backend caller (`POST /payment/authorize`). The
364
+ * storefront equivalent is {@link PaymentGatewayService.authorize}, which
365
+ * targets `/payment/frontend/authorize` with a customer token.
366
+ */
367
+ authorize: async (input, authCtx = SERVICE) => this.ctx.http.request({
368
+ method: "POST",
369
+ path: `/payment-gateway/${this.ctx.tenant}/payment/authorize`,
370
+ body: input,
371
+ auth: authCtx
372
+ }),
373
+ /**
374
+ * Captures an authorized payment. Omit `input` to capture the full
375
+ * authorized amount. Returns the provider's `captureId` on success.
376
+ */
377
+ capture: async (transactionId, input, authCtx = SERVICE) => this.ctx.http.request({
378
+ method: "POST",
379
+ path: `/payment-gateway/${this.ctx.tenant}/payment/${transactionId}/capture`,
380
+ ...input === void 0 ? {} : { body: input },
381
+ auth: authCtx
382
+ }),
383
+ /**
384
+ * Refunds a captured payment. Omit `input` to refund the full captured
385
+ * amount; pass `captureId` when several captures exist for the payment.
386
+ */
387
+ refund: async (transactionId, input, authCtx = SERVICE) => this.ctx.http.request({
388
+ method: "POST",
389
+ path: `/payment-gateway/${this.ctx.tenant}/payment/${transactionId}/refund`,
390
+ ...input === void 0 ? {} : { body: input },
391
+ auth: authCtx
392
+ }),
393
+ /** Cancels an authorized payment. Takes no body. */
394
+ cancel: async (transactionId, authCtx = SERVICE) => this.ctx.http.request({
395
+ method: "POST",
396
+ path: `/payment-gateway/${this.ctx.tenant}/payment/${transactionId}/cancel`,
397
+ auth: authCtx
398
+ })
399
+ };
276
400
  };
277
401
 
278
402
  export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken };
279
- //# sourceMappingURL=chunk-PYLWZZC4.js.map
280
- //# sourceMappingURL=chunk-PYLWZZC4.js.map
403
+ //# sourceMappingURL=chunk-6PJFOX3A.js.map
404
+ //# sourceMappingURL=chunk-6PJFOX3A.js.map