@01.software/sdk 0.68.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 +53 -0
  2. package/README.md +28 -7
  3. package/dist/client.cjs +38 -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 +38 -7
  8. package/dist/client.js.map +1 -1
  9. package/dist/{collection-client-IOaWsTMI.d.ts → collection-client-B1FSJ24_.d.ts} +5 -5
  10. package/dist/{collection-client-MbIJ5KzW.d.cts → collection-client-BHLStm1K.d.cts} +5 -5
  11. package/dist/{const-Dw5ElJs_.d.cts → const-BfQfV-rr.d.cts} +1 -1
  12. package/dist/{const-Do27Udj6.d.ts → const-ty8u0TDI.d.ts} +1 -1
  13. package/dist/embedded-admin/server.cjs +8 -0
  14. package/dist/embedded-admin/server.cjs.map +1 -1
  15. package/dist/embedded-admin/server.js +8 -0
  16. package/dist/embedded-admin/server.js.map +1 -1
  17. package/dist/embedded-admin.cjs +8 -0
  18. package/dist/embedded-admin.cjs.map +1 -1
  19. package/dist/embedded-admin.js +8 -0
  20. package/dist/embedded-admin.js.map +1 -1
  21. package/dist/errors.cjs +8 -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 +8 -0
  26. package/dist/errors.js.map +1 -1
  27. package/dist/{index-gnVxTKXu.d.cts → index-CX6si6YC.d.cts} +3 -3
  28. package/dist/{index-DcYsLOja.d.ts → index-DnKgjPGM.d.ts} +3 -3
  29. package/dist/index.cjs +38 -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 +38 -7
  34. package/dist/index.js.map +1 -1
  35. package/dist/{payload-types-BY1uZFRf.d.cts → payload-types-DTAaWKrp.d.cts} +32 -4
  36. package/dist/{payload-types-BY1uZFRf.d.ts → payload-types-DTAaWKrp.d.ts} +32 -4
  37. package/dist/query.cjs +17 -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 +17 -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 +38 -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 +38 -7
  50. package/dist/server.js.map +1 -1
  51. package/dist/storefront-cache.cjs +8 -0
  52. package/dist/storefront-cache.cjs.map +1 -1
  53. package/dist/storefront-cache.js +8 -0
  54. package/dist/storefront-cache.js.map +1 -1
  55. package/dist/{types-csjaig4G.d.cts → types-Bzgf4mTo.d.cts} +3 -3
  56. package/dist/{types-DnIuxgu2.d.cts → types-CpSiyJud.d.cts} +8 -2
  57. package/dist/{types-AWSVpuPE.d.ts → types-DX8Z44yQ.d.ts} +8 -2
  58. package/dist/{types-CLRw0aDa.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
@@ -1,7 +1,7 @@
1
1
  import { R as RealtimeEvent } from './realtime-D7HtUpqt.cjs';
2
2
  export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.cjs';
3
- import { P as PublicCollection } from './const-Dw5ElJs_.cjs';
4
- import './payload-types-BY1uZFRf.cjs';
3
+ import { P as PublicCollection } from './const-BfQfV-rr.cjs';
4
+ import './payload-types-DTAaWKrp.cjs';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
@@ -1,7 +1,7 @@
1
1
  import { R as RealtimeEvent } from './realtime-D7HtUpqt.js';
2
2
  export { a as RealtimeConnection, b as RealtimeListener } from './realtime-D7HtUpqt.js';
3
- import { P as PublicCollection } from './const-Do27Udj6.js';
4
- import './payload-types-BY1uZFRf.js';
3
+ import { P as PublicCollection } from './const-ty8u0TDI.js';
4
+ import './payload-types-DTAaWKrp.js';
5
5
 
6
6
  interface UseRealtimeQueryOptions {
7
7
  /** Filter events to specific collections. Empty/undefined = all collections. */
package/dist/server.cjs CHANGED
@@ -167,7 +167,13 @@ var COMMERCE_ERROR_CODES = [
167
167
  "checkout_reservation_release_requires_transaction",
168
168
  "admission_metadata_invalid",
169
169
  "admission_metadata_required",
170
+ "admission_not_eligible",
171
+ "admission_eligibility_unavailable",
172
+ "admission_authority_unavailable",
173
+ "admission_customer_binding_required",
174
+ "admission_eligibility_unproven",
170
175
  "capacity_exceeded",
176
+ "admission_required",
171
177
  "occurrence_lock_unavailable",
172
178
  "occurrence_not_open",
173
179
  "admission_type_capacity_exceeded",
@@ -186,6 +192,8 @@ var COMMERCE_ERROR_CODES = [
186
192
  "variant_inactive",
187
193
  "variant_product_mismatch",
188
194
  "product_not_public",
195
+ "product_not_eligible",
196
+ "purchase_limit_exceeded",
189
197
  "market_not_found",
190
198
  "market_shipping_currency_unsupported",
191
199
  "missing_market_rate",
@@ -833,6 +841,7 @@ async function httpFetch(url, options) {
833
841
  let lastError;
834
842
  let hasRetried401 = false;
835
843
  for (let attempt = 0; attempt <= retryConfig.maxRetries; attempt++) {
844
+ let terminalResponseError;
836
845
  try {
837
846
  const headers = new Headers(requestInit.headers);
838
847
  if (publishableKey) {
@@ -901,8 +910,9 @@ async function httpFetch(url, options) {
901
910
  hasRetried401 = true;
902
911
  try {
903
912
  const newToken = await onUnauthorized();
904
- if (newToken) {
913
+ if (newToken && SAFE_METHODS.includes((requestInit.method || "GET").toUpperCase())) {
905
914
  authToken = newToken;
915
+ attempt--;
906
916
  continue;
907
917
  }
908
918
  } catch {
@@ -935,11 +945,15 @@ async function httpFetch(url, options) {
935
945
  await delay(retryDelay);
936
946
  continue;
937
947
  }
948
+ terminalResponseError = error;
938
949
  throw error;
939
950
  }
940
951
  return response;
941
952
  } catch (error) {
942
953
  debugLog(debug, "error", url, error);
954
+ if (terminalResponseError && error === terminalResponseError) {
955
+ throw error;
956
+ }
943
957
  const method2 = (requestInit.method || "GET").toUpperCase();
944
958
  const isSafe = SAFE_METHODS.includes(method2);
945
959
  if (error instanceof Error && error.name === "AbortError") {
@@ -1351,6 +1365,15 @@ var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
1351
1365
  };
1352
1366
  var EVENTS_ENDPOINT_OPERATIONS = {
1353
1367
  registrations: {
1368
+ register: operation("event-registrations", "post", "/register"),
1369
+ guestLookup: operation("event-registrations", "post", "/guest/lookup"),
1370
+ guestLookupByUrl: operation("event-registrations", "get", "/guest/:token"),
1371
+ guestCancel: operation("event-registrations", "post", "/guest/cancel"),
1372
+ guestCancelByUrl: operation(
1373
+ "event-registrations",
1374
+ "post",
1375
+ "/guest/:token/cancel"
1376
+ ),
1354
1377
  listMine: operation("event-registrations", "get", "/my")
1355
1378
  },
1356
1379
  events: {
@@ -6287,24 +6310,32 @@ var EventsClient = class {
6287
6310
  }
6288
6311
  register(params) {
6289
6312
  return this.execute(
6290
- "/api/event-registrations/register",
6291
- "POST",
6313
+ resolveOperationPath(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
6314
+ resolveOperationMethod(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
6292
6315
  buildRegistrationRequestBody(params),
6293
6316
  { useCustomerAuth: true }
6294
6317
  );
6295
6318
  }
6296
6319
  getGuestRegistration(token) {
6297
6320
  return this.execute(
6298
- "/api/event-registrations/guest/lookup",
6299
- "POST",
6321
+ resolveOperationPath(
6322
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
6323
+ ),
6324
+ resolveOperationMethod(
6325
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
6326
+ ),
6300
6327
  { token },
6301
6328
  { useCustomerAuth: false }
6302
6329
  );
6303
6330
  }
6304
6331
  cancelGuestRegistration(token, params = {}) {
6305
6332
  return this.execute(
6306
- "/api/event-registrations/guest/cancel",
6307
- "POST",
6333
+ resolveOperationPath(
6334
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
6335
+ ),
6336
+ resolveOperationMethod(
6337
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
6338
+ ),
6308
6339
  buildGuestCancelRequestBody(token, params),
6309
6340
  { useCustomerAuth: false }
6310
6341
  );