@moonbase.sh/storefront-api 3.11.0 → 3.13.0

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ZodTypeAny, z } from 'zod';
1
+ import { z, ZodTypeAny } from 'zod';
2
2
 
3
3
  interface ILogger {
4
4
  debug: (message?: any, ...optionalParams: any[]) => void;
@@ -149,6 +149,361 @@ declare class TokenStore implements ITokenStore {
149
149
  private warnAboutStorage;
150
150
  }
151
151
 
152
+ declare const moneySchema: z.ZodObject<{
153
+ currency: z.ZodString;
154
+ amount: z.ZodNumber;
155
+ }, "strip", z.ZodTypeAny, {
156
+ currency: string;
157
+ amount: number;
158
+ }, {
159
+ currency: string;
160
+ amount: number;
161
+ }>;
162
+ declare const discountSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
163
+ promotionId: z.ZodOptional<z.ZodString>;
164
+ validFrom: z.ZodOptional<z.ZodString>;
165
+ validUntil: z.ZodOptional<z.ZodString>;
166
+ type: z.ZodLiteral<"PercentageOffDiscount">;
167
+ name: z.ZodString;
168
+ description: z.ZodOptional<z.ZodString>;
169
+ percentage: z.ZodNumber;
170
+ total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
171
+ isExclusive: z.ZodBoolean;
172
+ recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
173
+ }, "strip", z.ZodTypeAny, {
174
+ name: string;
175
+ type: "PercentageOffDiscount";
176
+ percentage: number;
177
+ isExclusive: boolean;
178
+ description?: string | undefined;
179
+ total?: Record<string, number> | undefined;
180
+ recurringPaymentUseCount?: number | undefined;
181
+ promotionId?: string | undefined;
182
+ validFrom?: string | undefined;
183
+ validUntil?: string | undefined;
184
+ }, {
185
+ name: string;
186
+ type: "PercentageOffDiscount";
187
+ percentage: number;
188
+ isExclusive: boolean;
189
+ description?: string | undefined;
190
+ total?: Record<string, number> | undefined;
191
+ recurringPaymentUseCount?: number | undefined;
192
+ promotionId?: string | undefined;
193
+ validFrom?: string | undefined;
194
+ validUntil?: string | undefined;
195
+ }>, z.ZodObject<{
196
+ promotionId: z.ZodOptional<z.ZodString>;
197
+ validFrom: z.ZodOptional<z.ZodString>;
198
+ validUntil: z.ZodOptional<z.ZodString>;
199
+ type: z.ZodLiteral<"FlatAmountOffDiscount">;
200
+ name: z.ZodString;
201
+ description: z.ZodOptional<z.ZodString>;
202
+ total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
203
+ isExclusive: z.ZodBoolean;
204
+ recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
205
+ }, "strip", z.ZodTypeAny, {
206
+ name: string;
207
+ type: "FlatAmountOffDiscount";
208
+ isExclusive: boolean;
209
+ description?: string | undefined;
210
+ total?: Record<string, number> | undefined;
211
+ recurringPaymentUseCount?: number | undefined;
212
+ promotionId?: string | undefined;
213
+ validFrom?: string | undefined;
214
+ validUntil?: string | undefined;
215
+ }, {
216
+ name: string;
217
+ type: "FlatAmountOffDiscount";
218
+ isExclusive: boolean;
219
+ description?: string | undefined;
220
+ total?: Record<string, number> | undefined;
221
+ recurringPaymentUseCount?: number | undefined;
222
+ promotionId?: string | undefined;
223
+ validFrom?: string | undefined;
224
+ validUntil?: string | undefined;
225
+ }>]>;
226
+ declare const recurrenceSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
227
+ type: z.ZodLiteral<"OneOff">;
228
+ }, "strip", z.ZodTypeAny, {
229
+ type: "OneOff";
230
+ }, {
231
+ type: "OneOff";
232
+ }>, z.ZodObject<{
233
+ type: z.ZodLiteral<"Recurring">;
234
+ cycleLength: z.ZodNativeEnum<typeof CycleLength>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ type: "Recurring";
237
+ cycleLength: CycleLength;
238
+ }, {
239
+ type: "Recurring";
240
+ cycleLength: CycleLength;
241
+ }>]>;
242
+ declare const pricingTierSchema: z.ZodObject<{
243
+ minQuantity: z.ZodNumber;
244
+ originalPrice: z.ZodRecord<z.ZodString, z.ZodNumber>;
245
+ price: z.ZodRecord<z.ZodString, z.ZodNumber>;
246
+ }, "strip", z.ZodTypeAny, {
247
+ minQuantity: number;
248
+ originalPrice: Record<string, number>;
249
+ price: Record<string, number>;
250
+ }, {
251
+ minQuantity: number;
252
+ originalPrice: Record<string, number>;
253
+ price: Record<string, number>;
254
+ }>;
255
+ declare const pricingVariationSchema: z.ZodObject<{
256
+ id: z.ZodString;
257
+ name: z.ZodString;
258
+ originalPrice: z.ZodRecord<z.ZodString, z.ZodNumber>;
259
+ price: z.ZodRecord<z.ZodString, z.ZodNumber>;
260
+ hasDiscount: z.ZodBoolean;
261
+ discount: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
262
+ promotionId: z.ZodOptional<z.ZodString>;
263
+ validFrom: z.ZodOptional<z.ZodString>;
264
+ validUntil: z.ZodOptional<z.ZodString>;
265
+ type: z.ZodLiteral<"PercentageOffDiscount">;
266
+ name: z.ZodString;
267
+ description: z.ZodOptional<z.ZodString>;
268
+ percentage: z.ZodNumber;
269
+ total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
270
+ isExclusive: z.ZodBoolean;
271
+ recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ name: string;
274
+ type: "PercentageOffDiscount";
275
+ percentage: number;
276
+ isExclusive: boolean;
277
+ description?: string | undefined;
278
+ total?: Record<string, number> | undefined;
279
+ recurringPaymentUseCount?: number | undefined;
280
+ promotionId?: string | undefined;
281
+ validFrom?: string | undefined;
282
+ validUntil?: string | undefined;
283
+ }, {
284
+ name: string;
285
+ type: "PercentageOffDiscount";
286
+ percentage: number;
287
+ isExclusive: boolean;
288
+ description?: string | undefined;
289
+ total?: Record<string, number> | undefined;
290
+ recurringPaymentUseCount?: number | undefined;
291
+ promotionId?: string | undefined;
292
+ validFrom?: string | undefined;
293
+ validUntil?: string | undefined;
294
+ }>, z.ZodObject<{
295
+ promotionId: z.ZodOptional<z.ZodString>;
296
+ validFrom: z.ZodOptional<z.ZodString>;
297
+ validUntil: z.ZodOptional<z.ZodString>;
298
+ type: z.ZodLiteral<"FlatAmountOffDiscount">;
299
+ name: z.ZodString;
300
+ description: z.ZodOptional<z.ZodString>;
301
+ total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
302
+ isExclusive: z.ZodBoolean;
303
+ recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
304
+ }, "strip", z.ZodTypeAny, {
305
+ name: string;
306
+ type: "FlatAmountOffDiscount";
307
+ isExclusive: boolean;
308
+ description?: string | undefined;
309
+ total?: Record<string, number> | undefined;
310
+ recurringPaymentUseCount?: number | undefined;
311
+ promotionId?: string | undefined;
312
+ validFrom?: string | undefined;
313
+ validUntil?: string | undefined;
314
+ }, {
315
+ name: string;
316
+ type: "FlatAmountOffDiscount";
317
+ isExclusive: boolean;
318
+ description?: string | undefined;
319
+ total?: Record<string, number> | undefined;
320
+ recurringPaymentUseCount?: number | undefined;
321
+ promotionId?: string | undefined;
322
+ validFrom?: string | undefined;
323
+ validUntil?: string | undefined;
324
+ }>]>>;
325
+ recurrence: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
326
+ type: z.ZodLiteral<"OneOff">;
327
+ }, "strip", z.ZodTypeAny, {
328
+ type: "OneOff";
329
+ }, {
330
+ type: "OneOff";
331
+ }>, z.ZodObject<{
332
+ type: z.ZodLiteral<"Recurring">;
333
+ cycleLength: z.ZodNativeEnum<typeof CycleLength>;
334
+ }, "strip", z.ZodTypeAny, {
335
+ type: "Recurring";
336
+ cycleLength: CycleLength;
337
+ }, {
338
+ type: "Recurring";
339
+ cycleLength: CycleLength;
340
+ }>]>;
341
+ pricingTiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
342
+ minQuantity: z.ZodNumber;
343
+ originalPrice: z.ZodRecord<z.ZodString, z.ZodNumber>;
344
+ price: z.ZodRecord<z.ZodString, z.ZodNumber>;
345
+ }, "strip", z.ZodTypeAny, {
346
+ minQuantity: number;
347
+ originalPrice: Record<string, number>;
348
+ price: Record<string, number>;
349
+ }, {
350
+ minQuantity: number;
351
+ originalPrice: Record<string, number>;
352
+ price: Record<string, number>;
353
+ }>, "many">>>;
354
+ }, "strip", z.ZodTypeAny, {
355
+ id: string;
356
+ name: string;
357
+ originalPrice: Record<string, number>;
358
+ price: Record<string, number>;
359
+ hasDiscount: boolean;
360
+ recurrence: {
361
+ type: "OneOff";
362
+ } | {
363
+ type: "Recurring";
364
+ cycleLength: CycleLength;
365
+ };
366
+ discount?: {
367
+ name: string;
368
+ type: "PercentageOffDiscount";
369
+ percentage: number;
370
+ isExclusive: boolean;
371
+ description?: string | undefined;
372
+ total?: Record<string, number> | undefined;
373
+ recurringPaymentUseCount?: number | undefined;
374
+ promotionId?: string | undefined;
375
+ validFrom?: string | undefined;
376
+ validUntil?: string | undefined;
377
+ } | {
378
+ name: string;
379
+ type: "FlatAmountOffDiscount";
380
+ isExclusive: boolean;
381
+ description?: string | undefined;
382
+ total?: Record<string, number> | undefined;
383
+ recurringPaymentUseCount?: number | undefined;
384
+ promotionId?: string | undefined;
385
+ validFrom?: string | undefined;
386
+ validUntil?: string | undefined;
387
+ } | undefined;
388
+ pricingTiers?: {
389
+ minQuantity: number;
390
+ originalPrice: Record<string, number>;
391
+ price: Record<string, number>;
392
+ }[] | null | undefined;
393
+ }, {
394
+ id: string;
395
+ name: string;
396
+ originalPrice: Record<string, number>;
397
+ price: Record<string, number>;
398
+ hasDiscount: boolean;
399
+ recurrence: {
400
+ type: "OneOff";
401
+ } | {
402
+ type: "Recurring";
403
+ cycleLength: CycleLength;
404
+ };
405
+ discount?: {
406
+ name: string;
407
+ type: "PercentageOffDiscount";
408
+ percentage: number;
409
+ isExclusive: boolean;
410
+ description?: string | undefined;
411
+ total?: Record<string, number> | undefined;
412
+ recurringPaymentUseCount?: number | undefined;
413
+ promotionId?: string | undefined;
414
+ validFrom?: string | undefined;
415
+ validUntil?: string | undefined;
416
+ } | {
417
+ name: string;
418
+ type: "FlatAmountOffDiscount";
419
+ isExclusive: boolean;
420
+ description?: string | undefined;
421
+ total?: Record<string, number> | undefined;
422
+ recurringPaymentUseCount?: number | undefined;
423
+ promotionId?: string | undefined;
424
+ validFrom?: string | undefined;
425
+ validUntil?: string | undefined;
426
+ } | undefined;
427
+ pricingTiers?: {
428
+ minQuantity: number;
429
+ originalPrice: Record<string, number>;
430
+ price: Record<string, number>;
431
+ }[] | null | undefined;
432
+ }>;
433
+
434
+ type Discount = z.infer<typeof discountSchema>;
435
+ type PricingVariation = z.infer<typeof pricingVariationSchema>;
436
+ type PricingTier = z.infer<typeof pricingTierSchema>;
437
+ interface Page<T> {
438
+ items: Array<T>;
439
+ hasMore: boolean;
440
+ next: string | null;
441
+ }
442
+ interface Quantifiable<T> {
443
+ value: T;
444
+ quantity: number;
445
+ }
446
+ type SingleOrMultiple<T> = T | T[];
447
+ interface RawPropertyObject {
448
+ [key: string]: RawPropertyValue;
449
+ }
450
+ type RawPropertyArray = RawPropertyValue[];
451
+ type RawPropertyValue = string | number | boolean | null | RawPropertyObject | RawPropertyArray;
452
+ declare enum CycleLength {
453
+ Daily = "Daily",
454
+ Weekly = "Weekly",
455
+ Monthly = "Monthly",
456
+ Quarterly = "Quarterly",
457
+ Yearly = "Yearly"
458
+ }
459
+ type IRecurrence = z.infer<typeof recurrenceSchema>;
460
+ type Money = z.infer<typeof moneySchema>;
461
+ declare enum MarketingConsentType {
462
+ OptIn = "OptIn",
463
+ OptedInByDefault = "OptedInByDefault",
464
+ OptOut = "OptOut"
465
+ }
466
+ /**
467
+ * A money collection is a dict of currency to amount
468
+ */
469
+ type MoneyCollection = Record<string, number>;
470
+ interface UrchinTrackingModule {
471
+ source?: string;
472
+ medium?: string;
473
+ campaign?: string;
474
+ term?: string;
475
+ content?: string;
476
+ referrer?: string;
477
+ /** Google Ads click ID, added to the landing page URL by auto-tagging. */
478
+ gclid?: string;
479
+ /** What Google Ads sends instead of `gclid` for some clicks on iOS. */
480
+ gbraid?: string;
481
+ /** What Google Ads sends instead of `gclid` for some clicks on iOS. */
482
+ wbraid?: string;
483
+ /** Meta click ID, added to links clicked on Facebook, Instagram and Messenger. */
484
+ fbclid?: string;
485
+ /** Microsoft Advertising click ID, added to the landing page URL by auto-tagging. */
486
+ msclkid?: string;
487
+ /** TikTok Ads click ID, added to the landing page URL of a TikTok ad. */
488
+ ttclid?: string;
489
+ /**
490
+ * The platforms whose click IDs were on the link. A click ID identifies the
491
+ * visitor's click, so the storefront only passes one on once the visitor has
492
+ * agreed to marketing cookies (`attributionConsent`). Until then it sends
493
+ * these instead, which still tell Moonbase the visit came from an ad.
494
+ */
495
+ adClicks?: AdPlatform[];
496
+ }
497
+ /** An ad platform whose click IDs Moonbase recognises on a link. */
498
+ type AdPlatform = 'google' | 'microsoft' | 'meta' | 'tiktok';
499
+ /**
500
+ * The query parameters for `utm`: the tags and referrer as `utm_*`, the ad
501
+ * click IDs under their own names (`gclid`, `gbraid`, `wbraid`, `fbclid`,
502
+ * `msclkid`, `ttclid`), as they appear on the landing page URL, and the
503
+ * platforms they came from as `utm_ad_click`. Fields left out are not sent.
504
+ */
505
+ declare function utmToObject(utm?: UrchinTrackingModule): Record<string, string>;
506
+
152
507
  type HttpMethods = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
153
508
  interface Response<T> {
154
509
  data: T;
@@ -1312,7 +1667,12 @@ declare class ActivationRequestEndpoints {
1312
1667
  get(requestId: string): Promise<ActivationRequest>;
1313
1668
  isCompleted(requestId: string): Promise<boolean>;
1314
1669
  fulfillLicense(requestId: string): Promise<ActivationRequest>;
1315
- fulfillTrial(requestId: string): Promise<ActivationRequest>;
1670
+ /**
1671
+ * Starts the trial the request's app asked for. `utm` is the tracking the visitor arrived with, which the
1672
+ * trial is put down to, as a sign-up or an order is, so trials can be told apart by the marketing that
1673
+ * brought them.
1674
+ */
1675
+ fulfillTrial(requestId: string, utm?: UrchinTrackingModule): Promise<ActivationRequest>;
1316
1676
  cancel(requestId: string): Promise<ActivationRequest>;
1317
1677
  }
1318
1678
 
@@ -1436,352 +1796,6 @@ declare class PendingPasswordStore {
1436
1796
  private write;
1437
1797
  }
1438
1798
 
1439
- declare const moneySchema: z.ZodObject<{
1440
- currency: z.ZodString;
1441
- amount: z.ZodNumber;
1442
- }, "strip", z.ZodTypeAny, {
1443
- currency: string;
1444
- amount: number;
1445
- }, {
1446
- currency: string;
1447
- amount: number;
1448
- }>;
1449
- declare const discountSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1450
- promotionId: z.ZodOptional<z.ZodString>;
1451
- validFrom: z.ZodOptional<z.ZodString>;
1452
- validUntil: z.ZodOptional<z.ZodString>;
1453
- type: z.ZodLiteral<"PercentageOffDiscount">;
1454
- name: z.ZodString;
1455
- description: z.ZodOptional<z.ZodString>;
1456
- percentage: z.ZodNumber;
1457
- total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1458
- isExclusive: z.ZodBoolean;
1459
- recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
1460
- }, "strip", z.ZodTypeAny, {
1461
- name: string;
1462
- type: "PercentageOffDiscount";
1463
- percentage: number;
1464
- isExclusive: boolean;
1465
- description?: string | undefined;
1466
- total?: Record<string, number> | undefined;
1467
- recurringPaymentUseCount?: number | undefined;
1468
- promotionId?: string | undefined;
1469
- validFrom?: string | undefined;
1470
- validUntil?: string | undefined;
1471
- }, {
1472
- name: string;
1473
- type: "PercentageOffDiscount";
1474
- percentage: number;
1475
- isExclusive: boolean;
1476
- description?: string | undefined;
1477
- total?: Record<string, number> | undefined;
1478
- recurringPaymentUseCount?: number | undefined;
1479
- promotionId?: string | undefined;
1480
- validFrom?: string | undefined;
1481
- validUntil?: string | undefined;
1482
- }>, z.ZodObject<{
1483
- promotionId: z.ZodOptional<z.ZodString>;
1484
- validFrom: z.ZodOptional<z.ZodString>;
1485
- validUntil: z.ZodOptional<z.ZodString>;
1486
- type: z.ZodLiteral<"FlatAmountOffDiscount">;
1487
- name: z.ZodString;
1488
- description: z.ZodOptional<z.ZodString>;
1489
- total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1490
- isExclusive: z.ZodBoolean;
1491
- recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
1492
- }, "strip", z.ZodTypeAny, {
1493
- name: string;
1494
- type: "FlatAmountOffDiscount";
1495
- isExclusive: boolean;
1496
- description?: string | undefined;
1497
- total?: Record<string, number> | undefined;
1498
- recurringPaymentUseCount?: number | undefined;
1499
- promotionId?: string | undefined;
1500
- validFrom?: string | undefined;
1501
- validUntil?: string | undefined;
1502
- }, {
1503
- name: string;
1504
- type: "FlatAmountOffDiscount";
1505
- isExclusive: boolean;
1506
- description?: string | undefined;
1507
- total?: Record<string, number> | undefined;
1508
- recurringPaymentUseCount?: number | undefined;
1509
- promotionId?: string | undefined;
1510
- validFrom?: string | undefined;
1511
- validUntil?: string | undefined;
1512
- }>]>;
1513
- declare const recurrenceSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1514
- type: z.ZodLiteral<"OneOff">;
1515
- }, "strip", z.ZodTypeAny, {
1516
- type: "OneOff";
1517
- }, {
1518
- type: "OneOff";
1519
- }>, z.ZodObject<{
1520
- type: z.ZodLiteral<"Recurring">;
1521
- cycleLength: z.ZodNativeEnum<typeof CycleLength>;
1522
- }, "strip", z.ZodTypeAny, {
1523
- type: "Recurring";
1524
- cycleLength: CycleLength;
1525
- }, {
1526
- type: "Recurring";
1527
- cycleLength: CycleLength;
1528
- }>]>;
1529
- declare const pricingTierSchema: z.ZodObject<{
1530
- minQuantity: z.ZodNumber;
1531
- originalPrice: z.ZodRecord<z.ZodString, z.ZodNumber>;
1532
- price: z.ZodRecord<z.ZodString, z.ZodNumber>;
1533
- }, "strip", z.ZodTypeAny, {
1534
- minQuantity: number;
1535
- originalPrice: Record<string, number>;
1536
- price: Record<string, number>;
1537
- }, {
1538
- minQuantity: number;
1539
- originalPrice: Record<string, number>;
1540
- price: Record<string, number>;
1541
- }>;
1542
- declare const pricingVariationSchema: z.ZodObject<{
1543
- id: z.ZodString;
1544
- name: z.ZodString;
1545
- originalPrice: z.ZodRecord<z.ZodString, z.ZodNumber>;
1546
- price: z.ZodRecord<z.ZodString, z.ZodNumber>;
1547
- hasDiscount: z.ZodBoolean;
1548
- discount: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1549
- promotionId: z.ZodOptional<z.ZodString>;
1550
- validFrom: z.ZodOptional<z.ZodString>;
1551
- validUntil: z.ZodOptional<z.ZodString>;
1552
- type: z.ZodLiteral<"PercentageOffDiscount">;
1553
- name: z.ZodString;
1554
- description: z.ZodOptional<z.ZodString>;
1555
- percentage: z.ZodNumber;
1556
- total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1557
- isExclusive: z.ZodBoolean;
1558
- recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
1559
- }, "strip", z.ZodTypeAny, {
1560
- name: string;
1561
- type: "PercentageOffDiscount";
1562
- percentage: number;
1563
- isExclusive: boolean;
1564
- description?: string | undefined;
1565
- total?: Record<string, number> | undefined;
1566
- recurringPaymentUseCount?: number | undefined;
1567
- promotionId?: string | undefined;
1568
- validFrom?: string | undefined;
1569
- validUntil?: string | undefined;
1570
- }, {
1571
- name: string;
1572
- type: "PercentageOffDiscount";
1573
- percentage: number;
1574
- isExclusive: boolean;
1575
- description?: string | undefined;
1576
- total?: Record<string, number> | undefined;
1577
- recurringPaymentUseCount?: number | undefined;
1578
- promotionId?: string | undefined;
1579
- validFrom?: string | undefined;
1580
- validUntil?: string | undefined;
1581
- }>, z.ZodObject<{
1582
- promotionId: z.ZodOptional<z.ZodString>;
1583
- validFrom: z.ZodOptional<z.ZodString>;
1584
- validUntil: z.ZodOptional<z.ZodString>;
1585
- type: z.ZodLiteral<"FlatAmountOffDiscount">;
1586
- name: z.ZodString;
1587
- description: z.ZodOptional<z.ZodString>;
1588
- total: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
1589
- isExclusive: z.ZodBoolean;
1590
- recurringPaymentUseCount: z.ZodOptional<z.ZodNumber>;
1591
- }, "strip", z.ZodTypeAny, {
1592
- name: string;
1593
- type: "FlatAmountOffDiscount";
1594
- isExclusive: boolean;
1595
- description?: string | undefined;
1596
- total?: Record<string, number> | undefined;
1597
- recurringPaymentUseCount?: number | undefined;
1598
- promotionId?: string | undefined;
1599
- validFrom?: string | undefined;
1600
- validUntil?: string | undefined;
1601
- }, {
1602
- name: string;
1603
- type: "FlatAmountOffDiscount";
1604
- isExclusive: boolean;
1605
- description?: string | undefined;
1606
- total?: Record<string, number> | undefined;
1607
- recurringPaymentUseCount?: number | undefined;
1608
- promotionId?: string | undefined;
1609
- validFrom?: string | undefined;
1610
- validUntil?: string | undefined;
1611
- }>]>>;
1612
- recurrence: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
1613
- type: z.ZodLiteral<"OneOff">;
1614
- }, "strip", z.ZodTypeAny, {
1615
- type: "OneOff";
1616
- }, {
1617
- type: "OneOff";
1618
- }>, z.ZodObject<{
1619
- type: z.ZodLiteral<"Recurring">;
1620
- cycleLength: z.ZodNativeEnum<typeof CycleLength>;
1621
- }, "strip", z.ZodTypeAny, {
1622
- type: "Recurring";
1623
- cycleLength: CycleLength;
1624
- }, {
1625
- type: "Recurring";
1626
- cycleLength: CycleLength;
1627
- }>]>;
1628
- pricingTiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
1629
- minQuantity: z.ZodNumber;
1630
- originalPrice: z.ZodRecord<z.ZodString, z.ZodNumber>;
1631
- price: z.ZodRecord<z.ZodString, z.ZodNumber>;
1632
- }, "strip", z.ZodTypeAny, {
1633
- minQuantity: number;
1634
- originalPrice: Record<string, number>;
1635
- price: Record<string, number>;
1636
- }, {
1637
- minQuantity: number;
1638
- originalPrice: Record<string, number>;
1639
- price: Record<string, number>;
1640
- }>, "many">>>;
1641
- }, "strip", z.ZodTypeAny, {
1642
- id: string;
1643
- name: string;
1644
- originalPrice: Record<string, number>;
1645
- price: Record<string, number>;
1646
- hasDiscount: boolean;
1647
- recurrence: {
1648
- type: "OneOff";
1649
- } | {
1650
- type: "Recurring";
1651
- cycleLength: CycleLength;
1652
- };
1653
- discount?: {
1654
- name: string;
1655
- type: "PercentageOffDiscount";
1656
- percentage: number;
1657
- isExclusive: boolean;
1658
- description?: string | undefined;
1659
- total?: Record<string, number> | undefined;
1660
- recurringPaymentUseCount?: number | undefined;
1661
- promotionId?: string | undefined;
1662
- validFrom?: string | undefined;
1663
- validUntil?: string | undefined;
1664
- } | {
1665
- name: string;
1666
- type: "FlatAmountOffDiscount";
1667
- isExclusive: boolean;
1668
- description?: string | undefined;
1669
- total?: Record<string, number> | undefined;
1670
- recurringPaymentUseCount?: number | undefined;
1671
- promotionId?: string | undefined;
1672
- validFrom?: string | undefined;
1673
- validUntil?: string | undefined;
1674
- } | undefined;
1675
- pricingTiers?: {
1676
- minQuantity: number;
1677
- originalPrice: Record<string, number>;
1678
- price: Record<string, number>;
1679
- }[] | null | undefined;
1680
- }, {
1681
- id: string;
1682
- name: string;
1683
- originalPrice: Record<string, number>;
1684
- price: Record<string, number>;
1685
- hasDiscount: boolean;
1686
- recurrence: {
1687
- type: "OneOff";
1688
- } | {
1689
- type: "Recurring";
1690
- cycleLength: CycleLength;
1691
- };
1692
- discount?: {
1693
- name: string;
1694
- type: "PercentageOffDiscount";
1695
- percentage: number;
1696
- isExclusive: boolean;
1697
- description?: string | undefined;
1698
- total?: Record<string, number> | undefined;
1699
- recurringPaymentUseCount?: number | undefined;
1700
- promotionId?: string | undefined;
1701
- validFrom?: string | undefined;
1702
- validUntil?: string | undefined;
1703
- } | {
1704
- name: string;
1705
- type: "FlatAmountOffDiscount";
1706
- isExclusive: boolean;
1707
- description?: string | undefined;
1708
- total?: Record<string, number> | undefined;
1709
- recurringPaymentUseCount?: number | undefined;
1710
- promotionId?: string | undefined;
1711
- validFrom?: string | undefined;
1712
- validUntil?: string | undefined;
1713
- } | undefined;
1714
- pricingTiers?: {
1715
- minQuantity: number;
1716
- originalPrice: Record<string, number>;
1717
- price: Record<string, number>;
1718
- }[] | null | undefined;
1719
- }>;
1720
-
1721
- type Discount = z.infer<typeof discountSchema>;
1722
- type PricingVariation = z.infer<typeof pricingVariationSchema>;
1723
- type PricingTier = z.infer<typeof pricingTierSchema>;
1724
- interface Page<T> {
1725
- items: Array<T>;
1726
- hasMore: boolean;
1727
- next: string | null;
1728
- }
1729
- interface Quantifiable<T> {
1730
- value: T;
1731
- quantity: number;
1732
- }
1733
- type SingleOrMultiple<T> = T | T[];
1734
- interface RawPropertyObject {
1735
- [key: string]: RawPropertyValue;
1736
- }
1737
- type RawPropertyArray = RawPropertyValue[];
1738
- type RawPropertyValue = string | number | boolean | null | RawPropertyObject | RawPropertyArray;
1739
- declare enum CycleLength {
1740
- Daily = "Daily",
1741
- Weekly = "Weekly",
1742
- Monthly = "Monthly",
1743
- Quarterly = "Quarterly",
1744
- Yearly = "Yearly"
1745
- }
1746
- type IRecurrence = z.infer<typeof recurrenceSchema>;
1747
- type Money = z.infer<typeof moneySchema>;
1748
- declare enum MarketingConsentType {
1749
- OptIn = "OptIn",
1750
- OptedInByDefault = "OptedInByDefault",
1751
- OptOut = "OptOut"
1752
- }
1753
- /**
1754
- * A money collection is a dict of currency to amount
1755
- */
1756
- type MoneyCollection = Record<string, number>;
1757
- interface UrchinTrackingModule {
1758
- source?: string;
1759
- medium?: string;
1760
- campaign?: string;
1761
- term?: string;
1762
- content?: string;
1763
- referrer?: string;
1764
- /** Google Ads click ID, added to the landing page URL by auto-tagging. */
1765
- gclid?: string;
1766
- /** What Google Ads sends instead of `gclid` for some clicks on iOS. */
1767
- gbraid?: string;
1768
- /** What Google Ads sends instead of `gclid` for some clicks on iOS. */
1769
- wbraid?: string;
1770
- /** Meta click ID, added to links clicked on Facebook, Instagram and Messenger. */
1771
- fbclid?: string;
1772
- /** Microsoft Advertising click ID, added to the landing page URL by auto-tagging. */
1773
- msclkid?: string;
1774
- /** TikTok Ads click ID, added to the landing page URL of a TikTok ad. */
1775
- ttclid?: string;
1776
- }
1777
- /**
1778
- * The query parameters for `utm`: the tags and referrer as `utm_*`, and the ad
1779
- * click IDs under their own names (`gclid`, `gbraid`, `wbraid`, `fbclid`,
1780
- * `msclkid`, `ttclid`), as they appear on the landing page URL. Fields left out
1781
- * are not sent.
1782
- */
1783
- declare function utmToObject(utm?: UrchinTrackingModule): Record<string, string>;
1784
-
1785
1799
  declare const addressSchema: z.ZodObject<{
1786
1800
  countryCode: z.ZodString;
1787
1801
  streetAddress1: z.ZodString;
@@ -2368,6 +2382,13 @@ declare class IdentityEndpoints {
2368
2382
  hasSubscriptions?: boolean | null | undefined;
2369
2383
  };
2370
2384
  }>;
2385
+ /**
2386
+ * Saves the signed-in customer's address, which their next checkout starts from. A checkout
2387
+ * they have already entered billing details in keeps those. Rejects with a `MoonbaseError` for
2388
+ * an address the store can't use: it needs a known country, a street address, a city or a
2389
+ * region, and in the US a postal code.
2390
+ */
2391
+ updateAddress(address: Address): Promise<User>;
2371
2392
  setPassword(currentPassword: string, newPassword: string): Promise<void>;
2372
2393
  forgotPassword(email: string): Promise<void>;
2373
2394
  resetPassword(email: string, newPassword: string, code: string): Promise<void>;
@@ -27252,6 +27273,7 @@ declare class StorefrontEndpoints {
27252
27273
  rate: number;
27253
27274
  region?: string | undefined;
27254
27275
  } | undefined;
27276
+ cookieConsentRequired?: boolean | undefined;
27255
27277
  }>;
27256
27278
  }
27257
27279
 
@@ -51381,6 +51403,7 @@ declare const storefrontSchema: z.ZodObject<{
51381
51403
  rate: number;
51382
51404
  region?: string | undefined;
51383
51405
  }>>;
51406
+ cookieConsentRequired: z.ZodOptional<z.ZodBoolean>;
51384
51407
  }, "strip", z.ZodTypeAny, {
51385
51408
  products: {
51386
51409
  id: string;
@@ -51875,6 +51898,7 @@ declare const storefrontSchema: z.ZodObject<{
51875
51898
  rate: number;
51876
51899
  region?: string | undefined;
51877
51900
  } | undefined;
51901
+ cookieConsentRequired?: boolean | undefined;
51878
51902
  }, {
51879
51903
  products: {
51880
51904
  id: string;
@@ -52195,6 +52219,7 @@ declare const storefrontSchema: z.ZodObject<{
52195
52219
  rate: number;
52196
52220
  region?: string | undefined;
52197
52221
  } | undefined;
52222
+ cookieConsentRequired?: boolean | undefined;
52198
52223
  }>;
52199
52224
 
52200
52225
  declare const schemas$1_offerConditionSchema: typeof offerConditionSchema;
@@ -52579,6 +52604,20 @@ declare const problemDetailsSchema: z.ZodObject<{
52579
52604
  }>;
52580
52605
  type ProblemDetails = z.infer<typeof problemDetailsSchema>;
52581
52606
 
52607
+ /**
52608
+ * The platforms the click IDs in `utm` came from, together with any it already
52609
+ * names in `adClicks`, each once; undefined when there are none, so a visit
52610
+ * without an ad click carries no empty list.
52611
+ */
52612
+ declare function adClicksOf(utm: UrchinTrackingModule | undefined): AdPlatform[] | undefined;
52613
+ /**
52614
+ * `utm` without the values of its ad click IDs, which identify the visitor's
52615
+ * click, but still naming in `adClicks` the platforms they came from, which
52616
+ * identify no one. This is what the storefront keeps and sends until the
52617
+ * visitor has agreed to marketing cookies: the visit still counts as an ad
52618
+ * click, and a sale from it is still put down to the ad's tags.
52619
+ */
52620
+ declare function withoutClickIds(utm: UrchinTrackingModule): UrchinTrackingModule;
52582
52621
  /**
52583
52622
  * Returns the host of `rawReferrer` if it parses as a URL with a different
52584
52623
  * origin from `currentOrigin`. Returns `undefined` for same-origin (internal
@@ -52611,7 +52650,25 @@ declare function resolveUtm(cached: UrchinTrackingModule | undefined, fresh: Urc
52611
52650
 
52612
52651
  interface MoonbaseConfiguration {
52613
52652
  endpoint: string;
52653
+ /**
52654
+ * Keep the attribution a visitor arrived with in localStorage, across visits,
52655
+ * rather than in sessionStorage for the tab. Only with the visitor's consent
52656
+ * (see `attributionConsent`), as it remembers them beyond the visit; a refusal
52657
+ * removes it.
52658
+ */
52614
52659
  persistUtm?: boolean;
52660
+ /**
52661
+ * Whether the visitor has agreed to marketing cookies, as your cookie banner
52662
+ * reports it, so `@moonbase.sh/vue` may keep and send the ad click IDs on the
52663
+ * landing page URL (`gclid`, `fbclid` and the rest) and record a tagged arrival
52664
+ * before they put anything in the cart. Without them it keeps only the UTM
52665
+ * tags, the referring site and which ad platforms the click IDs came from, for
52666
+ * the tab. Left out, the storefront follows the store's own setting in Moonbase
52667
+ * (always, per country, or only with cookie consent), which the catalog
52668
+ * reports for this visitor as `cookieConsentRequired`. Change it later with
52669
+ * `setAttributionConsent()`.
52670
+ */
52671
+ attributionConsent?: boolean;
52615
52672
  includeManifests?: boolean;
52616
52673
  store?: IStore;
52617
52674
  logger?: ILogger;
@@ -52641,4 +52698,4 @@ declare class MoonbaseClient {
52641
52698
  orders: OrderEndpoints;
52642
52699
  }
52643
52700
 
52644
- export { type Activation, ActivationMethod, type ActivationReleaseNotCovered, type ActivationRequest, ActivationRequestFulfillmentType, ActivationRequestStatus, ActivationStatus, type Address, Architecture, type BundleLineItem, CaptchaRequiredError, type CartCatalog, type CartOrder, type CartTotal, type CartTotalCondition, CartUtils, type CommunicationPreferences, type CommunicationPreferencesInput, type CommunicationPreferencesView, type CompletedOrder, ConnectableAccountProvider, type ConnectedAccount, ConsoleLogger, CycleLength, type Discount, DiscountUtils, type Download, type DownloadManifest, type ILogger, type IRecurrence, type IStore, type ITokenStore, type Identity, type ImageFit, type ImageFormat, type ImageTransform, ImageUtils, InMemoryStore, type License, type LicenseReleaseAccess, LicenseStatus, type LineItem, type LineItemTotal, LocalStorageStore, LogLevel, MarketingConsentType, type MilestoneProgress, type Money, type MoneyCollection, MoneyCollectionUtils, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OfferCondition, type OfferConditionContext, type OfferProgress, type OfferScope, OfferUtils, type OpenOrder, type Order, OrderStatus, type OrderTotal, type OwnedProduct, type Page, PasswordSetupRequiredError, type PendingPlanChange, Platform, type PricingOption, type PricingTier, type PricingVariation, type ProblemDetails, type ProductLineItem, type ProductRelease, type ProductReleaseAccess, type PromotionDisplay, type Quantifiable, type RawPropertyArray, type RawPropertyObject, type RawPropertyValue, ReleaseNotCoveredError, type SignUpOptions, type SignUpResult, type SingleOrMultiple, StoreClosedError, type Storefront, type StorefrontBundle, type StorefrontLicenseUpgrade, type StorefrontLicenseUpgradeReleaseAccess, type StorefrontOffer, type StorefrontOfferTarget, type StorefrontProduct, type StorefrontPromotion, type StorefrontPromotionCta, type StorefrontPromotionTarget, type SubscribeInput, type SubscribeResponse, type Subscription, type SubscriptionCancellationFeedback, SubscriptionCancellationReason, type SubscriptionPlanOption, type SubscriptionPlanOptions, SubscriptionStatus, type TaxEstimate, TokenStore, type UrchinTrackingModule, type User, type UserAccountConfirmed, type UserAccountConfirmedStatus, type Vendor, type VendorCaptcha, type VendorFeatures, type Voucher, accessTokenLifetime, imageWidths, isLocalStorageAvailable, isPromotionDisplay, isTransformableImageUrl, maxImageDimension, normalizeGroupIds, objectToQuery, parseOffSiteReferrer, problemDetailsSchema, promotionDisplays, resolveUtm, schemas, utmToObject };
52701
+ export { type Activation, ActivationMethod, type ActivationReleaseNotCovered, type ActivationRequest, ActivationRequestFulfillmentType, ActivationRequestStatus, ActivationStatus, type AdPlatform, type Address, Architecture, type BundleLineItem, CaptchaRequiredError, type CartCatalog, type CartOrder, type CartTotal, type CartTotalCondition, CartUtils, type CommunicationPreferences, type CommunicationPreferencesInput, type CommunicationPreferencesView, type CompletedOrder, ConnectableAccountProvider, type ConnectedAccount, ConsoleLogger, CycleLength, type Discount, DiscountUtils, type Download, type DownloadManifest, type ILogger, type IRecurrence, type IStore, type ITokenStore, type Identity, type ImageFit, type ImageFormat, type ImageTransform, ImageUtils, InMemoryStore, type License, type LicenseReleaseAccess, LicenseStatus, type LineItem, type LineItemTotal, LocalStorageStore, LogLevel, MarketingConsentType, type MilestoneProgress, type Money, type MoneyCollection, MoneyCollectionUtils, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type OfferCondition, type OfferConditionContext, type OfferProgress, type OfferScope, OfferUtils, type OpenOrder, type Order, OrderStatus, type OrderTotal, type OwnedProduct, type Page, PasswordSetupRequiredError, type PendingPlanChange, Platform, type PricingOption, type PricingTier, type PricingVariation, type ProblemDetails, type ProductLineItem, type ProductRelease, type ProductReleaseAccess, type PromotionDisplay, type Quantifiable, type RawPropertyArray, type RawPropertyObject, type RawPropertyValue, ReleaseNotCoveredError, type SignUpOptions, type SignUpResult, type SingleOrMultiple, StoreClosedError, type Storefront, type StorefrontBundle, type StorefrontLicenseUpgrade, type StorefrontLicenseUpgradeReleaseAccess, type StorefrontOffer, type StorefrontOfferTarget, type StorefrontProduct, type StorefrontPromotion, type StorefrontPromotionCta, type StorefrontPromotionTarget, type SubscribeInput, type SubscribeResponse, type Subscription, type SubscriptionCancellationFeedback, SubscriptionCancellationReason, type SubscriptionPlanOption, type SubscriptionPlanOptions, SubscriptionStatus, type TaxEstimate, TokenStore, type UrchinTrackingModule, type User, type UserAccountConfirmed, type UserAccountConfirmedStatus, type Vendor, type VendorCaptcha, type VendorFeatures, type Voucher, accessTokenLifetime, adClicksOf, imageWidths, isLocalStorageAvailable, isPromotionDisplay, isTransformableImageUrl, maxImageDimension, normalizeGroupIds, objectToQuery, parseOffSiteReferrer, problemDetailsSchema, promotionDisplays, resolveUtm, schemas, utmToObject, withoutClickIds };