@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.
- package/CHANGELOG.md +39 -0
- package/README.md +26 -7
- package/dist/client.cjs +35 -7
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +35 -7
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-C2VGBnCC.d.ts → collection-client-B1FSJ24_.d.ts} +5 -5
- package/dist/{collection-client-DvWkDxSM.d.cts → collection-client-BHLStm1K.d.cts} +5 -5
- package/dist/{const-AtPEgg__.d.cts → const-BfQfV-rr.d.cts} +1 -1
- package/dist/{const-DR96Chal.d.ts → const-ty8u0TDI.d.ts} +1 -1
- package/dist/embedded-admin/server.cjs +5 -0
- package/dist/embedded-admin/server.cjs.map +1 -1
- package/dist/embedded-admin/server.js +5 -0
- package/dist/embedded-admin/server.js.map +1 -1
- package/dist/embedded-admin.cjs +5 -0
- package/dist/embedded-admin.cjs.map +1 -1
- package/dist/embedded-admin.js +5 -0
- package/dist/embedded-admin.js.map +1 -1
- package/dist/errors.cjs +5 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +3 -3
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +5 -0
- package/dist/errors.js.map +1 -1
- package/dist/{index-Ce11c_Oh.d.cts → index-CX6si6YC.d.cts} +3 -3
- package/dist/{index-D8fmTrZk.d.ts → index-DnKgjPGM.d.ts} +3 -3
- package/dist/index.cjs +35 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +35 -7
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-rhnw3rR8.d.cts → payload-types-DTAaWKrp.d.cts} +18 -4
- package/dist/{payload-types-rhnw3rR8.d.ts → payload-types-DTAaWKrp.d.ts} +18 -4
- package/dist/query.cjs +14 -0
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +14 -0
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +35 -7
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +35 -7
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +5 -0
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +5 -0
- package/dist/storefront-cache.js.map +1 -1
- package/dist/{types-B99utaKU.d.cts → types-Bzgf4mTo.d.cts} +3 -3
- package/dist/{types-CHK8VIPa.d.ts → types-CpSiyJud.d.cts} +8 -2
- package/dist/{types-BR0D4AaW.d.cts → types-DX8Z44yQ.d.ts} +8 -2
- package/dist/{types-L0xmn_iT.d.ts → types-DdlhpNVv.d.ts} +3 -3
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.d.cts +5 -5
- package/dist/webhook.d.ts +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -253,6 +253,11 @@ var COMMERCE_ERROR_CODES = [
|
|
|
253
253
|
"checkout_reservation_release_requires_transaction",
|
|
254
254
|
"admission_metadata_invalid",
|
|
255
255
|
"admission_metadata_required",
|
|
256
|
+
"admission_not_eligible",
|
|
257
|
+
"admission_eligibility_unavailable",
|
|
258
|
+
"admission_authority_unavailable",
|
|
259
|
+
"admission_customer_binding_required",
|
|
260
|
+
"admission_eligibility_unproven",
|
|
256
261
|
"capacity_exceeded",
|
|
257
262
|
"admission_required",
|
|
258
263
|
"occurrence_lock_unavailable",
|
|
@@ -922,6 +927,7 @@ async function httpFetch(url, options) {
|
|
|
922
927
|
let lastError;
|
|
923
928
|
let hasRetried401 = false;
|
|
924
929
|
for (let attempt = 0; attempt <= retryConfig.maxRetries; attempt++) {
|
|
930
|
+
let terminalResponseError;
|
|
925
931
|
try {
|
|
926
932
|
const headers = new Headers(requestInit.headers);
|
|
927
933
|
if (publishableKey) {
|
|
@@ -990,8 +996,9 @@ async function httpFetch(url, options) {
|
|
|
990
996
|
hasRetried401 = true;
|
|
991
997
|
try {
|
|
992
998
|
const newToken = await onUnauthorized();
|
|
993
|
-
if (newToken) {
|
|
999
|
+
if (newToken && SAFE_METHODS.includes((requestInit.method || "GET").toUpperCase())) {
|
|
994
1000
|
authToken = newToken;
|
|
1001
|
+
attempt--;
|
|
995
1002
|
continue;
|
|
996
1003
|
}
|
|
997
1004
|
} catch {
|
|
@@ -1024,11 +1031,15 @@ async function httpFetch(url, options) {
|
|
|
1024
1031
|
await delay(retryDelay);
|
|
1025
1032
|
continue;
|
|
1026
1033
|
}
|
|
1034
|
+
terminalResponseError = error;
|
|
1027
1035
|
throw error;
|
|
1028
1036
|
}
|
|
1029
1037
|
return response;
|
|
1030
1038
|
} catch (error) {
|
|
1031
1039
|
debugLog(debug, "error", url, error);
|
|
1040
|
+
if (terminalResponseError && error === terminalResponseError) {
|
|
1041
|
+
throw error;
|
|
1042
|
+
}
|
|
1032
1043
|
const method2 = (requestInit.method || "GET").toUpperCase();
|
|
1033
1044
|
const isSafe = SAFE_METHODS.includes(method2);
|
|
1034
1045
|
if (error instanceof Error && error.name === "AbortError") {
|
|
@@ -1440,6 +1451,15 @@ var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
|
|
|
1440
1451
|
};
|
|
1441
1452
|
var EVENTS_ENDPOINT_OPERATIONS = {
|
|
1442
1453
|
registrations: {
|
|
1454
|
+
register: operation("event-registrations", "post", "/register"),
|
|
1455
|
+
guestLookup: operation("event-registrations", "post", "/guest/lookup"),
|
|
1456
|
+
guestLookupByUrl: operation("event-registrations", "get", "/guest/:token"),
|
|
1457
|
+
guestCancel: operation("event-registrations", "post", "/guest/cancel"),
|
|
1458
|
+
guestCancelByUrl: operation(
|
|
1459
|
+
"event-registrations",
|
|
1460
|
+
"post",
|
|
1461
|
+
"/guest/:token/cancel"
|
|
1462
|
+
),
|
|
1443
1463
|
listMine: operation("event-registrations", "get", "/my")
|
|
1444
1464
|
},
|
|
1445
1465
|
events: {
|
|
@@ -7185,24 +7205,32 @@ var EventsClient = class {
|
|
|
7185
7205
|
}
|
|
7186
7206
|
register(params) {
|
|
7187
7207
|
return this.execute(
|
|
7188
|
-
|
|
7189
|
-
|
|
7208
|
+
resolveOperationPath(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
|
|
7209
|
+
resolveOperationMethod(EVENTS_ENDPOINT_OPERATIONS.registrations.register),
|
|
7190
7210
|
buildRegistrationRequestBody(params),
|
|
7191
7211
|
{ useCustomerAuth: true }
|
|
7192
7212
|
);
|
|
7193
7213
|
}
|
|
7194
7214
|
getGuestRegistration(token) {
|
|
7195
7215
|
return this.execute(
|
|
7196
|
-
|
|
7197
|
-
|
|
7216
|
+
resolveOperationPath(
|
|
7217
|
+
EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
|
|
7218
|
+
),
|
|
7219
|
+
resolveOperationMethod(
|
|
7220
|
+
EVENTS_ENDPOINT_OPERATIONS.registrations.guestLookup
|
|
7221
|
+
),
|
|
7198
7222
|
{ token },
|
|
7199
7223
|
{ useCustomerAuth: false }
|
|
7200
7224
|
);
|
|
7201
7225
|
}
|
|
7202
7226
|
cancelGuestRegistration(token, params = {}) {
|
|
7203
7227
|
return this.execute(
|
|
7204
|
-
|
|
7205
|
-
|
|
7228
|
+
resolveOperationPath(
|
|
7229
|
+
EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
|
|
7230
|
+
),
|
|
7231
|
+
resolveOperationMethod(
|
|
7232
|
+
EVENTS_ENDPOINT_OPERATIONS.registrations.guestCancel
|
|
7233
|
+
),
|
|
7206
7234
|
buildGuestCancelRequestBody(token, params),
|
|
7207
7235
|
{ useCustomerAuth: false }
|
|
7208
7236
|
);
|