@01.software/sdk 0.69.0 → 0.70.1

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 (65) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +26 -7
  3. package/dist/client.cjs +35 -7
  4. package/dist/client.cjs.map +1 -1
  5. package/dist/client.d.cts +6 -6
  6. package/dist/client.d.ts +6 -6
  7. package/dist/client.js +35 -7
  8. package/dist/client.js.map +1 -1
  9. package/dist/{collection-client-C2VGBnCC.d.ts → collection-client-B1FSJ24_.d.ts} +5 -5
  10. package/dist/{collection-client-DvWkDxSM.d.cts → collection-client-BHLStm1K.d.cts} +5 -5
  11. package/dist/{const-AtPEgg__.d.cts → const-BfQfV-rr.d.cts} +1 -1
  12. package/dist/{const-DR96Chal.d.ts → const-ty8u0TDI.d.ts} +1 -1
  13. package/dist/embedded-admin/server.cjs +5 -0
  14. package/dist/embedded-admin/server.cjs.map +1 -1
  15. package/dist/embedded-admin/server.js +5 -0
  16. package/dist/embedded-admin/server.js.map +1 -1
  17. package/dist/embedded-admin.cjs +5 -0
  18. package/dist/embedded-admin.cjs.map +1 -1
  19. package/dist/embedded-admin.js +5 -0
  20. package/dist/embedded-admin.js.map +1 -1
  21. package/dist/errors.cjs +5 -0
  22. package/dist/errors.cjs.map +1 -1
  23. package/dist/errors.d.cts +3 -3
  24. package/dist/errors.d.ts +3 -3
  25. package/dist/errors.js +5 -0
  26. package/dist/errors.js.map +1 -1
  27. package/dist/{index-Ce11c_Oh.d.cts → index-CX6si6YC.d.cts} +3 -3
  28. package/dist/{index-D8fmTrZk.d.ts → index-DnKgjPGM.d.ts} +3 -3
  29. package/dist/index.cjs +35 -7
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +7 -7
  32. package/dist/index.d.ts +7 -7
  33. package/dist/index.js +35 -7
  34. package/dist/index.js.map +1 -1
  35. package/dist/{payload-types-rhnw3rR8.d.cts → payload-types-DTAaWKrp.d.cts} +18 -4
  36. package/dist/{payload-types-rhnw3rR8.d.ts → payload-types-DTAaWKrp.d.ts} +18 -4
  37. package/dist/query.cjs +14 -0
  38. package/dist/query.cjs.map +1 -1
  39. package/dist/query.d.cts +5 -5
  40. package/dist/query.d.ts +5 -5
  41. package/dist/query.js +14 -0
  42. package/dist/query.js.map +1 -1
  43. package/dist/realtime.d.cts +2 -2
  44. package/dist/realtime.d.ts +2 -2
  45. package/dist/server.cjs +35 -7
  46. package/dist/server.cjs.map +1 -1
  47. package/dist/server.d.cts +7 -7
  48. package/dist/server.d.ts +7 -7
  49. package/dist/server.js +35 -7
  50. package/dist/server.js.map +1 -1
  51. package/dist/storefront-cache.cjs +5 -0
  52. package/dist/storefront-cache.cjs.map +1 -1
  53. package/dist/storefront-cache.js +5 -0
  54. package/dist/storefront-cache.js.map +1 -1
  55. package/dist/{types-B99utaKU.d.cts → types-Bzgf4mTo.d.cts} +3 -3
  56. package/dist/{types-CHK8VIPa.d.ts → types-CpSiyJud.d.cts} +8 -2
  57. package/dist/{types-BR0D4AaW.d.cts → types-DX8Z44yQ.d.ts} +8 -2
  58. package/dist/{types-L0xmn_iT.d.ts → types-DdlhpNVv.d.ts} +3 -3
  59. package/dist/ui/form.d.cts +1 -1
  60. package/dist/ui/form.d.ts +1 -1
  61. package/dist/ui/video.d.cts +1 -1
  62. package/dist/ui/video.d.ts +1 -1
  63. package/dist/webhook.d.cts +5 -5
  64. package/dist/webhook.d.ts +5 -5
  65. package/package.json +1 -1
package/dist/client.d.cts CHANGED
@@ -1,10 +1,10 @@
1
- import { cI as CustomerScopedApi, bd as ListMyBenefitVouchersRequest, be as ListMyBenefitVouchersResponse, cJ as CommerceClient, i as CommunityClient, cK as ContentClient, aH as EventsClient, cL as CustomerNamespace, M as MarketDiscovery, ao as CustomerMembershipView, C as CancelMembershipParams, d as CancelMembershipResponse, l as ClientState, cM as ClientConfig } from './types-B99utaKU.cjs';
2
- export { A as AddItemParams, cN as ApiQueryOptions, cO as CancelBrowserPaymentSessionParams, cP as CartMergeParams, w as CartMergeResult, x as CartMineResult, y as CartMutationResult, z as CheckoutAbandonedReason, D as CheckoutAmounts, J as CheckoutOrderReference, K as CheckoutPaymentSessionRef, O as CheckoutShippingAddress, W as ClearCartParams, cQ as ClientMetadata, cR as ContentClientOptions, a4 as CreateCartParams, a5 as CreateCartResult, cS as CreateCheckoutParams, cT as CreateCheckoutResult, a8 as CreatePaymentSessionParams, a9 as CreatePortOnePaymentSessionParams, ap as CustomerSnapshot, cU as DebugConfig, cV as DeepPartial, cW as ExtractArrayType, bf as MembershipStatus, bh as Money, bk as OpenCheckoutPaymentState, cX as PayloadFindResponse, cY as PayloadMutationResponse, bl as PaymentFailureReason, bm as PaymentNextAction, bn as PaymentProviderStatus, bo as PaymentReconciliationReason, br as PaymentSessionRole, bs as PortOneHostedPaymentMethod, bu as PortOnePaymentNextAction, bx as PortOnePublicPaymentSession, bB as ProductUpsertInput, bC as ProductUpsertParams, bD as ProductUpsertResponse, bE as ProductUpsertVariantInput, bF as PublicAttribute, bG as PublicCaptureEvidence, bH as PublicCart, bI as PublicCartItem, bJ as PublicCartItemAdmission, bK as PublicCartMarket, bL as PublicCartReference, bM as PublicCheckout, bN as PublicCheckoutItem, bO as PublicMediaAsset, bP as PublicMediaSize, bQ as PublicOrder, bR as PublicOrderAmounts, bS as PublicOrderItem, bT as PublicOrderReference, bU as PublicPaymentSession, bX as ReconciliationRequired, b_ as RemoveItemParams, cZ as RetrieveBrowserPaymentSessionParams, c1 as RetrieveCartParams, c2 as RetrieveCheckoutParams, c_ as RetryConfig, c$ as RootClient, c$ as RootClientType, d0 as RootCollectionClient, d1 as RootReadOnlyQueryBuilder, ce as ShippingLine, d2 as Sort, cf as SpentCheckoutPaymentState, d3 as StorefrontContentListOptions, d4 as StorefrontContentReference, d5 as StorefrontGalleryItem, d6 as StorefrontGalleryItemsListOptions, d7 as StorefrontGalleryItemsSort, d8 as StorefrontLink, d9 as StorefrontLinksListOptions, da as StorefrontLinksSort, cw as UpdateCartAttributesParams, cx as UpdateDiscountCodesParams, cy as UpdateItemParams, cz as VariantInput, db as Where } from './types-B99utaKU.cjs';
3
- import { R as ReadOnlyCollectionClient } from './collection-client-DvWkDxSM.cjs';
1
+ import { cI as CustomerScopedApi, bd as ListMyBenefitVouchersRequest, be as ListMyBenefitVouchersResponse, cJ as CommerceClient, i as CommunityClient, cK as ContentClient, aH as EventsClient, cL as CustomerNamespace, M as MarketDiscovery, ao as CustomerMembershipView, C as CancelMembershipParams, d as CancelMembershipResponse, l as ClientState, cM as ClientConfig } from './types-Bzgf4mTo.cjs';
2
+ export { A as AddItemParams, cN as ApiQueryOptions, cO as CancelBrowserPaymentSessionParams, cP as CartMergeParams, w as CartMergeResult, x as CartMineResult, y as CartMutationResult, z as CheckoutAbandonedReason, D as CheckoutAmounts, J as CheckoutOrderReference, K as CheckoutPaymentSessionRef, O as CheckoutShippingAddress, W as ClearCartParams, cQ as ClientMetadata, cR as ContentClientOptions, a4 as CreateCartParams, a5 as CreateCartResult, cS as CreateCheckoutParams, cT as CreateCheckoutResult, a8 as CreatePaymentSessionParams, a9 as CreatePortOnePaymentSessionParams, ap as CustomerSnapshot, cU as DebugConfig, cV as DeepPartial, cW as ExtractArrayType, bf as MembershipStatus, bh as Money, bk as OpenCheckoutPaymentState, cX as PayloadFindResponse, cY as PayloadMutationResponse, bl as PaymentFailureReason, bm as PaymentNextAction, bn as PaymentProviderStatus, bo as PaymentReconciliationReason, br as PaymentSessionRole, bs as PortOneHostedPaymentMethod, bu as PortOnePaymentNextAction, bx as PortOnePublicPaymentSession, bB as ProductUpsertInput, bC as ProductUpsertParams, bD as ProductUpsertResponse, bE as ProductUpsertVariantInput, bF as PublicAttribute, bG as PublicCaptureEvidence, bH as PublicCart, bI as PublicCartItem, bJ as PublicCartItemAdmission, bK as PublicCartMarket, bL as PublicCartReference, bM as PublicCheckout, bN as PublicCheckoutItem, bO as PublicMediaAsset, bP as PublicMediaSize, bQ as PublicOrder, bR as PublicOrderAmounts, bS as PublicOrderItem, bT as PublicOrderReference, bU as PublicPaymentSession, bX as ReconciliationRequired, b_ as RemoveItemParams, cZ as RetrieveBrowserPaymentSessionParams, c1 as RetrieveCartParams, c2 as RetrieveCheckoutParams, c_ as RetryConfig, c$ as RootClient, c$ as RootClientType, d0 as RootCollectionClient, d1 as RootReadOnlyQueryBuilder, ce as ShippingLine, d2 as Sort, cf as SpentCheckoutPaymentState, d3 as StorefrontContentListOptions, d4 as StorefrontContentReference, d5 as StorefrontGalleryItem, d6 as StorefrontGalleryItemsListOptions, d7 as StorefrontGalleryItemsSort, d8 as StorefrontLink, d9 as StorefrontLinksListOptions, da as StorefrontLinksSort, cw as UpdateCartAttributesParams, cx as UpdateDiscountCodesParams, cy as UpdateItemParams, cz as VariantInput, db as Where } from './types-Bzgf4mTo.cjs';
3
+ import { R as ReadOnlyCollectionClient } from './collection-client-BHLStm1K.cjs';
4
4
  export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.cjs';
5
- export { C as Collection, P as PublicCollection } from './const-AtPEgg__.cjs';
6
- import './types-BR0D4AaW.cjs';
7
- import './payload-types-rhnw3rR8.cjs';
5
+ export { C as Collection, P as PublicCollection } from './const-BfQfV-rr.cjs';
6
+ import './types-CpSiyJud.cjs';
7
+ import './payload-types-DTAaWKrp.cjs';
8
8
  import './metadata.cjs';
9
9
 
10
10
  declare class CustomerBenefitVouchersApi extends CustomerScopedApi {
package/dist/client.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import { cI as CustomerScopedApi, bd as ListMyBenefitVouchersRequest, be as ListMyBenefitVouchersResponse, cJ as CommerceClient, i as CommunityClient, cK as ContentClient, aH as EventsClient, cL as CustomerNamespace, M as MarketDiscovery, ao as CustomerMembershipView, C as CancelMembershipParams, d as CancelMembershipResponse, l as ClientState, cM as ClientConfig } from './types-L0xmn_iT.js';
2
- export { A as AddItemParams, cN as ApiQueryOptions, cO as CancelBrowserPaymentSessionParams, cP as CartMergeParams, w as CartMergeResult, x as CartMineResult, y as CartMutationResult, z as CheckoutAbandonedReason, D as CheckoutAmounts, J as CheckoutOrderReference, K as CheckoutPaymentSessionRef, O as CheckoutShippingAddress, W as ClearCartParams, cQ as ClientMetadata, cR as ContentClientOptions, a4 as CreateCartParams, a5 as CreateCartResult, cS as CreateCheckoutParams, cT as CreateCheckoutResult, a8 as CreatePaymentSessionParams, a9 as CreatePortOnePaymentSessionParams, ap as CustomerSnapshot, cU as DebugConfig, cV as DeepPartial, cW as ExtractArrayType, bf as MembershipStatus, bh as Money, bk as OpenCheckoutPaymentState, cX as PayloadFindResponse, cY as PayloadMutationResponse, bl as PaymentFailureReason, bm as PaymentNextAction, bn as PaymentProviderStatus, bo as PaymentReconciliationReason, br as PaymentSessionRole, bs as PortOneHostedPaymentMethod, bu as PortOnePaymentNextAction, bx as PortOnePublicPaymentSession, bB as ProductUpsertInput, bC as ProductUpsertParams, bD as ProductUpsertResponse, bE as ProductUpsertVariantInput, bF as PublicAttribute, bG as PublicCaptureEvidence, bH as PublicCart, bI as PublicCartItem, bJ as PublicCartItemAdmission, bK as PublicCartMarket, bL as PublicCartReference, bM as PublicCheckout, bN as PublicCheckoutItem, bO as PublicMediaAsset, bP as PublicMediaSize, bQ as PublicOrder, bR as PublicOrderAmounts, bS as PublicOrderItem, bT as PublicOrderReference, bU as PublicPaymentSession, bX as ReconciliationRequired, b_ as RemoveItemParams, cZ as RetrieveBrowserPaymentSessionParams, c1 as RetrieveCartParams, c2 as RetrieveCheckoutParams, c_ as RetryConfig, c$ as RootClient, c$ as RootClientType, d0 as RootCollectionClient, d1 as RootReadOnlyQueryBuilder, ce as ShippingLine, d2 as Sort, cf as SpentCheckoutPaymentState, d3 as StorefrontContentListOptions, d4 as StorefrontContentReference, d5 as StorefrontGalleryItem, d6 as StorefrontGalleryItemsListOptions, d7 as StorefrontGalleryItemsSort, d8 as StorefrontLink, d9 as StorefrontLinksListOptions, da as StorefrontLinksSort, cw as UpdateCartAttributesParams, cx as UpdateDiscountCodesParams, cy as UpdateItemParams, cz as VariantInput, db as Where } from './types-L0xmn_iT.js';
3
- import { R as ReadOnlyCollectionClient } from './collection-client-C2VGBnCC.js';
1
+ import { cI as CustomerScopedApi, bd as ListMyBenefitVouchersRequest, be as ListMyBenefitVouchersResponse, cJ as CommerceClient, i as CommunityClient, cK as ContentClient, aH as EventsClient, cL as CustomerNamespace, M as MarketDiscovery, ao as CustomerMembershipView, C as CancelMembershipParams, d as CancelMembershipResponse, l as ClientState, cM as ClientConfig } from './types-DdlhpNVv.js';
2
+ export { A as AddItemParams, cN as ApiQueryOptions, cO as CancelBrowserPaymentSessionParams, cP as CartMergeParams, w as CartMergeResult, x as CartMineResult, y as CartMutationResult, z as CheckoutAbandonedReason, D as CheckoutAmounts, J as CheckoutOrderReference, K as CheckoutPaymentSessionRef, O as CheckoutShippingAddress, W as ClearCartParams, cQ as ClientMetadata, cR as ContentClientOptions, a4 as CreateCartParams, a5 as CreateCartResult, cS as CreateCheckoutParams, cT as CreateCheckoutResult, a8 as CreatePaymentSessionParams, a9 as CreatePortOnePaymentSessionParams, ap as CustomerSnapshot, cU as DebugConfig, cV as DeepPartial, cW as ExtractArrayType, bf as MembershipStatus, bh as Money, bk as OpenCheckoutPaymentState, cX as PayloadFindResponse, cY as PayloadMutationResponse, bl as PaymentFailureReason, bm as PaymentNextAction, bn as PaymentProviderStatus, bo as PaymentReconciliationReason, br as PaymentSessionRole, bs as PortOneHostedPaymentMethod, bu as PortOnePaymentNextAction, bx as PortOnePublicPaymentSession, bB as ProductUpsertInput, bC as ProductUpsertParams, bD as ProductUpsertResponse, bE as ProductUpsertVariantInput, bF as PublicAttribute, bG as PublicCaptureEvidence, bH as PublicCart, bI as PublicCartItem, bJ as PublicCartItemAdmission, bK as PublicCartMarket, bL as PublicCartReference, bM as PublicCheckout, bN as PublicCheckoutItem, bO as PublicMediaAsset, bP as PublicMediaSize, bQ as PublicOrder, bR as PublicOrderAmounts, bS as PublicOrderItem, bT as PublicOrderReference, bU as PublicPaymentSession, bX as ReconciliationRequired, b_ as RemoveItemParams, cZ as RetrieveBrowserPaymentSessionParams, c1 as RetrieveCartParams, c2 as RetrieveCheckoutParams, c_ as RetryConfig, c$ as RootClient, c$ as RootClientType, d0 as RootCollectionClient, d1 as RootReadOnlyQueryBuilder, ce as ShippingLine, d2 as Sort, cf as SpentCheckoutPaymentState, d3 as StorefrontContentListOptions, d4 as StorefrontContentReference, d5 as StorefrontGalleryItem, d6 as StorefrontGalleryItemsListOptions, d7 as StorefrontGalleryItemsSort, d8 as StorefrontLink, d9 as StorefrontLinksListOptions, da as StorefrontLinksSort, cw as UpdateCartAttributesParams, cx as UpdateDiscountCodesParams, cy as UpdateItemParams, cz as VariantInput, db as Where } from './types-DdlhpNVv.js';
3
+ import { R as ReadOnlyCollectionClient } from './collection-client-B1FSJ24_.js';
4
4
  export { isApiError, isAuthError, isCommerceSDKError, isConfigError, isConflictError, isGoneError, isNetworkError, isNotFoundError, isPermissionError, isRateLimitError, isSDKError, isServiceUnavailableError, isTimeoutError, isUsageLimitError, isValidationError } from './errors.js';
5
- export { C as Collection, P as PublicCollection } from './const-DR96Chal.js';
6
- import './types-CHK8VIPa.js';
7
- import './payload-types-rhnw3rR8.js';
5
+ export { C as Collection, P as PublicCollection } from './const-ty8u0TDI.js';
6
+ import './types-DX8Z44yQ.js';
7
+ import './payload-types-DTAaWKrp.js';
8
8
  import './metadata.js';
9
9
 
10
10
  declare class CustomerBenefitVouchersApi extends CustomerScopedApi {
package/dist/client.js CHANGED
@@ -110,6 +110,11 @@ var COMMERCE_ERROR_CODES = [
110
110
  "checkout_reservation_release_requires_transaction",
111
111
  "admission_metadata_invalid",
112
112
  "admission_metadata_required",
113
+ "admission_not_eligible",
114
+ "admission_eligibility_unavailable",
115
+ "admission_authority_unavailable",
116
+ "admission_customer_binding_required",
117
+ "admission_eligibility_unproven",
113
118
  "capacity_exceeded",
114
119
  "admission_required",
115
120
  "occurrence_lock_unavailable",
@@ -779,6 +784,7 @@ async function httpFetch(url, options) {
779
784
  let lastError;
780
785
  let hasRetried401 = false;
781
786
  for (let attempt = 0; attempt <= retryConfig.maxRetries; attempt++) {
787
+ let terminalResponseError;
782
788
  try {
783
789
  const headers = new Headers(requestInit.headers);
784
790
  if (publishableKey) {
@@ -847,8 +853,9 @@ async function httpFetch(url, options) {
847
853
  hasRetried401 = true;
848
854
  try {
849
855
  const newToken = await onUnauthorized();
850
- if (newToken) {
856
+ if (newToken && SAFE_METHODS.includes((requestInit.method || "GET").toUpperCase())) {
851
857
  authToken = newToken;
858
+ attempt--;
852
859
  continue;
853
860
  }
854
861
  } catch {
@@ -881,11 +888,15 @@ async function httpFetch(url, options) {
881
888
  await delay(retryDelay);
882
889
  continue;
883
890
  }
891
+ terminalResponseError = error;
884
892
  throw error;
885
893
  }
886
894
  return response;
887
895
  } catch (error) {
888
896
  debugLog(debug, "error", url, error);
897
+ if (terminalResponseError && error === terminalResponseError) {
898
+ throw error;
899
+ }
889
900
  const method2 = (requestInit.method || "GET").toUpperCase();
890
901
  const isSafe = SAFE_METHODS.includes(method2);
891
902
  if (error instanceof Error && error.name === "AbortError") {
@@ -1297,6 +1308,15 @@ var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
1297
1308
  };
1298
1309
  var EVENTS_ENDPOINT_OPERATIONS = {
1299
1310
  registrations: {
1311
+ register: operation("event-registrations", "post", "/register"),
1312
+ guestLookup: operation("event-registrations", "post", "/guest/lookup"),
1313
+ guestLookupByUrl: operation("event-registrations", "get", "/guest/:token"),
1314
+ guestCancel: operation("event-registrations", "post", "/guest/cancel"),
1315
+ guestCancelByUrl: operation(
1316
+ "event-registrations",
1317
+ "post",
1318
+ "/guest/:token/cancel"
1319
+ ),
1300
1320
  listMine: operation("event-registrations", "get", "/my")
1301
1321
  },
1302
1322
  events: {
@@ -6315,24 +6335,32 @@ var EventsClient = class {
6315
6335
  }
6316
6336
  register(params) {
6317
6337
  return this.execute(
6318
- "/api/event-registrations/register",
6319
- "POST",
6338
+ resolveOperationPath(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
6339
+ resolveOperationMethod(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
6320
6340
  buildRegistrationRequestBody(params),
6321
6341
  { useCustomerAuth: true }
6322
6342
  );
6323
6343
  }
6324
6344
  getGuestRegistration(token) {
6325
6345
  return this.execute(
6326
- "/api/event-registrations/guest/lookup",
6327
- "POST",
6346
+ resolveOperationPath(
6347
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
6348
+ ),
6349
+ resolveOperationMethod(
6350
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
6351
+ ),
6328
6352
  { token },
6329
6353
  { useCustomerAuth: false }
6330
6354
  );
6331
6355
  }
6332
6356
  cancelGuestRegistration(token, params = {}) {
6333
6357
  return this.execute(
6334
- "/api/event-registrations/guest/cancel",
6335
- "POST",
6358
+ resolveOperationPath(
6359
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
6360
+ ),
6361
+ resolveOperationMethod(
6362
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
6363
+ ),
6336
6364
  buildGuestCancelRequestBody(token, params),
6337
6365
  { useCustomerAuth: false }
6338
6366
  );