includio-cms 0.15.2 → 0.15.4
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 +40 -0
- package/DOCS.md +142 -3
- package/ROADMAP.md +13 -2
- package/dist/admin/client/shop/shipping-method-form.svelte +66 -1
- package/dist/admin/client/shop/shipping-method-form.svelte.d.ts +8 -0
- package/dist/admin/client/shop/shop-order-detail-page.svelte +101 -0
- package/dist/admin/remote/shop.remote.d.ts +44 -0
- package/dist/admin/remote/shop.remote.js +35 -0
- package/dist/cli/index.js +49 -4
- package/dist/cli/scaffold/admin.d.ts +9 -2
- package/dist/cli/scaffold/admin.js +91 -3
- package/dist/core/server/forms/submissions/operations/create.js +11 -5
- package/dist/db-postgres/schema/shop/order.d.ts +68 -0
- package/dist/db-postgres/schema/shop/order.js +4 -0
- package/dist/db-postgres/schema/shop/shippingMethod.d.ts +25 -0
- package/dist/db-postgres/schema/shop/shippingMethod.js +1 -0
- package/dist/paraglide/messages/_index.d.ts +3 -36
- package/dist/paraglide/messages/_index.js +3 -71
- package/dist/paraglide/messages/hello_world.d.ts +5 -0
- package/dist/paraglide/messages/hello_world.js +33 -0
- package/dist/paraglide/messages/login_hello.d.ts +16 -0
- package/dist/paraglide/messages/login_hello.js +34 -0
- package/dist/paraglide/messages/login_please_login.d.ts +16 -0
- package/dist/paraglide/messages/login_please_login.js +34 -0
- package/dist/shop/adapters/inpost/geowidget.d.ts +27 -0
- package/dist/shop/adapters/inpost/geowidget.js +31 -0
- package/dist/shop/adapters/inpost/index.d.ts +89 -0
- package/dist/shop/adapters/inpost/index.js +156 -0
- package/dist/shop/adapters/inpost/payload.d.ts +18 -0
- package/dist/shop/adapters/inpost/payload.js +85 -0
- package/dist/shop/adapters/inpost/points-api.d.ts +17 -0
- package/dist/shop/adapters/inpost/points-api.js +55 -0
- package/dist/shop/adapters/inpost/shipx-client.d.ts +56 -0
- package/dist/shop/adapters/inpost/shipx-client.js +95 -0
- package/dist/shop/adapters/inpost/status-map.d.ts +9 -0
- package/dist/shop/adapters/inpost/status-map.js +46 -0
- package/dist/shop/adapters/inpost/webhook.d.ts +16 -0
- package/dist/shop/adapters/inpost/webhook.js +55 -0
- package/dist/shop/client/index.d.ts +5 -0
- package/dist/shop/http/carrier-handler.d.ts +12 -0
- package/dist/shop/http/carrier-handler.js +45 -0
- package/dist/shop/http/carrier-webhook-handler.d.ts +13 -0
- package/dist/shop/http/carrier-webhook-handler.js +66 -0
- package/dist/shop/http/checkout-handler.js +23 -1
- package/dist/shop/http/index.d.ts +3 -0
- package/dist/shop/http/index.js +3 -0
- package/dist/shop/http/order-handler.js +14 -0
- package/dist/shop/http/shipment-label-handler.d.ts +10 -0
- package/dist/shop/http/shipment-label-handler.js +53 -0
- package/dist/shop/http/shipping-handler.js +3 -0
- package/dist/shop/index.d.ts +3 -1
- package/dist/shop/index.js +1 -0
- package/dist/shop/server/email.js +37 -0
- package/dist/shop/server/orders.d.ts +9 -0
- package/dist/shop/server/orders.js +48 -0
- package/dist/shop/server/shipments.d.ts +33 -0
- package/dist/shop/server/shipments.js +145 -0
- package/dist/shop/server/shipping.d.ts +2 -1
- package/dist/shop/server/shipping.js +9 -0
- package/dist/shop/svelte/InpostPicker.svelte +270 -0
- package/dist/shop/svelte/InpostPicker.svelte.d.ts +51 -0
- package/dist/shop/svelte/OrderStatus.svelte +53 -1
- package/dist/shop/svelte/index.d.ts +1 -0
- package/dist/shop/svelte/index.js +1 -0
- package/dist/shop/svelte/labels.d.ts +5 -0
- package/dist/shop/svelte/labels.js +6 -1
- package/dist/shop/types.d.ts +49 -1
- package/dist/updates/0.15.3/index.d.ts +2 -0
- package/dist/updates/0.15.3/index.js +19 -0
- package/dist/updates/0.15.4/index.d.ts +2 -0
- package/dist/updates/0.15.4/index.js +14 -0
- package/dist/updates/index.js +3 -1
- package/package.json +1 -1
- package/dist/paraglide/messages/en.d.ts +0 -5
- package/dist/paraglide/messages/en.js +0 -14
- package/dist/paraglide/messages/pl.d.ts +0 -5
- package/dist/paraglide/messages/pl.js +0 -14
package/dist/cli/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { scaffoldAdmin } from './scaffold/admin.js';
|
|
3
3
|
import { installPeers } from './install-peers.js';
|
|
4
4
|
import { createUser } from './create-user.js';
|
|
5
|
+
import fs from 'node:fs';
|
|
5
6
|
import path from 'node:path';
|
|
6
7
|
const args = process.argv.slice(2);
|
|
7
8
|
const command = args[0];
|
|
@@ -17,15 +18,59 @@ Commands:
|
|
|
17
18
|
Options:
|
|
18
19
|
--force Overwrite existing files
|
|
19
20
|
--routes-dir Path to routes directory (default: src/routes)
|
|
21
|
+
--cms-config Path to cms config (default: src/lib/cms/cms.config.ts)
|
|
22
|
+
--shop Force shop routes ON (default: auto-detect from cms config)
|
|
23
|
+
--no-shop Force shop routes OFF
|
|
20
24
|
--dry-run Show what would be installed (install-peers)
|
|
21
25
|
`);
|
|
22
26
|
}
|
|
27
|
+
function flagValue(name) {
|
|
28
|
+
const idx = args.indexOf(name);
|
|
29
|
+
return idx !== -1 ? args[idx + 1] : undefined;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Best-effort detection: scan cms config text for an active `shop: defineShop(`
|
|
33
|
+
* or `shop: <var>` property inside `defineCMS({ ... })`. Returns null if the
|
|
34
|
+
* config can't be located so the caller can fall back to a sensible default.
|
|
35
|
+
*/
|
|
36
|
+
function detectShopUsage(cmsConfigPath) {
|
|
37
|
+
if (!fs.existsSync(cmsConfigPath))
|
|
38
|
+
return null;
|
|
39
|
+
const raw = fs.readFileSync(cmsConfigPath, 'utf-8');
|
|
40
|
+
// Strip line + block comments so a commented `// shop:` doesn't trigger.
|
|
41
|
+
const stripped = raw
|
|
42
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
43
|
+
.replace(/\/\/[^\n]*/g, '');
|
|
44
|
+
return /\bshop\s*:\s*\S/.test(stripped);
|
|
45
|
+
}
|
|
23
46
|
if (command === 'scaffold' && subcommand === 'admin') {
|
|
24
47
|
const force = args.includes('--force');
|
|
25
|
-
const
|
|
26
|
-
const routesDir =
|
|
27
|
-
|
|
28
|
-
|
|
48
|
+
const cwd = process.cwd();
|
|
49
|
+
const routesDir = flagValue('--routes-dir') ?? path.join(cwd, 'src', 'routes');
|
|
50
|
+
const cmsConfigPath = flagValue('--cms-config') ?? path.join(cwd, 'src', 'lib', 'cms', 'cms.config.ts');
|
|
51
|
+
let shop;
|
|
52
|
+
let shopSource;
|
|
53
|
+
if (args.includes('--shop')) {
|
|
54
|
+
shop = true;
|
|
55
|
+
shopSource = 'flag --shop';
|
|
56
|
+
}
|
|
57
|
+
else if (args.includes('--no-shop')) {
|
|
58
|
+
shop = false;
|
|
59
|
+
shopSource = 'flag --no-shop';
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const detected = detectShopUsage(cmsConfigPath);
|
|
63
|
+
if (detected === null) {
|
|
64
|
+
shop = false;
|
|
65
|
+
shopSource = `${cmsConfigPath} not found → off`;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
shop = detected;
|
|
69
|
+
shopSource = `${cmsConfigPath} → ${detected ? 'shop: detected' : 'no shop config'}`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
console.log(`Scaffolding admin routes (shop ${shop ? 'enabled' : 'disabled'} — ${shopSource})...\n`);
|
|
73
|
+
scaffoldAdmin({ routesDir, force, shop });
|
|
29
74
|
}
|
|
30
75
|
else if (command === 'install-peers') {
|
|
31
76
|
const dryRun = args.includes('--dry-run');
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ScaffoldAdminOptions {
|
|
2
2
|
routesDir: string;
|
|
3
3
|
force?: boolean;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Emit shop module routes (api/shop/* + admin/(afterLogin)/shop/*).
|
|
6
|
+
* Default `true`. Set to `false` for projects that don't use the shop
|
|
7
|
+
* module — keeps the route tree clean and avoids 404 stubs in your app.
|
|
8
|
+
*/
|
|
9
|
+
shop?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function scaffoldAdmin(options: ScaffoldAdminOptions): void;
|
|
@@ -2,6 +2,10 @@ import fs from 'node:fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
const GENERATED_COMMENT = '<!-- Generated by includio-cms -->';
|
|
4
4
|
const GENERATED_COMMENT_TS = '// Generated by includio-cms';
|
|
5
|
+
function isShopFile(p) {
|
|
6
|
+
return (p.startsWith('api/shop/') ||
|
|
7
|
+
p.startsWith('admin/(afterLogin)/shop/'));
|
|
8
|
+
}
|
|
5
9
|
function getAdminFiles() {
|
|
6
10
|
return [
|
|
7
11
|
{
|
|
@@ -230,6 +234,30 @@ export const { GET } = createOrderHandler();
|
|
|
230
234
|
import { createPaymentWebhookHandler } from 'includio-cms/shop/http';
|
|
231
235
|
|
|
232
236
|
export const { POST } = createPaymentWebhookHandler();
|
|
237
|
+
`
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
path: 'api/shop/carriers/[id]/+server.ts',
|
|
241
|
+
content: `${GENERATED_COMMENT_TS}
|
|
242
|
+
import { createCarrierConfigHandler } from 'includio-cms/shop/http';
|
|
243
|
+
|
|
244
|
+
export const { GET } = createCarrierConfigHandler();
|
|
245
|
+
`
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
path: 'api/shop/carriers/[id]/webhook/+server.ts',
|
|
249
|
+
content: `${GENERATED_COMMENT_TS}
|
|
250
|
+
import { createCarrierWebhookHandler } from 'includio-cms/shop/http';
|
|
251
|
+
|
|
252
|
+
export const { POST } = createCarrierWebhookHandler();
|
|
253
|
+
`
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
path: 'api/shop/admin/orders/[id]/label/+server.ts',
|
|
257
|
+
content: `${GENERATED_COMMENT_TS}
|
|
258
|
+
import { createShipmentLabelHandler } from 'includio-cms/shop/http';
|
|
259
|
+
|
|
260
|
+
export const { GET } = createShipmentLabelHandler();
|
|
233
261
|
`
|
|
234
262
|
},
|
|
235
263
|
{
|
|
@@ -312,13 +340,73 @@ export const { GET, POST, PATCH, PUT, DELETE } = createAdminApiHandler();
|
|
|
312
340
|
import { createRestApiHandler } from 'includio-cms/admin/api/rest/handler';
|
|
313
341
|
|
|
314
342
|
export const { GET, POST, PUT, DELETE } = createRestApiHandler();
|
|
343
|
+
`
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
path: 'api/forms/[slug]/submit/+server.ts',
|
|
347
|
+
content: `${GENERATED_COMMENT_TS}
|
|
348
|
+
import { json } from '@sveltejs/kit';
|
|
349
|
+
import type { RequestHandler } from './$types';
|
|
350
|
+
import { createFormSubmission, parseFormDataForSubmission } from 'includio-cms/sveltekit/server';
|
|
351
|
+
import { getCMS } from 'includio-cms/core';
|
|
352
|
+
|
|
353
|
+
const counts = new Map<string, { count: number; resetAt: number }>();
|
|
354
|
+
const LIMIT = 5;
|
|
355
|
+
const WINDOW = 60 * 60 * 1000;
|
|
356
|
+
|
|
357
|
+
function checkRateLimit(ip: string): boolean {
|
|
358
|
+
const now = Date.now();
|
|
359
|
+
const entry = counts.get(ip);
|
|
360
|
+
if (!entry || now > entry.resetAt) {
|
|
361
|
+
counts.set(ip, { count: 1, resetAt: now + WINDOW });
|
|
362
|
+
return true;
|
|
363
|
+
}
|
|
364
|
+
if (entry.count >= LIMIT) return false;
|
|
365
|
+
entry.count++;
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export const POST: RequestHandler = async (event) => {
|
|
370
|
+
const slug = event.params.slug;
|
|
371
|
+
const ip = event.getClientAddress();
|
|
372
|
+
if (!checkRateLimit(ip)) return json({ error: 'Rate limit exceeded' }, { status: 429 });
|
|
373
|
+
|
|
374
|
+
const contentType = event.request.headers.get('content-type') || '';
|
|
375
|
+
const isMultipart = contentType.includes('multipart/form-data');
|
|
376
|
+
let data: Record<string, unknown>;
|
|
377
|
+
|
|
378
|
+
try {
|
|
379
|
+
if (isMultipart) {
|
|
380
|
+
const config = getCMS().getFormBySlug(slug);
|
|
381
|
+
const formData = await event.request.formData();
|
|
382
|
+
data = await parseFormDataForSubmission(formData, config.fields);
|
|
383
|
+
} else {
|
|
384
|
+
data = await event.request.json();
|
|
385
|
+
}
|
|
386
|
+
} catch (err) {
|
|
387
|
+
return json({ error: err instanceof Error ? err.message : 'Invalid request' }, { status: 400 });
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
try {
|
|
391
|
+
const success = await createFormSubmission({
|
|
392
|
+
slug,
|
|
393
|
+
data,
|
|
394
|
+
ip,
|
|
395
|
+
userAgent: event.request.headers.get('user-agent') || undefined
|
|
396
|
+
});
|
|
397
|
+
return success ? json({ success: true }) : json({ error: 'Submission failed' }, { status: 500 });
|
|
398
|
+
} catch (err) {
|
|
399
|
+
return json({ error: err instanceof Error ? err.message : 'Unknown error' }, { status: 400 });
|
|
400
|
+
}
|
|
401
|
+
};
|
|
315
402
|
`
|
|
316
403
|
}
|
|
317
404
|
];
|
|
318
405
|
}
|
|
319
406
|
export function scaffoldAdmin(options) {
|
|
320
|
-
const { routesDir, force = false } = options;
|
|
321
|
-
const
|
|
407
|
+
const { routesDir, force = false, shop = true } = options;
|
|
408
|
+
const allFiles = getAdminFiles();
|
|
409
|
+
const files = shop ? allFiles : allFiles.filter((f) => !isShopFile(f.path));
|
|
322
410
|
let created = 0;
|
|
323
411
|
let skipped = 0;
|
|
324
412
|
for (const file of files) {
|
|
@@ -334,7 +422,7 @@ export function scaffoldAdmin(options) {
|
|
|
334
422
|
console.log(` create ${file.path}`);
|
|
335
423
|
created++;
|
|
336
424
|
}
|
|
337
|
-
console.log(`\nDone: ${created} created, ${skipped} skipped`);
|
|
425
|
+
console.log(`\nDone: ${created} created, ${skipped} skipped${shop ? '' : ' (shop routes excluded)'}`);
|
|
338
426
|
if (skipped > 0 && !force) {
|
|
339
427
|
console.log('Use --force to overwrite existing files.');
|
|
340
428
|
}
|
|
@@ -16,7 +16,13 @@ export const createFormSubmission = async (options) => {
|
|
|
16
16
|
ip,
|
|
17
17
|
userAgent
|
|
18
18
|
});
|
|
19
|
-
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
console.error('[forms] DB createFormSubmission failed:', err);
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (config.notificationEmailAddresses && config.notificationEmailAddresses.length > 0 && getCMS().emailAdapter) {
|
|
25
|
+
try {
|
|
20
26
|
await getCMS().emailAdapter.sendMail({
|
|
21
27
|
to: config.notificationEmailAddresses,
|
|
22
28
|
subject: `New submission for form "${getLocalizedLabel(config.label, 'en')}"`,
|
|
@@ -24,9 +30,9 @@ export const createFormSubmission = async (options) => {
|
|
|
24
30
|
<p>Please log in to the admin panel to view the submission details.</p>`
|
|
25
31
|
});
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return false;
|
|
33
|
+
catch (err) {
|
|
34
|
+
console.error('[forms] notification email failed (submission already saved):', err);
|
|
35
|
+
}
|
|
31
36
|
}
|
|
37
|
+
return true;
|
|
32
38
|
};
|
|
@@ -279,6 +279,74 @@ export declare const shopOrdersTable: import("drizzle-orm/pg-core/table", { with
|
|
|
279
279
|
identity: undefined;
|
|
280
280
|
generated: undefined;
|
|
281
281
|
}, {}, {}>;
|
|
282
|
+
shipmentId: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
283
|
+
name: "shipment_id";
|
|
284
|
+
tableName: "shop_orders";
|
|
285
|
+
dataType: "string";
|
|
286
|
+
columnType: "PgText";
|
|
287
|
+
data: string;
|
|
288
|
+
driverParam: string;
|
|
289
|
+
notNull: false;
|
|
290
|
+
hasDefault: false;
|
|
291
|
+
isPrimaryKey: false;
|
|
292
|
+
isAutoincrement: false;
|
|
293
|
+
hasRuntimeDefault: false;
|
|
294
|
+
enumValues: [string, ...string[]];
|
|
295
|
+
baseColumn: never;
|
|
296
|
+
identity: undefined;
|
|
297
|
+
generated: undefined;
|
|
298
|
+
}, {}, {}>;
|
|
299
|
+
trackingNumber: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
300
|
+
name: "tracking_number";
|
|
301
|
+
tableName: "shop_orders";
|
|
302
|
+
dataType: "string";
|
|
303
|
+
columnType: "PgText";
|
|
304
|
+
data: string;
|
|
305
|
+
driverParam: string;
|
|
306
|
+
notNull: false;
|
|
307
|
+
hasDefault: false;
|
|
308
|
+
isPrimaryKey: false;
|
|
309
|
+
isAutoincrement: false;
|
|
310
|
+
hasRuntimeDefault: false;
|
|
311
|
+
enumValues: [string, ...string[]];
|
|
312
|
+
baseColumn: never;
|
|
313
|
+
identity: undefined;
|
|
314
|
+
generated: undefined;
|
|
315
|
+
}, {}, {}>;
|
|
316
|
+
labelUrl: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
317
|
+
name: "label_url";
|
|
318
|
+
tableName: "shop_orders";
|
|
319
|
+
dataType: "string";
|
|
320
|
+
columnType: "PgText";
|
|
321
|
+
data: string;
|
|
322
|
+
driverParam: string;
|
|
323
|
+
notNull: false;
|
|
324
|
+
hasDefault: false;
|
|
325
|
+
isPrimaryKey: false;
|
|
326
|
+
isAutoincrement: false;
|
|
327
|
+
hasRuntimeDefault: false;
|
|
328
|
+
enumValues: [string, ...string[]];
|
|
329
|
+
baseColumn: never;
|
|
330
|
+
identity: undefined;
|
|
331
|
+
generated: undefined;
|
|
332
|
+
}, {}, {}>;
|
|
333
|
+
shipmentCreatedAt: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
334
|
+
name: "shipment_created_at";
|
|
335
|
+
tableName: "shop_orders";
|
|
336
|
+
dataType: "date";
|
|
337
|
+
columnType: "PgTimestamp";
|
|
338
|
+
data: Date;
|
|
339
|
+
driverParam: string;
|
|
340
|
+
notNull: false;
|
|
341
|
+
hasDefault: false;
|
|
342
|
+
isPrimaryKey: false;
|
|
343
|
+
isAutoincrement: false;
|
|
344
|
+
hasRuntimeDefault: false;
|
|
345
|
+
enumValues: undefined;
|
|
346
|
+
baseColumn: never;
|
|
347
|
+
identity: undefined;
|
|
348
|
+
generated: undefined;
|
|
349
|
+
}, {}, {}>;
|
|
282
350
|
paymentMethod: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
283
351
|
name: "payment_method";
|
|
284
352
|
tableName: "shop_orders";
|
|
@@ -19,6 +19,10 @@ export const shopOrdersTable = pgTable('shop_orders', {
|
|
|
19
19
|
}),
|
|
20
20
|
carrierType: text('carrier_type'),
|
|
21
21
|
carrierRef: text('carrier_ref'),
|
|
22
|
+
shipmentId: text('shipment_id'),
|
|
23
|
+
trackingNumber: text('tracking_number'),
|
|
24
|
+
labelUrl: text('label_url'),
|
|
25
|
+
shipmentCreatedAt: timestamp('shipment_created_at', { withTimezone: true }),
|
|
22
26
|
paymentMethod: text('payment_method'),
|
|
23
27
|
paymentProviderRef: text('payment_provider_ref'),
|
|
24
28
|
consents: jsonb('consents').$type(),
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
export type ShopCarrierType = 'none' | 'inpost' | string;
|
|
2
|
+
export type InpostServiceType = 'inpost_locker_standard' | 'inpost_locker_express' | 'inpost_courier_standard' | 'inpost_courier_express';
|
|
3
|
+
export type InpostParcelSize = 'A' | 'B' | 'C';
|
|
4
|
+
export interface ShippingCarrierConfig {
|
|
5
|
+
serviceType?: InpostServiceType | string;
|
|
6
|
+
defaultSize?: InpostParcelSize | string;
|
|
7
|
+
}
|
|
2
8
|
export declare const shopShippingMethodsTable: import("drizzle-orm/pg-core/table", { with: { "resolution-mode": "require" } }).PgTableWithColumns<{
|
|
3
9
|
name: "shop_shipping_methods";
|
|
4
10
|
schema: undefined;
|
|
@@ -111,6 +117,25 @@ export declare const shopShippingMethodsTable: import("drizzle-orm/pg-core/table
|
|
|
111
117
|
}, {}, {
|
|
112
118
|
$type: string;
|
|
113
119
|
}>;
|
|
120
|
+
carrierConfig: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
121
|
+
name: "carrier_config";
|
|
122
|
+
tableName: "shop_shipping_methods";
|
|
123
|
+
dataType: "json";
|
|
124
|
+
columnType: "PgJsonb";
|
|
125
|
+
data: ShippingCarrierConfig | null;
|
|
126
|
+
driverParam: unknown;
|
|
127
|
+
notNull: false;
|
|
128
|
+
hasDefault: false;
|
|
129
|
+
isPrimaryKey: false;
|
|
130
|
+
isAutoincrement: false;
|
|
131
|
+
hasRuntimeDefault: false;
|
|
132
|
+
enumValues: undefined;
|
|
133
|
+
baseColumn: never;
|
|
134
|
+
identity: undefined;
|
|
135
|
+
generated: undefined;
|
|
136
|
+
}, {}, {
|
|
137
|
+
$type: ShippingCarrierConfig | null;
|
|
138
|
+
}>;
|
|
114
139
|
conditions: import("drizzle-orm/pg-core", { with: { "resolution-mode": "require" } }).PgColumn<{
|
|
115
140
|
name: "conditions";
|
|
116
141
|
tableName: "shop_shipping_methods";
|
|
@@ -7,6 +7,7 @@ export const shopShippingMethodsTable = pgTable('shop_shipping_methods', {
|
|
|
7
7
|
price: numeric('price', { precision: 20, scale: 6 }).notNull(),
|
|
8
8
|
vatRate: integer('vat_rate').notNull(),
|
|
9
9
|
carrierType: text('carrier_type').$type().default('none').notNull(),
|
|
10
|
+
carrierConfig: jsonb('carrier_config').$type(),
|
|
10
11
|
conditions: jsonb('conditions').$type(),
|
|
11
12
|
allowedPaymentMethods: jsonb('allowed_payment_methods').$type(),
|
|
12
13
|
isActive: boolean('is_active').default(true).notNull(),
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
locale?: "en" | "pl";
|
|
5
|
-
}): string;
|
|
6
|
-
/**
|
|
7
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
8
|
-
*
|
|
9
|
-
* - Changing this function will be over-written by the next build.
|
|
10
|
-
*
|
|
11
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
12
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
13
|
-
*
|
|
14
|
-
* @param {{}} inputs
|
|
15
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
16
|
-
* @returns {string}
|
|
17
|
-
*/
|
|
18
|
-
declare function login_hello(inputs?: {}, options?: {
|
|
19
|
-
locale?: "en" | "pl";
|
|
20
|
-
}): string;
|
|
21
|
-
/**
|
|
22
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
23
|
-
*
|
|
24
|
-
* - Changing this function will be over-written by the next build.
|
|
25
|
-
*
|
|
26
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
27
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
28
|
-
*
|
|
29
|
-
* @param {{}} inputs
|
|
30
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
31
|
-
* @returns {string}
|
|
32
|
-
*/
|
|
33
|
-
declare function login_please_login(inputs?: {}, options?: {
|
|
34
|
-
locale?: "en" | "pl";
|
|
35
|
-
}): string;
|
|
36
|
-
export { login_hello as login.hello, login_please_login as login.please_login };
|
|
1
|
+
export * from "./hello_world.js";
|
|
2
|
+
export * from "./login_hello.js";
|
|
3
|
+
export * from "./login_please_login.js";
|
|
@@ -1,72 +1,4 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
7
|
-
*
|
|
8
|
-
* - Changing this function will be over-written by the next build.
|
|
9
|
-
*
|
|
10
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
11
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
12
|
-
*
|
|
13
|
-
* @param {{ name: NonNullable<unknown> }} inputs
|
|
14
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
15
|
-
* @returns {string}
|
|
16
|
-
*/
|
|
17
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
18
|
-
export const hello_world = (inputs, options = {}) => {
|
|
19
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
20
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.hello_world(inputs)
|
|
21
|
-
}
|
|
22
|
-
const locale = options.locale ?? getLocale()
|
|
23
|
-
trackMessageCall("hello_world", locale)
|
|
24
|
-
if (locale === "en") return en.hello_world(inputs)
|
|
25
|
-
return pl.hello_world(inputs)
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
29
|
-
*
|
|
30
|
-
* - Changing this function will be over-written by the next build.
|
|
31
|
-
*
|
|
32
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
33
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
34
|
-
*
|
|
35
|
-
* @param {{}} inputs
|
|
36
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
37
|
-
* @returns {string}
|
|
38
|
-
*/
|
|
39
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
40
|
-
const login_hello = (inputs = {}, options = {}) => {
|
|
41
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
42
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.login_hello(inputs)
|
|
43
|
-
}
|
|
44
|
-
const locale = options.locale ?? getLocale()
|
|
45
|
-
trackMessageCall("login_hello", locale)
|
|
46
|
-
if (locale === "en") return en.login_hello(inputs)
|
|
47
|
-
return pl.login_hello(inputs)
|
|
48
|
-
};
|
|
49
|
-
export { login_hello as "login.hello" }
|
|
50
|
-
/**
|
|
51
|
-
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
52
|
-
*
|
|
53
|
-
* - Changing this function will be over-written by the next build.
|
|
54
|
-
*
|
|
55
|
-
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
56
|
-
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
57
|
-
*
|
|
58
|
-
* @param {{}} inputs
|
|
59
|
-
* @param {{ locale?: "en" | "pl" }} options
|
|
60
|
-
* @returns {string}
|
|
61
|
-
*/
|
|
62
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
63
|
-
const login_please_login = (inputs = {}, options = {}) => {
|
|
64
|
-
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
65
|
-
return /** @type {any} */ (globalThis).__paraglide_ssr.login_please_login(inputs)
|
|
66
|
-
}
|
|
67
|
-
const locale = options.locale ?? getLocale()
|
|
68
|
-
trackMessageCall("login_please_login", locale)
|
|
69
|
-
if (locale === "en") return en.login_please_login(inputs)
|
|
70
|
-
return pl.login_please_login(inputs)
|
|
71
|
-
};
|
|
72
|
-
export { login_please_login as "login.please_login" }
|
|
2
|
+
export * from './hello_world.js'
|
|
3
|
+
export * from './login_hello.js'
|
|
4
|
+
export * from './login_please_login.js'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
|
|
4
|
+
const en_hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
+
return `Hello, ${i.name} from en!`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const pl_hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
9
|
+
return `Hello, ${i.name} from pl!`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{ name: NonNullable<unknown> }} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
export const hello_world = (inputs, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.hello_world(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("hello_world", locale)
|
|
31
|
+
if (locale === "en") return en_hello_world(inputs)
|
|
32
|
+
return pl_hello_world(inputs)
|
|
33
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { login_hello as login.hello };
|
|
2
|
+
/**
|
|
3
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
4
|
+
*
|
|
5
|
+
* - Changing this function will be over-written by the next build.
|
|
6
|
+
*
|
|
7
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
8
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
9
|
+
*
|
|
10
|
+
* @param {{}} inputs
|
|
11
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
12
|
+
* @returns {string}
|
|
13
|
+
*/
|
|
14
|
+
declare function login_hello(inputs?: {}, options?: {
|
|
15
|
+
locale?: "en" | "pl";
|
|
16
|
+
}): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
|
|
4
|
+
const en_login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
5
|
+
return `Welcome back`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const pl_login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
+
return `Witaj ponownie`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
const login_hello = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.login_hello(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("login_hello", locale)
|
|
31
|
+
if (locale === "en") return en_login_hello(inputs)
|
|
32
|
+
return pl_login_hello(inputs)
|
|
33
|
+
};
|
|
34
|
+
export { login_hello as "login.hello" }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { login_please_login as login.please_login };
|
|
2
|
+
/**
|
|
3
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
4
|
+
*
|
|
5
|
+
* - Changing this function will be over-written by the next build.
|
|
6
|
+
*
|
|
7
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
8
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
9
|
+
*
|
|
10
|
+
* @param {{}} inputs
|
|
11
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
12
|
+
* @returns {string}
|
|
13
|
+
*/
|
|
14
|
+
declare function login_please_login(inputs?: {}, options?: {
|
|
15
|
+
locale?: "en" | "pl";
|
|
16
|
+
}): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { getLocale, trackMessageCall, experimentalMiddlewareLocaleSplitting, isServer } from '../runtime.js';
|
|
3
|
+
|
|
4
|
+
const en_login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
5
|
+
return `Login to your account`
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const pl_login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
+
return `Zaloguj się na swoje konto`
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* This function has been compiled by [Paraglide JS](https://inlang.com/m/gerre34r).
|
|
14
|
+
*
|
|
15
|
+
* - Changing this function will be over-written by the next build.
|
|
16
|
+
*
|
|
17
|
+
* - If you want to change the translations, you can either edit the source files e.g. `en.json`, or
|
|
18
|
+
* use another inlang app like [Fink](https://inlang.com/m/tdozzpar) or the [VSCode extension Sherlock](https://inlang.com/m/r7kp499g).
|
|
19
|
+
*
|
|
20
|
+
* @param {{}} inputs
|
|
21
|
+
* @param {{ locale?: "en" | "pl" }} options
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
25
|
+
const login_please_login = (inputs = {}, options = {}) => {
|
|
26
|
+
if (experimentalMiddlewareLocaleSplitting && isServer === false) {
|
|
27
|
+
return /** @type {any} */ (globalThis).__paraglide_ssr.login_please_login(inputs)
|
|
28
|
+
}
|
|
29
|
+
const locale = options.locale ?? getLocale()
|
|
30
|
+
trackMessageCall("login_please_login", locale)
|
|
31
|
+
if (locale === "en") return en_login_please_login(inputs)
|
|
32
|
+
return pl_login_please_login(inputs)
|
|
33
|
+
};
|
|
34
|
+
export { login_please_login as "login.please_login" }
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Geowidget v5 (Web Component) config used by `<InpostPicker>` on the frontend.
|
|
3
|
+
* The token is a public read-only "geowidget v5" token from your InPost account
|
|
4
|
+
* (https://manager.paczkomaty.pl). It must be delivered to the browser — do not
|
|
5
|
+
* pass private ShipX tokens here.
|
|
6
|
+
*
|
|
7
|
+
* Docs: https://dokumentacja-inpost.atlassian.net/wiki/spaces/PL/pages/50069505/Geowidget+v5
|
|
8
|
+
*/
|
|
9
|
+
export type GeowidgetEnvironment = 'production' | 'sandbox';
|
|
10
|
+
export type GeowidgetConfigPreset = 'parcelcollect' | 'parcelsend' | 'parcelcollect247' | string;
|
|
11
|
+
export interface GeowidgetConfig {
|
|
12
|
+
token: string;
|
|
13
|
+
language: string;
|
|
14
|
+
config: GeowidgetConfigPreset;
|
|
15
|
+
}
|
|
16
|
+
export interface GeowidgetWidgetDescriptor {
|
|
17
|
+
scriptUrl: string;
|
|
18
|
+
stylesheetUrl: string;
|
|
19
|
+
config: GeowidgetConfig;
|
|
20
|
+
}
|
|
21
|
+
export interface GeowidgetBuildOptions {
|
|
22
|
+
token: string;
|
|
23
|
+
environment?: GeowidgetEnvironment;
|
|
24
|
+
language?: string;
|
|
25
|
+
config?: GeowidgetConfigPreset;
|
|
26
|
+
}
|
|
27
|
+
export declare function buildGeowidgetDescriptor(opts: GeowidgetBuildOptions): GeowidgetWidgetDescriptor;
|