@lockerverse/sdk 0.2.222 → 0.2.224-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 +99 -5
- package/dist/bookings.d.ts +65 -0
- package/dist/bookings.d.ts.map +1 -0
- package/dist/bookings.js +2 -0
- package/dist/bookings.js.map +1 -0
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +11 -1
package/MIGRATIONS.md
CHANGED
|
@@ -4,6 +4,28 @@ This file ships in both @lockerverse/sdk and @lockerverse/react. Use the copy in
|
|
|
4
4
|
the target installed release. This is an agent-run procedure, not an install
|
|
5
5
|
script. Installing a package does not edit host code or guarantee these steps ran.
|
|
6
6
|
|
|
7
|
+
## 0.2.224-dev.1 — clearer booking payment messages
|
|
8
|
+
|
|
9
|
+
- **Affected:** the optional React booking payment component.
|
|
10
|
+
- **Automatic:** card loading and payment result messages use customer language.
|
|
11
|
+
Payment locks and saved-booking recovery are unchanged.
|
|
12
|
+
- **Required:** update the matching SDK/React pair and deploy the host. No API or
|
|
13
|
+
prop changes are needed. Other consumers need no integration edits.
|
|
14
|
+
- **Check:** a card loading error asks the customer to reload and check the booking
|
|
15
|
+
before another payment.
|
|
16
|
+
|
|
17
|
+
## 0.2.223-dev.1 — optional bookings
|
|
18
|
+
|
|
19
|
+
- No change is required for existing checkout, signup, auction or event consumers.
|
|
20
|
+
- Booking hosts must import the separate `@lockerverse/sdk/bookings` and
|
|
21
|
+
`@lockerverse/react/bookings` entries and read `guides/bookings.md`.
|
|
22
|
+
- Load `@lockerverse/react/booking-payment` only when a recovered attempt can pay.
|
|
23
|
+
Follow the optional Stripe peers in the target package manifest.
|
|
24
|
+
- Move business credentials and payment/booking work to the Lockerverse backend.
|
|
25
|
+
Keep host access storage private and update the hook sessionKey on access changes.
|
|
26
|
+
- Do not release an unknown payment outcome by clearing local state. Recover the
|
|
27
|
+
saved server attempt before permitting another payment.
|
|
28
|
+
|
|
7
29
|
## Upgrade procedure
|
|
8
30
|
|
|
9
31
|
1. Before installation, record the resolved installed version of each package
|
|
@@ -314,7 +336,7 @@ No host prop change is required.
|
|
|
314
336
|
- **Check:** inspect a wide and a tall photo on desktop and mobile. Confirm all
|
|
315
337
|
edges remain visible in the item gallery, thumbnails, and full-screen viewer.
|
|
316
338
|
|
|
317
|
-
## 0.2.
|
|
339
|
+
## 0.2.192-dev.1 — auction item additional charges
|
|
318
340
|
|
|
319
341
|
- **Affected:** Core auction item data, purchase quotes, and React auction checkout.
|
|
320
342
|
- **Automatic:** optional `additionalCharge` charges the first-item amount plus the
|
|
@@ -332,7 +354,7 @@ No host prop change is required.
|
|
|
332
354
|
- **Check:** compare one, two, and maximum quantity totals with the server quote,
|
|
333
355
|
verify the per-order limit, and inspect the named charge row before payment.
|
|
334
356
|
|
|
335
|
-
## 0.2.
|
|
357
|
+
## 0.2.190-dev.1 — widget load recovery and Sentry releases
|
|
336
358
|
|
|
337
359
|
- **Affected:** Core widget loading and SDK failure reporting.
|
|
338
360
|
- **Automatic:** a widget GET retries once after a network failure or request
|
|
@@ -359,6 +381,7 @@ No host prop change is required.
|
|
|
359
381
|
- **Check:** select one, two, and the maximum allowed trigger quantity. Confirm the
|
|
360
382
|
local summary and server quote agree; removing all trigger items removes shipping.
|
|
361
383
|
|
|
384
|
+
|
|
362
385
|
## 0.2.184 — single focus boundary for form fields
|
|
363
386
|
|
|
364
387
|
- **Affected:** React form controls and the shared phone field in payment and signup.
|
|
@@ -378,7 +401,7 @@ Widgets can now use a private contact list for email eligibility, a fixed amount
|
|
|
378
401
|
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.
|
|
379
402
|
|
|
380
403
|
|
|
381
|
-
## 0.2.
|
|
404
|
+
## 0.2.176-dev.1 — Secure checkout loading recovery
|
|
382
405
|
|
|
383
406
|
- **Affected:** React payment widget Stripe fields.
|
|
384
407
|
- **Automatic:** failed field or script loads show a reload action. Fields that
|
|
@@ -390,9 +413,23 @@ Required shipping appears in `catalog.widget.requiredShipping`. Do not offer thi
|
|
|
390
413
|
- Reload is an explicit customer action and can clear unsaved form entries.
|
|
391
414
|
Saved payment recovery remains in session storage.
|
|
392
415
|
|
|
393
|
-
|
|
394
416
|
## 0.2.175 — Match Stripe Elements payment method configuration
|
|
395
417
|
|
|
418
|
+
- **Affected:** Core checkout submission and React payment widgets.
|
|
419
|
+
- **Automatic:** React configures explicit card, Link, and community-enabled bank
|
|
420
|
+
methods in Stripe Elements and marks the confirmation request with
|
|
421
|
+
`paymentMethodConfiguration: "explicit"`. This matches the backend's Stripe
|
|
422
|
+
PaymentIntent configuration.
|
|
423
|
+
- **Required:** deploy the backend that supports this optional marker before
|
|
424
|
+
upgrading React. Keep Core and React matched. Existing Core-only callers omit
|
|
425
|
+
the marker and retain automatic payment methods. Custom Elements integrations
|
|
426
|
+
must send the marker only when they use the explicit method list.
|
|
427
|
+
- **Check:** submit card and bank payments through Stripe Elements in test mode,
|
|
428
|
+
including recurring checkout. Confirm pending recovery and settlement.
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
## 0.2.174-dev.1 — Match Stripe Elements payment method configuration
|
|
432
|
+
|
|
396
433
|
- **Affected:** Core checkout submission and React payment widgets.
|
|
397
434
|
- **Automatic:** React configures explicit card, Link, and community-enabled bank
|
|
398
435
|
methods in Stripe Elements and marks the confirmation request with
|
|
@@ -466,7 +503,39 @@ Required shipping appears in `catalog.widget.requiredShipping`. Do not offer thi
|
|
|
466
503
|
verify a changed selection cannot discard it. Check both paid and free order
|
|
467
504
|
confirmation panels. Do not submit a live transaction for this check.
|
|
468
505
|
|
|
469
|
-
## 0.2.
|
|
506
|
+
## 0.2.172-dev.1 — Check pending payment status
|
|
507
|
+
|
|
508
|
+
- **Affected:** React payment widgets with unresolved payments.
|
|
509
|
+
- **Automatic behavior:** the existing pending-payment screen now offers Check
|
|
510
|
+
payment status. It checks the saved payment reference and cannot submit a new
|
|
511
|
+
payment. The control is disabled while the check runs.
|
|
512
|
+
- **Required host changes:** none. Update Core and React together.
|
|
513
|
+
- **Verification:** complete a test bank payment, return to its pending checkout,
|
|
514
|
+
and check its status. Confirm completion clears recovery storage.
|
|
515
|
+
|
|
516
|
+
## 0.2.171-dev.1 — SDK payment recovery and completion UI
|
|
517
|
+
|
|
518
|
+
- **Affected:** React payment widgets and custom hosts that persist payment recovery.
|
|
519
|
+
- **Optional adoption:** pass `recoveryStorageKey` to `LockerversePayment` to let
|
|
520
|
+
the SDK save and restore the pending payment in session storage. Use a stable
|
|
521
|
+
key scoped to the API environment, community, and widget. Remove the host's
|
|
522
|
+
storage code and recovery-driven component key. Do not combine automatic
|
|
523
|
+
persistence with a second host persistence writer.
|
|
524
|
+
- **Compatibility:** the SDK reads the hosted Next app's existing version 1
|
|
525
|
+
records when the same key is used. It writes version 2 records with widget
|
|
526
|
+
identity. It checks widget and selection identity before recovery and keeps
|
|
527
|
+
an unresolved record if those details differ. Recovery uses the saved connected
|
|
528
|
+
account even if current payment routing has changed. Storage is read after hydration,
|
|
529
|
+
before the payable form mounts. No contact details or payment tokens are saved.
|
|
530
|
+
- **Optional UI adoption:** use `completionView="summary"` for the SDK confirmation
|
|
531
|
+
panel and remove the host's duplicate success panel. Completion callbacks still
|
|
532
|
+
run. The default inline message and explicit `resumePayment` integrations remain
|
|
533
|
+
supported. Auctions and legacy custom checkout forms are unchanged.
|
|
534
|
+
- **Check:** reload a pending checkout and confirm the existing payment is checked;
|
|
535
|
+
verify a changed selection cannot discard it. Check both paid and free order
|
|
536
|
+
confirmation panels. Do not submit a live transaction for this check.
|
|
537
|
+
|
|
538
|
+
## 0.2.169-dev.1 — six-month payment widgets
|
|
470
539
|
|
|
471
540
|
Affected: @lockerverse/sdk checkout and @lockerverse/react payment widgets.
|
|
472
541
|
|
|
@@ -482,6 +551,31 @@ Affected: @lockerverse/sdk checkout and @lockerverse/react payment widgets.
|
|
|
482
551
|
submission. Do not submit a live payment for an integration check.
|
|
483
552
|
|
|
484
553
|
|
|
554
|
+
## 0.2.168-dev.1 — bank authorization terms
|
|
555
|
+
|
|
556
|
+
- **Affected:** React payment widgets with ACH enabled.
|
|
557
|
+
- **Automatic:** Stripe displays its bank authorization terms before payment confirmation.
|
|
558
|
+
- **Adoption:** update the matching SDK/React development pair. No prop changes are required.
|
|
559
|
+
- **Check:** confirm that the bank authorization text is visible when a bank account is selected.
|
|
560
|
+
|
|
561
|
+
## 0.2.167-dev.1 — widget ACH and subscription payment recovery
|
|
562
|
+
|
|
563
|
+
- **Affected:** Core checkout data and React payment widgets.
|
|
564
|
+
- **Automatic:** bank payment availability follows the organization default and
|
|
565
|
+
community override returned by the backend. Missing policy remains disabled.
|
|
566
|
+
Pending payments keep their existing payment reference. A failed subscription
|
|
567
|
+
invoice can return `action_required` with `requiresAction: false` and `retryUrl`;
|
|
568
|
+
React shows a link to pay the same invoice instead of creating a second subscription.
|
|
569
|
+
- **Required for custom payment UI:** preserve the reference for pending and
|
|
570
|
+
action-required results. Handle `retryUrl` by opening that invoice, and recover
|
|
571
|
+
status before permitting a new checkout. Do not treat submission as settlement.
|
|
572
|
+
- **Adoption:** deploy the matching backend policy and recovery contract before
|
|
573
|
+
enabling ACH. Existing React hosts need no component prop changes. Keep Core and
|
|
574
|
+
React versions matched when upgrading. Auction payment methods are unchanged.
|
|
575
|
+
- **Check:** verify disabled/inherited/enabled bank visibility and pending, bank
|
|
576
|
+
verification, invoice retry, success, and terminal failure in Stripe test mode.
|
|
577
|
+
Do not create a live transaction for this check.
|
|
578
|
+
|
|
485
579
|
## 0.2.166 — single dropdown arrow
|
|
486
580
|
|
|
487
581
|
- **Affected:** native single-select custom fields in React signup and payment forms.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { R as LockerverseResourceEnvironmentOptions, z as LockerverseSdkError } from "./types.js";
|
|
2
|
+
//#region src/booking-types.d.ts
|
|
3
|
+
type LockerverseBookingBusiness = {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
timeZone: string;
|
|
7
|
+
service: {
|
|
8
|
+
name: string;
|
|
9
|
+
amountCents: number;
|
|
10
|
+
currency: "USD";
|
|
11
|
+
durationMinutes: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type LockerverseBookingConfiguration = {
|
|
15
|
+
business: LockerverseBookingBusiness;
|
|
16
|
+
reviewer: boolean;
|
|
17
|
+
square: boolean;
|
|
18
|
+
lockerverse: boolean;
|
|
19
|
+
ready: boolean;
|
|
20
|
+
message: string;
|
|
21
|
+
diagnosticCode?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
type LockerverseBookingStatus = "review" | "payment_pending" | "payment_action_required" | "payment_failed" | "paid" | "booking_pending" | "booking_created" | "external_payment_pending" | "complete" | "manual_refund_required";
|
|
24
|
+
type LockerverseBookingAttempt = {
|
|
25
|
+
id: string;
|
|
26
|
+
status: LockerverseBookingStatus;
|
|
27
|
+
start: string;
|
|
28
|
+
message: string;
|
|
29
|
+
publishableKey: string;
|
|
30
|
+
bookingId?: string | undefined;
|
|
31
|
+
bookingStatus?: string | undefined;
|
|
32
|
+
squarePaymentId?: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
type LockerverseBookingAvailability = {
|
|
35
|
+
slots: string[];
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
type LockerverseBookingSelection = {
|
|
39
|
+
date: string;
|
|
40
|
+
start: string;
|
|
41
|
+
};
|
|
42
|
+
type CreateLockerverseBookingsOptions = LockerverseResourceEnvironmentOptions & {
|
|
43
|
+
businessKey: string;
|
|
44
|
+
/** Return the limited business-scoped token. Never supply an admin token. */
|
|
45
|
+
getAccessToken: () => string | null | Promise<string | null>;
|
|
46
|
+
fetch?: typeof globalThis.fetch;
|
|
47
|
+
onError?: (error: LockerverseSdkError) => void;
|
|
48
|
+
requestTimeoutMs?: number;
|
|
49
|
+
sentryDsn?: string | null;
|
|
50
|
+
};
|
|
51
|
+
type LockerverseBookingsClient = {
|
|
52
|
+
readonly businessKey: string;
|
|
53
|
+
configuration: () => Promise<LockerverseBookingConfiguration>;
|
|
54
|
+
availability: (date: string) => Promise<LockerverseBookingAvailability>;
|
|
55
|
+
initialize: (selection: LockerverseBookingSelection) => Promise<LockerverseBookingAttempt>;
|
|
56
|
+
confirm: (confirmationToken: string) => Promise<LockerverseBookingAttempt>;
|
|
57
|
+
recover: () => Promise<LockerverseBookingAttempt | null>;
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/booking-client.d.ts
|
|
61
|
+
/** Business identity is public; the token is obtained only at request time. */
|
|
62
|
+
declare function createLockerverseBookingsClient(options: CreateLockerverseBookingsOptions): LockerverseBookingsClient;
|
|
63
|
+
//#endregion
|
|
64
|
+
export { type CreateLockerverseBookingsOptions, type LockerverseBookingAttempt, type LockerverseBookingAvailability, type LockerverseBookingBusiness, type LockerverseBookingConfiguration, type LockerverseBookingSelection, type LockerverseBookingStatus, type LockerverseBookingsClient, LockerverseSdkError, createLockerverseBookingsClient };
|
|
65
|
+
//# sourceMappingURL=bookings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings.d.ts","names":[],"sources":["../src/booking-types.ts","../src/booking-client.ts"],"mappings":";;KAKY;EACV;EACA;EACA;EACA;IACE;IACA;IACA;IACA;;;KAIQ;EACV,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;;KAGU;KAYA;EACV;EACA,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;;KAGU;EAAgC;EAAc;;KAE9C,mCACV;EACE;;EAEA,sCAAsC;EACtC,eAAe,WAAW;EAC1B,WAAW,OAAO;EAClB;EACA;;KAGQ;WACD;EACT,qBAAqB,QAAQ;EAC7B,eAAe,iBAAiB,QAAQ;EACxC,aACE,WAAW,gCACR,QAAQ;EACb,UAAU,8BAA8B,QAAQ;EAChD,eAAe,QAAQ;;;;;iBCtDT,gCACd,SAAS,mCACR"}
|
package/dist/bookings.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,t as r}from"./transport.js";import{n as i}from"./types.js";import{array as a,boolean as o,isoTimestamp as s,literal as c,minValue as l,nullable as u,number as d,object as f,optional as p,parse as m,picklist as h,pipe as g,safeInteger as _,string as v}from"valibot";const y=g(d(),_(),l(0)),b=f({key:v(),name:v(),service:f({amountCents:y,currency:c(`USD`),durationMinutes:g(d(),_(),l(1)),name:v()}),timeZone:v()}),x=f({business:b,diagnosticCode:p(v()),lockerverse:o(),message:v(),ready:o(),reviewer:o(),square:o()}),S=g(v(),s()),C=f({bookingId:p(v()),bookingStatus:p(v()),id:v(),message:v(),publishableKey:v(),squarePaymentId:p(v()),start:S,status:h([`review`,`payment_pending`,`payment_action_required`,`payment_failed`,`paid`,`booking_pending`,`booking_created`,`external_payment_pending`,`complete`,`manual_refund_required`])}),w=e=>m(x,e),T=e=>m(f({message:v(),slots:a(S)}),e),E=e=>m(C,e),D=e=>m(u(C),e),O=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,k=/^[A-Za-z0-9_-]{43}$/,A=/^\d{4}-\d{2}-\d{2}$/,j=/^ctoken_[A-Za-z0-9]+$/;function M(a){if(!O.test(a.businessKey)||a.businessKey.length>80)throw TypeError(`businessKey must be a valid booking business key.`);let o=e({...a,communitySlug:a.businessKey,requestTimeoutMs:a.requestTimeoutMs??6e4},`businessKey`),s=t({communitySlug:``,environment:o.environment,getContext:()=>({businessKey:a.businessKey}),onError:o.onError,resourceContextName:`lockerverse_bookings`,sentryDsn:o.sentryDsn}),{requestJson:c}=r(o.fetchImplementation,s,o.requestTimeoutMs),l=`${o.apiBaseUrl}/v2/booking-businesses/${o.resourceSlug}`;async function u(e,t,r,o){let u={code:`booking_request_failed`,message:`Unable to complete the booking request. Check the saved state before trying payment again.`,operation:t,report:!1};try{let t=await a.getAccessToken();if(t===null||!k.test(t))throw new i({...u,message:`Enter a valid limited booking access code. Your saved attempt is retained.`,reportable:!1,status:401});let s=new Headers({Authorization:`Bearer ${t}`}),d={cache:`no-store`,credentials:`omit`,headers:s,method:o===void 0?`GET`:`POST`,redirect:`error`};o!==void 0&&(d.body=JSON.stringify(o),s.set(`Content-Type`,`application/json`));let f=await c(`${l}${e}`,d,r,u,u);if(!f.ok)throw new i({...u,message:[401,403].includes(f.response.status)?`Booking access has expired or is not valid. Your saved attempt is retained.`:u.message,recoveryRecommended:!0,reportable:f.response.status>=500,status:f.response.status});return n(f.value)}catch(e){throw s(e instanceof i?e:new i({...u,recoveryRecommended:!0,reportable:!1}))}}return{availability(e){if(!A.test(e))throw TypeError(`date must use YYYY-MM-DD in the business time zone.`);return u(`/slots?date=${encodeURIComponent(e)}`,`find_booking_availability`,T)},businessKey:a.businessKey,async configuration(){let e=await u(`/config`,`load_booking_configuration`,w);if(e.business.key!==a.businessKey)throw s(new i({code:`booking_request_failed`,message:`The booking response does not match this business.`,operation:`load_booking_configuration`,reportable:!0}));return e},confirm(e){if(!j.test(e)||e.length>512)throw TypeError(`A valid payment confirmation token is required.`);return u(`/confirm`,`confirm_booking`,E,{confirmationToken:e})},initialize(e){if(!(A.test(e.date)&&Number.isFinite(Date.parse(e.start))))throw TypeError(`Select an available booking date and time.`);return u(`/attempt`,`initialize_booking`,E,{date:e.date,start:e.start})},recover:()=>u(`/recover`,`recover_booking`,D,{})}}export{i as LockerverseSdkError,M as createLockerverseBookingsClient};
|
|
2
|
+
//# sourceMappingURL=bookings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bookings.js","names":[],"sources":["../src/booking-schemas.ts","../src/booking-client.ts"],"sourcesContent":["/* oxlint-disable anti-slop/no-unknown-parameters -- These schema parsers are the untrusted HTTP JSON boundary. */\nimport {\n array,\n boolean,\n isoTimestamp,\n literal,\n minValue,\n nullable,\n number,\n object,\n optional,\n parse,\n picklist,\n pipe,\n safeInteger,\n string,\n} from \"valibot\";\n\nconst nonnegativeInteger = pipe(number(), safeInteger(), minValue(0));\nconst businessSchema = object({\n key: string(),\n name: string(),\n service: object({\n amountCents: nonnegativeInteger,\n currency: literal(\"USD\"),\n durationMinutes: pipe(number(), safeInteger(), minValue(1)),\n name: string(),\n }),\n timeZone: string(),\n});\nconst configurationSchema = object({\n business: businessSchema,\n diagnosticCode: optional(string()),\n lockerverse: boolean(),\n message: string(),\n ready: boolean(),\n reviewer: boolean(),\n square: boolean(),\n});\nconst instant = pipe(string(), isoTimestamp());\nconst attemptSchema = object({\n bookingId: optional(string()),\n bookingStatus: optional(string()),\n id: string(),\n message: string(),\n publishableKey: string(),\n squarePaymentId: optional(string()),\n start: instant,\n status: picklist([\n \"review\",\n \"payment_pending\",\n \"payment_action_required\",\n \"payment_failed\",\n \"paid\",\n \"booking_pending\",\n \"booking_created\",\n \"external_payment_pending\",\n \"complete\",\n \"manual_refund_required\",\n ]),\n});\n\nexport const parseBookingConfiguration = (value: unknown) =>\n parse(configurationSchema, value);\nexport const parseBookingAvailability = (value: unknown) =>\n parse(object({ message: string(), slots: array(instant) }), value);\nexport const parseBookingAttempt = (value: unknown) =>\n parse(attemptSchema, value);\nexport const parseBookingRecovery = (value: unknown) =>\n parse(nullable(attemptSchema), value);\n","import {\n parseBookingAttempt,\n parseBookingAvailability,\n parseBookingConfiguration,\n parseBookingRecovery,\n} from \"./booking-schemas.ts\";\nimport type {\n CreateLockerverseBookingsOptions,\n LockerverseBookingsClient,\n} from \"./booking-types.ts\";\nimport { deepFreeze } from \"./deep-freeze.ts\";\nimport { resolveResourceEnvironment } from \"./environment.ts\";\nimport { createSdkErrorReporter } from \"./error-reporting.ts\";\nimport { createTransport } from \"./transport.ts\";\nimport { LockerverseSdkError, type LockerverseSdkOperation } from \"./types.ts\";\n\nconst BUSINESS_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;\nconst ACCESS_TOKEN = /^[A-Za-z0-9_-]{43}$/;\nconst DATE = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst CONFIRMATION_TOKEN = /^ctoken_[A-Za-z0-9]+$/;\n\n/** Business identity is public; the token is obtained only at request time. */\nexport function createLockerverseBookingsClient(\n options: CreateLockerverseBookingsOptions\n): LockerverseBookingsClient {\n if (\n !BUSINESS_KEY.test(options.businessKey) ||\n options.businessKey.length > 80\n ) {\n throw new TypeError(\"businessKey must be a valid booking business key.\");\n }\n // Reuse the SDK environment/URL rules with this business as the resource identity.\n const runtime = resolveResourceEnvironment(\n {\n ...options,\n communitySlug: options.businessKey,\n requestTimeoutMs: options.requestTimeoutMs ?? 60_000,\n },\n \"businessKey\"\n );\n const reportError = createSdkErrorReporter({\n communitySlug: \"\",\n environment: runtime.environment,\n getContext: () => ({ businessKey: options.businessKey }),\n onError: runtime.onError,\n resourceContextName: \"lockerverse_bookings\",\n sentryDsn: runtime.sentryDsn,\n });\n const { requestJson } = createTransport(\n runtime.fetchImplementation,\n reportError,\n runtime.requestTimeoutMs\n );\n const baseUrl = `${runtime.apiBaseUrl}/v2/booking-businesses/${runtime.resourceSlug}`;\n\n async function request<T>(\n path: string,\n operation: LockerverseSdkOperation,\n // oxlint-disable-next-line anti-slop/no-unknown-parameters -- The transport parses untrusted JSON through this boundary.\n parser: (value: unknown) => T,\n body?:\n | { date: string; start: string }\n | { confirmationToken: string }\n | Record<string, never>\n ): Promise<T> {\n const context = {\n code: \"booking_request_failed\" as const,\n message:\n \"Unable to complete the booking request. Check the saved state before trying payment again.\",\n operation,\n report: false,\n };\n try {\n const token = await options.getAccessToken();\n if (token === null || !ACCESS_TOKEN.test(token)) {\n throw new LockerverseSdkError({\n ...context,\n message:\n \"Enter a valid limited booking access code. Your saved attempt is retained.\",\n reportable: false,\n status: 401,\n });\n }\n const headers = new Headers({\n Authorization: `Bearer ${token}`,\n });\n const init: RequestInit = {\n cache: \"no-store\",\n credentials: \"omit\",\n headers,\n method: body === undefined ? \"GET\" : \"POST\",\n redirect: \"error\",\n };\n if (body !== undefined) {\n init.body = JSON.stringify(body);\n headers.set(\"Content-Type\", \"application/json\");\n }\n const response = await requestJson(\n `${baseUrl}${path}`,\n init,\n parser,\n context,\n context\n );\n if (!response.ok) {\n throw new LockerverseSdkError({\n ...context,\n message: [401, 403].includes(response.response.status)\n ? \"Booking access has expired or is not valid. Your saved attempt is retained.\"\n : context.message,\n recoveryRecommended: true,\n reportable: response.response.status >= 500,\n status: response.response.status,\n });\n }\n return deepFreeze(response.value);\n } catch (error) {\n throw reportError(\n error instanceof LockerverseSdkError\n ? error\n : new LockerverseSdkError({\n ...context,\n recoveryRecommended: true,\n reportable: false,\n })\n );\n }\n }\n\n return {\n availability(date) {\n if (!DATE.test(date)) {\n throw new TypeError(\n \"date must use YYYY-MM-DD in the business time zone.\"\n );\n }\n return request(\n `/slots?date=${encodeURIComponent(date)}`,\n \"find_booking_availability\",\n parseBookingAvailability\n );\n },\n businessKey: options.businessKey,\n async configuration() {\n const result = await request(\n \"/config\",\n \"load_booking_configuration\",\n parseBookingConfiguration\n );\n if (result.business.key !== options.businessKey) {\n throw reportError(\n new LockerverseSdkError({\n code: \"booking_request_failed\",\n message: \"The booking response does not match this business.\",\n operation: \"load_booking_configuration\",\n reportable: true,\n })\n );\n }\n return result;\n },\n confirm(confirmationToken) {\n if (\n !CONFIRMATION_TOKEN.test(confirmationToken) ||\n confirmationToken.length > 512\n ) {\n throw new TypeError(\"A valid payment confirmation token is required.\");\n }\n return request(\"/confirm\", \"confirm_booking\", parseBookingAttempt, {\n confirmationToken,\n });\n },\n initialize(selection) {\n if (\n !(\n DATE.test(selection.date) &&\n Number.isFinite(Date.parse(selection.start))\n )\n ) {\n throw new TypeError(\"Select an available booking date and time.\");\n }\n return request(\"/attempt\", \"initialize_booking\", parseBookingAttempt, {\n date: selection.date,\n start: selection.start,\n });\n },\n recover: () =>\n request(\"/recover\", \"recover_booking\", parseBookingRecovery, {}),\n };\n}\n"],"mappings":"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"}
|
package/dist/types.d.ts
CHANGED
|
@@ -122,8 +122,8 @@ type LockerverseWidgetConfiguration = {
|
|
|
122
122
|
showCommunityBranding: boolean;
|
|
123
123
|
title: string | null;
|
|
124
124
|
};
|
|
125
|
-
type LockerverseSdkErrorCode = "public_events_load_failed" | "auction_load_failed" | "auction_bid_failed" | "auction_purchase_failed" | "auction_purchase_status_failed" | "auction_receipt_failed" | "widget_load_failed" | "signup_load_failed" | "signup_submit_failed" | "total_calculation_failed" | "payment_submit_failed" | "payment_status_failed" | "invalid_selection";
|
|
126
|
-
type LockerverseSdkOperation = "list_public_events" | "list_auctions" | "load_auction" | "create_auction_bid" | "create_auction_purchase" | "get_auction_purchase_receipt" | "get_auction_purchase_status" | "load_widget" | "load_signup" | "submit_signup" | "calculate_total" | "submit_payment" | "get_payment_status";
|
|
125
|
+
type LockerverseSdkErrorCode = "booking_request_failed" | "public_events_load_failed" | "auction_load_failed" | "auction_bid_failed" | "auction_purchase_failed" | "auction_purchase_status_failed" | "auction_receipt_failed" | "widget_load_failed" | "signup_load_failed" | "signup_submit_failed" | "total_calculation_failed" | "payment_submit_failed" | "payment_status_failed" | "invalid_selection";
|
|
126
|
+
type LockerverseSdkOperation = "load_booking_configuration" | "find_booking_availability" | "initialize_booking" | "confirm_booking" | "recover_booking" | "list_public_events" | "list_auctions" | "load_auction" | "create_auction_bid" | "create_auction_purchase" | "get_auction_purchase_receipt" | "get_auction_purchase_status" | "load_widget" | "load_signup" | "submit_signup" | "calculate_total" | "submit_payment" | "get_payment_status";
|
|
127
127
|
type LockerverseSdkServerCode = "PAYMENT_WIDGET_SALES_LIMIT_REACHED" | "PAYMENT_WIDGET_PHONE_INVALID" | "PAYMENT_WIDGET_PHONE_REQUIRED" | "SIGN_UP_WIDGET_PHONE_INVALID" | "SIGN_UP_WIDGET_PHONE_REQUIRED";
|
|
128
128
|
type LockerverseSdkFailureKind = "network" | "timeout" | "aborted" | "invalid_response";
|
|
129
129
|
declare class LockerverseSdkError extends Error {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";KAGY;KAKA;KACA;cAEC;KAED;EACV;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA,eAAe;EACf;EACA;EACA;;EAEA;EACA;EACA;;KAGU;KAEA;EACV,UAAU;IACR;IACA;IACA;IACA,QAAQ;;EAEV,cAAc;IACZ;IACA;IACA;IACA,QAAQ;;;KAIA;EACV,cAAc;EACd,WAAW;EACX,OAAO;EACP,SAAS;EACT,eAAe;EACf,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;;KAGU;EACV;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EAAiC;EAAY;;KAEpD;EACH;EACA;EACA;EACA;;KAGU,6BAA6B;EACvC;;KAGU,gCAAgC;EAC1C;;KAGU,qCAAqC;EAC/C,SAAS;EACT;;KAGU,oCAAoC;EAC9C,SAAS;EACT;;KAGU,yBACR,gCACA,6BACA,qCACA;KAEQ,kCACV,cAAc,0BACZ,cAAc,0CAEd,cAAc;KAIN,6BACV,cAAc,yBAAyB,0BACrC,cAAc;EACZ,SAAS;EAAa,OAAO,kCAAkC;;KAGzD;EACV;IAEM;IACA;IACA;;EAGN,cAAc;EACd;EACA,QAAQ;EACR;EACA;EACA;EACA;;KAGU;
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";KAGY;KAKA;KACA;cAEC;KAED;EACV;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA,eAAe;EACf;EACA;EACA;;EAEA;EACA;EACA;;KAGU;KAEA;EACV,UAAU;IACR;IACA;IACA;IACA,QAAQ;;EAEV,cAAc;IACZ;IACA;IACA;IACA,QAAQ;;;KAIA;EACV,cAAc;EACd,WAAW;EACX,OAAO;EACP,SAAS;EACT,eAAe;EACf,UAAU;EACV,QAAQ;;KAGE;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;;KAGU;EACV;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EAAiC;EAAY;;KAEpD;EACH;EACA;EACA;EACA;;KAGU,6BAA6B;EACvC;;KAGU,gCAAgC;EAC1C;;KAGU,qCAAqC;EAC/C,SAAS;EACT;;KAGU,oCAAoC;EAC9C,SAAS;EACT;;KAGU,yBACR,gCACA,6BACA,qCACA;KAEQ,kCACV,cAAc,0BACZ,cAAc,0CAEd,cAAc;KAIN,6BACV,cAAc,yBAAyB,0BACrC,cAAc;EACZ,SAAS;EAAa,OAAO,kCAAkC;;KAGzD;EACV;IAEM;IACA;IACA;;EAGN,cAAc;EACd;EACA,QAAQ;EACR;EACA;EACA;EACA;;KAGU;KAgBA;KAoBA;KAOA;cAMC,4BAA4B;WAC9B,aAAa;WACb,MAAM;WACN,WAAW;WACX;WACA;WACA;WACA,YAAY;WACZ;EAEG,cACV,aACA,MACA,SACA,WACA,YACA,qBACA,YACA;IAEA,cAAc;IACd,MAAM;IACN;IACA,WAAW;IACX;IACA;IACA,aAAa;IACb;;;KAeQ;EACV;EACA;EACA;EACA;EACA;EACA;EACA,iBAAiB;EACjB;EACA,eAAe;EACf;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU,2BAA2B;EACrC,iBAAiB;EACjB;EACA;EACA,SAAS;EACT,eAAe;EACf,WAAW;;KAGD,8BAA8B;EACxC;EACA;EACA,gBAAgB;EAChB,oBAAoB;EACpB,eAAe;;KAGL;EACV;EACA;EACA;EACA;;KAGU;KAMA;EACV;EACA;EACA,gBAAgB;EAChB;EACA;EACA;EACA;EACA;;KAGU,+BAA+B;EACzC;EACA,oBAAoB;;KAYV;EACV;IACE;IACA;IACA;IACA;IACA;IACA;;EAEF;;KAGU;EACV;EACA;EACA,qBAAqB;EACrB;EACA;EACA;EACA,WAAW;EACX;EACA,WAAW;;KAGD;EACN;EAAmB;;EACnB;EAAmB;;EACnB;;KAEM;EACN;EAAqB;;EACrB;EAAqB;;EACrB;;KAEM,mCACV;EACE,WAAW;;KAGH;EACV,WAAW;;KAGD,iCAAiC;EAC3C,SAAS;;EAGH,OAAO;EACP;;EAGA;EACA,WAAW;;KAIP,8BAA8B,SACxC;EACE,gBAAgB;EAChB,SAAS,SAAS;;KAIV,4BAA4B;EACtC,SAAS;EACT,UAAU;;KAGA;EACV,UAAU;EACV,YAAY;;KAGT;EACH;EACA,eAAe,WAAW;EAC1B,WAAW,OAAO;EAClB;EACA;EACA;;KAGU;EAEN;EACA,aAAa;;EAGb;EACA;;KAGM,iCACV,qCAAqC;KAE3B;EACV,iBACE,OAAO,mCACJ,QAAQ;EACb,mBACE,6BACG,QAAQ;EACb;QACM,QAAQ;KACX,OAAO,+BAA+B,QAAQ;;EAEjD,gBACE,OAAO,kCACJ,QAAQ"}
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=`0.2.
|
|
1
|
+
const e=`0.2.224-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 | \"booking_request_failed\"\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 | \"load_booking_configuration\"\n | \"find_booking_availability\"\n | \"initialize_booking\"\n | \"confirm_booking\"\n | \"recover_booking\"\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,gBAuMvC,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.
|
|
3
|
+
"version": "0.2.224-dev.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Lockerverse/lockerverse-sdk.git",
|
|
@@ -33,6 +33,11 @@
|
|
|
33
33
|
"types": "./dist/public-events.d.ts",
|
|
34
34
|
"import": "./dist/public-events.js",
|
|
35
35
|
"default": "./dist/public-events.js"
|
|
36
|
+
},
|
|
37
|
+
"./bookings": {
|
|
38
|
+
"types": "./dist/bookings.d.ts",
|
|
39
|
+
"import": "./dist/bookings.js",
|
|
40
|
+
"default": "./dist/bookings.js"
|
|
36
41
|
}
|
|
37
42
|
},
|
|
38
43
|
"module": "./dist/index.js",
|
|
@@ -92,6 +97,11 @@
|
|
|
92
97
|
"name": "failure-only telemetry",
|
|
93
98
|
"limit": "20 kB",
|
|
94
99
|
"path": "dist/telemetry.js"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"name": "Optional booking client",
|
|
103
|
+
"limit": "5 kB",
|
|
104
|
+
"path": "dist/bookings.js"
|
|
95
105
|
}
|
|
96
106
|
],
|
|
97
107
|
"scripts": {
|