@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
@@ -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-AtPEgg__.cjs';
4
- import './payload-types-rhnw3rR8.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-DR96Chal.js';
4
- import './payload-types-rhnw3rR8.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,6 +167,11 @@ 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",
171
176
  "admission_required",
172
177
  "occurrence_lock_unavailable",
@@ -836,6 +841,7 @@ async function httpFetch(url, options) {
836
841
  let lastError;
837
842
  let hasRetried401 = false;
838
843
  for (let attempt = 0; attempt <= retryConfig.maxRetries; attempt++) {
844
+ let terminalResponseError;
839
845
  try {
840
846
  const headers = new Headers(requestInit.headers);
841
847
  if (publishableKey) {
@@ -904,8 +910,9 @@ async function httpFetch(url, options) {
904
910
  hasRetried401 = true;
905
911
  try {
906
912
  const newToken = await onUnauthorized();
907
- if (newToken) {
913
+ if (newToken && SAFE_METHODS.includes((requestInit.method || "GET").toUpperCase())) {
908
914
  authToken = newToken;
915
+ attempt--;
909
916
  continue;
910
917
  }
911
918
  } catch {
@@ -938,11 +945,15 @@ async function httpFetch(url, options) {
938
945
  await delay(retryDelay);
939
946
  continue;
940
947
  }
948
+ terminalResponseError = error;
941
949
  throw error;
942
950
  }
943
951
  return response;
944
952
  } catch (error) {
945
953
  debugLog(debug, "error", url, error);
954
+ if (terminalResponseError && error === terminalResponseError) {
955
+ throw error;
956
+ }
946
957
  const method2 = (requestInit.method || "GET").toUpperCase();
947
958
  const isSafe = SAFE_METHODS.includes(method2);
948
959
  if (error instanceof Error && error.name === "AbortError") {
@@ -1354,6 +1365,15 @@ var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
1354
1365
  };
1355
1366
  var EVENTS_ENDPOINT_OPERATIONS = {
1356
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
+ ),
1357
1377
  listMine: operation("event-registrations", "get", "/my")
1358
1378
  },
1359
1379
  events: {
@@ -6290,24 +6310,32 @@ var EventsClient = class {
6290
6310
  }
6291
6311
  register(params) {
6292
6312
  return this.execute(
6293
- "/api/event-registrations/register",
6294
- "POST",
6313
+ resolveOperationPath(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
6314
+ resolveOperationMethod(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
6295
6315
  buildRegistrationRequestBody(params),
6296
6316
  { useCustomerAuth: true }
6297
6317
  );
6298
6318
  }
6299
6319
  getGuestRegistration(token) {
6300
6320
  return this.execute(
6301
- "/api/event-registrations/guest/lookup",
6302
- "POST",
6321
+ resolveOperationPath(
6322
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
6323
+ ),
6324
+ resolveOperationMethod(
6325
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
6326
+ ),
6303
6327
  { token },
6304
6328
  { useCustomerAuth: false }
6305
6329
  );
6306
6330
  }
6307
6331
  cancelGuestRegistration(token, params = {}) {
6308
6332
  return this.execute(
6309
- "/api/event-registrations/guest/cancel",
6310
- "POST",
6333
+ resolveOperationPath(
6334
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
6335
+ ),
6336
+ resolveOperationMethod(
6337
+ EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
6338
+ ),
6311
6339
  buildGuestCancelRequestBody(token, params),
6312
6340
  { useCustomerAuth: false }
6313
6341
  );