@crvouga/mockingbird-service-s3 1.2.0 → 1.4.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 +12 -0
- package/README.md +2 -0
- package/dist/{chunk-S3J2Y3I7.js → chunk-K6EOZJS7.js} +3 -2
- package/dist/{chunk-S3J2Y3I7.js.map → chunk-K6EOZJS7.js.map} +2 -2
- package/dist/{chunk-HHPVNDTG.js → chunk-XQURI6UT.js} +1428 -38
- package/dist/chunk-XQURI6UT.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 +2 -2
- package/dist/chunk-HHPVNDTG.js.map +0 -7
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -74,9 +74,15 @@ type ListRecordsOptions<T> = {
|
|
|
74
74
|
*/
|
|
75
75
|
declare class Collection<T> {
|
|
76
76
|
private readonly sqlite;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
78
|
+
readonly namespace: string;
|
|
79
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
80
|
+
readonly collectionName: string;
|
|
81
|
+
constructor(sqlite: SqliteClient$1,
|
|
82
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
83
|
+
namespace: string,
|
|
84
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
85
|
+
collectionName: string);
|
|
80
86
|
private bumpCollectionSeq;
|
|
81
87
|
nextSequence(): number;
|
|
82
88
|
get(id: string): T | undefined;
|
|
@@ -457,6 +463,36 @@ type NamespaceSnapshot = {
|
|
|
457
463
|
}[];
|
|
458
464
|
};
|
|
459
465
|
|
|
466
|
+
declare const STATE_FIELD_KINDS: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
467
|
+
type StateFieldKind = (typeof STATE_FIELD_KINDS)[number];
|
|
468
|
+
/** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
|
|
469
|
+
type StateMeta = Readonly<Record<string, string | number | boolean | null>>;
|
|
470
|
+
type StateField = {
|
|
471
|
+
name: string;
|
|
472
|
+
kind: StateFieldKind;
|
|
473
|
+
optional: boolean;
|
|
474
|
+
description?: string;
|
|
475
|
+
/** One level of nested object fields. */
|
|
476
|
+
fields?: StateField[];
|
|
477
|
+
meta?: StateMeta;
|
|
478
|
+
};
|
|
479
|
+
type StateCollectionView = {
|
|
480
|
+
name: string;
|
|
481
|
+
label: string;
|
|
482
|
+
description?: string;
|
|
483
|
+
count: number;
|
|
484
|
+
/** `mixed` when a declaration and stored rows both contribute fields. */
|
|
485
|
+
source: "declared" | "inferred" | "mixed";
|
|
486
|
+
fields: StateField[];
|
|
487
|
+
meta?: StateMeta;
|
|
488
|
+
};
|
|
489
|
+
/** The shape of one namespace, for an admin UI that has never seen the service before. */
|
|
490
|
+
type StateView = {
|
|
491
|
+
namespace: string;
|
|
492
|
+
storageNamespace: string;
|
|
493
|
+
collections: StateCollectionView[];
|
|
494
|
+
};
|
|
495
|
+
|
|
460
496
|
type WebhookEndpoint = {
|
|
461
497
|
/** Stable id; generated when omitted. */
|
|
462
498
|
id?: string;
|
|
@@ -583,6 +619,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
583
619
|
}): void;
|
|
584
620
|
/** Inspect the retained history for a namespace. */
|
|
585
621
|
timeline(namespace?: string): Timeline<ServiceTimelineState>;
|
|
622
|
+
/** Collections in one namespace: declared shape plus what the rows actually hold. */
|
|
623
|
+
state(namespace?: string): StateView;
|
|
586
624
|
};
|
|
587
625
|
|
|
588
626
|
/**
|
package/dist/index.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -385,6 +385,36 @@ type NamespaceSnapshot$1 = {
|
|
|
385
385
|
}[];
|
|
386
386
|
};
|
|
387
387
|
|
|
388
|
+
declare const STATE_FIELD_KINDS$1: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
389
|
+
type StateFieldKind$1 = (typeof STATE_FIELD_KINDS$1)[number];
|
|
390
|
+
/** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
|
|
391
|
+
type StateMeta$1 = Readonly<Record<string, string | number | boolean | null>>;
|
|
392
|
+
type StateField$1 = {
|
|
393
|
+
name: string;
|
|
394
|
+
kind: StateFieldKind$1;
|
|
395
|
+
optional: boolean;
|
|
396
|
+
description?: string;
|
|
397
|
+
/** One level of nested object fields. */
|
|
398
|
+
fields?: StateField$1[];
|
|
399
|
+
meta?: StateMeta$1;
|
|
400
|
+
};
|
|
401
|
+
type StateCollectionView$1 = {
|
|
402
|
+
name: string;
|
|
403
|
+
label: string;
|
|
404
|
+
description?: string;
|
|
405
|
+
count: number;
|
|
406
|
+
/** `mixed` when a declaration and stored rows both contribute fields. */
|
|
407
|
+
source: "declared" | "inferred" | "mixed";
|
|
408
|
+
fields: StateField$1[];
|
|
409
|
+
meta?: StateMeta$1;
|
|
410
|
+
};
|
|
411
|
+
/** The shape of one namespace, for an admin UI that has never seen the service before. */
|
|
412
|
+
type StateView$1 = {
|
|
413
|
+
namespace: string;
|
|
414
|
+
storageNamespace: string;
|
|
415
|
+
collections: StateCollectionView$1[];
|
|
416
|
+
};
|
|
417
|
+
|
|
388
418
|
type WebhookEndpoint$1 = {
|
|
389
419
|
/** Stable id; generated when omitted. */
|
|
390
420
|
id?: string;
|
|
@@ -511,6 +541,8 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$1 & {
|
|
|
511
541
|
}): void;
|
|
512
542
|
/** Inspect the retained history for a namespace. */
|
|
513
543
|
timeline(namespace?: string): Timeline$1<ServiceTimelineState$1>;
|
|
544
|
+
/** Collections in one namespace: declared shape plus what the rows actually hold. */
|
|
545
|
+
state(namespace?: string): StateView$1;
|
|
514
546
|
};
|
|
515
547
|
|
|
516
548
|
type CliOption = {
|
|
@@ -626,9 +658,15 @@ type ListRecordsOptions<T> = {
|
|
|
626
658
|
*/
|
|
627
659
|
declare class Collection<T> {
|
|
628
660
|
private readonly sqlite;
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
661
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
662
|
+
readonly namespace: string;
|
|
663
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
664
|
+
readonly collectionName: string;
|
|
665
|
+
constructor(sqlite: SqliteClient$1,
|
|
666
|
+
/** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
|
|
667
|
+
namespace: string,
|
|
668
|
+
/** Table name inside the namespace. Stable across resets of the rows themselves. */
|
|
669
|
+
collectionName: string);
|
|
632
670
|
private bumpCollectionSeq;
|
|
633
671
|
nextSequence(): number;
|
|
634
672
|
get(id: string): T | undefined;
|
|
@@ -996,6 +1034,36 @@ type NamespaceSnapshot = {
|
|
|
996
1034
|
}[];
|
|
997
1035
|
};
|
|
998
1036
|
|
|
1037
|
+
declare const STATE_FIELD_KINDS: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
|
|
1038
|
+
type StateFieldKind = (typeof STATE_FIELD_KINDS)[number];
|
|
1039
|
+
/** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
|
|
1040
|
+
type StateMeta = Readonly<Record<string, string | number | boolean | null>>;
|
|
1041
|
+
type StateField = {
|
|
1042
|
+
name: string;
|
|
1043
|
+
kind: StateFieldKind;
|
|
1044
|
+
optional: boolean;
|
|
1045
|
+
description?: string;
|
|
1046
|
+
/** One level of nested object fields. */
|
|
1047
|
+
fields?: StateField[];
|
|
1048
|
+
meta?: StateMeta;
|
|
1049
|
+
};
|
|
1050
|
+
type StateCollectionView = {
|
|
1051
|
+
name: string;
|
|
1052
|
+
label: string;
|
|
1053
|
+
description?: string;
|
|
1054
|
+
count: number;
|
|
1055
|
+
/** `mixed` when a declaration and stored rows both contribute fields. */
|
|
1056
|
+
source: "declared" | "inferred" | "mixed";
|
|
1057
|
+
fields: StateField[];
|
|
1058
|
+
meta?: StateMeta;
|
|
1059
|
+
};
|
|
1060
|
+
/** The shape of one namespace, for an admin UI that has never seen the service before. */
|
|
1061
|
+
type StateView = {
|
|
1062
|
+
namespace: string;
|
|
1063
|
+
storageNamespace: string;
|
|
1064
|
+
collections: StateCollectionView[];
|
|
1065
|
+
};
|
|
1066
|
+
|
|
999
1067
|
type WebhookEndpoint = {
|
|
1000
1068
|
/** Stable id; generated when omitted. */
|
|
1001
1069
|
id?: string;
|
|
@@ -1122,6 +1190,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
|
|
|
1122
1190
|
}): void;
|
|
1123
1191
|
/** Inspect the retained history for a namespace. */
|
|
1124
1192
|
timeline(namespace?: string): Timeline<ServiceTimelineState>;
|
|
1193
|
+
/** Collections in one namespace: declared shape plus what the rows actually hold. */
|
|
1194
|
+
state(namespace?: string): StateView;
|
|
1125
1195
|
};
|
|
1126
1196
|
|
|
1127
1197
|
/** 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-s3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Stateful Amazon S3 mock with binary objects, listing, copies, multipart uploads, presigned URLs, and canonical XML errors.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"pack:check": "bun ../../../scripts/pack-check.ts"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@crvouga/mockingbird-service-sqlite": "1.
|
|
75
|
+
"@crvouga/mockingbird-service-sqlite": "1.1.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@aws-sdk/client-s3": "3.1132.0",
|