@lockerverse/sdk 0.2.198-dev.1 → 0.2.201

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 CHANGED
@@ -36,6 +36,20 @@ 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.201 — stable hosted checkout heading
40
+
41
+ Page launchers keep the same logo and heading mounted during selection and
42
+ payment. Edit order appears below that heading. No host prop change is needed.
43
+ Dialog launchers and fixed checkout remain unchanged. Check Continue and Edit
44
+ order at desktop and mobile widths.
45
+
46
+ ## 0.2.200 — shared page launcher loading state
47
+
48
+ React page launchers accept `loadingFallback` to replace the entire launcher
49
+ while catalog options initialize or refresh. Hosts can pass their existing page
50
+ skeleton to avoid a second SDK loading panel. Dialog launchers and fixed payment
51
+ components are unchanged. Adoption is optional; verify cold load and Continue.
52
+
39
53
  ## 0.2.197 — disable Stripe Link in React widget checkout
40
54
 
41
55
  New React widget checkout forms request card payments, plus US bank account
@@ -60,11 +74,12 @@ No host prop change is required.
60
74
  configuration; remount for another link. Filtering is not server authorization.
61
75
  - **Optional:** Use `showDescription={false}` and the public page root class,
62
76
  `className`, `style`, and existing theme tokens for minimal branded pages.
63
- - **Hosted URL:** `/checkout?community=<slug>&widget=<slug>` defaults to dark.
64
- Optional `include` lists purchasable product slugs; `q.<slug>` prefills quantities.
65
- Use `theme=light` for light mode. Dev branch uses the development backend;
66
- production uses production. Explicit `env=development` or `env=production`
67
- selects a backend. The fixed checkout remains separate.
77
+ - **Hosted URL:** `https://app.lockerverse.com/<community>/widgets/v2/<widget>/checkout`
78
+ defaults to dark. Optional `include` lists purchasable product slugs;
79
+ `q.<slug>` prefills quantities. Use `theme=light` for light mode. The app
80
+ deployment selects its backend. The fixed checkout remains separate.
81
+ Older SDK-domain `/checkout?community=<slug>&widget=<slug>` links redirect
82
+ to the app, preserving the product filter, quantities, and theme.
68
83
  - **Verification:** Check both themes, mobile width, excluded prefill, quantity
69
84
  limits, Continue, and Edit order without submitting a live payment.
70
85
 
@@ -108,7 +123,7 @@ No host prop change is required.
108
123
  - **Check:** inspect a wide and a tall photo on desktop and mobile. Confirm all
109
124
  edges remain visible in the item gallery, thumbnails, and full-screen viewer.
110
125
 
111
- ## 0.2.192-dev.1 — auction item additional charges
126
+ ## 0.2.191 — auction item additional charges
112
127
 
113
128
  - **Affected:** Core auction item data, purchase quotes, and React auction checkout.
114
129
  - **Automatic:** optional `additionalCharge` charges the first-item amount plus the
@@ -126,7 +141,7 @@ No host prop change is required.
126
141
  - **Check:** compare one, two, and maximum quantity totals with the server quote,
127
142
  verify the per-order limit, and inspect the named charge row before payment.
128
143
 
129
- ## 0.2.190-dev.1 — widget load recovery and Sentry releases
144
+ ## 0.2.189 — widget load recovery and Sentry releases
130
145
 
131
146
  - **Affected:** Core widget loading and SDK failure reporting.
132
147
  - **Automatic:** a widget GET retries once after a network failure or request
@@ -153,7 +168,6 @@ No host prop change is required.
153
168
  - **Check:** select one, two, and the maximum allowed trigger quantity. Confirm the
154
169
  local summary and server quote agree; removing all trigger items removes shipping.
155
170
 
156
-
157
171
  ## 0.2.184 — single focus boundary for form fields
158
172
 
159
173
  - **Affected:** React form controls and the shared phone field in payment and signup.
@@ -173,7 +187,7 @@ Widgets can now use a private contact list for email eligibility, a fixed amount
173
187
  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.
174
188
 
175
189
 
176
- ## 0.2.176-dev.1 — Secure checkout loading recovery
190
+ ## 0.2.177 — Secure checkout loading recovery
177
191
 
178
192
  - **Affected:** React payment widget Stripe fields.
179
193
  - **Automatic:** failed field or script loads show a reload action. Fields that
@@ -185,22 +199,8 @@ Required shipping appears in `catalog.widget.requiredShipping`. Do not offer thi
185
199
  - Reload is an explicit customer action and can clear unsaved form entries.
186
200
  Saved payment recovery remains in session storage.
187
201
 
188
- ## 0.2.175 — Match Stripe Elements payment method configuration
189
-
190
- - **Affected:** Core checkout submission and React payment widgets.
191
- - **Automatic:** React configures explicit card, Link, and community-enabled bank
192
- methods in Stripe Elements and marks the confirmation request with
193
- `paymentMethodConfiguration: "explicit"`. This matches the backend's Stripe
194
- PaymentIntent configuration.
195
- - **Required:** deploy the backend that supports this optional marker before
196
- upgrading React. Keep Core and React matched. Existing Core-only callers omit
197
- the marker and retain automatic payment methods. Custom Elements integrations
198
- must send the marker only when they use the explicit method list.
199
- - **Check:** submit card and bank payments through Stripe Elements in test mode,
200
- including recurring checkout. Confirm pending recovery and settlement.
201
-
202
202
 
203
- ## 0.2.174-dev.1 — Match Stripe Elements payment method configuration
203
+ ## 0.2.175 — Match Stripe Elements payment method configuration
204
204
 
205
205
  - **Affected:** Core checkout submission and React payment widgets.
206
206
  - **Automatic:** React configures explicit card, Link, and community-enabled bank
@@ -275,39 +275,7 @@ Required shipping appears in `catalog.widget.requiredShipping`. Do not offer thi
275
275
  verify a changed selection cannot discard it. Check both paid and free order
276
276
  confirmation panels. Do not submit a live transaction for this check.
277
277
 
278
- ## 0.2.172-dev.1 — Check pending payment status
279
-
280
- - **Affected:** React payment widgets with unresolved payments.
281
- - **Automatic behavior:** the existing pending-payment screen now offers Check
282
- payment status. It checks the saved payment reference and cannot submit a new
283
- payment. The control is disabled while the check runs.
284
- - **Required host changes:** none. Update Core and React together.
285
- - **Verification:** complete a test bank payment, return to its pending checkout,
286
- and check its status. Confirm completion clears recovery storage.
287
-
288
- ## 0.2.171-dev.1 — SDK payment recovery and completion UI
289
-
290
- - **Affected:** React payment widgets and custom hosts that persist payment recovery.
291
- - **Optional adoption:** pass `recoveryStorageKey` to `LockerversePayment` to let
292
- the SDK save and restore the pending payment in session storage. Use a stable
293
- key scoped to the API environment, community, and widget. Remove the host's
294
- storage code and recovery-driven component key. Do not combine automatic
295
- persistence with a second host persistence writer.
296
- - **Compatibility:** the SDK reads the hosted Next app's existing version 1
297
- records when the same key is used. It writes version 2 records with widget
298
- identity. It checks widget and selection identity before recovery and keeps
299
- an unresolved record if those details differ. Recovery uses the saved connected
300
- account even if current payment routing has changed. Storage is read after hydration,
301
- before the payable form mounts. No contact details or payment tokens are saved.
302
- - **Optional UI adoption:** use `completionView="summary"` for the SDK confirmation
303
- panel and remove the host's duplicate success panel. Completion callbacks still
304
- run. The default inline message and explicit `resumePayment` integrations remain
305
- supported. Auctions and legacy custom checkout forms are unchanged.
306
- - **Check:** reload a pending checkout and confirm the existing payment is checked;
307
- verify a changed selection cannot discard it. Check both paid and free order
308
- confirmation panels. Do not submit a live transaction for this check.
309
-
310
- ## 0.2.169-dev.1 — six-month payment widgets
278
+ ## 0.2.170 — six-month payment widgets
311
279
 
312
280
  Affected: @lockerverse/sdk checkout and @lockerverse/react payment widgets.
313
281
 
@@ -323,31 +291,6 @@ Affected: @lockerverse/sdk checkout and @lockerverse/react payment widgets.
323
291
  submission. Do not submit a live payment for an integration check.
324
292
 
325
293
 
326
- ## 0.2.168-dev.1 — bank authorization terms
327
-
328
- - **Affected:** React payment widgets with ACH enabled.
329
- - **Automatic:** Stripe displays its bank authorization terms before payment confirmation.
330
- - **Adoption:** update the matching SDK/React development pair. No prop changes are required.
331
- - **Check:** confirm that the bank authorization text is visible when a bank account is selected.
332
-
333
- ## 0.2.167-dev.1 — widget ACH and subscription payment recovery
334
-
335
- - **Affected:** Core checkout data and React payment widgets.
336
- - **Automatic:** bank payment availability follows the organization default and
337
- community override returned by the backend. Missing policy remains disabled.
338
- Pending payments keep their existing payment reference. A failed subscription
339
- invoice can return `action_required` with `requiresAction: false` and `retryUrl`;
340
- React shows a link to pay the same invoice instead of creating a second subscription.
341
- - **Required for custom payment UI:** preserve the reference for pending and
342
- action-required results. Handle `retryUrl` by opening that invoice, and recover
343
- status before permitting a new checkout. Do not treat submission as settlement.
344
- - **Adoption:** deploy the matching backend policy and recovery contract before
345
- enabling ACH. Existing React hosts need no component prop changes. Keep Core and
346
- React versions matched when upgrading. Auction payment methods are unchanged.
347
- - **Check:** verify disabled/inherited/enabled bank visibility and pending, bank
348
- verification, invoice retry, success, and terminal failure in Stripe test mode.
349
- Do not create a live transaction for this check.
350
-
351
294
  ## 0.2.166 — single dropdown arrow
352
295
 
353
296
  - **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.198-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};
1
+ const e=`0.2.201`;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,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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lockerverse/sdk",
3
- "version": "0.2.198-dev.1",
3
+ "version": "0.2.201",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/Lockerverse/lockerverse-sdk.git",