@01.software/sdk 0.48.0 → 0.49.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 (57) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +64 -7
  3. package/dist/client.cjs +189 -26
  4. package/dist/client.cjs.map +1 -1
  5. package/dist/client.d.cts +7 -6
  6. package/dist/client.d.ts +7 -6
  7. package/dist/client.js +189 -26
  8. package/dist/client.js.map +1 -1
  9. package/dist/{collection-client-D3ExJU-7.d.ts → collection-client-DnDt6EQz.d.ts} +4 -4
  10. package/dist/{collection-client-CBup9yOx.d.cts → collection-client-XfGLPuTf.d.cts} +4 -4
  11. package/dist/{const-BXEi1Kix.d.cts → const-CBba4lDo.d.cts} +1 -1
  12. package/dist/{const-k9gHylYa.d.ts → const-DCNV5Kq7.d.ts} +1 -1
  13. package/dist/errors.cjs +63 -15
  14. package/dist/errors.cjs.map +1 -1
  15. package/dist/errors.d.cts +10 -1
  16. package/dist/errors.d.ts +10 -1
  17. package/dist/errors.js +63 -15
  18. package/dist/errors.js.map +1 -1
  19. package/dist/{index-BCM9CTL7.d.cts → index-CbKyoEzy.d.cts} +3 -3
  20. package/dist/{index-CHGGkcLj.d.ts → index-DUuIqUS8.d.ts} +3 -3
  21. package/dist/index.cjs +152 -48
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +8 -8
  24. package/dist/index.d.ts +8 -8
  25. package/dist/index.js +152 -48
  26. package/dist/index.js.map +1 -1
  27. package/dist/{payload-types-B6AZQcB7.d.cts → payload-types-MKbx5MuJ.d.cts} +133 -3
  28. package/dist/{payload-types-B6AZQcB7.d.ts → payload-types-MKbx5MuJ.d.ts} +133 -3
  29. package/dist/query.cjs +21 -0
  30. package/dist/query.cjs.map +1 -1
  31. package/dist/query.d.cts +5 -5
  32. package/dist/query.d.ts +5 -5
  33. package/dist/query.js +21 -0
  34. package/dist/query.js.map +1 -1
  35. package/dist/realtime.d.cts +2 -2
  36. package/dist/realtime.d.ts +2 -2
  37. package/dist/server.cjs +189 -26
  38. package/dist/server.cjs.map +1 -1
  39. package/dist/server.d.cts +8 -7
  40. package/dist/server.d.ts +8 -7
  41. package/dist/server.js +189 -26
  42. package/dist/server.js.map +1 -1
  43. package/dist/storefront-cache.cjs +21 -0
  44. package/dist/storefront-cache.cjs.map +1 -1
  45. package/dist/storefront-cache.js +21 -0
  46. package/dist/storefront-cache.js.map +1 -1
  47. package/dist/{types-DbA5V3mt.d.ts → types-1UeOk1Uy.d.cts} +31 -6
  48. package/dist/{types-8us-_C-Q.d.cts → types-BKr_2avj.d.cts} +2 -2
  49. package/dist/{types-CM2je9Kw.d.cts → types-Du4s5anw.d.ts} +31 -6
  50. package/dist/{types-ByD2zii1.d.ts → types-L_nh-ED7.d.ts} +2 -2
  51. package/dist/ui/form.d.cts +1 -1
  52. package/dist/ui/form.d.ts +1 -1
  53. package/dist/ui/video.d.cts +1 -1
  54. package/dist/ui/video.d.ts +1 -1
  55. package/dist/webhook.d.cts +4 -4
  56. package/dist/webhook.d.ts +4 -4
  57. package/package.json +5 -4
package/dist/server.d.cts CHANGED
@@ -1,11 +1,12 @@
1
- import { S as ServerCollectionClient } from './collection-client-CBup9yOx.cjs';
2
- export { C as CollectionClient } from './collection-client-CBup9yOx.cjs';
3
- import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, a as CommunityClient, aK as BanCustomerParams, aL as CommunityBan, aM as UnbanCustomerParams, M as MarketDiscovery, g as ClientState, aN as ClientServerConfig, E as EventsClient, aO as RootServerClientWithEvents } from './types-CM2je9Kw.cjs';
4
- export { A as AddItemParams, aP as CancelServerPaymentSessionParams, aQ as CartApi, aR as CartApiOptions, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, o as CheckoutAbandonedReason, p as CheckoutAmounts, aS as CheckoutApi, aT as CheckoutApiOptions, aU as CheckoutListItem, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, aV as CheckoutQueryParams, aW as CheckoutQueryResult, s as CheckoutShippingAddress, aX as CheckoutStatus, t as ClearCartParams, aY as CollectionCustomFieldDefinition, aZ as CollectionCustomFields, a_ as CollectionFieldSchema, a$ as CollectionSchemaResponse, b0 as ConfirmCustomPaymentSessionOptions, b1 as ConfirmCustomPaymentSessionParams, b2 as ConfirmCustomPaymentSessionResponse, b3 as ConfirmTossPaymentSessionParams, w as CreateCartParams, x as CreateCartResult, b4 as CreateCustomPaymentSessionParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, b5 as CreateServerCheckoutParams, b6 as CreateServerCheckoutResult, b7 as CustomPaymentSession, b8 as CustomPaymentSessionProof, d as CustomerMembershipView, F as CustomerSnapshot, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, J as MembershipStatus, bw as ModerationApi, K as Money, O as OpenCheckoutPaymentState, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, bx as PaymentSessionApi, by as PaymentSessionApiOptions, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, af as ReconciliationRequired, ag as RemoveItemParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bz as RetrieveCustomPaymentSessionParams, bA as RetrieveServerCheckoutParams, bB as RetrieveServerPaymentSessionParams, bC as RetrievedCustomPaymentSession, bD as RootServerClient, bE as ServerCartMergeParams, bF as ServerCartMineParams, bG as ServerCheckout, ao as ShippingLine, aq as SpentCheckoutPaymentState, bH as TenantContextInput, bI as TenantContextResponse, bJ as TenantCustomFieldType, bK as TenantFeatureProgressEvidenceValue, bL as TenantFeatureProgressFeature, bM as TenantFeatureProgressGroup, bN as TenantFeatureProgressInput, bO as TenantFeatureProgressItem, bP as TenantFeatureProgressItemState, bQ as TenantFeatureProgressResponse, bR as TenantFeatureProgressSeverity, bS as TenantFeatureProgressStatus, bT as TenantFieldConfigState, bU as TenantIntrospectionApi, bV as TenantIntrospectionApiOptions, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, aB as UpdateItemParams, aC as VariantInput } from './types-CM2je9Kw.cjs';
5
- import './payload-types-B6AZQcB7.cjs';
1
+ import { S as ServerCollectionClient } from './collection-client-XfGLPuTf.cjs';
2
+ export { C as CollectionClient } from './collection-client-XfGLPuTf.cjs';
3
+ import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, a as CommunityClient, aK as BanCustomerParams, aL as CommunityBan, aM as UnbanCustomerParams, M as MarketDiscovery, g as ClientState, aN as ClientServerConfig, E as EventsClient, aO as RootServerClientWithEvents } from './types-1UeOk1Uy.cjs';
4
+ export { A as AddItemParams, aP as CancelServerPaymentSessionParams, aQ as CartApi, aR as CartApiOptions, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, o as CheckoutAbandonedReason, p as CheckoutAmounts, aS as CheckoutApi, aT as CheckoutApiOptions, aU as CheckoutListItem, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, aV as CheckoutQueryParams, aW as CheckoutQueryResult, s as CheckoutShippingAddress, aX as CheckoutStatus, t as ClearCartParams, aY as CollectionCustomFieldDefinition, aZ as CollectionCustomFields, a_ as CollectionFieldSchema, a$ as CollectionSchemaResponse, b0 as ConfirmCustomPaymentSessionOptions, b1 as ConfirmCustomPaymentSessionParams, b2 as ConfirmCustomPaymentSessionResponse, b3 as ConfirmTossPaymentSessionParams, w as CreateCartParams, x as CreateCartResult, b4 as CreateCustomPaymentSessionParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, b5 as CreateServerCheckoutParams, b6 as CreateServerCheckoutResult, b7 as CustomPaymentSession, b8 as CustomPaymentSessionProof, d as CustomerMembershipView, F as CustomerSnapshot, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, J as MembershipStatus, bw as ModerationApi, K as Money, O as OpenCheckoutPaymentState, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, bx as PaymentSessionApi, by as PaymentSessionApiOptions, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, af as ReconciliationRequired, ag as RemoveItemParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bz as RetrieveCustomPaymentSessionParams, bA as RetrieveServerCheckoutParams, bB as RetrieveServerPaymentSessionParams, bC as RetrievedCustomPaymentSession, bD as RootServerClient, bE as ServerCartMergeParams, bF as ServerCartMineParams, bG as ServerCheckout, ao as ShippingLine, aq as SpentCheckoutPaymentState, bH as TenantContextInput, bI as TenantContextResponse, bJ as TenantCustomFieldType, bK as TenantFeatureProgressEvidenceValue, bL as TenantFeatureProgressFeature, bM as TenantFeatureProgressGroup, bN as TenantFeatureProgressInput, bO as TenantFeatureProgressItem, bP as TenantFeatureProgressItemState, bQ as TenantFeatureProgressResponse, bR as TenantFeatureProgressSeverity, bS as TenantFeatureProgressStatus, bT as TenantFieldConfigState, bU as TenantIntrospectionApi, bV as TenantIntrospectionApiOptions, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, aB as UpdateItemParams, aC as VariantInput } from './types-1UeOk1Uy.cjs';
5
+ import './payload-types-MKbx5MuJ.cjs';
6
+ export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.cjs';
6
7
  import './metadata.cjs';
7
- import './const-BXEi1Kix.cjs';
8
- import './types-8us-_C-Q.cjs';
8
+ import './const-CBba4lDo.cjs';
9
+ import './types-BKr_2avj.cjs';
9
10
 
10
11
  type PreviewDetailParams = {
11
12
  collection: string;
package/dist/server.d.ts CHANGED
@@ -1,11 +1,12 @@
1
- import { S as ServerCollectionClient } from './collection-client-D3ExJU-7.js';
2
- export { C as CollectionClient } from './collection-client-D3ExJU-7.js';
3
- import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, a as CommunityClient, aK as BanCustomerParams, aL as CommunityBan, aM as UnbanCustomerParams, M as MarketDiscovery, g as ClientState, aN as ClientServerConfig, E as EventsClient, aO as RootServerClientWithEvents } from './types-DbA5V3mt.js';
4
- export { A as AddItemParams, aP as CancelServerPaymentSessionParams, aQ as CartApi, aR as CartApiOptions, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, o as CheckoutAbandonedReason, p as CheckoutAmounts, aS as CheckoutApi, aT as CheckoutApiOptions, aU as CheckoutListItem, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, aV as CheckoutQueryParams, aW as CheckoutQueryResult, s as CheckoutShippingAddress, aX as CheckoutStatus, t as ClearCartParams, aY as CollectionCustomFieldDefinition, aZ as CollectionCustomFields, a_ as CollectionFieldSchema, a$ as CollectionSchemaResponse, b0 as ConfirmCustomPaymentSessionOptions, b1 as ConfirmCustomPaymentSessionParams, b2 as ConfirmCustomPaymentSessionResponse, b3 as ConfirmTossPaymentSessionParams, w as CreateCartParams, x as CreateCartResult, b4 as CreateCustomPaymentSessionParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, b5 as CreateServerCheckoutParams, b6 as CreateServerCheckoutResult, b7 as CustomPaymentSession, b8 as CustomPaymentSessionProof, d as CustomerMembershipView, F as CustomerSnapshot, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, J as MembershipStatus, bw as ModerationApi, K as Money, O as OpenCheckoutPaymentState, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, bx as PaymentSessionApi, by as PaymentSessionApiOptions, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, af as ReconciliationRequired, ag as RemoveItemParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bz as RetrieveCustomPaymentSessionParams, bA as RetrieveServerCheckoutParams, bB as RetrieveServerPaymentSessionParams, bC as RetrievedCustomPaymentSession, bD as RootServerClient, bE as ServerCartMergeParams, bF as ServerCartMineParams, bG as ServerCheckout, ao as ShippingLine, aq as SpentCheckoutPaymentState, bH as TenantContextInput, bI as TenantContextResponse, bJ as TenantCustomFieldType, bK as TenantFeatureProgressEvidenceValue, bL as TenantFeatureProgressFeature, bM as TenantFeatureProgressGroup, bN as TenantFeatureProgressInput, bO as TenantFeatureProgressItem, bP as TenantFeatureProgressItemState, bQ as TenantFeatureProgressResponse, bR as TenantFeatureProgressSeverity, bS as TenantFeatureProgressStatus, bT as TenantFieldConfigState, bU as TenantIntrospectionApi, bV as TenantIntrospectionApiOptions, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, aB as UpdateItemParams, aC as VariantInput } from './types-DbA5V3mt.js';
5
- import './payload-types-B6AZQcB7.js';
1
+ import { S as ServerCollectionClient } from './collection-client-DnDt6EQz.js';
2
+ export { C as CollectionClient } from './collection-client-DnDt6EQz.js';
3
+ import { aE as RawBaseApi, aF as ServerApiOptions, aG as ServerCommerceClient, aH as TenantIntrospectionClient, aI as SubscribeMembershipParams, aJ as SubscribeMembershipResponse, e as CancelMembershipParams, f as CancelMembershipResponse, a as CommunityClient, aK as BanCustomerParams, aL as CommunityBan, aM as UnbanCustomerParams, M as MarketDiscovery, g as ClientState, aN as ClientServerConfig, E as EventsClient, aO as RootServerClientWithEvents } from './types-Du4s5anw.js';
4
+ export { A as AddItemParams, aP as CancelServerPaymentSessionParams, aQ as CartApi, aR as CartApiOptions, l as CartMergeResult, m as CartMineResult, n as CartMutationResult, o as CheckoutAbandonedReason, p as CheckoutAmounts, aS as CheckoutApi, aT as CheckoutApiOptions, aU as CheckoutListItem, q as CheckoutOrderReference, r as CheckoutPaymentSessionRef, aV as CheckoutQueryParams, aW as CheckoutQueryResult, s as CheckoutShippingAddress, aX as CheckoutStatus, t as ClearCartParams, aY as CollectionCustomFieldDefinition, aZ as CollectionCustomFields, a_ as CollectionFieldSchema, a$ as CollectionSchemaResponse, b0 as ConfirmCustomPaymentSessionOptions, b1 as ConfirmCustomPaymentSessionParams, b2 as ConfirmCustomPaymentSessionResponse, b3 as ConfirmTossPaymentSessionParams, w as CreateCartParams, x as CreateCartResult, b4 as CreateCustomPaymentSessionParams, B as CreatePaymentSessionParams, D as CreatePortOnePaymentSessionParams, b5 as CreateServerCheckoutParams, b6 as CreateServerCheckoutResult, b7 as CustomPaymentSession, b8 as CustomPaymentSessionProof, d as CustomerMembershipView, F as CustomerSnapshot, b9 as EventAdmissionAvailabilityParams, ba as EventAdmissionAvailabilityResponse, bb as EventAdmissionAvailabilityType, bc as EventAdmissionPricePresentment, bd as EventGuestCancelParams, be as EventGuestRegistration, bf as EventGuestRegistrationResponse, bg as EventRegistrationAnswerInput, bh as EventRegistrationAttendeeInput, bi as EventRegistrationPublic, bj as EventRegistrationRegisterParams, bk as EventRegistrationRegisterResponse, bl as EventsCalendarItem, bm as EventsClientOptions, bn as EventsDateParam, bo as EventsExternalSource, bp as EventsLocation, bq as EventsOccurrenceLocation, br as EventsRangeEvent, bs as EventsRangeOccurrence, bt as EventsRangeParams, bu as EventsRangeResponse, bv as EventsTaxonomyItem, J as MembershipStatus, bw as ModerationApi, K as Money, O as OpenCheckoutPaymentState, N as PaymentFailureReason, Q as PaymentNextAction, R as PaymentProviderStatus, S as PaymentReconciliationReason, bx as PaymentSessionApi, by as PaymentSessionApiOptions, T as PaymentSessionRole, U as PortOneHostedPaymentMethod, V as PortOnePaymentNextAction, W as PortOnePublicPaymentSession, X as ProductUpsertInput, Y as ProductUpsertParams, Z as ProductUpsertResponse, _ as ProductUpsertVariantInput, $ as PublicAttribute, a0 as PublicCaptureEvidence, a1 as PublicCart, a2 as PublicCartItem, a3 as PublicCartItemAdmission, a4 as PublicCartMarket, a5 as PublicCartReference, a6 as PublicCheckout, a7 as PublicCheckoutItem, a8 as PublicMediaAsset, a9 as PublicMediaSize, aa as PublicOrder, ab as PublicOrderAmounts, ac as PublicOrderItem, ad as PublicOrderReference, ae as PublicPaymentSession, af as ReconciliationRequired, ag as RemoveItemParams, ai as RetrieveCartParams, aj as RetrieveCheckoutParams, bz as RetrieveCustomPaymentSessionParams, bA as RetrieveServerCheckoutParams, bB as RetrieveServerPaymentSessionParams, bC as RetrievedCustomPaymentSession, bD as RootServerClient, bE as ServerCartMergeParams, bF as ServerCartMineParams, bG as ServerCheckout, ao as ShippingLine, aq as SpentCheckoutPaymentState, bH as TenantContextInput, bI as TenantContextResponse, bJ as TenantCustomFieldType, bK as TenantFeatureProgressEvidenceValue, bL as TenantFeatureProgressFeature, bM as TenantFeatureProgressGroup, bN as TenantFeatureProgressInput, bO as TenantFeatureProgressItem, bP as TenantFeatureProgressItemState, bQ as TenantFeatureProgressResponse, bR as TenantFeatureProgressSeverity, bS as TenantFeatureProgressStatus, bT as TenantFieldConfigState, bU as TenantIntrospectionApi, bV as TenantIntrospectionApiOptions, az as UpdateCartAttributesParams, aA as UpdateDiscountCodesParams, aB as UpdateItemParams, aC as VariantInput } from './types-Du4s5anw.js';
5
+ import './payload-types-MKbx5MuJ.js';
6
+ export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.js';
6
7
  import './metadata.js';
7
- import './const-k9gHylYa.js';
8
- import './types-ByD2zii1.js';
8
+ import './const-DCNV5Kq7.js';
9
+ import './types-L_nh-ED7.js';
9
10
 
10
11
  type PreviewDetailParams = {
11
12
  collection: string;
package/dist/server.js CHANGED
@@ -2,6 +2,24 @@
2
2
  import { stringify } from "qs-esm";
3
3
 
4
4
  // src/core/errors.ts
5
+ var SDK_ERROR_BRAND = /* @__PURE__ */ Symbol.for("@01.software/sdk/SDKError");
6
+ var SDK_ERROR_TYPE_BRAND = /* @__PURE__ */ Symbol.for("@01.software/sdk/SDKError.type");
7
+ function defineSDKErrorBrand(error) {
8
+ Object.defineProperty(error, SDK_ERROR_BRAND, {
9
+ value: true,
10
+ enumerable: false,
11
+ configurable: false,
12
+ writable: false
13
+ });
14
+ }
15
+ function defineSDKErrorType(error, type) {
16
+ Object.defineProperty(error, SDK_ERROR_TYPE_BRAND, {
17
+ value: type,
18
+ enumerable: false,
19
+ configurable: false,
20
+ writable: false
21
+ });
22
+ }
5
23
  var SDKError = class extends Error {
6
24
  constructor(code, message, status, details, userMessage, suggestion, requestId) {
7
25
  super(message);
@@ -12,6 +30,7 @@ var SDKError = class extends Error {
12
30
  this.userMessage = userMessage;
13
31
  this.suggestion = suggestion;
14
32
  this.requestId = requestId;
33
+ defineSDKErrorBrand(this);
15
34
  if (Error.captureStackTrace) {
16
35
  Error.captureStackTrace(this, new.target);
17
36
  }
@@ -32,6 +51,7 @@ var SDKError = class extends Error {
32
51
  ...this.kind !== void 0 && { kind: this.kind },
33
52
  ...this.reason !== void 0 && { reason: this.reason },
34
53
  ...this.rawReason !== void 0 && { rawReason: this.rawReason },
54
+ ...this.apiReason !== void 0 && { apiReason: this.apiReason },
35
55
  ...this.retryable !== void 0 && { retryable: this.retryable },
36
56
  ...this.retryAfter !== void 0 && { retryAfter: this.retryAfter }
37
57
  };
@@ -205,8 +225,16 @@ function enhanceCommerceError(error, body, headerRequestId) {
205
225
  });
206
226
  return error;
207
227
  }
228
+ function enhanceNonCommerceError(error, reason) {
229
+ if (typeof reason === "string") Object.assign(error, { apiReason: reason });
230
+ return error;
231
+ }
232
+ function getSDKErrorReason(error) {
233
+ if (error.kind !== "commerce") return error.apiReason;
234
+ return error.reason === "unknown_commerce_error" ? error.rawReason : error.reason;
235
+ }
208
236
  function isCommerceSDKError(error) {
209
- if (!(error instanceof SDKError) || error.kind !== "commerce") return false;
237
+ if (!isSDKError(error) || error.kind !== "commerce") return false;
210
238
  if (typeof error.requestId !== "string" || typeof error.retryable !== "boolean" || error.retryAfter !== void 0 && (!Number.isSafeInteger(error.retryAfter) || error.retryAfter < 0) || typeof error.reason !== "string") {
211
239
  return false;
212
240
  }
@@ -216,12 +244,14 @@ var NetworkError = class extends SDKError {
216
244
  constructor(message, status, details, userMessage, suggestion) {
217
245
  super("NETWORK_ERROR", message, status, details, userMessage, suggestion);
218
246
  this.name = "NetworkError";
247
+ defineSDKErrorType(this, "NetworkError");
219
248
  }
220
249
  };
221
250
  var ValidationError = class extends SDKError {
222
251
  constructor(message, details, userMessage, suggestion, status = 400) {
223
252
  super("VALIDATION_ERROR", message, status, details, userMessage, suggestion);
224
253
  this.name = "ValidationError";
254
+ defineSDKErrorType(this, "ValidationError");
225
255
  }
226
256
  };
227
257
  var ApiError = class extends SDKError {
@@ -236,24 +266,28 @@ var ApiError = class extends SDKError {
236
266
  requestId
237
267
  );
238
268
  this.name = "ApiError";
269
+ defineSDKErrorType(this, "ApiError");
239
270
  }
240
271
  };
241
272
  var ConfigError = class extends SDKError {
242
273
  constructor(message, details, userMessage, suggestion) {
243
274
  super("CONFIG_ERROR", message, void 0, details, userMessage, suggestion);
244
275
  this.name = "ConfigError";
276
+ defineSDKErrorType(this, "ConfigError");
245
277
  }
246
278
  };
247
279
  var TimeoutError = class extends SDKError {
248
280
  constructor(message = "Request timed out.", details, userMessage, suggestion) {
249
281
  super("TIMEOUT_ERROR", message, 408, details, userMessage, suggestion);
250
282
  this.name = "TimeoutError";
283
+ defineSDKErrorType(this, "TimeoutError");
251
284
  }
252
285
  };
253
286
  var GoneError = class extends SDKError {
254
287
  constructor(message = "The requested resource is no longer available.", details, userMessage, suggestion) {
255
288
  super("GONE_ERROR", message, 410, details, userMessage, suggestion);
256
289
  this.name = "GoneError";
290
+ defineSDKErrorType(this, "GoneError");
257
291
  }
258
292
  };
259
293
  var ServiceUnavailableError = class extends SDKError {
@@ -268,6 +302,7 @@ var ServiceUnavailableError = class extends SDKError {
268
302
  );
269
303
  this.name = "ServiceUnavailableError";
270
304
  this.retryAfter = retryAfter;
305
+ defineSDKErrorType(this, "ServiceUnavailableError");
271
306
  }
272
307
  };
273
308
  var UsageLimitError = class extends SDKError {
@@ -275,6 +310,7 @@ var UsageLimitError = class extends SDKError {
275
310
  super("USAGE_LIMIT_ERROR", message, 429, details, userMessage, suggestion);
276
311
  this.name = "UsageLimitError";
277
312
  this.usage = usage;
313
+ defineSDKErrorType(this, "UsageLimitError");
278
314
  }
279
315
  toJSON() {
280
316
  return {
@@ -295,6 +331,7 @@ var AuthError = class extends SDKError {
295
331
  requestId
296
332
  );
297
333
  this.name = "AuthError";
334
+ defineSDKErrorType(this, "AuthError");
298
335
  }
299
336
  };
300
337
  var PermissionError = class extends SDKError {
@@ -309,6 +346,7 @@ var PermissionError = class extends SDKError {
309
346
  requestId
310
347
  );
311
348
  this.name = "PermissionError";
349
+ defineSDKErrorType(this, "PermissionError");
312
350
  }
313
351
  };
314
352
  var NotFoundError = class extends SDKError {
@@ -323,12 +361,14 @@ var NotFoundError = class extends SDKError {
323
361
  requestId
324
362
  );
325
363
  this.name = "NotFoundError";
364
+ defineSDKErrorType(this, "NotFoundError");
326
365
  }
327
366
  };
328
367
  var ConflictError = class extends SDKError {
329
368
  constructor(message, details, userMessage, suggestion, requestId) {
330
369
  super("conflict", message, 409, details, userMessage, suggestion, requestId);
331
370
  this.name = "ConflictError";
371
+ defineSDKErrorType(this, "ConflictError");
332
372
  }
333
373
  };
334
374
  var RateLimitError = class extends SDKError {
@@ -344,8 +384,64 @@ var RateLimitError = class extends SDKError {
344
384
  );
345
385
  this.name = "RateLimitError";
346
386
  this.retryAfter = retryAfter;
387
+ defineSDKErrorType(this, "RateLimitError");
347
388
  }
348
389
  };
390
+ function hasBrandedSDKErrorShape(error) {
391
+ if (error === null || typeof error !== "object") return false;
392
+ const candidate = error;
393
+ return candidate[SDK_ERROR_BRAND] === true && typeof candidate.name === "string" && typeof candidate.code === "string" && typeof candidate.message === "string" && (candidate.status === void 0 || typeof candidate.status === "number") && (candidate.userMessage === void 0 || typeof candidate.userMessage === "string") && (candidate.suggestion === void 0 || typeof candidate.suggestion === "string") && (candidate.requestId === void 0 || typeof candidate.requestId === "string") && (candidate.kind === void 0 || candidate.kind === "commerce") && (candidate.reason === void 0 || typeof candidate.reason === "string") && (candidate.rawReason === void 0 || typeof candidate.rawReason === "string") && (candidate.apiReason === void 0 || typeof candidate.apiReason === "string") && (candidate.retryable === void 0 || typeof candidate.retryable === "boolean") && (candidate.retryAfter === void 0 || typeof candidate.retryAfter === "number") && typeof candidate.getUserMessage === "function" && typeof candidate.toJSON === "function";
394
+ }
395
+ function hasSDKErrorType(error, type) {
396
+ return hasBrandedSDKErrorShape(error) && error[SDK_ERROR_TYPE_BRAND] === type;
397
+ }
398
+ function isSDKError(error) {
399
+ return error instanceof SDKError || hasBrandedSDKErrorShape(error);
400
+ }
401
+ function isNetworkError(error) {
402
+ return error instanceof NetworkError || hasSDKErrorType(error, "NetworkError");
403
+ }
404
+ function isValidationError(error) {
405
+ if (error instanceof ValidationError || hasSDKErrorType(error, "ValidationError")) {
406
+ return true;
407
+ }
408
+ if (error == null || typeof error !== "object") return false;
409
+ const candidate = error;
410
+ return candidate.name === "ValidationError" && candidate.code === "VALIDATION_ERROR" && typeof candidate.message === "string" && typeof candidate.getUserMessage === "function" && typeof candidate.toJSON === "function";
411
+ }
412
+ function isApiError(error) {
413
+ return error instanceof ApiError || hasSDKErrorType(error, "ApiError");
414
+ }
415
+ function isConfigError(error) {
416
+ return error instanceof ConfigError || hasSDKErrorType(error, "ConfigError");
417
+ }
418
+ function isTimeoutError(error) {
419
+ return error instanceof TimeoutError || hasSDKErrorType(error, "TimeoutError");
420
+ }
421
+ function isGoneError(error) {
422
+ return error instanceof GoneError || hasSDKErrorType(error, "GoneError");
423
+ }
424
+ function isServiceUnavailableError(error) {
425
+ return error instanceof ServiceUnavailableError || hasSDKErrorType(error, "ServiceUnavailableError");
426
+ }
427
+ function isUsageLimitError(error) {
428
+ return error instanceof UsageLimitError || hasSDKErrorType(error, "UsageLimitError");
429
+ }
430
+ function isAuthError(error) {
431
+ return error instanceof AuthError || hasSDKErrorType(error, "AuthError");
432
+ }
433
+ function isPermissionError(error) {
434
+ return error instanceof PermissionError || hasSDKErrorType(error, "PermissionError");
435
+ }
436
+ function isNotFoundError(error) {
437
+ return error instanceof NotFoundError || hasSDKErrorType(error, "NotFoundError");
438
+ }
439
+ function isConflictError(error) {
440
+ return error instanceof ConflictError || hasSDKErrorType(error, "ConflictError");
441
+ }
442
+ function isRateLimitError(error) {
443
+ return error instanceof RateLimitError || hasSDKErrorType(error, "RateLimitError");
444
+ }
349
445
  var createNetworkError = (message, status, details, userMessage, suggestion) => new NetworkError(message, status, details, userMessage, suggestion);
350
446
  var createValidationError = (message, details, userMessage, suggestion, status) => new ValidationError(message, details, userMessage, suggestion, status);
351
447
  var createApiError = (message, status, details, userMessage, suggestion, requestId) => new ApiError(message, status, details, userMessage, suggestion, requestId);
@@ -555,7 +651,7 @@ function mapResponseToError(status, parsed, details, requestId, retryAfter, erro
555
651
  if (retryAfter !== void 0) {
556
652
  Object.assign(withRequestId, { retryAfter });
557
653
  }
558
- return errorFamily === "commerce" ? enhanceCommerceError(withRequestId, parsed.body, requestId) : withRequestId;
654
+ return errorFamily === "commerce" ? enhanceCommerceError(withRequestId, parsed.body, requestId) : enhanceNonCommerceError(withRequestId, parsed.reason);
559
655
  };
560
656
  if (status === 400 || status === 422) {
561
657
  return finalize(
@@ -742,7 +838,7 @@ async function httpFetch(url, options) {
742
838
  ),
743
839
  requestId
744
840
  );
745
- throw errorFamily === "commerce" ? enhanceCommerceError(usageError, parsed.body, requestId) : usageError;
841
+ throw errorFamily === "commerce" ? enhanceCommerceError(usageError, parsed.body, requestId) : enhanceNonCommerceError(usageError, parsed.reason);
746
842
  }
747
843
  if (response.status === 401 && onUnauthorized && customerToken && !hasRetried401 && (commerceEnvelope?.reason ?? parsed.reason) === "token_expired") {
748
844
  hasRetried401 = true;
@@ -1464,7 +1560,7 @@ async function parseApiResponse(response, endpoint2, options = {}) {
1464
1560
  }
1465
1561
  const withRequestId = attachRequestId(error, requestId);
1466
1562
  if (retryAfter !== void 0) Object.assign(withRequestId, { retryAfter });
1467
- throw options.errorFamily === "commerce" ? enhanceCommerceError(withRequestId, data, requestId) : withRequestId;
1563
+ throw options.errorFamily === "commerce" ? enhanceCommerceError(withRequestId, data, requestId) : enhanceNonCommerceError(withRequestId, reason);
1468
1564
  }
1469
1565
  return data;
1470
1566
  }
@@ -1888,13 +1984,7 @@ function unwrapPayloadDoc(value) {
1888
1984
  return value;
1889
1985
  }
1890
1986
  function hasCanonicalNotFoundReason(error) {
1891
- const details = error.details;
1892
- if (typeof details !== "object" || details === null) return false;
1893
- if ("reason" in details && details.reason === "not_found") return true;
1894
- if (!("body" in details) || typeof details.body !== "object" || details.body === null) {
1895
- return false;
1896
- }
1897
- return "reason" in details.body && details.body.reason === "not_found";
1987
+ return getSDKErrorReason(error) === "not_found";
1898
1988
  }
1899
1989
  var CommunityClient = class extends RawCustomerScopedApi {
1900
1990
  constructor(options) {
@@ -3354,9 +3444,77 @@ function validateRequiredReconciliation(value, allowed, resource, path) {
3354
3444
  function validateNextAction(value, provider, resource, path) {
3355
3445
  const action = record(value, resource, path);
3356
3446
  if (provider === "portone") {
3447
+ if (action.type === "portone_sdk") {
3448
+ exact(
3449
+ action,
3450
+ [
3451
+ "type",
3452
+ "version",
3453
+ "storeId",
3454
+ "channelKey",
3455
+ "paymentId",
3456
+ "orderName",
3457
+ "totalAmount",
3458
+ "currency",
3459
+ "payMethod",
3460
+ "redirectUrl"
3461
+ ],
3462
+ [],
3463
+ resource,
3464
+ path
3465
+ );
3466
+ if (action.version !== "v2") fail(resource, `${path}.version`, "v2");
3467
+ for (const key of ["storeId", "channelKey"]) {
3468
+ boundedString(action[key], 255, resource, `${path}.${key}`);
3469
+ }
3470
+ const paymentId = boundedString(
3471
+ action.paymentId,
3472
+ 40,
3473
+ resource,
3474
+ `${path}.paymentId`
3475
+ );
3476
+ if (!/^[A-Za-z0-9]{6,40}$/.test(paymentId)) {
3477
+ fail(
3478
+ resource,
3479
+ `${path}.paymentId`,
3480
+ "6-40 ASCII alphanumeric characters"
3481
+ );
3482
+ }
3483
+ boundedString(
3484
+ action.orderName,
3485
+ MAX_COMMERCE_SHORT_TEXT_LENGTH,
3486
+ resource,
3487
+ `${path}.orderName`
3488
+ );
3489
+ positiveInteger(action.totalAmount, resource, `${path}.totalAmount`);
3490
+ if (action.currency !== "CURRENCY_KRW") {
3491
+ fail(resource, `${path}.currency`, "CURRENCY_KRW");
3492
+ }
3493
+ if (action.payMethod !== "CARD")
3494
+ fail(resource, `${path}.payMethod`, "CARD");
3495
+ const redirectUrl = boundedString(
3496
+ action.redirectUrl,
3497
+ 2048,
3498
+ resource,
3499
+ `${path}.redirectUrl`
3500
+ );
3501
+ try {
3502
+ const parsed = new URL(redirectUrl);
3503
+ const loopback = parsed.protocol === "http:" && (parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1");
3504
+ if (!loopback && parsed.protocol !== "https:" || parsed.username || parsed.password)
3505
+ throw new Error("unsafe redirect URL");
3506
+ } catch {
3507
+ fail(
3508
+ resource,
3509
+ `${path}.redirectUrl`,
3510
+ "HTTPS or loopback URL without embedded credentials"
3511
+ );
3512
+ }
3513
+ return;
3514
+ }
3357
3515
  exact(action, ["type", "checkoutUrl"], [], resource, path);
3358
3516
  if (action.type !== "portone_checkout") {
3359
- fail(resource, `${path}.type`, "portone_checkout");
3517
+ fail(resource, `${path}.type`, "portone_checkout | portone_sdk");
3360
3518
  }
3361
3519
  const checkoutUrl = boundedString(
3362
3520
  action.checkoutUrl,
@@ -4753,21 +4911,11 @@ var PRODUCT_DETAIL_UNAVAILABLE_REASONS = /* @__PURE__ */ new Set([
4753
4911
  "not_published",
4754
4912
  "feature_disabled"
4755
4913
  ]);
4756
- function isRecord(value) {
4757
- return typeof value === "object" && value !== null;
4758
- }
4759
- function readProductDetailUnavailableReason(value) {
4760
- if (!isRecord(value)) return void 0;
4761
- const directReason = value.reason ?? value.code;
4762
- if (typeof directReason === "string" && PRODUCT_DETAIL_UNAVAILABLE_REASONS.has(directReason)) {
4763
- return directReason;
4764
- }
4765
- return readProductDetailUnavailableReason(value.body);
4766
- }
4767
4914
  function productDetailResultFromError(error) {
4768
4915
  if (!(error instanceof SDKError) || error.status !== 404) return void 0;
4769
- const reason = readProductDetailUnavailableReason(error.details);
4770
- if (!reason) return void 0;
4916
+ const reason = getSDKErrorReason(error);
4917
+ if (!reason || !PRODUCT_DETAIL_UNAVAILABLE_REASONS.has(reason))
4918
+ return void 0;
4771
4919
  return { found: false, reason };
4772
4920
  }
4773
4921
  var MARKET_PRICE_QUERY_UNSUPPORTED_MESSAGE = "Market listing pages do not support base price filters or price sorts.";
@@ -5826,6 +5974,21 @@ export {
5826
5974
  ServerCommerceClient,
5827
5975
  ServerPreviewClient,
5828
5976
  TenantIntrospectionApi,
5829
- createServerClient
5977
+ createServerClient,
5978
+ isApiError,
5979
+ isAuthError,
5980
+ isCommerceSDKError,
5981
+ isConfigError,
5982
+ isConflictError,
5983
+ isGoneError,
5984
+ isNetworkError,
5985
+ isNotFoundError,
5986
+ isPermissionError,
5987
+ isRateLimitError,
5988
+ isSDKError,
5989
+ isServiceUnavailableError,
5990
+ isTimeoutError,
5991
+ isUsageLimitError,
5992
+ isValidationError
5830
5993
  };
5831
5994
  //# sourceMappingURL=server.js.map