@asteby/storefront 0.21.1 → 0.22.1
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/{account-settings-quulZwuF.d.ts → account-settings-CwEnn5sR.d.ts} +30 -1
- package/dist/{account-settings-BkShqX2k.d.cts → account-settings-DZGcveuu.d.cts} +30 -1
- package/dist/cli.js +26 -1
- package/dist/fiscal-document.d.cts +2 -2
- package/dist/fiscal-document.d.ts +2 -2
- package/dist/index.cjs +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/dist/mock.cjs +48 -2
- package/dist/mock.cjs.map +1 -1
- package/dist/mock.d.cts +1 -1
- package/dist/mock.d.ts +1 -1
- package/dist/mock.js +48 -2
- package/dist/mock.js.map +1 -1
- package/dist/mockup.d.cts +1 -1
- package/dist/mockup.d.ts +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
|
@@ -509,6 +509,11 @@ type Customer = {
|
|
|
509
509
|
/** Saved fiscal data; `null`/absent when none. */
|
|
510
510
|
fiscal?: FiscalIdentity | null;
|
|
511
511
|
created_at: string;
|
|
512
|
+
/**
|
|
513
|
+
* The buyer proved they control `email` with a code (contract 1.15). `false` for an account registered without
|
|
514
|
+
* verification (the store had no mail connector) and when there is no e-mail. Absent on older servers: say nothing.
|
|
515
|
+
*/
|
|
516
|
+
email_verified?: boolean;
|
|
512
517
|
/** Preferred language, one of the store's (contract 1.9). Absent on older servers. */
|
|
513
518
|
locale?: string | null;
|
|
514
519
|
/** Notification preferences (contract 1.9). Absent on older servers. */
|
|
@@ -566,6 +571,11 @@ type CustomerCapabilities = {
|
|
|
566
571
|
data_export?: boolean;
|
|
567
572
|
/** The buyer can delete their account (`customer.deleteAccount`). Absent on older servers. */
|
|
568
573
|
account_delete?: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* The buyer can verify and change their e-mail from the account (`customer.email`; contract 1.15). It needs mail
|
|
576
|
+
* delivery, because the code goes to the NEW address. Absent on older servers: there is no such section.
|
|
577
|
+
*/
|
|
578
|
+
email_change?: boolean;
|
|
569
579
|
};
|
|
570
580
|
/** `GET {gateway}/_token`: what the token in use is and what it can do. Needs no scope. */
|
|
571
581
|
type TokenIntrospection = {
|
|
@@ -603,6 +613,23 @@ type CustomerSetPasswordInput = {
|
|
|
603
613
|
password: string;
|
|
604
614
|
current_password?: string;
|
|
605
615
|
};
|
|
616
|
+
/** `customer.email.confirmVerification`: the 6-digit code mailed to the current address. */
|
|
617
|
+
type CustomerEmailCodeInput = {
|
|
618
|
+
code: string;
|
|
619
|
+
};
|
|
620
|
+
/** `customer.email.requestChange`: the new address. */
|
|
621
|
+
type CustomerEmailChangeInput = {
|
|
622
|
+
email: string;
|
|
623
|
+
};
|
|
624
|
+
/** `customer.email.confirmChange`: the same new address and the code that arrived there. */
|
|
625
|
+
type CustomerEmailChangeConfirmInput = {
|
|
626
|
+
email: string;
|
|
627
|
+
code: string;
|
|
628
|
+
};
|
|
629
|
+
/** The answer to asking for a change: always this, whether or not the new address has an account. */
|
|
630
|
+
type CustomerEmailChangeRequested = {
|
|
631
|
+
status: 'verification_required';
|
|
632
|
+
};
|
|
606
633
|
type CustomerResetPasswordInput = {
|
|
607
634
|
email: string;
|
|
608
635
|
code: string;
|
|
@@ -1372,6 +1399,8 @@ type RegionPostalCode = {
|
|
|
1372
1399
|
province: string;
|
|
1373
1400
|
city: string;
|
|
1374
1401
|
neighborhoods: string[];
|
|
1402
|
+
/** Every municipality the code covers, only when more than one (the form leaves the city editable and offers them). */
|
|
1403
|
+
cities?: string[];
|
|
1375
1404
|
};
|
|
1376
1405
|
/** `GET /storefront/region`: how the market formats, taxes, addresses and invoices. */
|
|
1377
1406
|
type Region = {
|
|
@@ -1740,4 +1769,4 @@ declare function dataExportBytes(file: Pick<DataExportFile, 'content_base64'>):
|
|
|
1740
1769
|
/** A download filename that is safe in a `Content-Disposition` header: no path, quotes, control characters or spaces. */
|
|
1741
1770
|
declare function safeExportFilename(name: unknown, fallback?: string): string;
|
|
1742
1771
|
|
|
1743
|
-
export { type
|
|
1772
|
+
export { type FiscalDocumentEvidence as $, type AccountDeleteInput as A, type Customer as B, type Cart as C, type CustomerCapabilities as D, type CustomerEmailChangeConfirmInput as E, type CustomerEmailChangeInput as F, type CustomerEmailChangeRequested as G, type CustomerEmailCodeInput as H, type CustomerIdentifier as I, type CustomerPasswordLoginInput as J, type CustomerPreferences as K, type CustomerRegisterInput as L, type CustomerRegisterResult as M, type CustomerResetPasswordInput as N, type CustomerSession as O, type CustomerSessionInfo as P, type CustomerSessionInput as Q, type CustomerSetPasswordInput as R, type CustomerUpdateInput as S, type CustomerVerifyRegistrationInput as T, type DataExportFile as U, type DeclineCode as V, type DeliveryInput as W, type DeliveryMethod as X, type DeliveryOptions as Y, type Facet as Z, type FacetValue as _, type Address as a, type PaymentPoint as a$, type FiscalDocumentSource as a0, type FiscalIdentity as a1, type FiscalIdentityInput as a2, type FiscalProfile as a3, type FiscalProfileInput as a4, type FiscalVerification as a5, type GeoHint as a6, type IdentityCapture as a7, type IdentityDocumentSpec as a8, type IdentityFieldRule as a9, type NextActionKind as aA, type Order as aB, type OrderLine as aC, type OrderPickup as aD, type OrderProblem as aE, type OrderProgress as aF, type OrderProgressStep as aG, type OrderSection as aH, type OrderShippingService as aI, type OrderStage as aJ, type OrderStepKey as aK, type OrderStepState as aL, type Page as aM, type PageInfo as aN, type PaymentAction as aO, type PaymentAttemptResult as aP, type PaymentAttemptStatus as aQ, type PaymentClient as aR, type PaymentClientCsp as aS, type PaymentConfig as aT, type PaymentFlow as aU, type PaymentInfo as aV, type PaymentMethod as aW, type PaymentMethods as aX, type PaymentNextStep as aY, type PaymentOption as aZ, type PaymentOptionKey as a_, type IdentityRulesV1 as aa, type IdentityStrategy as ab, type Image as ac, type InsufficientStockDetails as ad, type InsufficientStockLine as ae, type InvoiceAction as af, type InvoiceDoc as ag, type InvoiceFile as ah, type InvoiceFileKind as ai, type InvoiceReceiver as aj, type InvoiceRequest as ak, type InvoiceResult as al, type InvoiceStage as am, type InvoiceSummary as an, type InvoicingCapabilities as ao, type Location as ap, type LocationContacts as aq, type LocationKind as ar, type LocationListParams as as, type LocationPickup as at, type Menu as au, type MenuItem as av, type Money as aw, type MoneyRange as ax, type NearestLocation as ay, type NextAction as az, type AddressInput as b, isStorefrontError as b$, type PaymentSubmitInput as b0, type PaymentVoucher as b1, type PendingPayment as b2, type PendingPaymentVoucher as b3, type PickupOption as b4, type Product as b5, type ProductAttributeValue as b6, type ProductCategory as b7, type ProductConnection as b8, type ProductOption as b9, type ShipmentStatus as bA, type ShipmentsSummary as bB, type ShippingRate as bC, type Shop as bD, type ShopBranch as bE, type ShopContact as bF, type ShopPolicies as bG, type StockLevel as bH, StorefrontError as bI, type StorefrontErrorBody as bJ, type StorefrontErrorCode as bK, type StorefrontErrorInit as bL, type Subject as bM, type SubjectCatalog as bN, type SubjectCatalogNode as bO, type SubjectField as bP, type SubjectFieldType as bQ, type SubjectInput as bR, type SubjectKind as bS, type SubjectPatch as bT, type SubjectRef as bU, type Theme as bV, type TokenIntrospection as bW, type UnavailableRateProvider as bX, dataExportBytes as bY, isAccountDeleteBlocked as bZ, isReauthRequired as b_, type ProductSort as ba, type ProductVariant as bb, type PromotionAnnouncement as bc, type PromotionReward as bd, type PromotionTier as be, type PromotionsList as bf, type ReauthInput as bg, type ReauthResult as bh, type RecommendationPlacement as bi, type Refund as bj, type Region as bk, type RegionFiscalEntry as bl, type RegionFiscalId as bm, type RegionPaymentMethod as bn, type RegionPostalCode as bo, type RestockSubscriptionInput as bp, type RestockSubscriptionResult as bq, type ReturnRequest as br, type ReturnRequestInput as bs, type SEO as bt, type Section as bu, type SelectedOption as bv, type Shipment as bw, type ShipmentEvent as bx, type ShipmentKind as by, type ShipmentMap as bz, type Article as c, safeExportFilename as c0, type Availability as d, type AvailabilityStatus as e, type CartBuyer as f, type CartBuyerInput as g, type CartCost as h, type CartDelivery as i, type CartDiscountCode as j, type CartDiscountLine as k, type CartInvoice as l, type CartLine as m, type CartLineInput as n, type CartLineMerchandise as o, type CartLineProblem as p, type CartLineUpdateInput as q, type CartPromotions as r, type CartRecommendation as s, type CartRecommendations as t, type CheckoutInfo as u, type CheckoutInput as v, type CheckoutPayment as w, type CheckoutResult as x, type Collection as y, type Connection as z };
|
|
@@ -509,6 +509,11 @@ type Customer = {
|
|
|
509
509
|
/** Saved fiscal data; `null`/absent when none. */
|
|
510
510
|
fiscal?: FiscalIdentity | null;
|
|
511
511
|
created_at: string;
|
|
512
|
+
/**
|
|
513
|
+
* The buyer proved they control `email` with a code (contract 1.15). `false` for an account registered without
|
|
514
|
+
* verification (the store had no mail connector) and when there is no e-mail. Absent on older servers: say nothing.
|
|
515
|
+
*/
|
|
516
|
+
email_verified?: boolean;
|
|
512
517
|
/** Preferred language, one of the store's (contract 1.9). Absent on older servers. */
|
|
513
518
|
locale?: string | null;
|
|
514
519
|
/** Notification preferences (contract 1.9). Absent on older servers. */
|
|
@@ -566,6 +571,11 @@ type CustomerCapabilities = {
|
|
|
566
571
|
data_export?: boolean;
|
|
567
572
|
/** The buyer can delete their account (`customer.deleteAccount`). Absent on older servers. */
|
|
568
573
|
account_delete?: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* The buyer can verify and change their e-mail from the account (`customer.email`; contract 1.15). It needs mail
|
|
576
|
+
* delivery, because the code goes to the NEW address. Absent on older servers: there is no such section.
|
|
577
|
+
*/
|
|
578
|
+
email_change?: boolean;
|
|
569
579
|
};
|
|
570
580
|
/** `GET {gateway}/_token`: what the token in use is and what it can do. Needs no scope. */
|
|
571
581
|
type TokenIntrospection = {
|
|
@@ -603,6 +613,23 @@ type CustomerSetPasswordInput = {
|
|
|
603
613
|
password: string;
|
|
604
614
|
current_password?: string;
|
|
605
615
|
};
|
|
616
|
+
/** `customer.email.confirmVerification`: the 6-digit code mailed to the current address. */
|
|
617
|
+
type CustomerEmailCodeInput = {
|
|
618
|
+
code: string;
|
|
619
|
+
};
|
|
620
|
+
/** `customer.email.requestChange`: the new address. */
|
|
621
|
+
type CustomerEmailChangeInput = {
|
|
622
|
+
email: string;
|
|
623
|
+
};
|
|
624
|
+
/** `customer.email.confirmChange`: the same new address and the code that arrived there. */
|
|
625
|
+
type CustomerEmailChangeConfirmInput = {
|
|
626
|
+
email: string;
|
|
627
|
+
code: string;
|
|
628
|
+
};
|
|
629
|
+
/** The answer to asking for a change: always this, whether or not the new address has an account. */
|
|
630
|
+
type CustomerEmailChangeRequested = {
|
|
631
|
+
status: 'verification_required';
|
|
632
|
+
};
|
|
606
633
|
type CustomerResetPasswordInput = {
|
|
607
634
|
email: string;
|
|
608
635
|
code: string;
|
|
@@ -1372,6 +1399,8 @@ type RegionPostalCode = {
|
|
|
1372
1399
|
province: string;
|
|
1373
1400
|
city: string;
|
|
1374
1401
|
neighborhoods: string[];
|
|
1402
|
+
/** Every municipality the code covers, only when more than one (the form leaves the city editable and offers them). */
|
|
1403
|
+
cities?: string[];
|
|
1375
1404
|
};
|
|
1376
1405
|
/** `GET /storefront/region`: how the market formats, taxes, addresses and invoices. */
|
|
1377
1406
|
type Region = {
|
|
@@ -1740,4 +1769,4 @@ declare function dataExportBytes(file: Pick<DataExportFile, 'content_base64'>):
|
|
|
1740
1769
|
/** A download filename that is safe in a `Content-Disposition` header: no path, quotes, control characters or spaces. */
|
|
1741
1770
|
declare function safeExportFilename(name: unknown, fallback?: string): string;
|
|
1742
1771
|
|
|
1743
|
-
export { type
|
|
1772
|
+
export { type FiscalDocumentEvidence as $, type AccountDeleteInput as A, type Customer as B, type Cart as C, type CustomerCapabilities as D, type CustomerEmailChangeConfirmInput as E, type CustomerEmailChangeInput as F, type CustomerEmailChangeRequested as G, type CustomerEmailCodeInput as H, type CustomerIdentifier as I, type CustomerPasswordLoginInput as J, type CustomerPreferences as K, type CustomerRegisterInput as L, type CustomerRegisterResult as M, type CustomerResetPasswordInput as N, type CustomerSession as O, type CustomerSessionInfo as P, type CustomerSessionInput as Q, type CustomerSetPasswordInput as R, type CustomerUpdateInput as S, type CustomerVerifyRegistrationInput as T, type DataExportFile as U, type DeclineCode as V, type DeliveryInput as W, type DeliveryMethod as X, type DeliveryOptions as Y, type Facet as Z, type FacetValue as _, type Address as a, type PaymentPoint as a$, type FiscalDocumentSource as a0, type FiscalIdentity as a1, type FiscalIdentityInput as a2, type FiscalProfile as a3, type FiscalProfileInput as a4, type FiscalVerification as a5, type GeoHint as a6, type IdentityCapture as a7, type IdentityDocumentSpec as a8, type IdentityFieldRule as a9, type NextActionKind as aA, type Order as aB, type OrderLine as aC, type OrderPickup as aD, type OrderProblem as aE, type OrderProgress as aF, type OrderProgressStep as aG, type OrderSection as aH, type OrderShippingService as aI, type OrderStage as aJ, type OrderStepKey as aK, type OrderStepState as aL, type Page as aM, type PageInfo as aN, type PaymentAction as aO, type PaymentAttemptResult as aP, type PaymentAttemptStatus as aQ, type PaymentClient as aR, type PaymentClientCsp as aS, type PaymentConfig as aT, type PaymentFlow as aU, type PaymentInfo as aV, type PaymentMethod as aW, type PaymentMethods as aX, type PaymentNextStep as aY, type PaymentOption as aZ, type PaymentOptionKey as a_, type IdentityRulesV1 as aa, type IdentityStrategy as ab, type Image as ac, type InsufficientStockDetails as ad, type InsufficientStockLine as ae, type InvoiceAction as af, type InvoiceDoc as ag, type InvoiceFile as ah, type InvoiceFileKind as ai, type InvoiceReceiver as aj, type InvoiceRequest as ak, type InvoiceResult as al, type InvoiceStage as am, type InvoiceSummary as an, type InvoicingCapabilities as ao, type Location as ap, type LocationContacts as aq, type LocationKind as ar, type LocationListParams as as, type LocationPickup as at, type Menu as au, type MenuItem as av, type Money as aw, type MoneyRange as ax, type NearestLocation as ay, type NextAction as az, type AddressInput as b, isStorefrontError as b$, type PaymentSubmitInput as b0, type PaymentVoucher as b1, type PendingPayment as b2, type PendingPaymentVoucher as b3, type PickupOption as b4, type Product as b5, type ProductAttributeValue as b6, type ProductCategory as b7, type ProductConnection as b8, type ProductOption as b9, type ShipmentStatus as bA, type ShipmentsSummary as bB, type ShippingRate as bC, type Shop as bD, type ShopBranch as bE, type ShopContact as bF, type ShopPolicies as bG, type StockLevel as bH, StorefrontError as bI, type StorefrontErrorBody as bJ, type StorefrontErrorCode as bK, type StorefrontErrorInit as bL, type Subject as bM, type SubjectCatalog as bN, type SubjectCatalogNode as bO, type SubjectField as bP, type SubjectFieldType as bQ, type SubjectInput as bR, type SubjectKind as bS, type SubjectPatch as bT, type SubjectRef as bU, type Theme as bV, type TokenIntrospection as bW, type UnavailableRateProvider as bX, dataExportBytes as bY, isAccountDeleteBlocked as bZ, isReauthRequired as b_, type ProductSort as ba, type ProductVariant as bb, type PromotionAnnouncement as bc, type PromotionReward as bd, type PromotionTier as be, type PromotionsList as bf, type ReauthInput as bg, type ReauthResult as bh, type RecommendationPlacement as bi, type Refund as bj, type Region as bk, type RegionFiscalEntry as bl, type RegionFiscalId as bm, type RegionPaymentMethod as bn, type RegionPostalCode as bo, type RestockSubscriptionInput as bp, type RestockSubscriptionResult as bq, type ReturnRequest as br, type ReturnRequestInput as bs, type SEO as bt, type Section as bu, type SelectedOption as bv, type Shipment as bw, type ShipmentEvent as bx, type ShipmentKind as by, type ShipmentMap as bz, type Article as c, safeExportFilename as c0, type Availability as d, type AvailabilityStatus as e, type CartBuyer as f, type CartBuyerInput as g, type CartCost as h, type CartDelivery as i, type CartDiscountCode as j, type CartDiscountLine as k, type CartInvoice as l, type CartLine as m, type CartLineInput as n, type CartLineMerchandise as o, type CartLineProblem as p, type CartLineUpdateInput as q, type CartPromotions as r, type CartRecommendation as s, type CartRecommendations as t, type CheckoutInfo as u, type CheckoutInput as v, type CheckoutPayment as w, type CheckoutResult as x, type Collection as y, type Connection as z };
|
package/dist/cli.js
CHANGED
|
@@ -477,6 +477,31 @@ function createStorefrontClient(config) {
|
|
|
477
477
|
* A wrong credential is always the same `400`; too many tries is `429` (`StorefrontError.retryAfter`).
|
|
478
478
|
*/
|
|
479
479
|
reauth: (input, options) => write("POST", "/storefront/customer/reauth", input, options),
|
|
480
|
+
/**
|
|
481
|
+
* The buyer's e-mail from their account (contract 1.15, `capabilities().email_change`). All four calls need the
|
|
482
|
+
* buyer's session; a wrong or expired code is always the same `400` on `code`, too many tries is `429`.
|
|
483
|
+
*/
|
|
484
|
+
email: {
|
|
485
|
+
/**
|
|
486
|
+
* Mails a code to the account's CURRENT e-mail so it can be verified. `422` when it is already verified, the
|
|
487
|
+
* account has no e-mail or the store cannot send mail; `429` while a code was just sent.
|
|
488
|
+
*/
|
|
489
|
+
requestVerification: (options) => write("POST", "/storefront/customer/email/verification", void 0, options),
|
|
490
|
+
/** Verifies the current e-mail with the code; answers the buyer with `email_verified: true`. */
|
|
491
|
+
confirmVerification: (input, options) => write("POST", "/storefront/customer/email/verification/confirm", input, options),
|
|
492
|
+
/**
|
|
493
|
+
* Asks to change the e-mail. Needs a recent `reauth` (`403 reauth_required`, see `isReauthRequired`). A code is
|
|
494
|
+
* sent to the NEW address and nothing changes until `confirmChange`. The answer is the same whether or not the
|
|
495
|
+
* new address already has an account (then nothing is sent and the code can never work): word your screen as
|
|
496
|
+
* «if the address can be used, we sent a code». `400` on `email` for an invalid or unchanged address.
|
|
497
|
+
*/
|
|
498
|
+
requestChange: (input, options) => write("POST", "/storefront/customer/email/change", input, options),
|
|
499
|
+
/**
|
|
500
|
+
* Confirms the change with the code that arrived at the new address. The other sessions of the account are
|
|
501
|
+
* closed (the one making the call stays) and the answer is the buyer with the new, verified e-mail.
|
|
502
|
+
*/
|
|
503
|
+
confirmChange: (input, options) => write("POST", "/storefront/customer/email/change/confirm", input, options)
|
|
504
|
+
},
|
|
480
505
|
/**
|
|
481
506
|
* The buyer's data as a JSON file (contract 1.9, `capabilities().data_export`). Needs a recent `reauth`. It is
|
|
482
507
|
* built on request and is neither stored nor emailed: call it from YOUR server, stream the bytes
|
|
@@ -604,7 +629,7 @@ function repairPath(connectionName) {
|
|
|
604
629
|
import { chmodSync, closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, statSync, unlinkSync, writeSync } from "fs";
|
|
605
630
|
import { dirname, join, resolve } from "path";
|
|
606
631
|
import { hostname } from "os";
|
|
607
|
-
var SDK_VERSION = true ? "0.
|
|
632
|
+
var SDK_VERSION = true ? "0.22.1" : "dev";
|
|
608
633
|
function writeFileAtomic(file, content, mode = 384) {
|
|
609
634
|
const dir = dirname(file);
|
|
610
635
|
mkdirSync(dir, { recursive: true });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { a0 as FiscalDocumentSource, bl as RegionFiscalEntry, a8 as IdentityDocumentSpec, $ as FiscalDocumentEvidence, bm as RegionFiscalId, aa as IdentityRulesV1 } from './account-settings-DZGcveuu.cjs';
|
|
2
|
+
export { a7 as IdentityCapture, a9 as IdentityFieldRule, ab as IdentityStrategy } from './account-settings-DZGcveuu.cjs';
|
|
3
3
|
import './geo.cjs';
|
|
4
4
|
|
|
5
5
|
/** A value read from a document: text, or the codes of a catalog (`multiple` fields). */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { a0 as FiscalDocumentSource, bl as RegionFiscalEntry, a8 as IdentityDocumentSpec, $ as FiscalDocumentEvidence, bm as RegionFiscalId, aa as IdentityRulesV1 } from './account-settings-CwEnn5sR.js';
|
|
2
|
+
export { a7 as IdentityCapture, a9 as IdentityFieldRule, ab as IdentityStrategy } from './account-settings-CwEnn5sR.js';
|
|
3
3
|
import './geo.js';
|
|
4
4
|
|
|
5
5
|
/** A value read from a document: text, or the codes of a catalog (`multiple` fields). */
|
package/dist/index.cjs
CHANGED
|
@@ -509,6 +509,31 @@ function createStorefrontClient(config) {
|
|
|
509
509
|
* A wrong credential is always the same `400`; too many tries is `429` (`StorefrontError.retryAfter`).
|
|
510
510
|
*/
|
|
511
511
|
reauth: (input, options) => write("POST", "/storefront/customer/reauth", input, options),
|
|
512
|
+
/**
|
|
513
|
+
* The buyer's e-mail from their account (contract 1.15, `capabilities().email_change`). All four calls need the
|
|
514
|
+
* buyer's session; a wrong or expired code is always the same `400` on `code`, too many tries is `429`.
|
|
515
|
+
*/
|
|
516
|
+
email: {
|
|
517
|
+
/**
|
|
518
|
+
* Mails a code to the account's CURRENT e-mail so it can be verified. `422` when it is already verified, the
|
|
519
|
+
* account has no e-mail or the store cannot send mail; `429` while a code was just sent.
|
|
520
|
+
*/
|
|
521
|
+
requestVerification: (options) => write("POST", "/storefront/customer/email/verification", void 0, options),
|
|
522
|
+
/** Verifies the current e-mail with the code; answers the buyer with `email_verified: true`. */
|
|
523
|
+
confirmVerification: (input, options) => write("POST", "/storefront/customer/email/verification/confirm", input, options),
|
|
524
|
+
/**
|
|
525
|
+
* Asks to change the e-mail. Needs a recent `reauth` (`403 reauth_required`, see `isReauthRequired`). A code is
|
|
526
|
+
* sent to the NEW address and nothing changes until `confirmChange`. The answer is the same whether or not the
|
|
527
|
+
* new address already has an account (then nothing is sent and the code can never work): word your screen as
|
|
528
|
+
* «if the address can be used, we sent a code». `400` on `email` for an invalid or unchanged address.
|
|
529
|
+
*/
|
|
530
|
+
requestChange: (input, options) => write("POST", "/storefront/customer/email/change", input, options),
|
|
531
|
+
/**
|
|
532
|
+
* Confirms the change with the code that arrived at the new address. The other sessions of the account are
|
|
533
|
+
* closed (the one making the call stays) and the answer is the buyer with the new, verified e-mail.
|
|
534
|
+
*/
|
|
535
|
+
confirmChange: (input, options) => write("POST", "/storefront/customer/email/change/confirm", input, options)
|
|
536
|
+
},
|
|
512
537
|
/**
|
|
513
538
|
* The buyer's data as a JSON file (contract 1.9, `capabilities().data_export`). Needs a recent `reauth`. It is
|
|
514
539
|
* built on request and is neither stored nor emailed: call it from YOUR server, stream the bytes
|