@viu/emporix-sdk 2.36.1 → 2.38.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 (54) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/dist/availability.d.cts +1 -1
  3. package/dist/availability.d.ts +1 -1
  4. package/dist/cart.d.cts +1 -1
  5. package/dist/cart.d.ts +1 -1
  6. package/dist/category.d.cts +1 -1
  7. package/dist/category.d.ts +1 -1
  8. package/dist/checkout.d.cts +1 -1
  9. package/dist/checkout.d.ts +1 -1
  10. package/dist/{chunk-LQFRJSVT.js → chunk-5XZ6MSXW.js} +13 -2
  11. package/dist/chunk-5XZ6MSXW.js.map +1 -0
  12. package/dist/{chunk-PRN3T6TY.js → chunk-UA4BM6OP.js} +20 -2
  13. package/dist/chunk-UA4BM6OP.js.map +1 -0
  14. package/dist/companies.d.cts +1 -1
  15. package/dist/companies.d.ts +1 -1
  16. package/dist/contacts.d.cts +1 -1
  17. package/dist/contacts.d.ts +1 -1
  18. package/dist/{context-DK8jg6y5.d.cts → context-D64-B1Rz.d.cts} +13 -0
  19. package/dist/{context-DK8jg6y5.d.ts → context-D64-B1Rz.d.ts} +13 -0
  20. package/dist/{customer-groups-BfHDqExS.d.cts → customer-groups-B6xrwf59.d.cts} +1 -1
  21. package/dist/{customer-groups-Cs6-Cwzg.d.ts → customer-groups-YZg22bFc.d.ts} +1 -1
  22. package/dist/customer-groups.cjs +11 -0
  23. package/dist/customer-groups.cjs.map +1 -1
  24. package/dist/customer-groups.d.cts +2 -2
  25. package/dist/customer-groups.d.ts +2 -2
  26. package/dist/customer-groups.js +1 -1
  27. package/dist/customer.cjs +18 -0
  28. package/dist/customer.cjs.map +1 -1
  29. package/dist/customer.d.cts +46 -2
  30. package/dist/customer.d.ts +46 -2
  31. package/dist/customer.js +1 -1
  32. package/dist/index.cjs +35 -1
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +45 -7
  35. package/dist/index.d.ts +45 -7
  36. package/dist/index.js +10 -5
  37. package/dist/index.js.map +1 -1
  38. package/dist/locations.d.cts +1 -1
  39. package/dist/locations.d.ts +1 -1
  40. package/dist/media.d.cts +1 -1
  41. package/dist/media.d.ts +1 -1
  42. package/dist/orders.d.cts +1 -1
  43. package/dist/orders.d.ts +1 -1
  44. package/dist/payment.d.cts +1 -1
  45. package/dist/payment.d.ts +1 -1
  46. package/dist/price.d.cts +1 -1
  47. package/dist/price.d.ts +1 -1
  48. package/dist/product.d.cts +1 -1
  49. package/dist/product.d.ts +1 -1
  50. package/dist/segment.d.cts +1 -1
  51. package/dist/segment.d.ts +1 -1
  52. package/package.json +1 -1
  53. package/dist/chunk-LQFRJSVT.js.map +0 -1
  54. package/dist/chunk-PRN3T6TY.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { q as StoredAnonymousSession, b as AuthContext, C as ClientContext, P as PaginatedItems, T as TokenProvider, o as ResolvedConfig, E as EmporixConfig, k as LogLevel, p as ServiceName, e as CustomerTokenRefresher } from './context-DK8jg6y5.cjs';
2
- export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, h as HttpResult, L as LEVEL, i as LevelResolver, j as LogFields, l as Logger, m as LoggerConfig, n as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, r as StorefrontCredentials, s as auth, t as createConsoleLogger, u as createNoopLogger, v as iterateAll, w as redact, x as resolveToken, y as validateConfig } from './context-DK8jg6y5.cjs';
1
+ import { q as StoredAnonymousSession, b as AuthContext, C as ClientContext, P as PaginatedItems, T as TokenProvider, o as ResolvedConfig, E as EmporixConfig, k as LogLevel, p as ServiceName, e as CustomerTokenRefresher } from './context-D64-B1Rz.cjs';
2
+ export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, h as HttpResult, L as LEVEL, i as LevelResolver, j as LogFields, l as Logger, m as LoggerConfig, n as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, r as StorefrontCredentials, s as auth, t as createConsoleLogger, u as createNoopLogger, v as iterateAll, w as redact, x as resolveToken, y as validateConfig } from './context-D64-B1Rz.cjs';
3
3
  import { CustomerService } from './customer.cjs';
4
4
  export { Address, AddressCreateInput, AddressUpdateInput, ChangeEmailInput, ConfirmEmailChangeInput, Customer, CustomerSession, CustomerSignupInput, CustomerUpdateInput, PasswordChangeInput, PasswordResetConfirmInput, PasswordResetRequestInput, ResendActivationInput } from './customer.cjs';
5
5
  import { ProductService } from './product.cjs';
@@ -21,7 +21,7 @@ export { Segment, SegmentAssignmentBulkResult, SegmentBulkItem, SegmentBulkResul
21
21
  import { CompaniesService } from './companies.cjs';
22
22
  import { ContactsService } from './contacts.cjs';
23
23
  import { LocationsService } from './locations.cjs';
24
- import { m as UserResponse, U as UserCreateRequest, l as UserIdResponse, k as UserExtendedResponse, o as UserUpdateRequest, j as GroupsQueryDocument, n as UserScopesResponse, a as AccessControlQueryDocument, G as GroupCreateRequest, h as GroupIdResponse, i as GroupUpdateRequest, c as AssignmentCreateRequest, d as AssignmentIdResponse, b as AccessControlUpsertRequest, A as AccessControlIdResponse, e as CustomScopeQueryDocument, f as CustomScopeUpsertRequest, C as CustomScopeIdResponse, g as CustomerGroupsService } from './customer-groups-BfHDqExS.cjs';
24
+ import { m as UserResponse, U as UserCreateRequest, l as UserIdResponse, k as UserExtendedResponse, o as UserUpdateRequest, j as GroupsQueryDocument, n as UserScopesResponse, a as AccessControlQueryDocument, G as GroupCreateRequest, h as GroupIdResponse, i as GroupUpdateRequest, c as AssignmentCreateRequest, d as AssignmentIdResponse, b as AccessControlUpsertRequest, A as AccessControlIdResponse, e as CustomScopeQueryDocument, f as CustomScopeUpsertRequest, C as CustomScopeIdResponse, g as CustomerGroupsService } from './customer-groups-B6xrwf59.cjs';
25
25
  import { OrdersService, SalesOrdersService } from './orders.cjs';
26
26
  export { GetOrderOptions, ListLegalEntityOrdersOptions, ListMyOrdersOptions, ListSalesOrdersOptions, Order, OrderEntry, OrderStatus, OrderTransitionOptions, SalesOrder, SalesOrderCalculationInput, SalesOrderCreateInput, SalesOrderCreated, SalesOrderEntriesInput, SalesOrderHistoricalTransitions, SalesOrderPatch, SalesOrderReplaceInput, SalesOrderSearchInput, SalesOrderSplitInput, SalesOrderSplitResult, Transition, UpdateSalesOrderOptions } from './orders.cjs';
27
27
  import { AvailabilityService } from './availability.cjs';
@@ -677,9 +677,18 @@ type SessionContextPatch = Pick<SessionContextPatch$1, "siteCode" | "currency" |
677
677
  };
678
678
 
679
679
  /**
680
- * Session-context binding for the current storefront session. Both endpoints
681
- * resolve the session-id from the `Authorization` token — no path/query
682
- * parameter required.
680
+ * Session-context binding for the current storefront session. Every method here
681
+ * hits a `/me/context` path, so the session-id comes from the `Authorization`
682
+ * token — no path or query parameter required.
683
+ *
684
+ * **The service's other half is intentionally not wrapped.** Emporix also exposes
685
+ * the same four operations addressed by an explicit session id —
686
+ * `GET`/`PUT /{sessionId}/context`, `POST`/`DELETE` on its attributes. Those are
687
+ * administrative: they let a caller read and rewrite *someone else's* session,
688
+ * which is not a storefront capability and needs a service token. Wrapping them
689
+ * here would put an admin surface on the object a storefront holds. If you need
690
+ * them, build the request directly — the generated types are in
691
+ * `../generated/session-context`.
683
692
  */
684
693
  declare class SessionContextService {
685
694
  private readonly ctx;
@@ -746,6 +755,13 @@ declare class IamService {
746
755
  update: (userId: string, input: IamUserUpdate, auth: AuthContext) => Promise<void>;
747
756
  delete: (userId: string, auth: AuthContext) => Promise<void>;
748
757
  getGroups: (userId: string, auth: AuthContext) => Promise<IamGroup[]>;
758
+ /**
759
+ * Reads one of a user's groups (`GET /users/{userId}/groups/{groupId}`).
760
+ * The collection read above returns the same shape per entry; this exists
761
+ * because Emporix exposes the item separately and a caller holding both ids
762
+ * should not have to page the collection to resolve one group.
763
+ */
764
+ getGroup: (userId: string, groupId: string, auth: AuthContext) => Promise<IamGroup>;
749
765
  getScopes: (userId: string, auth: AuthContext) => Promise<IamUserScopes>;
750
766
  getMyScopes: (auth: AuthContext) => Promise<IamUserScopes>;
751
767
  getAccessControls: (userId: string, auth: AuthContext) => Promise<IamAccessControl[]>;
@@ -3775,7 +3791,29 @@ type ImportedEntity = {
3775
3791
  /**
3776
3792
  * State of the imported entity.
3777
3793
  */
3778
- state?: 'TO_CREATE' | 'ENABLED' | 'DISABLED' | 'EXISTS';
3794
+ state?: 'TO_CREATE' | 'ENABLED' | 'DISABLED' | 'EXISTS' | 'FAILED';
3795
+ /**
3796
+ * Reasons the entity was skipped, disabled, or failed during import.
3797
+ */
3798
+ details?: Array<ImportDetails>;
3799
+ };
3800
+ type ImportDetails = {
3801
+ /**
3802
+ * Machine-readable reason code for UI localization.
3803
+ */
3804
+ code?: 'MISSING_FUNCTION' | 'MISSING_TOKEN' | 'NOT_IMPORTABLE' | 'ALREADY_EXISTS' | 'AGENT_IMPORTED_DISABLED' | 'IMPORT_FAILED';
3805
+ /**
3806
+ * ID of the related object, such as a function ID or token ID.
3807
+ */
3808
+ objectId?: string;
3809
+ /**
3810
+ * Display name of the related object, such as a tool name.
3811
+ */
3812
+ objectName?: string;
3813
+ /**
3814
+ * English fallback message when a localized string is not available.
3815
+ */
3816
+ message?: string;
3779
3817
  };
3780
3818
  type AttachmentResponse = {
3781
3819
  /**
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { q as StoredAnonymousSession, b as AuthContext, C as ClientContext, P as PaginatedItems, T as TokenProvider, o as ResolvedConfig, E as EmporixConfig, k as LogLevel, p as ServiceName, e as CustomerTokenRefresher } from './context-DK8jg6y5.js';
2
- export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, h as HttpResult, L as LEVEL, i as LevelResolver, j as LogFields, l as Logger, m as LoggerConfig, n as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, r as StorefrontCredentials, s as auth, t as createConsoleLogger, u as createNoopLogger, v as iterateAll, w as redact, x as resolveToken, y as validateConfig } from './context-DK8jg6y5.js';
1
+ import { q as StoredAnonymousSession, b as AuthContext, C as ClientContext, P as PaginatedItems, T as TokenProvider, o as ResolvedConfig, E as EmporixConfig, k as LogLevel, p as ServiceName, e as CustomerTokenRefresher } from './context-D64-B1Rz.js';
2
+ export { A as AnonymousSession, a as AnonymousSessionStore, c as AuthKind, d as CustomerRefreshRegistry, D as DEFAULT_HOST, f as DefaultTokenProvider, H as HttpClient, g as HttpClientOptions, h as HttpResult, L as LEVEL, i as LevelResolver, j as LogFields, l as Logger, m as LoggerConfig, n as LoggerObjectConfig, R as RequestOptions, S as ServiceCredentials, r as StorefrontCredentials, s as auth, t as createConsoleLogger, u as createNoopLogger, v as iterateAll, w as redact, x as resolveToken, y as validateConfig } from './context-D64-B1Rz.js';
3
3
  import { CustomerService } from './customer.js';
4
4
  export { Address, AddressCreateInput, AddressUpdateInput, ChangeEmailInput, ConfirmEmailChangeInput, Customer, CustomerSession, CustomerSignupInput, CustomerUpdateInput, PasswordChangeInput, PasswordResetConfirmInput, PasswordResetRequestInput, ResendActivationInput } from './customer.js';
5
5
  import { ProductService } from './product.js';
@@ -21,7 +21,7 @@ export { Segment, SegmentAssignmentBulkResult, SegmentBulkItem, SegmentBulkResul
21
21
  import { CompaniesService } from './companies.js';
22
22
  import { ContactsService } from './contacts.js';
23
23
  import { LocationsService } from './locations.js';
24
- import { m as UserResponse, U as UserCreateRequest, l as UserIdResponse, k as UserExtendedResponse, o as UserUpdateRequest, j as GroupsQueryDocument, n as UserScopesResponse, a as AccessControlQueryDocument, G as GroupCreateRequest, h as GroupIdResponse, i as GroupUpdateRequest, c as AssignmentCreateRequest, d as AssignmentIdResponse, b as AccessControlUpsertRequest, A as AccessControlIdResponse, e as CustomScopeQueryDocument, f as CustomScopeUpsertRequest, C as CustomScopeIdResponse, g as CustomerGroupsService } from './customer-groups-Cs6-Cwzg.js';
24
+ import { m as UserResponse, U as UserCreateRequest, l as UserIdResponse, k as UserExtendedResponse, o as UserUpdateRequest, j as GroupsQueryDocument, n as UserScopesResponse, a as AccessControlQueryDocument, G as GroupCreateRequest, h as GroupIdResponse, i as GroupUpdateRequest, c as AssignmentCreateRequest, d as AssignmentIdResponse, b as AccessControlUpsertRequest, A as AccessControlIdResponse, e as CustomScopeQueryDocument, f as CustomScopeUpsertRequest, C as CustomScopeIdResponse, g as CustomerGroupsService } from './customer-groups-YZg22bFc.js';
25
25
  import { OrdersService, SalesOrdersService } from './orders.js';
26
26
  export { GetOrderOptions, ListLegalEntityOrdersOptions, ListMyOrdersOptions, ListSalesOrdersOptions, Order, OrderEntry, OrderStatus, OrderTransitionOptions, SalesOrder, SalesOrderCalculationInput, SalesOrderCreateInput, SalesOrderCreated, SalesOrderEntriesInput, SalesOrderHistoricalTransitions, SalesOrderPatch, SalesOrderReplaceInput, SalesOrderSearchInput, SalesOrderSplitInput, SalesOrderSplitResult, Transition, UpdateSalesOrderOptions } from './orders.js';
27
27
  import { AvailabilityService } from './availability.js';
@@ -677,9 +677,18 @@ type SessionContextPatch = Pick<SessionContextPatch$1, "siteCode" | "currency" |
677
677
  };
678
678
 
679
679
  /**
680
- * Session-context binding for the current storefront session. Both endpoints
681
- * resolve the session-id from the `Authorization` token — no path/query
682
- * parameter required.
680
+ * Session-context binding for the current storefront session. Every method here
681
+ * hits a `/me/context` path, so the session-id comes from the `Authorization`
682
+ * token — no path or query parameter required.
683
+ *
684
+ * **The service's other half is intentionally not wrapped.** Emporix also exposes
685
+ * the same four operations addressed by an explicit session id —
686
+ * `GET`/`PUT /{sessionId}/context`, `POST`/`DELETE` on its attributes. Those are
687
+ * administrative: they let a caller read and rewrite *someone else's* session,
688
+ * which is not a storefront capability and needs a service token. Wrapping them
689
+ * here would put an admin surface on the object a storefront holds. If you need
690
+ * them, build the request directly — the generated types are in
691
+ * `../generated/session-context`.
683
692
  */
684
693
  declare class SessionContextService {
685
694
  private readonly ctx;
@@ -746,6 +755,13 @@ declare class IamService {
746
755
  update: (userId: string, input: IamUserUpdate, auth: AuthContext) => Promise<void>;
747
756
  delete: (userId: string, auth: AuthContext) => Promise<void>;
748
757
  getGroups: (userId: string, auth: AuthContext) => Promise<IamGroup[]>;
758
+ /**
759
+ * Reads one of a user's groups (`GET /users/{userId}/groups/{groupId}`).
760
+ * The collection read above returns the same shape per entry; this exists
761
+ * because Emporix exposes the item separately and a caller holding both ids
762
+ * should not have to page the collection to resolve one group.
763
+ */
764
+ getGroup: (userId: string, groupId: string, auth: AuthContext) => Promise<IamGroup>;
749
765
  getScopes: (userId: string, auth: AuthContext) => Promise<IamUserScopes>;
750
766
  getMyScopes: (auth: AuthContext) => Promise<IamUserScopes>;
751
767
  getAccessControls: (userId: string, auth: AuthContext) => Promise<IamAccessControl[]>;
@@ -3775,7 +3791,29 @@ type ImportedEntity = {
3775
3791
  /**
3776
3792
  * State of the imported entity.
3777
3793
  */
3778
- state?: 'TO_CREATE' | 'ENABLED' | 'DISABLED' | 'EXISTS';
3794
+ state?: 'TO_CREATE' | 'ENABLED' | 'DISABLED' | 'EXISTS' | 'FAILED';
3795
+ /**
3796
+ * Reasons the entity was skipped, disabled, or failed during import.
3797
+ */
3798
+ details?: Array<ImportDetails>;
3799
+ };
3800
+ type ImportDetails = {
3801
+ /**
3802
+ * Machine-readable reason code for UI localization.
3803
+ */
3804
+ code?: 'MISSING_FUNCTION' | 'MISSING_TOKEN' | 'NOT_IMPORTABLE' | 'ALREADY_EXISTS' | 'AGENT_IMPORTED_DISABLED' | 'IMPORT_FAILED';
3805
+ /**
3806
+ * ID of the related object, such as a function ID or token ID.
3807
+ */
3808
+ objectId?: string;
3809
+ /**
3810
+ * Display name of the related object, such as a tool name.
3811
+ */
3812
+ objectName?: string;
3813
+ /**
3814
+ * English fallback message when a localized string is not available.
3815
+ */
3816
+ message?: string;
3779
3817
  };
3780
3818
  type AttachmentResponse = {
3781
3819
  /**
package/dist/index.js CHANGED
@@ -28,10 +28,10 @@ import { CompaniesService } from './chunk-QQMLN76U.js';
28
28
  export { CompaniesService } from './chunk-QQMLN76U.js';
29
29
  import { ContactsService } from './chunk-27NLS646.js';
30
30
  export { ContactsService } from './chunk-27NLS646.js';
31
- import { CustomerGroupsService, IamService } from './chunk-LQFRJSVT.js';
32
- export { CustomerGroupsService, IamService } from './chunk-LQFRJSVT.js';
33
- import { CustomerService } from './chunk-PRN3T6TY.js';
34
- export { CustomerService } from './chunk-PRN3T6TY.js';
31
+ import { CustomerGroupsService, IamService } from './chunk-5XZ6MSXW.js';
32
+ export { CustomerGroupsService, IamService } from './chunk-5XZ6MSXW.js';
33
+ import { CustomerService } from './chunk-UA4BM6OP.js';
34
+ export { CustomerService } from './chunk-UA4BM6OP.js';
35
35
  import './chunk-3BDDYX3V.js';
36
36
  import { EmporixTimeoutError, EmporixNetworkError, errorFromResponse, EmporixNotFoundError, EmporixError } from './chunk-UWGGF4MC.js';
37
37
  export { EmporixAuthError, EmporixError, EmporixForbiddenError, EmporixInsufficientScopeError, EmporixNetworkError, EmporixNotFoundError, EmporixServerError, EmporixTimeoutError, EmporixValidationError, errorFromResponse } from './chunk-UWGGF4MC.js';
@@ -444,6 +444,10 @@ var HttpClient = class {
444
444
  doFetch;
445
445
  buildHeaders(o, token, isFormData) {
446
446
  return {
447
+ // Before `o.headers` on purpose: a caller may override the tenant for a
448
+ // single request, the way `Accept-Language` can be overridden. Only
449
+ // `Authorization` is non-negotiable.
450
+ ...this.opts.tenant !== void 0 ? { "Emporix-Tenant": this.opts.tenant } : {},
447
451
  ...this.opts.requestContext?.language ? { "Accept-Language": this.opts.requestContext.language } : {},
448
452
  ...o.headers ?? {},
449
453
  Authorization: `Bearer ${token}`,
@@ -698,7 +702,7 @@ var HttpClient = class {
698
702
  };
699
703
 
700
704
  // package.json
701
- var version = "2.36.1";
705
+ var version = "2.38.0";
702
706
 
703
707
  // src/version.ts
704
708
  var SDK_VERSION = version;
@@ -732,6 +736,7 @@ function createCore(config) {
732
736
  logger: root.child({ service }),
733
737
  http: new HttpClient({
734
738
  host: cfg.host,
739
+ tenant: cfg.tenant,
735
740
  provider: tokenProvider,
736
741
  logger: root.child({ service: "http" }),
737
742
  retry: cfg.retry,