@lockerverse/sdk 0.2.191 → 0.2.192-dev.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/MIGRATIONS.md +77 -5
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/MIGRATIONS.md
CHANGED
|
@@ -36,7 +36,7 @@ If it cannot be found, report that limit and use the baseline review below. Do n
|
|
|
36
36
|
claim that every historical migration was applied. Read this file even if the
|
|
37
37
|
version already matches: a previous upgrade may have missed host adoption steps.
|
|
38
38
|
|
|
39
|
-
## 0.2.
|
|
39
|
+
## 0.2.192-dev.1 — auction item additional charges
|
|
40
40
|
|
|
41
41
|
- **Affected:** Core auction item data, purchase quotes, and React auction checkout.
|
|
42
42
|
- **Automatic:** optional `additionalCharge` charges the first-item amount plus the
|
|
@@ -54,7 +54,7 @@ version already matches: a previous upgrade may have missed host adoption steps.
|
|
|
54
54
|
- **Check:** compare one, two, and maximum quantity totals with the server quote,
|
|
55
55
|
verify the per-order limit, and inspect the named charge row before payment.
|
|
56
56
|
|
|
57
|
-
## 0.2.
|
|
57
|
+
## 0.2.190-dev.1 — widget load recovery and Sentry releases
|
|
58
58
|
|
|
59
59
|
- **Affected:** Core widget loading and SDK failure reporting.
|
|
60
60
|
- **Automatic:** a widget GET retries once after a network failure or request
|
|
@@ -81,6 +81,7 @@ version already matches: a previous upgrade may have missed host adoption steps.
|
|
|
81
81
|
- **Check:** select one, two, and the maximum allowed trigger quantity. Confirm the
|
|
82
82
|
local summary and server quote agree; removing all trigger items removes shipping.
|
|
83
83
|
|
|
84
|
+
|
|
84
85
|
## 0.2.184 — single focus boundary for form fields
|
|
85
86
|
|
|
86
87
|
- **Affected:** React form controls and the shared phone field in payment and signup.
|
|
@@ -100,7 +101,7 @@ Widgets can now use a private contact list for email eligibility, a fixed amount
|
|
|
100
101
|
Required shipping appears in `catalog.widget.requiredShipping`. Do not offer this product as a separate shopper choice. The SDK adds its quantity once when a trigger product is selected; the server also enforces this rule. Render authoritative quote line items and totals, including shipping. The built-in launcher and payment summary handle this automatically.
|
|
101
102
|
|
|
102
103
|
|
|
103
|
-
## 0.2.
|
|
104
|
+
## 0.2.176-dev.1 — Secure checkout loading recovery
|
|
104
105
|
|
|
105
106
|
- **Affected:** React payment widget Stripe fields.
|
|
106
107
|
- **Automatic:** failed field or script loads show a reload action. Fields that
|
|
@@ -112,9 +113,23 @@ Required shipping appears in `catalog.widget.requiredShipping`. Do not offer thi
|
|
|
112
113
|
- Reload is an explicit customer action and can clear unsaved form entries.
|
|
113
114
|
Saved payment recovery remains in session storage.
|
|
114
115
|
|
|
115
|
-
|
|
116
116
|
## 0.2.175 — Match Stripe Elements payment method configuration
|
|
117
117
|
|
|
118
|
+
- **Affected:** Core checkout submission and React payment widgets.
|
|
119
|
+
- **Automatic:** React configures explicit card, Link, and community-enabled bank
|
|
120
|
+
methods in Stripe Elements and marks the confirmation request with
|
|
121
|
+
`paymentMethodConfiguration: "explicit"`. This matches the backend's Stripe
|
|
122
|
+
PaymentIntent configuration.
|
|
123
|
+
- **Required:** deploy the backend that supports this optional marker before
|
|
124
|
+
upgrading React. Keep Core and React matched. Existing Core-only callers omit
|
|
125
|
+
the marker and retain automatic payment methods. Custom Elements integrations
|
|
126
|
+
must send the marker only when they use the explicit method list.
|
|
127
|
+
- **Check:** submit card and bank payments through Stripe Elements in test mode,
|
|
128
|
+
including recurring checkout. Confirm pending recovery and settlement.
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
## 0.2.174-dev.1 — Match Stripe Elements payment method configuration
|
|
132
|
+
|
|
118
133
|
- **Affected:** Core checkout submission and React payment widgets.
|
|
119
134
|
- **Automatic:** React configures explicit card, Link, and community-enabled bank
|
|
120
135
|
methods in Stripe Elements and marks the confirmation request with
|
|
@@ -188,7 +203,39 @@ Required shipping appears in `catalog.widget.requiredShipping`. Do not offer thi
|
|
|
188
203
|
verify a changed selection cannot discard it. Check both paid and free order
|
|
189
204
|
confirmation panels. Do not submit a live transaction for this check.
|
|
190
205
|
|
|
191
|
-
## 0.2.
|
|
206
|
+
## 0.2.172-dev.1 — Check pending payment status
|
|
207
|
+
|
|
208
|
+
- **Affected:** React payment widgets with unresolved payments.
|
|
209
|
+
- **Automatic behavior:** the existing pending-payment screen now offers Check
|
|
210
|
+
payment status. It checks the saved payment reference and cannot submit a new
|
|
211
|
+
payment. The control is disabled while the check runs.
|
|
212
|
+
- **Required host changes:** none. Update Core and React together.
|
|
213
|
+
- **Verification:** complete a test bank payment, return to its pending checkout,
|
|
214
|
+
and check its status. Confirm completion clears recovery storage.
|
|
215
|
+
|
|
216
|
+
## 0.2.171-dev.1 — SDK payment recovery and completion UI
|
|
217
|
+
|
|
218
|
+
- **Affected:** React payment widgets and custom hosts that persist payment recovery.
|
|
219
|
+
- **Optional adoption:** pass `recoveryStorageKey` to `LockerversePayment` to let
|
|
220
|
+
the SDK save and restore the pending payment in session storage. Use a stable
|
|
221
|
+
key scoped to the API environment, community, and widget. Remove the host's
|
|
222
|
+
storage code and recovery-driven component key. Do not combine automatic
|
|
223
|
+
persistence with a second host persistence writer.
|
|
224
|
+
- **Compatibility:** the SDK reads the hosted Next app's existing version 1
|
|
225
|
+
records when the same key is used. It writes version 2 records with widget
|
|
226
|
+
identity. It checks widget and selection identity before recovery and keeps
|
|
227
|
+
an unresolved record if those details differ. Recovery uses the saved connected
|
|
228
|
+
account even if current payment routing has changed. Storage is read after hydration,
|
|
229
|
+
before the payable form mounts. No contact details or payment tokens are saved.
|
|
230
|
+
- **Optional UI adoption:** use `completionView="summary"` for the SDK confirmation
|
|
231
|
+
panel and remove the host's duplicate success panel. Completion callbacks still
|
|
232
|
+
run. The default inline message and explicit `resumePayment` integrations remain
|
|
233
|
+
supported. Auctions and legacy custom checkout forms are unchanged.
|
|
234
|
+
- **Check:** reload a pending checkout and confirm the existing payment is checked;
|
|
235
|
+
verify a changed selection cannot discard it. Check both paid and free order
|
|
236
|
+
confirmation panels. Do not submit a live transaction for this check.
|
|
237
|
+
|
|
238
|
+
## 0.2.169-dev.1 — six-month payment widgets
|
|
192
239
|
|
|
193
240
|
Affected: @lockerverse/sdk checkout and @lockerverse/react payment widgets.
|
|
194
241
|
|
|
@@ -204,6 +251,31 @@ Affected: @lockerverse/sdk checkout and @lockerverse/react payment widgets.
|
|
|
204
251
|
submission. Do not submit a live payment for an integration check.
|
|
205
252
|
|
|
206
253
|
|
|
254
|
+
## 0.2.168-dev.1 — bank authorization terms
|
|
255
|
+
|
|
256
|
+
- **Affected:** React payment widgets with ACH enabled.
|
|
257
|
+
- **Automatic:** Stripe displays its bank authorization terms before payment confirmation.
|
|
258
|
+
- **Adoption:** update the matching SDK/React development pair. No prop changes are required.
|
|
259
|
+
- **Check:** confirm that the bank authorization text is visible when a bank account is selected.
|
|
260
|
+
|
|
261
|
+
## 0.2.167-dev.1 — widget ACH and subscription payment recovery
|
|
262
|
+
|
|
263
|
+
- **Affected:** Core checkout data and React payment widgets.
|
|
264
|
+
- **Automatic:** bank payment availability follows the organization default and
|
|
265
|
+
community override returned by the backend. Missing policy remains disabled.
|
|
266
|
+
Pending payments keep their existing payment reference. A failed subscription
|
|
267
|
+
invoice can return `action_required` with `requiresAction: false` and `retryUrl`;
|
|
268
|
+
React shows a link to pay the same invoice instead of creating a second subscription.
|
|
269
|
+
- **Required for custom payment UI:** preserve the reference for pending and
|
|
270
|
+
action-required results. Handle `retryUrl` by opening that invoice, and recover
|
|
271
|
+
status before permitting a new checkout. Do not treat submission as settlement.
|
|
272
|
+
- **Adoption:** deploy the matching backend policy and recovery contract before
|
|
273
|
+
enabling ACH. Existing React hosts need no component prop changes. Keep Core and
|
|
274
|
+
React versions matched when upgrading. Auction payment methods are unchanged.
|
|
275
|
+
- **Check:** verify disabled/inherited/enabled bank visibility and pending, bank
|
|
276
|
+
verification, invoice retry, success, and terminal failure in Stripe test mode.
|
|
277
|
+
Do not create a live transaction for this check.
|
|
278
|
+
|
|
207
279
|
## 0.2.166 — single dropdown arrow
|
|
208
280
|
|
|
209
281
|
- **Affected:** native single-select custom fields in React signup and payment forms.
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=`0.2.
|
|
1
|
+
const e=`0.2.192-dev.1`;var t=class extends Error{failureKind;code;operation;reportable;recoveryRecommended;sdkVersion;serverCode;status;constructor({failureKind:t,code:n,message:r,operation:i,reportable:a,recoveryRecommended:o=!1,serverCode:s,status:c}){super(r),this.name=`LockerverseSdkError`,this.failureKind=t,this.code=n,this.operation=i,this.reportable=a,this.recoveryRecommended=o,this.sdkVersion=e,this.serverCode=s,this.status=c}};export{t as n,e as t};
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["packageMetadata.version"],"sources":["../package.json","../src/types.ts"],"sourcesContent":["","import packageMetadata from \"../package.json\" with { type: \"json\" };\nimport type { GeneratedPaymentResult } from \"./generated/public-contract-types.ts\";\n\nexport type LockerversePaymentOption =\n | \"one-time\"\n | \"monthly\"\n | \"annually\"\n | \"every-six-months\";\nexport type LockerverseEnvironment = \"development\" | \"production\";\nexport type LockerverseFulfillmentType = \"none\" | \"event_admission\";\n\nexport const LOCKERVERSE_SDK_VERSION = packageMetadata.version;\n\nexport type LockerverseProduct = {\n id: string;\n listingId: string;\n slug: string;\n name: string;\n description: string | null;\n fulfillmentType: LockerverseFulfillmentType;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n amountCents: number | null;\n minimumAmountCents: number | null;\n minimumQuantity: number | null;\n /** Per-order limit for this widget listing. Null means no per-order limit. */\n maximumQuantity: number | null;\n inventoryQuantity: number | null;\n acceptsDiscounts: boolean;\n};\n\nexport type LockerverseAvailabilityStatus = \"available\" | \"sold_out\";\n\nexport type LockerverseCatalogAvailability = {\n listings: Array<{\n listingId: string;\n maxPurchasableQuantity: number | null;\n remainingQuantity: number | null;\n status: LockerverseAvailabilityStatus;\n }>;\n sharedLimits: Array<{\n id: string;\n listingIds: string[];\n remainingQuantity: number;\n status: LockerverseAvailabilityStatus;\n }>;\n};\n\nexport type LockerverseCatalog = {\n availability: LockerverseCatalogAvailability;\n community: LockerverseCommunityBranding | null;\n event: LockerverseEvent | null;\n payment: LockerversePaymentConfiguration;\n pricingPolicy: LockerverseCheckoutPricingPolicy;\n products: LockerverseProduct[];\n widget: LockerverseWidgetConfiguration;\n};\n\nexport type LockerverseEvent = {\n description: string | null;\n endAt: string;\n id: string;\n location: string | null;\n name: string;\n startAt: string;\n status: \"draft\" | \"active\" | \"finished\" | \"cancelled\";\n};\n\nexport type LockerverseCommunityBranding = {\n widgetAchEnabled?: boolean | undefined;\n accentColor: string;\n imageUrl: string | null;\n memberIdLabel?: string | null | undefined;\n name: string;\n};\n\nexport type LockerverseCheckoutPricingPolicy = {\n currency: \"usd\";\n serviceFeeRateBasisPoints: number;\n};\n\nexport type LockerversePaymentConfiguration = {\n connectedAccountId: string | null;\n currency: \"usd\";\n publishableKey: string;\n};\n\nexport type LockerverseWidgetFields = {\n memberId: boolean;\n merchSize: boolean;\n phone: boolean;\n promoCode: boolean;\n serviceFee: boolean;\n shipping: boolean;\n tipping: boolean;\n};\n\nexport type LockerverseCustomFieldOption = { id: string; label: string };\n\ntype LockerverseCustomFieldBase = {\n id: string;\n label: string;\n paymentOptionIds?: string[] | undefined;\n required: boolean;\n};\n\nexport type LockerverseTextCustomField = LockerverseCustomFieldBase & {\n type: \"text\" | \"textarea\";\n};\n\nexport type LockerverseBooleanCustomField = LockerverseCustomFieldBase & {\n type: \"checkbox\";\n};\n\nexport type LockerverseSingleOptionCustomField = LockerverseCustomFieldBase & {\n options: LockerverseCustomFieldOption[];\n type: \"radio\" | \"select\";\n};\n\nexport type LockerverseMultiOptionCustomField = LockerverseCustomFieldBase & {\n options: LockerverseCustomFieldOption[];\n type: \"checkboxes\" | \"multi_select\";\n};\n\nexport type LockerverseCustomField =\n | LockerverseBooleanCustomField\n | LockerverseTextCustomField\n | LockerverseSingleOptionCustomField\n | LockerverseMultiOptionCustomField;\n\nexport type LockerverseCustomFieldAnswerValue<\n Field extends LockerverseCustomField,\n> = Field extends LockerverseBooleanCustomField\n ? boolean\n : Field extends LockerverseMultiOptionCustomField\n ? string[]\n : string;\n\nexport type LockerverseCustomFieldAnswer<\n Field extends LockerverseCustomField = LockerverseCustomField,\n> = Field extends LockerverseCustomField\n ? { fieldId: Field[\"id\"]; value: LockerverseCustomFieldAnswerValue<Field> }\n : never;\n\nexport type LockerverseWidgetConfiguration = {\n requiredShipping?:\n | {\n additionalUnitAmountCents?: number | undefined;\n productId: string;\n triggerProductIds: string[];\n }\n | undefined;\n customFields: LockerverseCustomField[];\n description: string | null;\n fields: LockerverseWidgetFields;\n id: string;\n name: string;\n showCommunityBranding: boolean;\n title: string | null;\n};\n\nexport type LockerverseSdkErrorCode =\n | \"public_events_load_failed\"\n | \"auction_load_failed\"\n | \"auction_bid_failed\"\n | \"auction_purchase_failed\"\n | \"auction_purchase_status_failed\"\n | \"auction_receipt_failed\"\n | \"widget_load_failed\"\n | \"signup_load_failed\"\n | \"signup_submit_failed\"\n | \"total_calculation_failed\"\n | \"payment_submit_failed\"\n | \"payment_status_failed\"\n | \"invalid_selection\";\n\nexport type LockerverseSdkOperation =\n | \"list_public_events\"\n | \"list_auctions\"\n | \"load_auction\"\n | \"create_auction_bid\"\n | \"create_auction_purchase\"\n | \"get_auction_purchase_receipt\"\n | \"get_auction_purchase_status\"\n | \"load_widget\"\n | \"load_signup\"\n | \"submit_signup\"\n | \"calculate_total\"\n | \"submit_payment\"\n | \"get_payment_status\";\n\nexport type LockerverseSdkServerCode =\n | \"PAYMENT_WIDGET_SALES_LIMIT_REACHED\"\n | \"PAYMENT_WIDGET_PHONE_INVALID\"\n | \"PAYMENT_WIDGET_PHONE_REQUIRED\"\n | \"SIGN_UP_WIDGET_PHONE_INVALID\"\n | \"SIGN_UP_WIDGET_PHONE_REQUIRED\";\n\nexport type LockerverseSdkFailureKind =\n | \"network\"\n | \"timeout\"\n | \"aborted\"\n | \"invalid_response\";\n\nexport class LockerverseSdkError extends Error {\n readonly failureKind: LockerverseSdkFailureKind | undefined;\n readonly code: LockerverseSdkErrorCode;\n readonly operation: LockerverseSdkOperation;\n readonly reportable: boolean;\n readonly recoveryRecommended: boolean;\n readonly sdkVersion: string;\n readonly serverCode: LockerverseSdkServerCode | undefined;\n readonly status: number | undefined;\n\n constructor({\n failureKind,\n code,\n message,\n operation,\n reportable,\n recoveryRecommended = false,\n serverCode,\n status,\n }: {\n failureKind?: LockerverseSdkFailureKind | undefined;\n code: LockerverseSdkErrorCode;\n message: string;\n operation: LockerverseSdkOperation;\n reportable: boolean;\n recoveryRecommended?: boolean;\n serverCode?: LockerverseSdkServerCode;\n status?: number | undefined;\n }) {\n super(message);\n this.name = \"LockerverseSdkError\";\n this.failureKind = failureKind;\n this.code = code;\n this.operation = operation;\n this.reportable = reportable;\n this.recoveryRecommended = recoveryRecommended;\n this.sdkVersion = LOCKERVERSE_SDK_VERSION;\n this.serverCode = serverCode;\n this.status = status;\n }\n}\n\nexport type LockerverseCheckoutLineItem = {\n productId: string;\n productName: string;\n listingId: string;\n listingSlug: string;\n acceptsDiscounts: boolean;\n eventId: string | null;\n fulfillmentType: LockerverseFulfillmentType;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n quantity: number;\n unitAmountCents: number;\n subtotalCents: number;\n};\n\nexport type LockerverseAppliedDiscount = {\n percentageOff?: number | undefined;\n amountOffCents?: number | undefined;\n message?: string | undefined;\n source: \"email_list\" | \"promo_code\";\n};\n\nexport type LockerverseCheckoutAmounts = {\n amountCents: number;\n discountableSubtotalCents: number;\n discountCents: number;\n serviceFeeCents: number;\n subtotalCents: number;\n tipCents: number;\n totalCents: number;\n};\n\nexport type LockerverseCheckoutQuote = LockerverseCheckoutAmounts & {\n appliedDiscount: LockerverseAppliedDiscount | null;\n authoritative: true;\n paymentReference: string;\n payment: LockerversePaymentConfiguration;\n paymentOption: LockerversePaymentOption;\n lineItems: LockerverseCheckoutLineItem[];\n};\n\nexport type LockerverseCheckoutEstimate = LockerverseCheckoutAmounts & {\n appliedDiscount: null;\n authoritative: false;\n items: readonly LockerverseCheckoutItem[];\n lineItems: readonly LockerverseCheckoutLineItem[];\n paymentOption: LockerversePaymentOption;\n};\n\nexport type LockerverseCheckoutPricingInput = {\n email?: string;\n includeServiceFee?: boolean;\n promoCode?: string;\n tipCents?: number;\n};\n\nexport type LockerversePaymentStatus =\n | \"action_required\"\n | \"failed\"\n | \"pending\"\n | \"success\";\n\nexport type LockerversePaymentResult = {\n checkoutId: string;\n paymentReference: string;\n checkoutStatus: LockerversePaymentStatus;\n retryUrl?: string | undefined;\n clientSecret: string | null;\n paymentRequired: boolean;\n requiresAction: boolean;\n status: string | null;\n};\n\nexport type LockerversePaymentCompletion = LockerversePaymentResult & {\n email: string | null;\n lineItems: readonly LockerverseCheckoutLineItem[] | null;\n};\n\ntype AssertPaymentContract<T extends true> = T;\ntype _PaymentResultMatchesGenerated = AssertPaymentContract<\n LockerversePaymentResult extends GeneratedPaymentResult\n ? GeneratedPaymentResult extends LockerversePaymentResult\n ? true\n : false\n : false\n>;\n\nexport type LockerverseShipping = {\n address: {\n city: string;\n country: string;\n line1: string;\n line2?: string;\n postal_code: string;\n state: string;\n };\n name: string;\n};\n\nexport type LockerversePaymentSubmission = {\n confirmationToken?: string;\n paymentMethodConfiguration?: \"explicit\";\n customFieldAnswers?: LockerverseCustomFieldAnswer[];\n email: string;\n memberId?: string;\n merchSize?: \"XS\" | \"S\" | \"M\" | \"L\" | \"XL\" | \"XXL\" | \"XXXL\";\n metadata?: Record<string, string>;\n phone?: string;\n shipping?: LockerverseShipping;\n};\n\nexport type LockerverseCheckoutItem =\n | { productId: string; quantity: number }\n | { productId: string; amountCents: number }\n | { productId: string };\n\nexport type LockerverseCheckoutSelectionItem =\n | { productSlug: string; quantity: number }\n | { productSlug: string; amountCents: number }\n | { productSlug: string };\n\nexport type LockerverseEstimateCheckoutInput =\n LockerverseCheckoutPricingInput & {\n selection: LockerverseCheckoutSelectionItem[];\n };\n\nexport type LockerverseLoadCheckoutInput = {\n selection: LockerverseCheckoutSelectionItem[];\n};\n\nexport type LockerverseCalculateTotalInput = LockerverseCheckoutPricingInput & {\n catalog: LockerverseCatalog;\n} & (\n | {\n items: LockerverseCheckoutItem[];\n selection?: never;\n }\n | {\n items?: never;\n selection: LockerverseCheckoutSelectionItem[];\n }\n );\n\nexport type LockerversePreparedCheckout = Readonly<\n LockerverseCheckoutQuote & {\n items: readonly LockerverseCheckoutItem[];\n pricing: Readonly<LockerverseCheckoutPricingInput>;\n }\n>;\n\nexport type LockerverseLoadedCheckout = Readonly<{\n catalog: LockerverseCatalog;\n checkout: LockerversePreparedCheckout;\n}>;\n\nexport type LockerverseSubmitPaymentInput = {\n checkout: LockerversePreparedCheckout;\n submission: LockerversePaymentSubmission;\n};\n\ntype CreateLockerverseWidgetBaseOptions = {\n communitySlug: string;\n fetch?: typeof globalThis.fetch;\n onError?: (error: LockerverseSdkError) => void;\n requestTimeoutMs?: number;\n sentryDsn?: string | null;\n widgetSlug: string;\n};\n\nexport type LockerverseResourceEnvironmentOptions =\n | {\n apiBaseUrl: string;\n environment: LockerverseEnvironment;\n }\n | {\n apiBaseUrl?: undefined;\n environment?: \"production\";\n };\n\nexport type CreateLockerverseWidgetOptions =\n CreateLockerverseWidgetBaseOptions & LockerverseResourceEnvironmentOptions;\n\nexport type LockerverseCheckoutClient = {\n calculateTotal: (\n input: LockerverseCalculateTotalInput\n ) => Promise<LockerversePreparedCheckout>;\n getPaymentStatus: (\n paymentReference: string\n ) => Promise<LockerversePaymentResult>;\n load: {\n (): Promise<LockerverseCatalog>;\n (input: LockerverseLoadCheckoutInput): Promise<LockerverseLoadedCheckout>;\n };\n submitPayment: (\n input: LockerverseSubmitPaymentInput\n ) => Promise<LockerversePaymentResult>;\n};\n"],"mappings":"ACWA,MAAa,EAA0BA,UAiMvC,IAAa,EAAb,cAAyC,KAAM,CAC7C,YACA,KACA,UACA,WACA,oBACA,WACA,WACA,OAEA,YAAY,CACV,cACA,OACA,UACA,YACA,aACA,sBAAsB,GACtB,aACA,UAUC,CACD,MAAM,CAAO,EACb,KAAK,KAAO,sBACZ,KAAK,YAAc,EACnB,KAAK,KAAO,EACZ,KAAK,UAAY,EACjB,KAAK,WAAa,EAClB,KAAK,oBAAsB,EAC3B,KAAK,WAAa,EAClB,KAAK,WAAa,EAClB,KAAK,OAAS,CAChB,CACF"}
|
|
1
|
+
{"version":3,"file":"types.js","names":["packageMetadata.version"],"sources":["../package.json","../src/types.ts"],"sourcesContent":["","import packageMetadata from \"../package.json\" with { type: \"json\" };\nimport type { GeneratedPaymentResult } from \"./generated/public-contract-types.ts\";\n\nexport type LockerversePaymentOption =\n | \"one-time\"\n | \"monthly\"\n | \"annually\"\n | \"every-six-months\";\nexport type LockerverseEnvironment = \"development\" | \"production\";\nexport type LockerverseFulfillmentType = \"none\" | \"event_admission\";\n\nexport const LOCKERVERSE_SDK_VERSION = packageMetadata.version;\n\nexport type LockerverseProduct = {\n id: string;\n listingId: string;\n slug: string;\n name: string;\n description: string | null;\n fulfillmentType: LockerverseFulfillmentType;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n amountCents: number | null;\n minimumAmountCents: number | null;\n minimumQuantity: number | null;\n /** Per-order limit for this widget listing. Null means no per-order limit. */\n maximumQuantity: number | null;\n inventoryQuantity: number | null;\n acceptsDiscounts: boolean;\n};\n\nexport type LockerverseAvailabilityStatus = \"available\" | \"sold_out\";\n\nexport type LockerverseCatalogAvailability = {\n listings: Array<{\n listingId: string;\n maxPurchasableQuantity: number | null;\n remainingQuantity: number | null;\n status: LockerverseAvailabilityStatus;\n }>;\n sharedLimits: Array<{\n id: string;\n listingIds: string[];\n remainingQuantity: number;\n status: LockerverseAvailabilityStatus;\n }>;\n};\n\nexport type LockerverseCatalog = {\n availability: LockerverseCatalogAvailability;\n community: LockerverseCommunityBranding | null;\n event: LockerverseEvent | null;\n payment: LockerversePaymentConfiguration;\n pricingPolicy: LockerverseCheckoutPricingPolicy;\n products: LockerverseProduct[];\n widget: LockerverseWidgetConfiguration;\n};\n\nexport type LockerverseEvent = {\n description: string | null;\n endAt: string;\n id: string;\n location: string | null;\n name: string;\n startAt: string;\n status: \"draft\" | \"active\" | \"finished\" | \"cancelled\";\n};\n\nexport type LockerverseCommunityBranding = {\n widgetAchEnabled?: boolean | undefined;\n accentColor: string;\n imageUrl: string | null;\n memberIdLabel?: string | null | undefined;\n name: string;\n};\n\nexport type LockerverseCheckoutPricingPolicy = {\n currency: \"usd\";\n serviceFeeRateBasisPoints: number;\n};\n\nexport type LockerversePaymentConfiguration = {\n connectedAccountId: string | null;\n currency: \"usd\";\n publishableKey: string;\n};\n\nexport type LockerverseWidgetFields = {\n memberId: boolean;\n merchSize: boolean;\n phone: boolean;\n promoCode: boolean;\n serviceFee: boolean;\n shipping: boolean;\n tipping: boolean;\n};\n\nexport type LockerverseCustomFieldOption = { id: string; label: string };\n\ntype LockerverseCustomFieldBase = {\n id: string;\n label: string;\n paymentOptionIds?: string[] | undefined;\n required: boolean;\n};\n\nexport type LockerverseTextCustomField = LockerverseCustomFieldBase & {\n type: \"text\" | \"textarea\";\n};\n\nexport type LockerverseBooleanCustomField = LockerverseCustomFieldBase & {\n type: \"checkbox\";\n};\n\nexport type LockerverseSingleOptionCustomField = LockerverseCustomFieldBase & {\n options: LockerverseCustomFieldOption[];\n type: \"radio\" | \"select\";\n};\n\nexport type LockerverseMultiOptionCustomField = LockerverseCustomFieldBase & {\n options: LockerverseCustomFieldOption[];\n type: \"checkboxes\" | \"multi_select\";\n};\n\nexport type LockerverseCustomField =\n | LockerverseBooleanCustomField\n | LockerverseTextCustomField\n | LockerverseSingleOptionCustomField\n | LockerverseMultiOptionCustomField;\n\nexport type LockerverseCustomFieldAnswerValue<\n Field extends LockerverseCustomField,\n> = Field extends LockerverseBooleanCustomField\n ? boolean\n : Field extends LockerverseMultiOptionCustomField\n ? string[]\n : string;\n\nexport type LockerverseCustomFieldAnswer<\n Field extends LockerverseCustomField = LockerverseCustomField,\n> = Field extends LockerverseCustomField\n ? { fieldId: Field[\"id\"]; value: LockerverseCustomFieldAnswerValue<Field> }\n : never;\n\nexport type LockerverseWidgetConfiguration = {\n requiredShipping?:\n | {\n additionalUnitAmountCents?: number | undefined;\n productId: string;\n triggerProductIds: string[];\n }\n | undefined;\n customFields: LockerverseCustomField[];\n description: string | null;\n fields: LockerverseWidgetFields;\n id: string;\n name: string;\n showCommunityBranding: boolean;\n title: string | null;\n};\n\nexport type LockerverseSdkErrorCode =\n | \"public_events_load_failed\"\n | \"auction_load_failed\"\n | \"auction_bid_failed\"\n | \"auction_purchase_failed\"\n | \"auction_purchase_status_failed\"\n | \"auction_receipt_failed\"\n | \"widget_load_failed\"\n | \"signup_load_failed\"\n | \"signup_submit_failed\"\n | \"total_calculation_failed\"\n | \"payment_submit_failed\"\n | \"payment_status_failed\"\n | \"invalid_selection\";\n\nexport type LockerverseSdkOperation =\n | \"list_public_events\"\n | \"list_auctions\"\n | \"load_auction\"\n | \"create_auction_bid\"\n | \"create_auction_purchase\"\n | \"get_auction_purchase_receipt\"\n | \"get_auction_purchase_status\"\n | \"load_widget\"\n | \"load_signup\"\n | \"submit_signup\"\n | \"calculate_total\"\n | \"submit_payment\"\n | \"get_payment_status\";\n\nexport type LockerverseSdkServerCode =\n | \"PAYMENT_WIDGET_SALES_LIMIT_REACHED\"\n | \"PAYMENT_WIDGET_PHONE_INVALID\"\n | \"PAYMENT_WIDGET_PHONE_REQUIRED\"\n | \"SIGN_UP_WIDGET_PHONE_INVALID\"\n | \"SIGN_UP_WIDGET_PHONE_REQUIRED\";\n\nexport type LockerverseSdkFailureKind =\n | \"network\"\n | \"timeout\"\n | \"aborted\"\n | \"invalid_response\";\n\nexport class LockerverseSdkError extends Error {\n readonly failureKind: LockerverseSdkFailureKind | undefined;\n readonly code: LockerverseSdkErrorCode;\n readonly operation: LockerverseSdkOperation;\n readonly reportable: boolean;\n readonly recoveryRecommended: boolean;\n readonly sdkVersion: string;\n readonly serverCode: LockerverseSdkServerCode | undefined;\n readonly status: number | undefined;\n\n constructor({\n failureKind,\n code,\n message,\n operation,\n reportable,\n recoveryRecommended = false,\n serverCode,\n status,\n }: {\n failureKind?: LockerverseSdkFailureKind | undefined;\n code: LockerverseSdkErrorCode;\n message: string;\n operation: LockerverseSdkOperation;\n reportable: boolean;\n recoveryRecommended?: boolean;\n serverCode?: LockerverseSdkServerCode;\n status?: number | undefined;\n }) {\n super(message);\n this.name = \"LockerverseSdkError\";\n this.failureKind = failureKind;\n this.code = code;\n this.operation = operation;\n this.reportable = reportable;\n this.recoveryRecommended = recoveryRecommended;\n this.sdkVersion = LOCKERVERSE_SDK_VERSION;\n this.serverCode = serverCode;\n this.status = status;\n }\n}\n\nexport type LockerverseCheckoutLineItem = {\n productId: string;\n productName: string;\n listingId: string;\n listingSlug: string;\n acceptsDiscounts: boolean;\n eventId: string | null;\n fulfillmentType: LockerverseFulfillmentType;\n pricingMode: \"fixed\" | \"custom\";\n paymentOption: LockerversePaymentOption;\n quantity: number;\n unitAmountCents: number;\n subtotalCents: number;\n};\n\nexport type LockerverseAppliedDiscount = {\n percentageOff?: number | undefined;\n amountOffCents?: number | undefined;\n message?: string | undefined;\n source: \"email_list\" | \"promo_code\";\n};\n\nexport type LockerverseCheckoutAmounts = {\n amountCents: number;\n discountableSubtotalCents: number;\n discountCents: number;\n serviceFeeCents: number;\n subtotalCents: number;\n tipCents: number;\n totalCents: number;\n};\n\nexport type LockerverseCheckoutQuote = LockerverseCheckoutAmounts & {\n appliedDiscount: LockerverseAppliedDiscount | null;\n authoritative: true;\n paymentReference: string;\n payment: LockerversePaymentConfiguration;\n paymentOption: LockerversePaymentOption;\n lineItems: LockerverseCheckoutLineItem[];\n};\n\nexport type LockerverseCheckoutEstimate = LockerverseCheckoutAmounts & {\n appliedDiscount: null;\n authoritative: false;\n items: readonly LockerverseCheckoutItem[];\n lineItems: readonly LockerverseCheckoutLineItem[];\n paymentOption: LockerversePaymentOption;\n};\n\nexport type LockerverseCheckoutPricingInput = {\n email?: string;\n includeServiceFee?: boolean;\n promoCode?: string;\n tipCents?: number;\n};\n\nexport type LockerversePaymentStatus =\n | \"action_required\"\n | \"failed\"\n | \"pending\"\n | \"success\";\n\nexport type LockerversePaymentResult = {\n checkoutId: string;\n paymentReference: string;\n checkoutStatus: LockerversePaymentStatus;\n retryUrl?: string | undefined;\n clientSecret: string | null;\n paymentRequired: boolean;\n requiresAction: boolean;\n status: string | null;\n};\n\nexport type LockerversePaymentCompletion = LockerversePaymentResult & {\n email: string | null;\n lineItems: readonly LockerverseCheckoutLineItem[] | null;\n};\n\ntype AssertPaymentContract<T extends true> = T;\ntype _PaymentResultMatchesGenerated = AssertPaymentContract<\n LockerversePaymentResult extends GeneratedPaymentResult\n ? GeneratedPaymentResult extends LockerversePaymentResult\n ? true\n : false\n : false\n>;\n\nexport type LockerverseShipping = {\n address: {\n city: string;\n country: string;\n line1: string;\n line2?: string;\n postal_code: string;\n state: string;\n };\n name: string;\n};\n\nexport type LockerversePaymentSubmission = {\n confirmationToken?: string;\n paymentMethodConfiguration?: \"explicit\";\n customFieldAnswers?: LockerverseCustomFieldAnswer[];\n email: string;\n memberId?: string;\n merchSize?: \"XS\" | \"S\" | \"M\" | \"L\" | \"XL\" | \"XXL\" | \"XXXL\";\n metadata?: Record<string, string>;\n phone?: string;\n shipping?: LockerverseShipping;\n};\n\nexport type LockerverseCheckoutItem =\n | { productId: string; quantity: number }\n | { productId: string; amountCents: number }\n | { productId: string };\n\nexport type LockerverseCheckoutSelectionItem =\n | { productSlug: string; quantity: number }\n | { productSlug: string; amountCents: number }\n | { productSlug: string };\n\nexport type LockerverseEstimateCheckoutInput =\n LockerverseCheckoutPricingInput & {\n selection: LockerverseCheckoutSelectionItem[];\n };\n\nexport type LockerverseLoadCheckoutInput = {\n selection: LockerverseCheckoutSelectionItem[];\n};\n\nexport type LockerverseCalculateTotalInput = LockerverseCheckoutPricingInput & {\n catalog: LockerverseCatalog;\n} & (\n | {\n items: LockerverseCheckoutItem[];\n selection?: never;\n }\n | {\n items?: never;\n selection: LockerverseCheckoutSelectionItem[];\n }\n );\n\nexport type LockerversePreparedCheckout = Readonly<\n LockerverseCheckoutQuote & {\n items: readonly LockerverseCheckoutItem[];\n pricing: Readonly<LockerverseCheckoutPricingInput>;\n }\n>;\n\nexport type LockerverseLoadedCheckout = Readonly<{\n catalog: LockerverseCatalog;\n checkout: LockerversePreparedCheckout;\n}>;\n\nexport type LockerverseSubmitPaymentInput = {\n checkout: LockerversePreparedCheckout;\n submission: LockerversePaymentSubmission;\n};\n\ntype CreateLockerverseWidgetBaseOptions = {\n communitySlug: string;\n fetch?: typeof globalThis.fetch;\n onError?: (error: LockerverseSdkError) => void;\n requestTimeoutMs?: number;\n sentryDsn?: string | null;\n widgetSlug: string;\n};\n\nexport type LockerverseResourceEnvironmentOptions =\n | {\n apiBaseUrl: string;\n environment: LockerverseEnvironment;\n }\n | {\n apiBaseUrl?: undefined;\n environment?: \"production\";\n };\n\nexport type CreateLockerverseWidgetOptions =\n CreateLockerverseWidgetBaseOptions & LockerverseResourceEnvironmentOptions;\n\nexport type LockerverseCheckoutClient = {\n calculateTotal: (\n input: LockerverseCalculateTotalInput\n ) => Promise<LockerversePreparedCheckout>;\n getPaymentStatus: (\n paymentReference: string\n ) => Promise<LockerversePaymentResult>;\n load: {\n (): Promise<LockerverseCatalog>;\n (input: LockerverseLoadCheckoutInput): Promise<LockerverseLoadedCheckout>;\n };\n submitPayment: (\n input: LockerverseSubmitPaymentInput\n ) => Promise<LockerversePaymentResult>;\n};\n"],"mappings":"ACWA,MAAa,EAA0BA,gBAiMvC,IAAa,EAAb,cAAyC,KAAM,CAC7C,YACA,KACA,UACA,WACA,oBACA,WACA,WACA,OAEA,YAAY,CACV,cACA,OACA,UACA,YACA,aACA,sBAAsB,GACtB,aACA,UAUC,CACD,MAAM,CAAO,EACb,KAAK,KAAO,sBACZ,KAAK,YAAc,EACnB,KAAK,KAAO,EACZ,KAAK,UAAY,EACjB,KAAK,WAAa,EAClB,KAAK,oBAAsB,EAC3B,KAAK,WAAa,EAClB,KAAK,WAAa,EAClB,KAAK,OAAS,CAChB,CACF"}
|