@crvouga/mockingbird-service-flex 3.10.0 → 4.0.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/CHANGELOG.md +12 -4
- package/README.md +18 -7
- package/dist/{chunk-NKBXNJ5B.js → chunk-AGWRBLUO.js} +147 -23
- package/dist/{chunk-NKBXNJ5B.js.map → chunk-AGWRBLUO.js.map} +3 -3
- package/dist/{chunk-OATZRDML.js → chunk-BW7LXOWN.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +3 -1
- package/dist/server.d.ts +16 -1
- package/dist/server.js +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-OATZRDML.js.map → chunk-BW7LXOWN.js.map} +0 -0
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseFaultHeader,
|
|
10
10
|
resolveAdminPrefix,
|
|
11
11
|
restoreClock
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AGWRBLUO.js";
|
|
13
13
|
|
|
14
14
|
// ../../adapters/node/dist/cli.js
|
|
15
15
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
|
|
|
3057
3057
|
break;
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
|
-
targets.set(name, { ...target, packageVersion: packageVersion ?? "
|
|
3060
|
+
targets.set(name, { ...target, packageVersion: packageVersion ?? "4.0.1" });
|
|
3061
3061
|
} catch (error) {
|
|
3062
3062
|
throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
3063
3063
|
}
|
|
@@ -5062,4 +5062,4 @@ export {
|
|
|
5062
5062
|
createServer2 as createServer,
|
|
5063
5063
|
serveTarget
|
|
5064
5064
|
};
|
|
5065
|
-
//# sourceMappingURL=chunk-
|
|
5065
|
+
//# sourceMappingURL=chunk-BW7LXOWN.js.map
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1494,6 +1494,12 @@ declare const FLEX_NAMESPACE = "flex";
|
|
|
1494
1494
|
/** Every webhook event type the mock sends (our receiver reconciles on each). */
|
|
1495
1495
|
declare const FLEX_EVENT_TYPES: readonly ["product.updated", "checkout.session.completed", "checkout_session.completed", "checkout.session.async_payment_succeeded", "checkout.session.async_payment_failed", "checkout.session.refunded", "checkout.session.expired", "checkout_session.expired", "payment_intent.succeeded", "customer.subscription.created", "refund.created", "refund.updated", "charge.refunded", "charge.refund.updated"];
|
|
1496
1496
|
type FlexEventType = (typeof FLEX_EVENT_TYPES)[number];
|
|
1497
|
+
/**
|
|
1498
|
+
* The key Flex nests an event's object under (`EventObject` in Flex's OpenAPI): a
|
|
1499
|
+
* `refund.created` event carries `{refund: {...}}`, a `checkout.session.completed` event
|
|
1500
|
+
* `{checkout_session: {...}}`. `charge.refund.updated` carries the refund.
|
|
1501
|
+
*/
|
|
1502
|
+
declare const eventObjectKey: (type: string) => string;
|
|
1497
1503
|
/** The event inside the `{event: {...}}` webhook envelope. */
|
|
1498
1504
|
type FlexEvent = {
|
|
1499
1505
|
event_id: string;
|
|
@@ -1569,8 +1575,23 @@ declare class FlexAPI implements FetchAPI$1 {
|
|
|
1569
1575
|
private getSession;
|
|
1570
1576
|
private listSessions;
|
|
1571
1577
|
private refund;
|
|
1572
|
-
/**
|
|
1578
|
+
/**
|
|
1579
|
+
* Refund part or all of a paid session, emitting the refund events Flex sends:
|
|
1580
|
+
* `checkout.session.refunded` (seen in test mode, carrying the session and its refunds),
|
|
1581
|
+
* then, in the order production delivers a dashboard refund, `refund.created` twice,
|
|
1582
|
+
* `charge.refunded`, `refund.updated` and `charge.refund.updated`. An endpoint receives only
|
|
1583
|
+
* the types it subscribes to.
|
|
1584
|
+
*/
|
|
1573
1585
|
applyRefund(id: string, amount: number): SessionRecord | undefined;
|
|
1586
|
+
/** Refund a paid session from Flex's dashboard (`POST /__admin/sessions/:id/refund`). */
|
|
1587
|
+
dashboardRefund(id: string, amount?: number): {
|
|
1588
|
+
session: SessionRecord;
|
|
1589
|
+
} | {
|
|
1590
|
+
status: 400 | 404 | 409;
|
|
1591
|
+
message: string;
|
|
1592
|
+
};
|
|
1593
|
+
private presentRefund;
|
|
1594
|
+
private presentCharge;
|
|
1574
1595
|
private createCustomer;
|
|
1575
1596
|
private newCustomer;
|
|
1576
1597
|
private getSetupIntent;
|
|
@@ -1621,5 +1642,5 @@ declare class FlexAPI implements FetchAPI$1 {
|
|
|
1621
1642
|
/** Whether a string is one of the next-action types. */
|
|
1622
1643
|
declare const isNextActionType: (value: unknown) => value is NextActionType;
|
|
1623
1644
|
|
|
1624
|
-
export { CARDS, CORPUS_ROWS, DEFAULT_SETTINGS, ELIGIBILITIES, FLEX_EVENT_TYPES, FLEX_NAMESPACE, FLEX_PRESETS, FlexAPI, NEXT_ACTION_TYPES, PAYMENT_INTENT_STATUSES, SUBSCRIPTION_STATUSES, classifyCard, corpusProduct, createRuntime, document, isNextActionType, keyMode, operationIds, periodEnd, substituteSessionId, supportedOperationIds };
|
|
1645
|
+
export { CARDS, CORPUS_ROWS, DEFAULT_SETTINGS, ELIGIBILITIES, FLEX_EVENT_TYPES, FLEX_NAMESPACE, FLEX_PRESETS, FlexAPI, NEXT_ACTION_TYPES, PAYMENT_INTENT_STATUSES, SUBSCRIPTION_STATUSES, classifyCard, corpusProduct, createRuntime, document, eventObjectKey, isNextActionType, keyMode, operationIds, periodEnd, substituteSessionId, supportedOperationIds };
|
|
1625
1646
|
export type { CardOutcome, CorpusRow, CustomerRecord, Eligibility, FetchAPI$1 as FetchAPI, FlexAPIOptions, FlexEvent, FlexEventType, FlexRuntime, FlexRuntimeOptions, LineItemRecord, NextAction, NextActionType, OperationId, PaymentIntentRecord, PaymentIntentStatus, PaymentMethodRecord, ProductRecord, Recurring, RefundRecord, SessionMode, SessionRecord, SessionStatus, Settings, SetupIntentRecord, SqliteClient, SubscriptionData, SubscriptionRecord, SubscriptionStatus, SupportedOperationId };
|
package/dist/index.js
CHANGED
|
@@ -14,13 +14,14 @@ import {
|
|
|
14
14
|
corpusProduct,
|
|
15
15
|
createRuntime,
|
|
16
16
|
document,
|
|
17
|
+
eventObjectKey,
|
|
17
18
|
isNextActionType,
|
|
18
19
|
keyMode,
|
|
19
20
|
operationIds,
|
|
20
21
|
periodEnd,
|
|
21
22
|
substituteSessionId,
|
|
22
23
|
supportedOperationIds
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-AGWRBLUO.js";
|
|
24
25
|
export {
|
|
25
26
|
CARDS,
|
|
26
27
|
CORPUS_ROWS,
|
|
@@ -37,6 +38,7 @@ export {
|
|
|
37
38
|
corpusProduct,
|
|
38
39
|
createRuntime,
|
|
39
40
|
document,
|
|
41
|
+
eventObjectKey,
|
|
40
42
|
isNextActionType,
|
|
41
43
|
keyMode,
|
|
42
44
|
operationIds,
|
package/dist/server.d.ts
CHANGED
|
@@ -2289,8 +2289,23 @@ declare class FlexAPI implements FetchAPI {
|
|
|
2289
2289
|
private getSession;
|
|
2290
2290
|
private listSessions;
|
|
2291
2291
|
private refund;
|
|
2292
|
-
/**
|
|
2292
|
+
/**
|
|
2293
|
+
* Refund part or all of a paid session, emitting the refund events Flex sends:
|
|
2294
|
+
* `checkout.session.refunded` (seen in test mode, carrying the session and its refunds),
|
|
2295
|
+
* then, in the order production delivers a dashboard refund, `refund.created` twice,
|
|
2296
|
+
* `charge.refunded`, `refund.updated` and `charge.refund.updated`. An endpoint receives only
|
|
2297
|
+
* the types it subscribes to.
|
|
2298
|
+
*/
|
|
2293
2299
|
applyRefund(id: string, amount: number): SessionRecord | undefined;
|
|
2300
|
+
/** Refund a paid session from Flex's dashboard (`POST /__admin/sessions/:id/refund`). */
|
|
2301
|
+
dashboardRefund(id: string, amount?: number): {
|
|
2302
|
+
session: SessionRecord;
|
|
2303
|
+
} | {
|
|
2304
|
+
status: 400 | 404 | 409;
|
|
2305
|
+
message: string;
|
|
2306
|
+
};
|
|
2307
|
+
private presentRefund;
|
|
2308
|
+
private presentCharge;
|
|
2294
2309
|
private createCustomer;
|
|
2295
2310
|
private newCustomer;
|
|
2296
2311
|
private getSetupIntent;
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-service-flex",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Stateful emulator of the Flex HSA/FSA payments API: products (recorded catalog corpus), checkout sessions in payment, subscription, off-session and setup modes, subscriptions, customers, setup intents, refunds, the hosted checkout page, and Svix-signed webhooks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
File without changes
|