@crvouga/mockingbird-service-flex 1.3.0 → 1.5.0
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 +14 -2
- package/dist/{chunk-KNQ2MP6O.js → chunk-3UD5KSQR.js} +3 -2
- package/dist/{chunk-KNQ2MP6O.js.map → chunk-3UD5KSQR.js.map} +2 -2
- package/dist/{chunk-UQWTCFIV.js → chunk-MGSS74P5.js} +2361 -163
- package/dist/chunk-MGSS74P5.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +41 -3
- package/dist/index.js +1 -1
- package/dist/server.d.ts +73 -3
- package/dist/server.js +2 -2
- package/package.json +4 -3
- package/dist/chunk-UQWTCFIV.js.map +0 -7
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -86,9 +86,15 @@ type ListRecordsOptions<T> = {
|
|
|
86
86
|
*/
|
|
87
87
|
declare class Collection<T> {
|
|
88
88
|
private readonly sqlite;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
90
|
+
readonly namespace: string;
|
|
91
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
92
|
+
readonly collectionName: string;
|
|
93
|
+
constructor(sqlite: SqliteClient$1,
|
|
94
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
95
|
+
namespace: string,
|
|
96
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
97
|
+
collectionName: string);
|
|
92
98
|
private bumpCollectionSeq;
|
|
93
99
|
nextSequence(): number;
|
|
94
100
|
get(id: string): T | undefined;
|
|
@@ -469,6 +475,36 @@ type NamespaceSnapshot = {
|
|
|
469
475
|
}[];
|
|
470
476
|
};
|
|
471
477
|
|
|
478
|
+
declare const STATE_FIELD_KINDS: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
479
|
+
type StateFieldKind = (typeof STATE_FIELD_KINDS)[number];
|
|
480
|
+
/** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
|
|
481
|
+
type StateMeta = Readonly<Record<string, string | number | boolean | null>>;
|
|
482
|
+
type StateField = {
|
|
483
|
+
name: string;
|
|
484
|
+
kind: StateFieldKind;
|
|
485
|
+
optional: boolean;
|
|
486
|
+
description?: string;
|
|
487
|
+
/** One level of nested object fields. */
|
|
488
|
+
fields?: StateField[];
|
|
489
|
+
meta?: StateMeta;
|
|
490
|
+
};
|
|
491
|
+
type StateCollectionView = {
|
|
492
|
+
name: string;
|
|
493
|
+
label: string;
|
|
494
|
+
description?: string;
|
|
495
|
+
count: number;
|
|
496
|
+
/** `mixed` when a declaration and stored rows both contribute fields. */
|
|
497
|
+
source: "declared" | "inferred" | "mixed";
|
|
498
|
+
fields: StateField[];
|
|
499
|
+
meta?: StateMeta;
|
|
500
|
+
};
|
|
501
|
+
/** The shape of one namespace, for an admin UI that has never seen the service before. */
|
|
502
|
+
type StateView = {
|
|
503
|
+
namespace: string;
|
|
504
|
+
storageNamespace: string;
|
|
505
|
+
collections: StateCollectionView[];
|
|
506
|
+
};
|
|
507
|
+
|
|
472
508
|
type WebhookEndpoint = {
|
|
473
509
|
/** Stable id; generated when omitted. */
|
|
474
510
|
id?: string;
|
|
@@ -595,6 +631,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
595
631
|
}): void;
|
|
596
632
|
/** Inspect the retained history for a namespace. */
|
|
597
633
|
timeline(namespace?: string): Timeline<ServiceTimelineState>;
|
|
634
|
+
/** Collections in one namespace: declared shape plus what the rows actually hold. */
|
|
635
|
+
state(namespace?: string): StateView;
|
|
598
636
|
};
|
|
599
637
|
|
|
600
638
|
/** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
|
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -386,6 +386,36 @@ type NamespaceSnapshot$1 = {
|
|
|
386
386
|
}[];
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
+
declare const STATE_FIELD_KINDS$1: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
390
|
+
type StateFieldKind$1 = (typeof STATE_FIELD_KINDS$1)[number];
|
|
391
|
+
/** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
|
|
392
|
+
type StateMeta$1 = Readonly<Record<string, string | number | boolean | null>>;
|
|
393
|
+
type StateField$1 = {
|
|
394
|
+
name: string;
|
|
395
|
+
kind: StateFieldKind$1;
|
|
396
|
+
optional: boolean;
|
|
397
|
+
description?: string;
|
|
398
|
+
/** One level of nested object fields. */
|
|
399
|
+
fields?: StateField$1[];
|
|
400
|
+
meta?: StateMeta$1;
|
|
401
|
+
};
|
|
402
|
+
type StateCollectionView$1 = {
|
|
403
|
+
name: string;
|
|
404
|
+
label: string;
|
|
405
|
+
description?: string;
|
|
406
|
+
count: number;
|
|
407
|
+
/** `mixed` when a declaration and stored rows both contribute fields. */
|
|
408
|
+
source: "declared" | "inferred" | "mixed";
|
|
409
|
+
fields: StateField$1[];
|
|
410
|
+
meta?: StateMeta$1;
|
|
411
|
+
};
|
|
412
|
+
/** The shape of one namespace, for an admin UI that has never seen the service before. */
|
|
413
|
+
type StateView$1 = {
|
|
414
|
+
namespace: string;
|
|
415
|
+
storageNamespace: string;
|
|
416
|
+
collections: StateCollectionView$1[];
|
|
417
|
+
};
|
|
418
|
+
|
|
389
419
|
type WebhookEndpoint$1 = {
|
|
390
420
|
/** Stable id; generated when omitted. */
|
|
391
421
|
id?: string;
|
|
@@ -512,6 +542,8 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$2 & {
|
|
|
512
542
|
}): void;
|
|
513
543
|
/** Inspect the retained history for a namespace. */
|
|
514
544
|
timeline(namespace?: string): Timeline$1<ServiceTimelineState$1>;
|
|
545
|
+
/** Collections in one namespace: declared shape plus what the rows actually hold. */
|
|
546
|
+
state(namespace?: string): StateView$1;
|
|
515
547
|
};
|
|
516
548
|
|
|
517
549
|
type CliOption = {
|
|
@@ -627,9 +659,15 @@ type ListRecordsOptions<T> = {
|
|
|
627
659
|
*/
|
|
628
660
|
declare class Collection<T> {
|
|
629
661
|
private readonly sqlite;
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
662
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
663
|
+
readonly namespace: string;
|
|
664
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
665
|
+
readonly collectionName: string;
|
|
666
|
+
constructor(sqlite: SqliteClient$1,
|
|
667
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
668
|
+
namespace: string,
|
|
669
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
670
|
+
collectionName: string);
|
|
633
671
|
private bumpCollectionSeq;
|
|
634
672
|
nextSequence(): number;
|
|
635
673
|
get(id: string): T | undefined;
|
|
@@ -997,6 +1035,36 @@ type NamespaceSnapshot = {
|
|
|
997
1035
|
}[];
|
|
998
1036
|
};
|
|
999
1037
|
|
|
1038
|
+
declare const STATE_FIELD_KINDS: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1039
|
+
type StateFieldKind = (typeof STATE_FIELD_KINDS)[number];
|
|
1040
|
+
/** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
|
|
1041
|
+
type StateMeta = Readonly<Record<string, string | number | boolean | null>>;
|
|
1042
|
+
type StateField = {
|
|
1043
|
+
name: string;
|
|
1044
|
+
kind: StateFieldKind;
|
|
1045
|
+
optional: boolean;
|
|
1046
|
+
description?: string;
|
|
1047
|
+
/** One level of nested object fields. */
|
|
1048
|
+
fields?: StateField[];
|
|
1049
|
+
meta?: StateMeta;
|
|
1050
|
+
};
|
|
1051
|
+
type StateCollectionView = {
|
|
1052
|
+
name: string;
|
|
1053
|
+
label: string;
|
|
1054
|
+
description?: string;
|
|
1055
|
+
count: number;
|
|
1056
|
+
/** `mixed` when a declaration and stored rows both contribute fields. */
|
|
1057
|
+
source: "declared" | "inferred" | "mixed";
|
|
1058
|
+
fields: StateField[];
|
|
1059
|
+
meta?: StateMeta;
|
|
1060
|
+
};
|
|
1061
|
+
/** The shape of one namespace, for an admin UI that has never seen the service before. */
|
|
1062
|
+
type StateView = {
|
|
1063
|
+
namespace: string;
|
|
1064
|
+
storageNamespace: string;
|
|
1065
|
+
collections: StateCollectionView[];
|
|
1066
|
+
};
|
|
1067
|
+
|
|
1000
1068
|
type WebhookEndpoint = {
|
|
1001
1069
|
/** Stable id; generated when omitted. */
|
|
1002
1070
|
id?: string;
|
|
@@ -1123,6 +1191,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI$1 & {
|
|
|
1123
1191
|
}): void;
|
|
1124
1192
|
/** Inspect the retained history for a namespace. */
|
|
1125
1193
|
timeline(namespace?: string): Timeline<ServiceTimelineState>;
|
|
1194
|
+
/** Collections in one namespace: declared shape plus what the rows actually hold. */
|
|
1195
|
+
state(namespace?: string): StateView;
|
|
1126
1196
|
};
|
|
1127
1197
|
|
|
1128
1198
|
/** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
|
package/dist/server.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crvouga/mockingbird-service-flex",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Stateful mock 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",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"docs": "https://docs.withflex.com",
|
|
60
60
|
"description": "Flex lets merchants accept HSA/FSA funds at checkout for eligible health and wellness products."
|
|
61
61
|
},
|
|
62
|
-
"
|
|
62
|
+
"parity": "Checkout, subscriptions, and webhooks",
|
|
63
63
|
"parityTier": "cold",
|
|
64
64
|
"playground": {
|
|
65
65
|
"headers": {
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"pack:check": "bun ../../../scripts/pack-check.ts"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@crvouga/mockingbird-service-sqlite": "1.
|
|
83
|
+
"@crvouga/mockingbird-service-sqlite": "1.2.0",
|
|
84
84
|
"hono": "4.11.9"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
"@crvouga/mockingbird-sqlite": "0.0.0-development",
|
|
96
96
|
"@crvouga/mockingbird-openapi": "0.0.0-development",
|
|
97
97
|
"@crvouga/mockingbird-service": "0.0.0-development",
|
|
98
|
+
"@crvouga/mockingbird-ui": "0.0.0-development",
|
|
98
99
|
"@crvouga/mockingbird-http-codec": "0.0.0-development",
|
|
99
100
|
"@crvouga/mockingbird-adapter-node": "0.0.0-development",
|
|
100
101
|
"svix": "1.41.0",
|