@tokenoftrust/storefront-runner 2.4.57 → 2.4.59
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.
|
@@ -399,7 +399,6 @@ export function decideFulfillmentAccess(input: {
|
|
|
399
399
|
const stage = commerceStageForEnv(input.customizationEnv);
|
|
400
400
|
if (!stage) return { ok: false, status: 409, code: "stage-unknown" };
|
|
401
401
|
const host = input.hostResource.trim();
|
|
402
|
-
if (!isOpaqueId(host) && host.length === 0) return { ok: false, status: 403, code: "denied" };
|
|
403
402
|
if (!host) return { ok: false, status: 403, code: "denied" };
|
|
404
403
|
if (input.bodyTenantId && input.bodyTenantId !== host) return { ok: false, status: 403, code: "denied" };
|
|
405
404
|
if (!input.subject || !isOpaqueId(input.subject)) return { ok: false, status: 403, code: "denied" };
|
|
@@ -1094,8 +1093,7 @@ export class FulfillmentService {
|
|
|
1094
1093
|
private async write(statements: readonly SqlStatement[]): Promise<number[] | null> {
|
|
1095
1094
|
try {
|
|
1096
1095
|
return await this.db.batch(statements);
|
|
1097
|
-
} catch
|
|
1098
|
-
if (error instanceof Error && error.message === "storage") return null;
|
|
1096
|
+
} catch {
|
|
1099
1097
|
return null;
|
|
1100
1098
|
}
|
|
1101
1099
|
}
|
|
@@ -18,8 +18,6 @@ import {
|
|
|
18
18
|
|
|
19
19
|
export const RESERVATION_AUTHORITY_HEADER = "x-tot-reservation-authority";
|
|
20
20
|
export const RESERVATION_AUTHORITY_NONE = "none";
|
|
21
|
-
/** Catalog `available` / `quantity` never authorizes a hold. */
|
|
22
|
-
export const CATALOG_IS_RESERVATION_AUTHORITY = false;
|
|
23
21
|
export const VERIFICATION_PROVIDER_OWNER = "tot-9577-tot-verification-provider";
|
|
24
22
|
|
|
25
23
|
const SKU_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,80}$/;
|
|
@@ -137,9 +135,6 @@ export function mirrorOnHand(sku: string, locationId: string): number | null {
|
|
|
137
135
|
}
|
|
138
136
|
|
|
139
137
|
export function reservationAuthorityHeader(): typeof RESERVATION_AUTHORITY_NONE {
|
|
140
|
-
if (CATALOG_IS_RESERVATION_AUTHORITY) {
|
|
141
|
-
throw new Error("catalog availability is not reservation authority");
|
|
142
|
-
}
|
|
143
138
|
return RESERVATION_AUTHORITY_NONE;
|
|
144
139
|
}
|
|
145
140
|
|
|
@@ -217,13 +212,7 @@ export function d1CommerceRunner(db: D1CommerceDatabase): StatementRunner {
|
|
|
217
212
|
return asRows(await db.prepare(sql).bind(...params).all());
|
|
218
213
|
},
|
|
219
214
|
async batch(statements) {
|
|
220
|
-
if (!db.batch)
|
|
221
|
-
const results: Record<string, unknown>[][] = [];
|
|
222
|
-
for (const statement of statements) {
|
|
223
|
-
results.push(asRows(await db.prepare(statement.sql).bind(...statement.params).all()));
|
|
224
|
-
}
|
|
225
|
-
return results;
|
|
226
|
-
}
|
|
215
|
+
if (!db.batch) throw new Error("D1 batch is required");
|
|
227
216
|
const bound: unknown[] = statements.map((statement) => db.prepare(statement.sql).bind(...statement.params));
|
|
228
217
|
const results = await db.batch(bound);
|
|
229
218
|
return results.map((result) => asRows(result));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/storefront-runner",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.59",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"description": "World-shareable storefront runner: multi-tenant renderer on Astro/Cloudflare. No control plane.",
|
|
6
6
|
"packageManager": "pnpm@11.9.0",
|