@crvouga/mockingbird-service-aws-secrets 1.7.1 → 2.0.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/dist/cli.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  runCli,
4
4
  serveCommand,
5
5
  serveTarget
6
- } from "./chunk-GDZSTAIM.js";
7
- import "./chunk-3ZIKSFTQ.js";
6
+ } from "./chunk-Q6YFMIYD.js";
7
+ import "./chunk-XQ45L6Q4.js";
8
8
 
9
9
  // src/cli.ts
10
10
  var code = await runCli(
package/dist/index.d.ts CHANGED
@@ -207,6 +207,15 @@ type FaultCandidate = {
207
207
  namespace: string;
208
208
  };
209
209
  type FaultRegistry = {
210
+ isolateNamespaces(): void;
211
+ snapshot(namespace: string): {
212
+ rules: (FaultRule & {
213
+ remaining: number | null;
214
+ hits: number;
215
+ position: number;
216
+ })[];
217
+ rngState: number;
218
+ };
210
219
  add(rule: FaultRule): FaultRule;
211
220
  list(): (FaultRule & {
212
221
  remaining: number | null;
@@ -214,6 +223,14 @@ type FaultRegistry = {
214
223
  })[];
215
224
  remove(id: string): boolean;
216
225
  clear(): void;
226
+ restore(namespace: string, state: {
227
+ rules: (FaultRule & {
228
+ remaining: number | null;
229
+ hits: number;
230
+ position: number;
231
+ })[];
232
+ rngState: number;
233
+ }): void;
217
234
  /**
218
235
  * Every fault this request should get, in rule order, stopping at the first that answers
219
236
  * or drops (effect-only and delay-only rules let later rules match too). Consumes one of
@@ -391,8 +408,8 @@ type MetricsReport = {
391
408
  };
392
409
  type Metrics = {
393
410
  record(entry: RequestLog): void;
394
- report(): MetricsReport;
395
- reset(): void;
411
+ report(namespace?: string): MetricsReport;
412
+ reset(namespace?: string): void;
396
413
  };
397
414
 
398
415
  /** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
@@ -558,6 +575,9 @@ type PublishInput = {
558
575
  id?: string;
559
576
  };
560
577
  type WebhookHub = {
578
+ pending(namespace: string): number;
579
+ snapshot(namespace: string): unknown;
580
+ restore(namespace: string, snapshot: unknown): void;
561
581
  publish(input: PublishInput): WebhookMessage;
562
582
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
563
583
  setEndpoints(namespace: string, endpoints: WebhookEndpoint[]): WebhookEndpoint[];
@@ -585,6 +605,8 @@ type ServiceTimelineState = Readonly<{
585
605
  }>;
586
606
  type ServiceCheckpoint = Checkpoint<ServiceTimelineState>;
587
607
  type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
608
+ /** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
609
+ stop?(): void;
588
610
  readonly name: string;
589
611
  readonly sqlite: SqliteClient$1;
590
612
  readonly clock: Clock;
@@ -595,6 +617,13 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
595
617
  readonly credentials: CredentialRegistry;
596
618
  /** The webhook hub, when the service has outbound webhooks. */
597
619
  readonly webhooks: WebhookHub | undefined;
620
+ /** Enable independent namespace clocks and PRNGs before serving a fleet. */
621
+ isolateNamespaces(): void;
622
+ namespaceClock(namespace?: string): Clock;
623
+ namespaceOf(request: Request): string;
624
+ /** Opaque in-process checkpoint including records, controls and webhook history. */
625
+ fleetSnapshot(namespace: string): object;
626
+ fleetRestore(snapshot: unknown, namespace: string): void;
598
627
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
599
628
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
600
629
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
@@ -867,6 +896,7 @@ type AwsSecretsRuntimeOptions = {
867
896
  sqlite?: SqliteClient;
868
897
  clock?: Clock;
869
898
  seed?: number | string;
899
+ adminPrefix?: string;
870
900
  adminKey?: string;
871
901
  onLog?: (entry: RequestLog) => void;
872
902
  region?: string;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  document,
8
8
  operationIds,
9
9
  supportedOperationIds
10
- } from "./chunk-3ZIKSFTQ.js";
10
+ } from "./chunk-XQ45L6Q4.js";
11
11
  export {
12
12
  AWS_SECRETS_NAMESPACE,
13
13
  AWS_SECRETS_PRESETS,
package/dist/server.d.ts CHANGED
@@ -154,6 +154,15 @@ type FaultCandidate$1 = {
154
154
  namespace: string;
155
155
  };
156
156
  type FaultRegistry$1 = {
157
+ isolateNamespaces(): void;
158
+ snapshot(namespace: string): {
159
+ rules: (FaultRule$1 & {
160
+ remaining: number | null;
161
+ hits: number;
162
+ position: number;
163
+ })[];
164
+ rngState: number;
165
+ };
157
166
  add(rule: FaultRule$1): FaultRule$1;
158
167
  list(): (FaultRule$1 & {
159
168
  remaining: number | null;
@@ -161,6 +170,14 @@ type FaultRegistry$1 = {
161
170
  })[];
162
171
  remove(id: string): boolean;
163
172
  clear(): void;
173
+ restore(namespace: string, state: {
174
+ rules: (FaultRule$1 & {
175
+ remaining: number | null;
176
+ hits: number;
177
+ position: number;
178
+ })[];
179
+ rngState: number;
180
+ }): void;
164
181
  /**
165
182
  * Every fault this request should get, in rule order, stopping at the first that answers
166
183
  * or drops (effect-only and delay-only rules let later rules match too). Consumes one of
@@ -325,8 +342,8 @@ type MetricsReport$1 = {
325
342
  };
326
343
  type Metrics$1 = {
327
344
  record(entry: RequestLog$1): void;
328
- report(): MetricsReport$1;
329
- reset(): void;
345
+ report(namespace?: string): MetricsReport$1;
346
+ reset(namespace?: string): void;
330
347
  };
331
348
 
332
349
  /** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
@@ -480,6 +497,9 @@ type PublishInput$1 = {
480
497
  id?: string;
481
498
  };
482
499
  type WebhookHub$1 = {
500
+ pending(namespace: string): number;
501
+ snapshot(namespace: string): unknown;
502
+ restore(namespace: string, snapshot: unknown): void;
483
503
  publish(input: PublishInput$1): WebhookMessage$1;
484
504
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
485
505
  setEndpoints(namespace: string, endpoints: WebhookEndpoint$1[]): WebhookEndpoint$1[];
@@ -507,6 +527,8 @@ type ServiceTimelineState$1 = Readonly<{
507
527
  }>;
508
528
  type ServiceCheckpoint$1 = Checkpoint$1<ServiceTimelineState$1>;
509
529
  type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$1 & {
530
+ /** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
531
+ stop?(): void;
510
532
  readonly name: string;
511
533
  readonly sqlite: SqliteClient$2;
512
534
  readonly clock: Clock$1;
@@ -517,6 +539,13 @@ type ServiceRuntime$1<T extends ServiceInstance$1> = FetchAPI$1 & {
517
539
  readonly credentials: CredentialRegistry$1;
518
540
  /** The webhook hub, when the service has outbound webhooks. */
519
541
  readonly webhooks: WebhookHub$1 | undefined;
542
+ /** Enable independent namespace clocks and PRNGs before serving a fleet. */
543
+ isolateNamespaces(): void;
544
+ namespaceClock(namespace?: string): Clock$1;
545
+ namespaceOf(request: Request): string;
546
+ /** Opaque in-process checkpoint including records, controls and webhook history. */
547
+ fleetSnapshot(namespace: string): object;
548
+ fleetRestore(snapshot: unknown, namespace: string): void;
520
549
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
521
550
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule$1>): FaultRule$1[];
522
551
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
@@ -563,6 +592,7 @@ type CliOption = {
563
592
  };
564
593
  type CliValues = Record<string, string | boolean | undefined>;
565
594
  type CommonServeOptions = {
595
+ adminPrefix?: string;
566
596
  adminKey: string | undefined;
567
597
  seed: string | undefined;
568
598
  onLog: ((entry: RequestLog$1) => void) | undefined;
@@ -780,6 +810,15 @@ type FaultCandidate = {
780
810
  namespace: string;
781
811
  };
782
812
  type FaultRegistry = {
813
+ isolateNamespaces(): void;
814
+ snapshot(namespace: string): {
815
+ rules: (FaultRule & {
816
+ remaining: number | null;
817
+ hits: number;
818
+ position: number;
819
+ })[];
820
+ rngState: number;
821
+ };
783
822
  add(rule: FaultRule): FaultRule;
784
823
  list(): (FaultRule & {
785
824
  remaining: number | null;
@@ -787,6 +826,14 @@ type FaultRegistry = {
787
826
  })[];
788
827
  remove(id: string): boolean;
789
828
  clear(): void;
829
+ restore(namespace: string, state: {
830
+ rules: (FaultRule & {
831
+ remaining: number | null;
832
+ hits: number;
833
+ position: number;
834
+ })[];
835
+ rngState: number;
836
+ }): void;
790
837
  /**
791
838
  * Every fault this request should get, in rule order, stopping at the first that answers
792
839
  * or drops (effect-only and delay-only rules let later rules match too). Consumes one of
@@ -964,8 +1011,8 @@ type MetricsReport = {
964
1011
  };
965
1012
  type Metrics = {
966
1013
  record(entry: RequestLog): void;
967
- report(): MetricsReport;
968
- reset(): void;
1014
+ report(namespace?: string): MetricsReport;
1015
+ reset(namespace?: string): void;
969
1016
  };
970
1017
 
971
1018
  /** One journal entry: a request log stamped with when (on the mock clock) it was handled. */
@@ -1131,6 +1178,9 @@ type PublishInput = {
1131
1178
  id?: string;
1132
1179
  };
1133
1180
  type WebhookHub = {
1181
+ pending(namespace: string): number;
1182
+ snapshot(namespace: string): unknown;
1183
+ restore(namespace: string, snapshot: unknown): void;
1134
1184
  publish(input: PublishInput): WebhookMessage;
1135
1185
  /** Replace a namespace's own endpoints (`PUT /__admin/webhook-endpoints`). */
1136
1186
  setEndpoints(namespace: string, endpoints: WebhookEndpoint[]): WebhookEndpoint[];
@@ -1158,6 +1208,8 @@ type ServiceTimelineState = Readonly<{
1158
1208
  }>;
1159
1209
  type ServiceCheckpoint = Checkpoint<ServiceTimelineState>;
1160
1210
  type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1211
+ /** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
1212
+ stop?(): void;
1161
1213
  readonly name: string;
1162
1214
  readonly sqlite: SqliteClient$1;
1163
1215
  readonly clock: Clock;
@@ -1168,6 +1220,13 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
1168
1220
  readonly credentials: CredentialRegistry;
1169
1221
  /** The webhook hub, when the service has outbound webhooks. */
1170
1222
  readonly webhooks: WebhookHub | undefined;
1223
+ /** Enable independent namespace clocks and PRNGs before serving a fleet. */
1224
+ isolateNamespaces(): void;
1225
+ namespaceClock(namespace?: string): Clock;
1226
+ namespaceOf(request: Request): string;
1227
+ /** Opaque in-process checkpoint including records, controls and webhook history. */
1228
+ fleetSnapshot(namespace: string): object;
1229
+ fleetRestore(snapshot: unknown, namespace: string): void;
1171
1230
  /** Expand a named preset into fault rules (and webhook faults) for `namespace`. */
1172
1231
  applyPreset(name: string, namespace?: string, overrides?: Partial<FaultRule>): FaultRule[];
1173
1232
  /** The instance behind `namespace` (the default one when omitted), created on first use. */
@@ -1317,6 +1376,7 @@ type AwsSecretsRuntimeOptions = {
1317
1376
  sqlite?: SqliteClient;
1318
1377
  clock?: Clock;
1319
1378
  seed?: number | string;
1379
+ adminPrefix?: string;
1320
1380
  adminKey?: string;
1321
1381
  onLog?: (entry: RequestLog) => void;
1322
1382
  region?: string;
package/dist/server.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  DEFAULT_PORT,
3
3
  createServer,
4
4
  serveTarget
5
- } from "./chunk-GDZSTAIM.js";
6
- import "./chunk-3ZIKSFTQ.js";
5
+ } from "./chunk-Q6YFMIYD.js";
6
+ import "./chunk-XQ45L6Q4.js";
7
7
  export {
8
8
  DEFAULT_PORT,
9
9
  createServer,
package/openapi.yaml ADDED
@@ -0,0 +1,22 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: AWS Secrets Manager and SSM Parameter Store (Mockingbird subset)
4
+ version: "2017-10-17"
5
+ description: AWS JSON contracts used by the pinned Secrets Manager and SSM clients.
6
+ servers:
7
+ - url: https://secretsmanager.us-east-1.amazonaws.com
8
+ paths:
9
+ /:
10
+ post:
11
+ operationId: AwsSecretsRpc
12
+ x-mockingbird: { supported: true, parity: { enabled: true, safe: false } }
13
+ parameters:
14
+ - { name: X-Amz-Target, in: header, required: true, schema: { type: string } }
15
+ requestBody:
16
+ required: true
17
+ content:
18
+ application/x-amz-json-1.1: { schema: { type: object, additionalProperties: true } }
19
+ application/json: { schema: { type: object, additionalProperties: true } }
20
+ responses:
21
+ "200": { description: Operation response, content: { application/x-amz-json-1.1: { schema: { type: object, additionalProperties: true } } } }
22
+ "400": { description: AWS exception, content: { application/x-amz-json-1.1: { schema: { type: object, additionalProperties: true } } } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crvouga/mockingbird-service-aws-secrets",
3
- "version": "1.7.1",
3
+ "version": "2.0.0",
4
4
  "description": "Stateful AWS Secrets Manager and SSM Parameter Store mock with versions, stages, rotation, and redacted controls.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -8,7 +8,10 @@
8
8
  "files": [
9
9
  "dist",
10
10
  "README.md",
11
- "CHANGELOG.md"
11
+ "CHANGELOG.md",
12
+ "DISCOVERY.md",
13
+ "SUPPORT.md",
14
+ "openapi.yaml"
12
15
  ],
13
16
  "main": "./dist/index.js",
14
17
  "types": "./dist/index.d.ts",
@@ -57,7 +60,29 @@
57
60
  "docs": "https://docs.aws.amazon.com/secretsmanager/latest/apireference/"
58
61
  },
59
62
  "parity": "Secrets Manager and Parameter Store",
60
- "parityTier": "cold"
63
+ "parityTier": "cold",
64
+ "discovery": {
65
+ "guide": "DISCOVERY.md",
66
+ "behavior": "README.md",
67
+ "capabilities": "SUPPORT.md",
68
+ "contract": "openapi.yaml",
69
+ "types": "dist/index.d.ts",
70
+ "oracle": {
71
+ "kind": "Live vendor API or sandbox",
72
+ "command": "bun run parity:service -- aws-secrets",
73
+ "note": "Run from a Mockingbird checkout; credentials come only from .env.local or GitHub Actions secrets. Missing credentials exit 2."
74
+ },
75
+ "introspection": [
76
+ "GET /__admin/health",
77
+ "GET /__admin",
78
+ "GET /__admin/state",
79
+ "GET /__admin/requests",
80
+ "GET /__admin/metrics",
81
+ "GET /__admin/faults/presets",
82
+ "GET /__admin/ui"
83
+ ],
84
+ "reporting": "https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md"
85
+ }
61
86
  },
62
87
  "scripts": {
63
88
  "generate": "bun ../../openapi/codegen/dist/cli.js",
@@ -72,7 +97,7 @@
72
97
  "pack:check": "bun ../../../scripts/pack-check.ts"
73
98
  },
74
99
  "dependencies": {
75
- "@crvouga/mockingbird-service-sqlite": "1.3.0"
100
+ "@crvouga/mockingbird-service-sqlite": "2.0.0"
76
101
  },
77
102
  "devDependencies": {
78
103
  "@aws-sdk/client-secrets-manager": "3.1132.0",