@mailoo/market 1.35.12 → 1.35.14
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/README.md +21 -12
- package/dist/chunk-SNYTGUGW.js +484 -0
- package/dist/chunk-SNYTGUGW.js.map +1 -0
- package/dist/types-ClEuQGG0.d.cts +144 -0
- package/dist/types-ClEuQGG0.d.ts +144 -0
- package/dist/wholesale-price-list/google-sheets/index.cjs +819 -0
- package/dist/wholesale-price-list/google-sheets/index.cjs.map +1 -0
- package/dist/wholesale-price-list/google-sheets/index.d.cts +99 -0
- package/dist/wholesale-price-list/google-sheets/index.d.ts +99 -0
- package/dist/wholesale-price-list/google-sheets/index.js +381 -0
- package/dist/wholesale-price-list/google-sheets/index.js.map +1 -0
- package/dist/wholesale-price-list/index.cjs +170 -416
- package/dist/wholesale-price-list/index.cjs.map +1 -1
- package/dist/wholesale-price-list/index.d.cts +41 -230
- package/dist/wholesale-price-list/index.d.ts +41 -230
- package/dist/wholesale-price-list/index.js +116 -787
- package/dist/wholesale-price-list/index.js.map +1 -1
- package/package.json +14 -3
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/wholesale-price-list/google-sheets/index.ts
|
|
31
|
+
var google_sheets_exports = {};
|
|
32
|
+
__export(google_sheets_exports, {
|
|
33
|
+
createPriceListGoogleClients: () => createPriceListGoogleClients,
|
|
34
|
+
renderPriceListGoogleSheet: () => renderPriceListGoogleSheet
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(google_sheets_exports);
|
|
37
|
+
|
|
38
|
+
// src/wholesale-price-list/concurrency.ts
|
|
39
|
+
var DEFAULT_PREVIEW_IMAGE_CONCURRENCY = 6;
|
|
40
|
+
async function mapWithConcurrency(items, concurrency, mapper) {
|
|
41
|
+
if (!Number.isInteger(concurrency) || concurrency < 1) {
|
|
42
|
+
throw new Error("concurrency must be an integer >= 1");
|
|
43
|
+
}
|
|
44
|
+
if (items.length === 0) return [];
|
|
45
|
+
const results = new Array(items.length);
|
|
46
|
+
let nextIndex = 0;
|
|
47
|
+
async function worker() {
|
|
48
|
+
for (; ; ) {
|
|
49
|
+
const i = nextIndex;
|
|
50
|
+
nextIndex += 1;
|
|
51
|
+
if (i >= items.length) return;
|
|
52
|
+
results[i] = await mapper(items[i], i);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const workerCount = Math.min(concurrency, items.length);
|
|
56
|
+
await Promise.all(Array.from({ length: workerCount }, () => worker()));
|
|
57
|
+
return results;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/wholesale-price-list/fetch-url.ts
|
|
61
|
+
async function fetchAbsoluteUrlBytes(url) {
|
|
62
|
+
const trimmed = url.trim();
|
|
63
|
+
if (!/^https?:\/\//i.test(trimmed)) return null;
|
|
64
|
+
try {
|
|
65
|
+
const res = await fetch(trimmed);
|
|
66
|
+
if (!res.ok) return null;
|
|
67
|
+
const buf = new Uint8Array(await res.arrayBuffer());
|
|
68
|
+
return buf.byteLength > 0 ? buf : null;
|
|
69
|
+
} catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function isMailooApiKeyedImageUrl(url) {
|
|
74
|
+
try {
|
|
75
|
+
const u = new URL(url.trim());
|
|
76
|
+
return u.pathname.includes("/api/v1/images/public/content");
|
|
77
|
+
} catch {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function isAnonymousHttpImageUrl(url) {
|
|
82
|
+
const trimmed = url.trim();
|
|
83
|
+
if (!/^https?:\/\//i.test(trimmed)) return false;
|
|
84
|
+
if (isMailooApiKeyedImageUrl(trimmed)) return false;
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// src/wholesale-price-list/labels.ts
|
|
89
|
+
var BUILTIN = {
|
|
90
|
+
en: {
|
|
91
|
+
title: "Price list",
|
|
92
|
+
photo: "Photo",
|
|
93
|
+
category: "Category",
|
|
94
|
+
product: "Product",
|
|
95
|
+
variant: "Variant",
|
|
96
|
+
packaging: "Packaging",
|
|
97
|
+
price: "Price",
|
|
98
|
+
onRequest: "on request",
|
|
99
|
+
link: "Link",
|
|
100
|
+
linkText: "Open",
|
|
101
|
+
quantity: "Quantity",
|
|
102
|
+
sum: "Sum",
|
|
103
|
+
total: "Total",
|
|
104
|
+
generated: "Generated: {date}",
|
|
105
|
+
filenamePrefix: "price-list"
|
|
106
|
+
},
|
|
107
|
+
ru: {
|
|
108
|
+
title: "\u041F\u0440\u0430\u0439\u0441-\u043B\u0438\u0441\u0442",
|
|
109
|
+
photo: "\u0424\u043E\u0442\u043E",
|
|
110
|
+
category: "\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",
|
|
111
|
+
product: "\u0422\u043E\u0432\u0430\u0440",
|
|
112
|
+
variant: "\u0412\u0430\u0440\u0438\u0430\u043D\u0442",
|
|
113
|
+
packaging: "\u0423\u043F\u0430\u043A\u043E\u0432\u043A\u0430",
|
|
114
|
+
price: "\u0426\u0435\u043D\u0430",
|
|
115
|
+
onRequest: "\u043F\u043E \u0437\u0430\u043F\u0440\u043E\u0441\u0443",
|
|
116
|
+
link: "\u0421\u0441\u044B\u043B\u043A\u0430",
|
|
117
|
+
linkText: "\u041E\u0442\u043A\u0440\u044B\u0442\u044C",
|
|
118
|
+
quantity: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",
|
|
119
|
+
sum: "\u0421\u0443\u043C\u043C\u0430",
|
|
120
|
+
total: "\u0418\u0442\u043E\u0433\u043E",
|
|
121
|
+
generated: "\u0421\u0444\u043E\u0440\u043C\u0438\u0440\u043E\u0432\u0430\u043D\u043E: {date}",
|
|
122
|
+
filenamePrefix: "price-list"
|
|
123
|
+
},
|
|
124
|
+
hy: {
|
|
125
|
+
title: "\u0533\u0576\u0561\u0581\u0578\u0582\u0581\u0561\u056F",
|
|
126
|
+
photo: "\u053C\u0578\u0582\u057D\u0561\u0576\u056F\u0561\u0580",
|
|
127
|
+
category: "\u053F\u0561\u057F\u0565\u0563\u0578\u0580\u056B\u0561",
|
|
128
|
+
product: "\u0531\u057A\u0580\u0561\u0576\u0584",
|
|
129
|
+
variant: "\u054F\u0561\u0580\u0562\u0565\u0580\u0561\u056F",
|
|
130
|
+
packaging: "\u0553\u0561\u0569\u0565\u0569\u0561\u057E\u0578\u0580\u0578\u0582\u0574",
|
|
131
|
+
price: "\u0533\u056B\u0576",
|
|
132
|
+
onRequest: "\u0568\u057D\u057F \u0570\u0561\u0580\u0581\u0574\u0561\u0576",
|
|
133
|
+
link: "\u0540\u0572\u0578\u0582\u0574",
|
|
134
|
+
linkText: "\u0532\u0561\u0581\u0565\u056C",
|
|
135
|
+
quantity: "\u0554\u0561\u0576\u0561\u056F",
|
|
136
|
+
sum: "\u0533\u0578\u0582\u0574\u0561\u0580",
|
|
137
|
+
total: "\u0538\u0576\u0564\u0561\u0574\u0565\u0576\u0568",
|
|
138
|
+
generated: "\u054D\u057F\u0565\u0572\u056E\u057E\u0561\u056E \u0567\u055D {date}",
|
|
139
|
+
filenamePrefix: "price-list"
|
|
140
|
+
},
|
|
141
|
+
de: {
|
|
142
|
+
title: "Preisliste",
|
|
143
|
+
photo: "Foto",
|
|
144
|
+
category: "Kategorie",
|
|
145
|
+
product: "Produkt",
|
|
146
|
+
variant: "Variante",
|
|
147
|
+
packaging: "Verpackung",
|
|
148
|
+
price: "Preis",
|
|
149
|
+
onRequest: "auf Anfrage",
|
|
150
|
+
link: "Link",
|
|
151
|
+
linkText: "\xD6ffnen",
|
|
152
|
+
quantity: "Menge",
|
|
153
|
+
sum: "Summe",
|
|
154
|
+
total: "Gesamt",
|
|
155
|
+
generated: "Erstellt: {date}",
|
|
156
|
+
filenamePrefix: "price-list"
|
|
157
|
+
},
|
|
158
|
+
es: {
|
|
159
|
+
title: "Lista de precios",
|
|
160
|
+
photo: "Foto",
|
|
161
|
+
category: "Categor\xEDa",
|
|
162
|
+
product: "Producto",
|
|
163
|
+
variant: "Variante",
|
|
164
|
+
packaging: "Embalaje",
|
|
165
|
+
price: "Precio",
|
|
166
|
+
onRequest: "bajo petici\xF3n",
|
|
167
|
+
link: "Enlace",
|
|
168
|
+
linkText: "Abrir",
|
|
169
|
+
quantity: "Cantidad",
|
|
170
|
+
sum: "Suma",
|
|
171
|
+
total: "Total",
|
|
172
|
+
generated: "Generado: {date}",
|
|
173
|
+
filenamePrefix: "price-list"
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var BUILTIN_LOCALES = /* @__PURE__ */ new Set(["hy", "ru", "en", "de", "es"]);
|
|
177
|
+
function resolvePriceListLabels(locale, overrides) {
|
|
178
|
+
const code = locale.trim().toLowerCase();
|
|
179
|
+
const base = BUILTIN_LOCALES.has(code) ? BUILTIN[code] : BUILTIN.en;
|
|
180
|
+
return { ...base, ...overrides };
|
|
181
|
+
}
|
|
182
|
+
function formatGeneratedLabel(template, generatedAt, locale, timeZone) {
|
|
183
|
+
const d = new Date(generatedAt);
|
|
184
|
+
if (Number.isNaN(d.getTime())) {
|
|
185
|
+
throw new Error(`header.generatedAt is not a valid ISO date: ${generatedAt}`);
|
|
186
|
+
}
|
|
187
|
+
const tz = timeZone && timeZone.trim() !== "" ? timeZone.trim() : "UTC";
|
|
188
|
+
const date = new Intl.DateTimeFormat(locale, {
|
|
189
|
+
dateStyle: "medium",
|
|
190
|
+
timeStyle: "short",
|
|
191
|
+
timeZone: tz
|
|
192
|
+
}).format(d);
|
|
193
|
+
return template.replace(/\{date\}/g, date);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// src/wholesale-price-list/unit-price.ts
|
|
197
|
+
function coerceUnitPrice(value) {
|
|
198
|
+
if (value === null) return null;
|
|
199
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value < 0) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
return value;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/wholesale-price-list/layout.ts
|
|
206
|
+
var PRICE_LIST_DEFAULT_PHOTO_PX = 120;
|
|
207
|
+
var PRICE_LIST_DATA_ROW_HEIGHT_PT = 96;
|
|
208
|
+
var PRICE_LIST_PHOTO_COL_CHARS = 18;
|
|
209
|
+
var PRICE_LIST_BANNER_ROW_COUNT = 3;
|
|
210
|
+
function excelColumnLetter(index1Based) {
|
|
211
|
+
if (!Number.isInteger(index1Based) || index1Based < 1) {
|
|
212
|
+
throw new Error(`Invalid column index: ${index1Based}`);
|
|
213
|
+
}
|
|
214
|
+
let n = index1Based;
|
|
215
|
+
let s = "";
|
|
216
|
+
while (n > 0) {
|
|
217
|
+
const rem = (n - 1) % 26;
|
|
218
|
+
s = String.fromCharCode(65 + rem) + s;
|
|
219
|
+
n = Math.floor((n - 1) / 26);
|
|
220
|
+
}
|
|
221
|
+
return s;
|
|
222
|
+
}
|
|
223
|
+
function validatePriceListInput(input) {
|
|
224
|
+
if (!input || typeof input !== "object") {
|
|
225
|
+
throw new Error("PriceListInput is required");
|
|
226
|
+
}
|
|
227
|
+
if (typeof input.locale !== "string" || input.locale.trim() === "") {
|
|
228
|
+
throw new Error("locale is required");
|
|
229
|
+
}
|
|
230
|
+
if (!input.header || typeof input.header !== "object") {
|
|
231
|
+
throw new Error("header is required");
|
|
232
|
+
}
|
|
233
|
+
if (typeof input.header.siteName !== "string" || input.header.siteName.trim() === "") {
|
|
234
|
+
throw new Error("header.siteName is required");
|
|
235
|
+
}
|
|
236
|
+
if (typeof input.header.contacts !== "string") {
|
|
237
|
+
throw new Error("header.contacts must be a string");
|
|
238
|
+
}
|
|
239
|
+
if (typeof input.header.generatedAt !== "string" || Number.isNaN(new Date(input.header.generatedAt).getTime())) {
|
|
240
|
+
throw new Error("header.generatedAt must be a valid ISO date string");
|
|
241
|
+
}
|
|
242
|
+
if (!Array.isArray(input.rows)) {
|
|
243
|
+
throw new Error("rows must be an array");
|
|
244
|
+
}
|
|
245
|
+
if (input.photoSizePx !== void 0 && (!Number.isInteger(input.photoSizePx) || input.photoSizePx < 32)) {
|
|
246
|
+
throw new Error("photoSizePx must be an integer >= 32");
|
|
247
|
+
}
|
|
248
|
+
if (input.previewImageConcurrency !== void 0 && (!Number.isInteger(input.previewImageConcurrency) || input.previewImageConcurrency < 1)) {
|
|
249
|
+
throw new Error("previewImageConcurrency must be an integer >= 1");
|
|
250
|
+
}
|
|
251
|
+
const rows = input.rows.map((row, i) => {
|
|
252
|
+
if (typeof row.productId !== "string" || row.productId.trim() === "") {
|
|
253
|
+
throw new Error(`rows[${i}].productId is required`);
|
|
254
|
+
}
|
|
255
|
+
if (typeof row.product !== "string" || row.product.trim() === "") {
|
|
256
|
+
throw new Error(`rows[${i}].product is required`);
|
|
257
|
+
}
|
|
258
|
+
if (typeof row.productUrl !== "string" || row.productUrl.trim() === "") {
|
|
259
|
+
throw new Error(`rows[${i}].productUrl is required`);
|
|
260
|
+
}
|
|
261
|
+
return {
|
|
262
|
+
...row,
|
|
263
|
+
unitPrice: coerceUnitPrice(
|
|
264
|
+
typeof row.unitPrice === "number" || row.unitPrice === null ? row.unitPrice : Number.NaN
|
|
265
|
+
)
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
return {
|
|
269
|
+
...input,
|
|
270
|
+
rows
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
function resolvePreviewImageConcurrency(input) {
|
|
274
|
+
return input.previewImageConcurrency ?? DEFAULT_PREVIEW_IMAGE_CONCURRENCY;
|
|
275
|
+
}
|
|
276
|
+
function buildPriceListLayout(input) {
|
|
277
|
+
const normalized = validatePriceListInput(input);
|
|
278
|
+
const labels = resolvePriceListLabels(normalized.locale, normalized.labels);
|
|
279
|
+
const photoSizePx = normalized.photoSizePx ?? PRICE_LIST_DEFAULT_PHOTO_PX;
|
|
280
|
+
const headerRow = PRICE_LIST_BANNER_ROW_COUNT + 1;
|
|
281
|
+
const firstDataRow = headerRow + 1;
|
|
282
|
+
const totalRow = firstDataRow + normalized.rows.length;
|
|
283
|
+
const keys = [
|
|
284
|
+
{ key: "photo", header: labels.photo },
|
|
285
|
+
{ key: "category", header: labels.category },
|
|
286
|
+
{ key: "product", header: labels.product },
|
|
287
|
+
{ key: "variant", header: labels.variant },
|
|
288
|
+
{ key: "packaging", header: labels.packaging },
|
|
289
|
+
{ key: "price", header: labels.price },
|
|
290
|
+
{ key: "link", header: labels.link },
|
|
291
|
+
{ key: "quantity", header: labels.quantity },
|
|
292
|
+
{ key: "sum", header: labels.sum },
|
|
293
|
+
{ key: "currencyHidden", header: "" }
|
|
294
|
+
];
|
|
295
|
+
const columns = keys.map((c, i) => ({
|
|
296
|
+
key: c.key,
|
|
297
|
+
header: c.header,
|
|
298
|
+
index: i + 1,
|
|
299
|
+
letter: excelColumnLetter(i + 1)
|
|
300
|
+
}));
|
|
301
|
+
const letter = (key) => {
|
|
302
|
+
const col = columns.find((c) => c.key === key);
|
|
303
|
+
if (!col) throw new Error(`Missing column ${key}`);
|
|
304
|
+
return col.letter;
|
|
305
|
+
};
|
|
306
|
+
return {
|
|
307
|
+
locale: normalized.locale,
|
|
308
|
+
photoSizePx,
|
|
309
|
+
dataRowHeightPt: PRICE_LIST_DATA_ROW_HEIGHT_PT,
|
|
310
|
+
photoColWidthChars: PRICE_LIST_PHOTO_COL_CHARS,
|
|
311
|
+
headerRow,
|
|
312
|
+
firstDataRow,
|
|
313
|
+
totalRow,
|
|
314
|
+
columns,
|
|
315
|
+
priceColLetter: letter("price"),
|
|
316
|
+
quantityColLetter: letter("quantity"),
|
|
317
|
+
sumColLetter: letter("sum"),
|
|
318
|
+
currencyColLetter: letter("currencyHidden"),
|
|
319
|
+
linkColLetter: letter("link")
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// src/wholesale-price-list/preview-image.ts
|
|
324
|
+
var import_sharp = __toESM(require("sharp"), 1);
|
|
325
|
+
function errorMessage(e) {
|
|
326
|
+
return e instanceof Error ? e.message : String(e);
|
|
327
|
+
}
|
|
328
|
+
async function normalizePreviewSquare(input, sizePx = PRICE_LIST_DEFAULT_PHOTO_PX) {
|
|
329
|
+
if (!Number.isInteger(sizePx) || sizePx < 32) {
|
|
330
|
+
throw new Error("sizePx must be an integer >= 32");
|
|
331
|
+
}
|
|
332
|
+
if (input.byteLength === 0) {
|
|
333
|
+
throw new Error("Empty preview image");
|
|
334
|
+
}
|
|
335
|
+
return (0, import_sharp.default)(Buffer.from(input), {
|
|
336
|
+
limitInputPixels: 268435456,
|
|
337
|
+
failOn: "error"
|
|
338
|
+
}).rotate().resize({
|
|
339
|
+
width: sizePx,
|
|
340
|
+
height: sizePx,
|
|
341
|
+
fit: "contain",
|
|
342
|
+
background: { r: 255, g: 255, b: 255, alpha: 1 }
|
|
343
|
+
}).png().toBuffer();
|
|
344
|
+
}
|
|
345
|
+
async function tryNormalizePreviewSquare(input, sizePx = PRICE_LIST_DEFAULT_PHOTO_PX) {
|
|
346
|
+
try {
|
|
347
|
+
const png = await normalizePreviewSquare(input, sizePx);
|
|
348
|
+
return { png, error: null };
|
|
349
|
+
} catch (e) {
|
|
350
|
+
const msg = errorMessage(e);
|
|
351
|
+
if (msg.includes("Empty preview image") || msg.includes("sizePx must")) {
|
|
352
|
+
throw e;
|
|
353
|
+
}
|
|
354
|
+
return { png: null, error: msg };
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
async function rasterizeLogo(input, opts) {
|
|
358
|
+
if (input.byteLength === 0) {
|
|
359
|
+
throw new Error("Empty logo image");
|
|
360
|
+
}
|
|
361
|
+
const widthPx = opts?.widthPx ?? 120;
|
|
362
|
+
const heightPx = opts?.heightPx ?? 40;
|
|
363
|
+
if (!Number.isInteger(widthPx) || widthPx < 16) {
|
|
364
|
+
throw new Error("logo widthPx must be an integer >= 16");
|
|
365
|
+
}
|
|
366
|
+
if (!Number.isInteger(heightPx) || heightPx < 16) {
|
|
367
|
+
throw new Error("logo heightPx must be an integer >= 16");
|
|
368
|
+
}
|
|
369
|
+
try {
|
|
370
|
+
return await (0, import_sharp.default)(Buffer.from(input), {
|
|
371
|
+
limitInputPixels: 268435456,
|
|
372
|
+
failOn: "error",
|
|
373
|
+
density: 288
|
|
374
|
+
}).resize({
|
|
375
|
+
width: widthPx,
|
|
376
|
+
height: heightPx,
|
|
377
|
+
fit: "contain",
|
|
378
|
+
background: { r: 255, g: 255, b: 255, alpha: 0 }
|
|
379
|
+
}).png().toBuffer();
|
|
380
|
+
} catch (e) {
|
|
381
|
+
throw new Error(
|
|
382
|
+
`Failed to rasterize logo (SVG/PNG/JPEG/WebP required): ${errorMessage(e)}`
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
async function tryRasterizeLogo(input, opts) {
|
|
387
|
+
try {
|
|
388
|
+
const png = await rasterizeLogo(input, opts);
|
|
389
|
+
return { png, error: null };
|
|
390
|
+
} catch (e) {
|
|
391
|
+
const msg = errorMessage(e);
|
|
392
|
+
if (msg.includes("Empty logo image") || msg.includes("widthPx must") || msg.includes("heightPx must")) {
|
|
393
|
+
throw e;
|
|
394
|
+
}
|
|
395
|
+
return { png: null, error: msg };
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function googleSheetsImageFormula(url, sizePx) {
|
|
399
|
+
const safe = url.replace(/"/g, '""');
|
|
400
|
+
return `=IMAGE("${safe}",4,${sizePx},${sizePx})`;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// src/wholesale-price-list/resolve-media.ts
|
|
404
|
+
async function resolvePreviewBytes(input, rowIndex) {
|
|
405
|
+
const row = input.rows[rowIndex];
|
|
406
|
+
if (row.previewImageBytes && row.previewImageBytes.byteLength > 0) {
|
|
407
|
+
return row.previewImageBytes;
|
|
408
|
+
}
|
|
409
|
+
if (input.loadPreviewImage) {
|
|
410
|
+
return input.loadPreviewImage({
|
|
411
|
+
previewMediaId: row.previewMediaId,
|
|
412
|
+
previewImageUrl: row.previewImageUrl
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
const url = row.previewImageUrl?.trim();
|
|
416
|
+
if (url && isAnonymousHttpImageUrl(url)) {
|
|
417
|
+
return fetchAbsoluteUrlBytes(url);
|
|
418
|
+
}
|
|
419
|
+
return null;
|
|
420
|
+
}
|
|
421
|
+
async function resolveLogoBytes(input) {
|
|
422
|
+
if (input.header.logoBytes && input.header.logoBytes.byteLength > 0) {
|
|
423
|
+
return input.header.logoBytes;
|
|
424
|
+
}
|
|
425
|
+
const url = input.header.logoUrl?.trim();
|
|
426
|
+
if (!url) return null;
|
|
427
|
+
if (input.loadLogo) return input.loadLogo(url);
|
|
428
|
+
if (isAnonymousHttpImageUrl(url)) return fetchAbsoluteUrlBytes(url);
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// src/wholesale-price-list/sum-formula.ts
|
|
433
|
+
function buildLineSumFormula(args) {
|
|
434
|
+
const { layout, row } = args;
|
|
435
|
+
const q = `${layout.quantityColLetter}${row}`;
|
|
436
|
+
const p = `${layout.priceColLetter}${row}`;
|
|
437
|
+
return `IFERROR(IF(N(${q})<=0,"",IF(NOT(ISNUMBER(${p})),"",${q}*${p})),"")`;
|
|
438
|
+
}
|
|
439
|
+
function buildTotalSumFormula(args) {
|
|
440
|
+
const { layout, firstDataRow, lastDataRow } = args;
|
|
441
|
+
if (lastDataRow < firstDataRow) return "0";
|
|
442
|
+
const range = `${layout.sumColLetter}${firstDataRow}:${layout.sumColLetter}${lastDataRow}`;
|
|
443
|
+
return `SUM(${range})`;
|
|
444
|
+
}
|
|
445
|
+
function buildCurrencyTotalSumIfFormula(args) {
|
|
446
|
+
const { layout, firstDataRow, lastDataRow, currency } = args;
|
|
447
|
+
if (lastDataRow < firstDataRow) return "0";
|
|
448
|
+
if (!currency || currency.includes('"')) {
|
|
449
|
+
throw new Error("currency for SUMIF must be a non-empty string without quotes");
|
|
450
|
+
}
|
|
451
|
+
const sumRange = `${layout.sumColLetter}${firstDataRow}:${layout.sumColLetter}${lastDataRow}`;
|
|
452
|
+
const curRange = `${layout.currencyColLetter}${firstDataRow}:${layout.currencyColLetter}${lastDataRow}`;
|
|
453
|
+
return `SUMIF(${curRange},"${currency}",${sumRange})`;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// src/wholesale-price-list/google-sheets/index.ts
|
|
457
|
+
var SCOPES = [
|
|
458
|
+
"https://www.googleapis.com/auth/spreadsheets",
|
|
459
|
+
"https://www.googleapis.com/auth/drive"
|
|
460
|
+
];
|
|
461
|
+
function parseServiceAccountJson(raw) {
|
|
462
|
+
if (typeof raw === "object" && raw !== null && !Array.isArray(raw)) {
|
|
463
|
+
return raw;
|
|
464
|
+
}
|
|
465
|
+
if (typeof raw !== "string" || !raw.trim()) {
|
|
466
|
+
throw new Error("serviceAccountJson is required");
|
|
467
|
+
}
|
|
468
|
+
try {
|
|
469
|
+
const parsed = JSON.parse(raw);
|
|
470
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
471
|
+
throw new Error("not an object");
|
|
472
|
+
}
|
|
473
|
+
return parsed;
|
|
474
|
+
} catch {
|
|
475
|
+
throw new Error("serviceAccountJson must be valid JSON object");
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
async function createPriceListGoogleClients(serviceAccountJson) {
|
|
479
|
+
const credentials = parseServiceAccountJson(serviceAccountJson);
|
|
480
|
+
const { google } = await import("googleapis");
|
|
481
|
+
const auth = new google.auth.GoogleAuth({
|
|
482
|
+
credentials,
|
|
483
|
+
scopes: SCOPES
|
|
484
|
+
});
|
|
485
|
+
return {
|
|
486
|
+
sheets: google.sheets({
|
|
487
|
+
version: "v4",
|
|
488
|
+
auth
|
|
489
|
+
}),
|
|
490
|
+
drive: google.drive({
|
|
491
|
+
version: "v3",
|
|
492
|
+
auth
|
|
493
|
+
})
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
async function uploadPngPublic(drive, name, png, folderId) {
|
|
497
|
+
const created = await drive.files.create({
|
|
498
|
+
requestBody: {
|
|
499
|
+
name,
|
|
500
|
+
mimeType: "image/png",
|
|
501
|
+
parents: folderId ? [folderId] : void 0
|
|
502
|
+
},
|
|
503
|
+
media: { mimeType: "image/png", body: Buffer.from(png) },
|
|
504
|
+
fields: "id",
|
|
505
|
+
supportsAllDrives: true
|
|
506
|
+
});
|
|
507
|
+
const fileId = created.data.id;
|
|
508
|
+
if (!fileId) throw new Error("Drive file create returned no id");
|
|
509
|
+
await drive.permissions.create({
|
|
510
|
+
fileId,
|
|
511
|
+
requestBody: { role: "reader", type: "anyone" },
|
|
512
|
+
supportsAllDrives: true
|
|
513
|
+
});
|
|
514
|
+
return `https://drive.google.com/uc?export=view&id=${encodeURIComponent(fileId)}`;
|
|
515
|
+
}
|
|
516
|
+
function colWidthPixels(layout, key) {
|
|
517
|
+
if (key === "photo") return Math.round(layout.photoSizePx * 1.15);
|
|
518
|
+
if (key === "product") return 180;
|
|
519
|
+
if (key === "link" || key === "quantity" || key === "sum" || key === "price")
|
|
520
|
+
return 100;
|
|
521
|
+
if (key === "currencyHidden") return 1;
|
|
522
|
+
return 120;
|
|
523
|
+
}
|
|
524
|
+
async function renderPriceListGoogleSheet(input, options) {
|
|
525
|
+
const normalized = validatePriceListInput(input);
|
|
526
|
+
const warnings = [];
|
|
527
|
+
const labels = resolvePriceListLabels(normalized.locale, normalized.labels);
|
|
528
|
+
const layout = buildPriceListLayout(normalized);
|
|
529
|
+
const concurrency = resolvePreviewImageConcurrency(normalized);
|
|
530
|
+
const clients = options.clients ?? await createPriceListGoogleClients(options.serviceAccountJson);
|
|
531
|
+
const { sheets, drive } = clients;
|
|
532
|
+
const title = `${normalized.header.siteName} \u2014 ${labels.title} (${normalized.locale})`.slice(
|
|
533
|
+
0,
|
|
534
|
+
100
|
|
535
|
+
);
|
|
536
|
+
const created = await sheets.spreadsheets.create({
|
|
537
|
+
requestBody: {
|
|
538
|
+
properties: { title },
|
|
539
|
+
sheets: [
|
|
540
|
+
{
|
|
541
|
+
properties: {
|
|
542
|
+
title: labels.title.slice(0, 100),
|
|
543
|
+
gridProperties: {
|
|
544
|
+
frozenRowCount: layout.headerRow
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
]
|
|
549
|
+
},
|
|
550
|
+
fields: "spreadsheetId,spreadsheetUrl"
|
|
551
|
+
});
|
|
552
|
+
const spreadsheetId = created.data.spreadsheetId;
|
|
553
|
+
const spreadsheetUrl = created.data.spreadsheetUrl;
|
|
554
|
+
if (!spreadsheetId || !spreadsheetUrl) {
|
|
555
|
+
throw new Error("Sheets create returned no spreadsheetId/url");
|
|
556
|
+
}
|
|
557
|
+
const meta = await sheets.spreadsheets.get({
|
|
558
|
+
spreadsheetId,
|
|
559
|
+
fields: "sheets.properties"
|
|
560
|
+
});
|
|
561
|
+
const sheetId = meta.data.sheets?.[0]?.properties?.sheetId;
|
|
562
|
+
if (sheetId == null) throw new Error("Missing sheetId");
|
|
563
|
+
if (options.driveFolderId?.trim()) {
|
|
564
|
+
const file = await drive.files.get({
|
|
565
|
+
fileId: spreadsheetId,
|
|
566
|
+
fields: "parents",
|
|
567
|
+
supportsAllDrives: true
|
|
568
|
+
});
|
|
569
|
+
const prevParents = (file.data.parents ?? []).join(",");
|
|
570
|
+
await drive.files.update({
|
|
571
|
+
fileId: spreadsheetId,
|
|
572
|
+
addParents: options.driveFolderId.trim(),
|
|
573
|
+
removeParents: prevParents || void 0,
|
|
574
|
+
supportsAllDrives: true,
|
|
575
|
+
fields: "id,parents"
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
if (options.shareWithEmail?.trim()) {
|
|
579
|
+
await drive.permissions.create({
|
|
580
|
+
fileId: spreadsheetId,
|
|
581
|
+
requestBody: {
|
|
582
|
+
type: "user",
|
|
583
|
+
role: "writer",
|
|
584
|
+
emailAddress: options.shareWithEmail.trim()
|
|
585
|
+
},
|
|
586
|
+
sendNotificationEmail: false,
|
|
587
|
+
supportsAllDrives: true
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
const folderId = options.driveFolderId?.trim() || null;
|
|
591
|
+
let logoImageUrl = null;
|
|
592
|
+
const logoBytes = await resolveLogoBytes(normalized);
|
|
593
|
+
if (logoBytes) {
|
|
594
|
+
const { png, error } = await tryRasterizeLogo(logoBytes);
|
|
595
|
+
if (png) {
|
|
596
|
+
logoImageUrl = await uploadPngPublic(
|
|
597
|
+
drive,
|
|
598
|
+
`price-list-logo-${normalized.locale}.png`,
|
|
599
|
+
png,
|
|
600
|
+
folderId
|
|
601
|
+
);
|
|
602
|
+
} else if (error) {
|
|
603
|
+
warnings.push(`header.logo: ${error}`);
|
|
604
|
+
}
|
|
605
|
+
} else {
|
|
606
|
+
const candidate = normalized.header.logoUrl?.trim() || null;
|
|
607
|
+
if (candidate && !/\.svg(\?|$)/i.test(candidate) && isAnonymousHttpImageUrl(candidate)) {
|
|
608
|
+
logoImageUrl = candidate;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const generated = formatGeneratedLabel(
|
|
612
|
+
labels.generated,
|
|
613
|
+
normalized.header.generatedAt,
|
|
614
|
+
normalized.locale,
|
|
615
|
+
normalized.header.timeZone
|
|
616
|
+
);
|
|
617
|
+
const lastColLetter = layout.columns.find((c) => c.key === "sum").letter;
|
|
618
|
+
const values = [];
|
|
619
|
+
const bannerRow1 = Array(layout.columns.length).fill("");
|
|
620
|
+
bannerRow1[0] = normalized.header.siteName;
|
|
621
|
+
if (logoImageUrl) {
|
|
622
|
+
bannerRow1[5] = googleSheetsImageFormula(logoImageUrl, 40);
|
|
623
|
+
}
|
|
624
|
+
values.push(bannerRow1);
|
|
625
|
+
values.push([
|
|
626
|
+
normalized.header.contacts,
|
|
627
|
+
...Array(layout.columns.length - 1).fill("")
|
|
628
|
+
]);
|
|
629
|
+
values.push([generated, ...Array(layout.columns.length - 1).fill("")]);
|
|
630
|
+
values.push(
|
|
631
|
+
layout.columns.map((c) => c.key === "currencyHidden" ? "" : c.header)
|
|
632
|
+
);
|
|
633
|
+
const previewPrep = await mapWithConcurrency(
|
|
634
|
+
normalized.rows,
|
|
635
|
+
concurrency,
|
|
636
|
+
async (row, i) => {
|
|
637
|
+
try {
|
|
638
|
+
const bytes = await resolvePreviewBytes(normalized, i);
|
|
639
|
+
if (bytes) {
|
|
640
|
+
const { png, error } = await tryNormalizePreviewSquare(
|
|
641
|
+
bytes,
|
|
642
|
+
layout.photoSizePx
|
|
643
|
+
);
|
|
644
|
+
if (!png) {
|
|
645
|
+
return {
|
|
646
|
+
imageUrl: null,
|
|
647
|
+
warning: error ? `rows[${i}].previewImage: ${error}` : `rows[${i}].previewImage: undecodable`
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
const imageUrl = await uploadPngPublic(
|
|
651
|
+
drive,
|
|
652
|
+
`price-list-${row.productId}-${row.variantId ?? "p"}.png`,
|
|
653
|
+
png,
|
|
654
|
+
folderId
|
|
655
|
+
);
|
|
656
|
+
return { imageUrl, warning: null };
|
|
657
|
+
}
|
|
658
|
+
const candidate = row.previewImageUrl?.trim() || null;
|
|
659
|
+
if (candidate && isAnonymousHttpImageUrl(candidate)) {
|
|
660
|
+
return { imageUrl: candidate, warning: null };
|
|
661
|
+
}
|
|
662
|
+
return { imageUrl: null, warning: null };
|
|
663
|
+
} catch (e) {
|
|
664
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
665
|
+
return {
|
|
666
|
+
imageUrl: null,
|
|
667
|
+
warning: `rows[${i}].previewImage: ${msg}`
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
);
|
|
672
|
+
const currencies = /* @__PURE__ */ new Set();
|
|
673
|
+
for (let i = 0; i < normalized.rows.length; i++) {
|
|
674
|
+
const row = normalized.rows[i];
|
|
675
|
+
const excelRow = layout.firstDataRow + i;
|
|
676
|
+
const line = Array(layout.columns.length).fill("");
|
|
677
|
+
const photoIdx = layout.columns.findIndex((c) => c.key === "photo");
|
|
678
|
+
const prep = previewPrep[i];
|
|
679
|
+
if (prep.warning) warnings.push(prep.warning);
|
|
680
|
+
if (prep.imageUrl && photoIdx >= 0) {
|
|
681
|
+
line[photoIdx] = googleSheetsImageFormula(
|
|
682
|
+
prep.imageUrl,
|
|
683
|
+
layout.photoSizePx
|
|
684
|
+
);
|
|
685
|
+
}
|
|
686
|
+
line[layout.columns.findIndex((c) => c.key === "category")] = row.category ?? "";
|
|
687
|
+
line[layout.columns.findIndex((c) => c.key === "product")] = row.product;
|
|
688
|
+
line[layout.columns.findIndex((c) => c.key === "variant")] = row.variant ?? "";
|
|
689
|
+
line[layout.columns.findIndex((c) => c.key === "packaging")] = row.packaging ?? "";
|
|
690
|
+
const priceIdx = layout.columns.findIndex((c) => c.key === "price");
|
|
691
|
+
if (row.unitPrice === null) {
|
|
692
|
+
line[priceIdx] = labels.onRequest;
|
|
693
|
+
} else {
|
|
694
|
+
line[priceIdx] = String(row.unitPrice);
|
|
695
|
+
}
|
|
696
|
+
const linkIdx = layout.columns.findIndex((c) => c.key === "link");
|
|
697
|
+
line[linkIdx] = `=HYPERLINK("${row.productUrl.replace(/"/g, '""')}","${labels.linkText.replace(/"/g, '""')}")`;
|
|
698
|
+
const qtyIdx = layout.columns.findIndex((c) => c.key === "quantity");
|
|
699
|
+
line[qtyIdx] = "";
|
|
700
|
+
const sumIdx = layout.columns.findIndex((c) => c.key === "sum");
|
|
701
|
+
line[sumIdx] = `=${buildLineSumFormula({ layout, row: excelRow })}`;
|
|
702
|
+
const curIdx = layout.columns.findIndex((c) => c.key === "currencyHidden");
|
|
703
|
+
const cur = row.currency?.trim() || "";
|
|
704
|
+
line[curIdx] = cur;
|
|
705
|
+
if (cur) currencies.add(cur);
|
|
706
|
+
values.push(line);
|
|
707
|
+
}
|
|
708
|
+
const currencyList = [...currencies].sort();
|
|
709
|
+
const multi = currencyList.length > 1;
|
|
710
|
+
if (!multi) {
|
|
711
|
+
const totalLine = Array(layout.columns.length).fill("");
|
|
712
|
+
totalLine[layout.columns.findIndex((c) => c.key === "quantity")] = labels.total;
|
|
713
|
+
const lastData = normalized.rows.length === 0 ? layout.firstDataRow - 1 : layout.firstDataRow + normalized.rows.length - 1;
|
|
714
|
+
totalLine[layout.columns.findIndex((c) => c.key === "sum")] = `=${buildTotalSumFormula({
|
|
715
|
+
layout,
|
|
716
|
+
firstDataRow: layout.firstDataRow,
|
|
717
|
+
lastDataRow: lastData
|
|
718
|
+
})}`;
|
|
719
|
+
values.push(totalLine);
|
|
720
|
+
} else {
|
|
721
|
+
const lastData = layout.firstDataRow + normalized.rows.length - 1;
|
|
722
|
+
for (let i = 0; i < currencyList.length; i++) {
|
|
723
|
+
const currency = currencyList[i];
|
|
724
|
+
const totalLine = Array(layout.columns.length).fill("");
|
|
725
|
+
totalLine[layout.columns.findIndex((c) => c.key === "quantity")] = i === 0 ? `${labels.total} (${currency})` : currency;
|
|
726
|
+
totalLine[layout.columns.findIndex((c) => c.key === "sum")] = `=${buildCurrencyTotalSumIfFormula({
|
|
727
|
+
layout,
|
|
728
|
+
firstDataRow: layout.firstDataRow,
|
|
729
|
+
lastDataRow: lastData,
|
|
730
|
+
currency
|
|
731
|
+
})}`;
|
|
732
|
+
values.push(totalLine);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
await sheets.spreadsheets.values.update({
|
|
736
|
+
spreadsheetId,
|
|
737
|
+
range: `A1:${lastColLetter}${values.length}`,
|
|
738
|
+
valueInputOption: "USER_ENTERED",
|
|
739
|
+
requestBody: { values }
|
|
740
|
+
});
|
|
741
|
+
const requests = [];
|
|
742
|
+
for (const col of layout.columns) {
|
|
743
|
+
requests.push({
|
|
744
|
+
updateDimensionProperties: {
|
|
745
|
+
range: {
|
|
746
|
+
sheetId,
|
|
747
|
+
dimension: "COLUMNS",
|
|
748
|
+
startIndex: col.index - 1,
|
|
749
|
+
endIndex: col.index
|
|
750
|
+
},
|
|
751
|
+
properties: {
|
|
752
|
+
pixelSize: colWidthPixels(layout, col.key),
|
|
753
|
+
hiddenByUser: col.key === "currencyHidden"
|
|
754
|
+
},
|
|
755
|
+
fields: "pixelSize,hiddenByUser"
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
if (normalized.rows.length > 0) {
|
|
760
|
+
requests.push({
|
|
761
|
+
updateDimensionProperties: {
|
|
762
|
+
range: {
|
|
763
|
+
sheetId,
|
|
764
|
+
dimension: "ROWS",
|
|
765
|
+
startIndex: layout.firstDataRow - 1,
|
|
766
|
+
endIndex: layout.firstDataRow - 1 + normalized.rows.length
|
|
767
|
+
},
|
|
768
|
+
properties: { pixelSize: 130 },
|
|
769
|
+
fields: "pixelSize"
|
|
770
|
+
}
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
requests.push({
|
|
774
|
+
setBasicFilter: {
|
|
775
|
+
filter: {
|
|
776
|
+
range: {
|
|
777
|
+
sheetId,
|
|
778
|
+
startRowIndex: layout.headerRow - 1,
|
|
779
|
+
endRowIndex: layout.headerRow + normalized.rows.length,
|
|
780
|
+
startColumnIndex: 0,
|
|
781
|
+
endColumnIndex: layout.columns.find((c) => c.key === "sum").index
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
if (normalized.rows.length > 0) {
|
|
787
|
+
const qtyCol = layout.columns.find((c) => c.key === "quantity").index - 1;
|
|
788
|
+
requests.push({
|
|
789
|
+
setDataValidation: {
|
|
790
|
+
range: {
|
|
791
|
+
sheetId,
|
|
792
|
+
startRowIndex: layout.firstDataRow - 1,
|
|
793
|
+
endRowIndex: layout.firstDataRow - 1 + normalized.rows.length,
|
|
794
|
+
startColumnIndex: qtyCol,
|
|
795
|
+
endColumnIndex: qtyCol + 1
|
|
796
|
+
},
|
|
797
|
+
rule: {
|
|
798
|
+
condition: {
|
|
799
|
+
type: "NUMBER_GREATER_THAN_EQ",
|
|
800
|
+
values: [{ userEnteredValue: "0" }]
|
|
801
|
+
},
|
|
802
|
+
strict: true,
|
|
803
|
+
showCustomUi: true
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
await sheets.spreadsheets.batchUpdate({
|
|
809
|
+
spreadsheetId,
|
|
810
|
+
requestBody: { requests }
|
|
811
|
+
});
|
|
812
|
+
return { spreadsheetId, spreadsheetUrl, warnings };
|
|
813
|
+
}
|
|
814
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
815
|
+
0 && (module.exports = {
|
|
816
|
+
createPriceListGoogleClients,
|
|
817
|
+
renderPriceListGoogleSheet
|
|
818
|
+
});
|
|
819
|
+
//# sourceMappingURL=index.cjs.map
|