@tokenoftrust/storefront-runner 2.4.58 → 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.
|
@@ -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",
|