@crvouga/mockingbird-service-elasticsearch 1.13.0 → 1.15.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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog — @crvouga/mockingbird-service-elasticsearch
2
2
 
3
+ ## 1.15.0 (2026-11-14)
4
+
5
+ ### Features
6
+
7
+ - expand in-process emulation and resolve Plane and streaming gaps ([e6733fd](https://github.com/crvouga/mockingbird/commit/e6733fd00f5dd03259f36cc0f452780a7e0deea4))
8
+ - add browser runtime polyfills and edge-snapping app cycle ([815b739](https://github.com/crvouga/mockingbird/commit/815b7399f1e058b89b3fa025f79a5014172b3ab8))
9
+ - run lab systems in browser PR previews ([df14882](https://github.com/crvouga/mockingbird/commit/df148828ca66db1e20cf9fa2fdf38b56b5116da4))
10
+ - publish the shared runtime once; services depend on it instead of inlining it ([4903c4a](https://github.com/crvouga/mockingbird/commit/4903c4a748fd801001ad3fd34b6016b55e0f9953))
11
+
12
+ ### Dependencies
13
+
14
+ - `@crvouga/mockingbird-runtime`
15
+
16
+ ## 1.14.0 (2026-11-13)
17
+
18
+ ### Features
19
+
20
+ - add transcript storage, signature and meetings; tags, teams, messages, macros and calls ([ee21e12](https://github.com/crvouga/mockingbird/commit/ee21e12024768bd52c6902b1722fb35a94d2444b))
21
+
3
22
  ## 1.13.0 (2026-11-12)
4
23
 
5
24
  ### Features
@@ -0,0 +1,82 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+
19
+ // <define:__MOCKINGBIRD_ADMIN_BRAND__>
20
+ var define_MOCKINGBIRD_ADMIN_BRAND_default = { vendor: "Amazon Web Services", website: "https://aws.amazon.com/", docs: "https://docs.aws.amazon.com/", guide: "https://mockingbird.chrisvouga.dev/services/elasticsearch", logo: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAAAsSAAALEgHS3X78AAALp0lEQVR4nO2dT0hbWx7Hf52ZZZLFm/cgE4VZTCSkm9FHIBs7PKGCfY+68A9dZBOpC2VQcWGLKGWQSmldSO1CZ6joJvMIT7tQxgoRUscwkEcYAwMVaZYqwvBmkWQzbzOziEdv7j33T/yZexL7/aza5N6b672fe87v/M6fe+d3v//D/wiAa/IL1ScAmhsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWv1J9AlrCoSBFI+10N9RGLQG/dJtsLk9Hx58olc64fHbu0N3VSeFQG0Uj7YbvTs/O6ePxp4trUFBwdkbuqH5bT2vAT/HYIHV3dZpKI6NYKtN6YoOWVtak3y8vzlN3V2fVZ6l0hkYnZxwdf3ZqjOKxgarPTs/O6eGjx1QslW33D4eClHj7mnxeT9Xn33z7iE7Ozg3bx2MDNBQbdHwNiqUyvdvapaWVNUfnUy+UVmGzU2P0YSdJ8dhATfIQEfm8HhofidN2ctVwk4iISpKLWnm6g46OrZeHiKg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BFhAIsIBAgAUEAiwgEGABgQALCARYQCDAAgIBFhAIsIBAgAUEAiwgEGABgQCL/wMxYZPhdjCdcgAAAABJRU5ErkJggg==", color: "#FF9900", description: "Elasticsearch Service public AWS API." };
21
+
22
+ // mockingbird-service-runtime:@crvouga/mockingbird-runtime/service
23
+ var service_exports = {};
24
+ __export(service_exports, {
25
+ PACKAGE_VERSION: () => PACKAGE_VERSION,
26
+ createRuntime: () => createRuntime
27
+ });
28
+ __reExport(service_exports, service_star);
29
+ import * as service_star from "@crvouga/mockingbird-runtime/service";
30
+ import { PACKAGE_VERSION as SHARED_VERSION, createRuntime as sharedRuntime } from "@crvouga/mockingbird-runtime/service";
31
+ var PACKAGE_VERSION = true ? "1.15.0" : SHARED_VERSION;
32
+ var ADMIN_BRAND = typeof define_MOCKINGBIRD_ADMIN_BRAND_default === "object" ? define_MOCKINGBIRD_ADMIN_BRAND_default : void 0;
33
+ var createRuntime = (options) => sharedRuntime({
34
+ ...options,
35
+ version: options.version ?? PACKAGE_VERSION,
36
+ adminBrand: options.adminBrand ?? ADMIN_BRAND
37
+ });
38
+
39
+ // src/generated/openapi.ts
40
+ var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"Amazon Elasticsearch Service (Mockingbird subset)","version":"1.0.0","description":"AWS protocol transport; README lists the implemented AWS operations."},"servers":[{"url":"https://elasticsearch.us-east-1.amazonaws.com"}],"paths":{"/":{"post":{"operationId":"AwsRpc","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS protocol response"},"400":{"description":"AWS protocol error"}}},"get":{"operationId":"AwsQuery","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS query response"}}}},"/{path}":{"parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"AwsRestGet","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS REST response"}}},"put":{"operationId":"AwsRestPut","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS REST response"}}},"post":{"operationId":"AwsRestPost","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS REST response"}}},"patch":{"operationId":"AwsRestPatch","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS REST response"}}},"delete":{"operationId":"AwsRestDelete","x-mockingbird":{"supported":false,"reason":"Vendor operations are not implemented in this scaffold.","parity":{"enabled":false,"reason":"Use the stateful LocalStack scenario runner."}},"responses":{"200":{"description":"AWS REST response"}}}}}}`);
41
+ var operationIds = ["AwsQuery", "AwsRpc", "AwsRestGet", "AwsRestPut", "AwsRestPost", "AwsRestDelete", "AwsRestPatch"];
42
+ var supportedOperationIds = [];
43
+
44
+ // src/runtime.ts
45
+ var createRuntime2 = (options = {}) => createRuntime({
46
+ name: "elasticsearch",
47
+ document,
48
+ credential: service_exports.sigV4AccessKeyId,
49
+ ...options.sqlite ? { sqlite: options.sqlite } : {},
50
+ ...options.clock ? { clock: options.clock } : {},
51
+ ...options.seed !== void 0 ? { seed: options.seed } : {},
52
+ ...options.adminPrefix !== void 0 ? { adminPrefix: options.adminPrefix } : {},
53
+ ...options.adminKey !== void 0 ? { adminKey: options.adminKey } : {},
54
+ ...options.adminControls !== void 0 ? { adminControls: options.adminControls } : {},
55
+ ...options.onLog ? { onLog: options.onLog } : {},
56
+ create: ({ sqlite, namespace, clock }) => new ElasticsearchAPI({
57
+ sqlite,
58
+ namespace,
59
+ now: clock.now,
60
+ ...options.region ? { region: options.region } : {},
61
+ ...options.accountId ? { accountId: options.accountId } : {}
62
+ })
63
+ });
64
+
65
+ // src/index.ts
66
+ var ElasticsearchAPI = class extends service_exports.AwsProtocolAPI {
67
+ constructor(options = {}) {
68
+ super("elasticsearch", options);
69
+ }
70
+ dispatch({ operation }) {
71
+ return this.unsupported(operation);
72
+ }
73
+ };
74
+
75
+ export {
76
+ document,
77
+ operationIds,
78
+ supportedOperationIds,
79
+ createRuntime2 as createRuntime,
80
+ ElasticsearchAPI
81
+ };
82
+ //# sourceMappingURL=chunk-6XOLU6GX.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["<define:__MOCKINGBIRD_ADMIN_BRAND__>", "mockingbird-service-runtime:@crvouga/mockingbird-runtime/service", "../src/generated/openapi.ts", "../src/runtime.ts", "../src/index.ts"],
4
+ "sourcesContent": ["{\"vendor\":\"Amazon Web Services\",\"website\":\"https://aws.amazon.com/\",\"docs\":\"https://docs.aws.amazon.com/\",\"guide\":\"https://mockingbird.chrisvouga.dev/services/elasticsearch\",\"logo\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAAAsSAAALEgHS3X78AAALp0lEQVR4nO2dT0hbWx7Hf52ZZZLFm/cgE4VZTCSkm9FHIBs7PKGCfY+68A9dZBOpC2VQcWGLKGWQSmldSO1CZ6joJvMIT7tQxgoRUscwkEcYAwMVaZYqwvBmkWQzbzOziEdv7j33T/yZexL7/aza5N6b672fe87v/M6fe+d3v//D/wiAa/IL1ScAmhsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIBFhAIMACAgEWEAiwgECABQQCLCAQYAGBAAsIB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I5CW/t4e6ut90DQdjlYcHRdoPfFDzekJ0X2hUh6iJhVIUOt6go2CmMu+ufX+2jdelMip9IHSF640tUBahExmC0apRrzeSvUNv2lujUB6tG8/ViGUeEXC0cVblm9r9vzWCqRHNKvDobYbfX2kkKOSJvh0+ZrKz4XPRiArZPkasSY10dXALkEtr5u67UAgwALzwgALCARYQCDAAgIBFhAIsIBAgAUEAiwgEGABgQALCARYQCDAAgIBFhAIsIBAgAUEAiwgEGABgQALCARYQCDAAgIBFhAIsIBAgAUEAiwgEGABgQALCARYQCDAAgIBFhAIsIBAgAUEAiwgEGABgQALCARYQCDAAgIBFhAIsIBAgAUEAiwgEGABgQCL/wMxYZPhdjCdcgAAAABJRU5ErkJggg==\",\"color\":\"#FF9900\",\"description\":\"Elasticsearch Service public AWS API.\"}", "export * from \"@crvouga/mockingbird-runtime/service\"\nimport { PACKAGE_VERSION as SHARED_VERSION, createRuntime as sharedRuntime } from \"@crvouga/mockingbird-runtime/service\"\nexport const PACKAGE_VERSION =\n typeof __MOCKINGBIRD_PACKAGE_VERSION__ === \"string\" ? __MOCKINGBIRD_PACKAGE_VERSION__ : SHARED_VERSION\nconst ADMIN_BRAND =\n typeof __MOCKINGBIRD_ADMIN_BRAND__ === \"object\" ? __MOCKINGBIRD_ADMIN_BRAND__ : undefined\nexport const createRuntime = (options) =>\n sharedRuntime({\n ...options,\n version: options.version ?? PACKAGE_VERSION,\n adminBrand: options.adminBrand ?? ADMIN_BRAND,\n })\n", "// Generated by @crvouga/mockingbird-openapi-codegen from openapi.yaml. Do not edit.\n\nimport type { OpenAPIDocument } from \"@crvouga/mockingbird-openapi\"\n\nexport const document: OpenAPIDocument = JSON.parse(`{\"openapi\":\"3.1.0\",\"info\":{\"title\":\"Amazon Elasticsearch Service (Mockingbird subset)\",\"version\":\"1.0.0\",\"description\":\"AWS protocol transport; README lists the implemented AWS operations.\"},\"servers\":[{\"url\":\"https://elasticsearch.us-east-1.amazonaws.com\"}],\"paths\":{\"/\":{\"post\":{\"operationId\":\"AwsRpc\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS protocol response\"},\"400\":{\"description\":\"AWS protocol error\"}}},\"get\":{\"operationId\":\"AwsQuery\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS query response\"}}}},\"/{path}\":{\"parameters\":[{\"name\":\"path\",\"in\":\"path\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"get\":{\"operationId\":\"AwsRestGet\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS REST response\"}}},\"put\":{\"operationId\":\"AwsRestPut\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS REST response\"}}},\"post\":{\"operationId\":\"AwsRestPost\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS REST response\"}}},\"patch\":{\"operationId\":\"AwsRestPatch\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS REST response\"}}},\"delete\":{\"operationId\":\"AwsRestDelete\",\"x-mockingbird\":{\"supported\":false,\"reason\":\"Vendor operations are not implemented in this scaffold.\",\"parity\":{\"enabled\":false,\"reason\":\"Use the stateful LocalStack scenario runner.\"}},\"responses\":{\"200\":{\"description\":\"AWS REST response\"}}}}}}`) as OpenAPIDocument\n\nexport type OperationId = \"AwsQuery\" | \"AwsRpc\" | \"AwsRestGet\" | \"AwsRestPut\" | \"AwsRestPost\" | \"AwsRestDelete\" | \"AwsRestPatch\"\nexport type SupportedOperationId = never\nexport const operationIds = [\"AwsQuery\",\"AwsRpc\",\"AwsRestGet\",\"AwsRestPut\",\"AwsRestPost\",\"AwsRestDelete\",\"AwsRestPatch\"] as const\nexport const supportedOperationIds = [] as const\n", "import {\n type Clock,\n type MockControls,\n type RequestLog,\n type ServiceRuntime,\n createRuntime as serviceRuntime,\n sigV4AccessKeyId,\n} from \"@crvouga/mockingbird-service\"\nimport type { SqliteClient } from \"@crvouga/mockingbird-sqlite\"\nimport { document } from \"./generated/openapi.js\"\nimport { ElasticsearchAPI } from \"./index.js\"\nexport type RuntimeOptions = {\n sqlite?: SqliteClient\n clock?: Clock\n seed?: number | string\n region?: string\n accountId?: string\n adminPrefix?: string\n adminKey?: string\n /** Admin controls to boot with: clock, latency, faults, seed, a starting snapshot. */\n adminControls?: MockControls\n onLog?: (entry: RequestLog) => void\n}\nexport type Runtime = ServiceRuntime<ElasticsearchAPI>\nexport const createRuntime = (options: RuntimeOptions = {}): Runtime =>\n serviceRuntime({\n name: \"elasticsearch\",\n document,\n credential: sigV4AccessKeyId,\n ...(options.sqlite ? { sqlite: options.sqlite } : {}),\n ...(options.clock ? { clock: options.clock } : {}),\n ...(options.seed !== undefined ? { seed: options.seed } : {}),\n ...(options.adminPrefix !== undefined ? { adminPrefix: options.adminPrefix } : {}),\n ...(options.adminKey !== undefined ? { adminKey: options.adminKey } : {}),\n ...(options.adminControls !== undefined ? { adminControls: options.adminControls } : {}),\n ...(options.onLog ? { onLog: options.onLog } : {}),\n create: ({ sqlite, namespace, clock }) =>\n new ElasticsearchAPI({\n sqlite,\n namespace,\n now: clock.now,\n ...(options.region ? { region: options.region } : {}),\n ...(options.accountId ? { accountId: options.accountId } : {}),\n }),\n })\n", "import {\n type AwsOperation,\n AwsProtocolAPI,\n type AwsProtocolOptions,\n} from \"@crvouga/mockingbird-service\"\nimport { document, operationIds, supportedOperationIds } from \"./generated/openapi.js\"\n\nexport type { Runtime, RuntimeOptions } from \"./runtime.js\"\nexport { createRuntime } from \"./runtime.js\"\nexport { document, operationIds, supportedOperationIds }\nexport type APIOptions = AwsProtocolOptions\nexport class ElasticsearchAPI extends AwsProtocolAPI {\n constructor(options: APIOptions = {}) {\n super(\"elasticsearch\", options)\n }\n dispatch({ operation }: AwsOperation): unknown {\n return this.unsupported(operation)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA,+CAAC,QAAS,uBAAsB,SAAU,2BAA0B,MAAO,gCAA+B,OAAQ,6DAA4D,MAAO,8gIAA6gI,OAAQ,WAAU,aAAc,wCAAuC;;;ACAzwI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAAc;AACd,SAAS,mBAAmB,gBAAgB,iBAAiB,qBAAqB;AAC3E,IAAM,kBACX,OAAsD,sBAAkC;AAC1F,IAAM,cACJ,OAAO,2CAAgC,WAAW,yCAA8B;AAC3E,IAAM,gBAAgB,CAAC,YAC5B,cAAc;AAAA,EACZ,GAAG;AAAA,EACH,SAAS,QAAQ,WAAW;AAAA,EAC5B,YAAY,QAAQ,cAAc;AACpC,CAAC;;;ACPI,IAAM,WAA4B,KAAK,MAAM,i0EAAi0E;AAI92E,IAAM,eAAe,CAAC,YAAW,UAAS,cAAa,cAAa,eAAc,iBAAgB,cAAc;AAChH,IAAM,wBAAwB,CAAC;;;ACe/B,IAAMA,iBAAgB,CAAC,UAA0B,CAAC,MACvD,cAAe;AAAA,EACb,MAAM;AAAA,EACN;AAAA,EACA,YAAY;AAAA,EACZ,GAAI,QAAQ,SAAS,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;AAAA,EACnD,GAAI,QAAQ,QAAQ,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;AAAA,EAChD,GAAI,QAAQ,SAAS,SAAY,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC;AAAA,EAC3D,GAAI,QAAQ,gBAAgB,SAAY,EAAE,aAAa,QAAQ,YAAY,IAAI,CAAC;AAAA,EAChF,GAAI,QAAQ,aAAa,SAAY,EAAE,UAAU,QAAQ,SAAS,IAAI,CAAC;AAAA,EACvE,GAAI,QAAQ,kBAAkB,SAAY,EAAE,eAAe,QAAQ,cAAc,IAAI,CAAC;AAAA,EACtF,GAAI,QAAQ,QAAQ,EAAE,OAAO,QAAQ,MAAM,IAAI,CAAC;AAAA,EAChD,QAAQ,CAAC,EAAE,QAAQ,WAAW,MAAM,MAClC,IAAI,iBAAiB;AAAA,IACnB;AAAA,IACA;AAAA,IACA,KAAK,MAAM;AAAA,IACX,GAAI,QAAQ,SAAS,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;AAAA,IACnD,GAAI,QAAQ,YAAY,EAAE,WAAW,QAAQ,UAAU,IAAI,CAAC;AAAA,EAC9D,CAAC;AACL,CAAC;;;ACjCI,IAAM,mBAAN,cAA+B,+BAAe;AAAA,EACnD,YAAY,UAAsB,CAAC,GAAG;AACpC,UAAM,iBAAiB,OAAO;AAAA,EAChC;AAAA,EACA,SAAS,EAAE,UAAU,GAA0B;AAC7C,WAAO,KAAK,YAAY,SAAS;AAAA,EACnC;AACF;",
6
+ "names": ["createRuntime"]
7
+ }
@@ -0,0 +1,31 @@
1
+ import {
2
+ createRuntime
3
+ } from "./chunk-6XOLU6GX.js";
4
+
5
+ // src/server.ts
6
+ import { listen } from "@crvouga/mockingbird-runtime/adapter-node";
7
+ var DEFAULT_PORT = 8922;
8
+ var createServer = async (options = {}) => {
9
+ const { port, host, ...rest } = options;
10
+ const runtime = createRuntime(rest);
11
+ return { ...await listen(runtime, { port: port ?? 0, ...host ? { host } : {} }), runtime };
12
+ };
13
+ var serveTarget = {
14
+ name: "elasticsearch",
15
+ defaultPort: DEFAULT_PORT,
16
+ create: (_values, common) => createRuntime({
17
+ ...common.adminPrefix !== void 0 ? { adminPrefix: common.adminPrefix } : {},
18
+ ...common.adminKey !== void 0 ? { adminKey: common.adminKey } : {},
19
+ ...common.adminControls !== void 0 ? { adminControls: common.adminControls } : {},
20
+ ...common.seed !== void 0 ? { seed: common.seed } : {},
21
+ ...common.onLog ? { onLog: common.onLog } : {}
22
+ }),
23
+ banner: () => ["Point the AWS SDK endpoint at this server"]
24
+ };
25
+
26
+ export {
27
+ DEFAULT_PORT,
28
+ createServer,
29
+ serveTarget
30
+ };
31
+ //# sourceMappingURL=chunk-MWQVS43W.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/server.ts"],
4
+ "sourcesContent": ["/// <reference types=\"node\" />\nimport { type Listening, listen, type ServeTarget } from \"@crvouga/mockingbird-adapter-node\"\nimport { createRuntime, type Runtime, type RuntimeOptions } from \"./runtime.js\"\nexport const DEFAULT_PORT = 8922\nexport type ServerOptions = RuntimeOptions & { port?: number; host?: string }\nexport const createServer = async (\n options: ServerOptions = {},\n): Promise<Listening & { runtime: Runtime }> => {\n const { port, host, ...rest } = options\n const runtime = createRuntime(rest)\n return { ...(await listen(runtime, { port: port ?? 0, ...(host ? { host } : {}) })), runtime }\n}\nexport const serveTarget: ServeTarget = {\n name: \"elasticsearch\",\n defaultPort: DEFAULT_PORT,\n create: (_values, common) =>\n createRuntime({\n ...(common.adminPrefix !== undefined ? { adminPrefix: common.adminPrefix } : {}),\n ...(common.adminKey !== undefined ? { adminKey: common.adminKey } : {}),\n ...(common.adminControls !== undefined ? { adminControls: common.adminControls } : {}),\n ...(common.seed !== undefined ? { seed: common.seed } : {}),\n ...(common.onLog ? { onLog: common.onLog } : {}),\n }),\n banner: () => [\"Point the AWS SDK endpoint at this server\"],\n}\n"],
5
+ "mappings": ";;;;;AACA,SAAyB,cAAgC;AAElD,IAAM,eAAe;AAErB,IAAM,eAAe,OAC1B,UAAyB,CAAC,MACoB;AAC9C,QAAM,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAChC,QAAM,UAAU,cAAc,IAAI;AAClC,SAAO,EAAE,GAAI,MAAM,OAAO,SAAS,EAAE,MAAM,QAAQ,GAAG,GAAI,OAAO,EAAE,KAAK,IAAI,CAAC,EAAG,CAAC,GAAI,QAAQ;AAC/F;AACO,IAAM,cAA2B;AAAA,EACtC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ,CAAC,SAAS,WAChB,cAAc;AAAA,IACZ,GAAI,OAAO,gBAAgB,SAAY,EAAE,aAAa,OAAO,YAAY,IAAI,CAAC;AAAA,IAC9E,GAAI,OAAO,aAAa,SAAY,EAAE,UAAU,OAAO,SAAS,IAAI,CAAC;AAAA,IACrE,GAAI,OAAO,kBAAkB,SAAY,EAAE,eAAe,OAAO,cAAc,IAAI,CAAC;AAAA,IACpF,GAAI,OAAO,SAAS,SAAY,EAAE,MAAM,OAAO,KAAK,IAAI,CAAC;AAAA,IACzD,GAAI,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AAAA,EAChD,CAAC;AAAA,EACH,QAAQ,MAAM,CAAC,2CAA2C;AAC5D;",
6
+ "names": []
7
+ }
package/dist/cli.js CHANGED
@@ -1,13 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- runCli,
4
- serveCommand,
5
3
  serveTarget
6
- } from "./chunk-AF2PIWCW.js";
7
- import "./chunk-HRHCY374.js";
8
- import "./chunk-JJHVNIP7.js";
4
+ } from "./chunk-MWQVS43W.js";
5
+ import "./chunk-6XOLU6GX.js";
9
6
 
10
7
  // src/cli.ts
8
+ import { runCli, serveCommand } from "@crvouga/mockingbird-runtime/adapter-node";
11
9
  var code = await runCli(
12
10
  {
13
11
  bin: "mockingbird-elasticsearch",
package/dist/cli.js.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/cli.ts"],
4
4
  "sourcesContent": ["#!/usr/bin/env node\n/// <reference types=\"node\" />\nimport { runCli, serveCommand } from \"@crvouga/mockingbird-adapter-node\"\nimport { serveTarget } from \"./server.js\"\n\nconst code = await runCli(\n {\n bin: \"mockingbird-elasticsearch\",\n description: \"stateful Amazon Elasticsearch Service mock\",\n commands: { serve: serveCommand(serveTarget) },\n },\n process.argv.slice(2),\n)\nif (code !== 0) process.exitCode = code\n"],
5
- "mappings": ";;;;;;;;;;AAKA,IAAM,OAAO,MAAM;AAAA,EACjB;AAAA,IACE,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU,EAAE,OAAO,aAAa,WAAW,EAAE;AAAA,EAC/C;AAAA,EACA,QAAQ,KAAK,MAAM,CAAC;AACtB;AACA,IAAI,SAAS,EAAG,SAAQ,WAAW;",
5
+ "mappings": ";;;;;;;AAEA,SAAS,QAAQ,oBAAoB;AAGrC,IAAM,OAAO,MAAM;AAAA,EACjB;AAAA,IACE,KAAK;AAAA,IACL,aAAa;AAAA,IACb,UAAU,EAAE,OAAO,aAAa,WAAW,EAAE;AAAA,EAC/C;AAAA,EACA,QAAQ,KAAK,MAAM,CAAC;AACtB;AACA,IAAI,SAAS,EAAG,SAAQ,WAAW;",
6
6
  "names": []
7
7
  }
package/dist/index.d.ts CHANGED
@@ -101,145 +101,6 @@ interface FetchAPI {
101
101
  /** A bare function form of {@link FetchAPI}, compatible with `Bun.serve`, workerd, and Deno. */
102
102
  type FetchHandler = (request: Request) => Promise<Response>;
103
103
 
104
- /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
105
- type SqliteValue$1 = null | number | bigint | string | Uint8Array | boolean;
106
- /** Mutation counters returned by {@link SqliteStatement.run}. */
107
- type SqliteRunResult$1 = {
108
- changes: number;
109
- lastInsertRowid: number | bigint;
110
- };
111
- /**
112
- * Prepared statement bound to a {@link SqliteClient}.
113
- *
114
- * Pass bind values as rest arguments on each call (no sticky `bind()`).
115
- */
116
- interface SqliteStatement$1 {
117
- run(...params: SqliteValue$1[]): SqliteRunResult$1;
118
- all<T = Record<string, unknown>>(...params: SqliteValue$1[]): T[];
119
- get<T = Record<string, unknown>>(...params: SqliteValue$1[]): T | undefined;
120
- }
121
- /**
122
- * Sync SQLite client port owned by Mockingbird.
123
- *
124
- * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
125
- * `bun:sqlite` instances all work when they expose this surface.
126
- */
127
- interface SqliteClient$1 {
128
- exec(sql: string): void;
129
- prepare(sql: string): SqliteStatement$1;
130
- transaction<T>(fn: () => T): T;
131
- }
132
-
133
- /** Every stored record carries a monotonically increasing sequence for stable ordering. */
134
- type Stored<T> = {
135
- seq: number;
136
- value: T;
137
- };
138
- type ListRecordsOptions<T> = {
139
- /** Keep only records passing the predicate. */
140
- where?: (value: T, seq: number) => boolean;
141
- /** Sort order; default newest first. */
142
- order?: "newest" | "oldest";
143
- };
144
- /**
145
- * A SQLite-backed table of JSON records addressed by id. Ordering is by insertion
146
- * sequence, never by id lexicographic order, so list semantics stay stable.
147
- */
148
- declare class Collection<T> {
149
- private readonly sqlite;
150
- /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
151
- readonly namespace: string;
152
- /** Table name inside the namespace. Stable across resets of the rows themselves. */
153
- readonly collectionName: string;
154
- private readonly statements;
155
- private prepare;
156
- constructor(sqlite: SqliteClient$1,
157
- /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
158
- namespace: string,
159
- /** Table name inside the namespace. Stable across resets of the rows themselves. */
160
- collectionName: string);
161
- private bumpCollectionSeq;
162
- nextSequence(): number;
163
- get(id: string): T | undefined;
164
- has(id: string): boolean;
165
- /** Insert a new record, assigning it the next sequence number. */
166
- insert(id: string, value: T): Stored<T>;
167
- /** Replace an existing record's value, keeping its position. */
168
- update(id: string, value: T): Stored<T> | undefined;
169
- delete(id: string): boolean;
170
- /** How many records the collection holds, without reading them. */
171
- count(): number;
172
- list(options?: ListRecordsOptions<T>): Array<Stored<T> & {
173
- id: string;
174
- }>;
175
- }
176
-
177
- /**
178
- * What names an id base: a non-negative safe integer (or its decimal string) or `"boot"`,
179
- * which derives the base from the wall clock when the runtime is created.
180
- */
181
- type IdBase = number | string;
182
- /**
183
- * Sequential id source persisted in SQLite. Ids are deterministic for a given
184
- * sequence history (`cus_` + 14 opaque chars), so reproductions stay stable.
185
- * A runtime's `idBase` is mixed in, so a different base reissues none of another's ids.
186
- */
187
- declare class IdSequence {
188
- private readonly sqlite;
189
- private readonly namespace;
190
- private readonly salt;
191
- constructor(sqlite: SqliteClient$1, namespace: string, salt?: string);
192
- next(prefix: string, length?: number): string;
193
- }
194
-
195
- /** Options every provider constructor accepts. */
196
- type APIOptions$1 = {
197
- /** Sync SQLite client. Defaults to `@crvouga/mockingbird-service-sqlite`. */
198
- sqlite?: SqliteClient$1;
199
- /** Clock used for `created`-style fields. Default `Date.now`. */
200
- now?: () => number;
201
- /**
202
- * Storage namespace for this instance's records. Instances sharing one SQLite
203
- * client stay isolated when their namespaces differ. Defaults to the service name.
204
- */
205
- namespace?: string;
206
- };
207
-
208
- type AwsInput = Record<string, unknown>;
209
- type AwsProtocolOptions = APIOptions$1 & {
210
- region?: string;
211
- accountId?: string;
212
- };
213
- type AwsOperation = {
214
- operation: string;
215
- input: AwsInput;
216
- request: Request;
217
- url: URL;
218
- };
219
- /** Fetch-native AWS wire transport. Service subclasses own operations and persisted state. */
220
- declare abstract class AwsProtocolAPI {
221
- readonly service: string;
222
- readonly sqlite: SqliteClient$1;
223
- readonly namespace: string;
224
- readonly now: () => number;
225
- readonly region: string;
226
- readonly accountId: string;
227
- readonly ids: IdSequence;
228
- private readonly collections;
229
- constructor(service: string, options?: AwsProtocolOptions);
230
- collection(name: string): Collection<AwsInput>;
231
- arn(type: string, name: string, service?: string): string;
232
- reset(): Promise<void>;
233
- abstract dispatch(context: AwsOperation): unknown | Promise<unknown>;
234
- route(_method: string, _pathname: string): {
235
- operation: string;
236
- params: AwsInput;
237
- } | undefined;
238
- fetch(request: Request): Promise<Response>;
239
- unsupported(operation: string): never;
240
- get(collection: string, id: string, code?: string): AwsInput;
241
- }
242
-
243
104
  /**
244
105
  * The single source of time for a service.
245
106
  *
@@ -270,6 +131,11 @@ type Clock = {
270
131
  state(): ClockState;
271
132
  };
272
133
 
134
+ type UpstreamState = {
135
+ mode: "emulated" | "forward";
136
+ baseUrl: string;
137
+ };
138
+
273
139
  /**
274
140
  * Seeded pseudo-random numbers, so anything a mock invents — ids, jitter, which
275
141
  * request a percentage fault hits — is reproducible from a seed.
@@ -533,6 +399,7 @@ declare const SNAPSHOT_FORMAT = "mockingbird.snapshot/v1";
533
399
  * `records` are required, so a hand-written seed file is a valid snapshot.
534
400
  */
535
401
  type SnapshotDocument = {
402
+ upstream?: UpstreamState;
536
403
  format: typeof SNAPSHOT_FORMAT;
537
404
  /** The service that wrote it. A snapshot is rejected by any other service. */
538
405
  service?: string;
@@ -606,6 +473,7 @@ type LatencyState = LatencyRule & {
606
473
  };
607
474
  /** What {@link controlHeaders} turns into request headers. */
608
475
  type ControlHeaderInput = {
476
+ upstream?: "emulated" | "forward";
609
477
  namespace?: string;
610
478
  adminKey?: string;
611
479
  branch?: string;
@@ -623,6 +491,48 @@ type ControlHeaderInput = {
623
491
  snapshot?: string;
624
492
  };
625
493
 
494
+ /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
495
+ type SqliteValue$1 = null | number | bigint | string | Uint8Array | boolean;
496
+ /** Mutation counters returned by {@link SqliteStatement.run}. */
497
+ type SqliteRunResult$1 = {
498
+ changes: number;
499
+ lastInsertRowid: number | bigint;
500
+ };
501
+ /**
502
+ * Prepared statement bound to a {@link SqliteClient}.
503
+ *
504
+ * Pass bind values as rest arguments on each call (no sticky `bind()`).
505
+ */
506
+ interface SqliteStatement$1 {
507
+ run(...params: SqliteValue$1[]): SqliteRunResult$1;
508
+ all<T = Record<string, unknown>>(...params: SqliteValue$1[]): T[];
509
+ get<T = Record<string, unknown>>(...params: SqliteValue$1[]): T | undefined;
510
+ }
511
+ /**
512
+ * Sync SQLite client port owned by Mockingbird.
513
+ *
514
+ * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
515
+ * `bun:sqlite` instances all work when they expose this surface.
516
+ */
517
+ interface SqliteClient$1 {
518
+ exec(sql: string): void;
519
+ prepare(sql: string): SqliteStatement$1;
520
+ transaction<T>(fn: () => T): T;
521
+ }
522
+
523
+ /** Options every provider constructor accepts. */
524
+ type APIOptions$1 = {
525
+ /** Sync SQLite client. Defaults to `@crvouga/mockingbird-service-sqlite`. */
526
+ sqlite?: SqliteClient$1;
527
+ /** Clock used for `created`-style fields. Default `Date.now`. */
528
+ now?: () => number;
529
+ /**
530
+ * Storage namespace for this instance's records. Instances sharing one SQLite
531
+ * client stay isolated when their namespaces differ. Defaults to the service name.
532
+ */
533
+ namespace?: string;
534
+ };
535
+
626
536
  /**
627
537
  * One problem with a request body, at a dotted path (`patient.address.city`, `items.0.sku`).
628
538
  * `kind` is `media_type` when the body is present but its media type is not one the operation
@@ -649,6 +559,7 @@ type RejectedRequest = {
649
559
  };
650
560
  /** One handled request, as the structured log sees it. */
651
561
  type RequestLog = {
562
+ upstream?: boolean;
652
563
  service: string;
653
564
  namespace: string;
654
565
  operationId: string | undefined;
@@ -783,8 +694,6 @@ type CredentialRegistry = {
783
694
  }[];
784
695
  };
785
696
 
786
- type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
787
-
788
697
  /**
789
698
  * A point-in-time copy of everything a service namespace holds.
790
699
  *
@@ -807,6 +716,50 @@ type NamespaceSnapshot = {
807
716
  }[];
808
717
  };
809
718
 
719
+ /** Every stored record carries a monotonically increasing sequence for stable ordering. */
720
+ type Stored<T> = {
721
+ seq: number;
722
+ value: T;
723
+ };
724
+ type ListRecordsOptions<T> = {
725
+ /** Keep only records passing the predicate. */
726
+ where?: (value: T, seq: number) => boolean;
727
+ /** Sort order; default newest first. */
728
+ order?: "newest" | "oldest";
729
+ };
730
+ /**
731
+ * A SQLite-backed table of JSON records addressed by id. Ordering is by insertion
732
+ * sequence, never by id lexicographic order, so list semantics stay stable.
733
+ */
734
+ declare class Collection<T> {
735
+ private readonly sqlite;
736
+ /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
737
+ readonly namespace: string;
738
+ /** Table name inside the namespace. Stable across resets of the rows themselves. */
739
+ readonly collectionName: string;
740
+ private readonly statements;
741
+ private prepare;
742
+ constructor(sqlite: SqliteClient$1,
743
+ /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
744
+ namespace: string,
745
+ /** Table name inside the namespace. Stable across resets of the rows themselves. */
746
+ collectionName: string);
747
+ private bumpCollectionSeq;
748
+ nextSequence(): number;
749
+ get(id: string): T | undefined;
750
+ has(id: string): boolean;
751
+ /** Insert a new record, assigning it the next sequence number. */
752
+ insert(id: string, value: T): Stored<T>;
753
+ /** Replace an existing record's value, keeping its position. */
754
+ update(id: string, value: T): Stored<T> | undefined;
755
+ delete(id: string): boolean;
756
+ /** How many records the collection holds, without reading them. */
757
+ count(): number;
758
+ list(options?: ListRecordsOptions<T>): Array<Stored<T> & {
759
+ id: string;
760
+ }>;
761
+ }
762
+
810
763
  declare const STATE_FIELD_KINDS: readonly ["string", "number", "boolean", "null", "object", "array", "unknown"];
811
764
  type StateFieldKind = (typeof STATE_FIELD_KINDS)[number];
812
765
  /** JSON-safe annotations a bespoke admin UI may read. The default UI shows them as text. */
@@ -837,6 +790,61 @@ type StateView = {
837
790
  collections: StateCollectionView[];
838
791
  };
839
792
 
793
+ /**
794
+ * What names an id base: a non-negative safe integer (or its decimal string) or `"boot"`,
795
+ * which derives the base from the wall clock when the runtime is created.
796
+ */
797
+ type IdBase = number | string;
798
+ /**
799
+ * Sequential id source persisted in SQLite. Ids are deterministic for a given
800
+ * sequence history (`cus_` + 14 opaque chars), so reproductions stay stable.
801
+ * A runtime's `idBase` is mixed in, so a different base reissues none of another's ids.
802
+ */
803
+ declare class IdSequence {
804
+ private readonly sqlite;
805
+ private readonly namespace;
806
+ private readonly salt;
807
+ constructor(sqlite: SqliteClient$1, namespace: string, salt?: string);
808
+ next(prefix: string, length?: number): string;
809
+ }
810
+
811
+ type AwsInput = Record<string, unknown>;
812
+ type AwsProtocolOptions = APIOptions$1 & {
813
+ region?: string;
814
+ accountId?: string;
815
+ };
816
+ type AwsOperation = {
817
+ operation: string;
818
+ input: AwsInput;
819
+ request: Request;
820
+ url: URL;
821
+ };
822
+ /** Fetch-native AWS wire transport. Service subclasses own operations and persisted state. */
823
+ declare abstract class AwsProtocolAPI {
824
+ readonly service: string;
825
+ readonly sqlite: SqliteClient$1;
826
+ readonly namespace: string;
827
+ readonly now: () => number;
828
+ readonly region: string;
829
+ readonly accountId: string;
830
+ readonly ids: IdSequence;
831
+ private readonly collections;
832
+ constructor(service: string, options?: AwsProtocolOptions);
833
+ collection(name: string): Collection<AwsInput>;
834
+ arn(type: string, name: string, service?: string): string;
835
+ reset(): Promise<void>;
836
+ abstract dispatch(context: AwsOperation): unknown | Promise<unknown>;
837
+ route(_method: string, _pathname: string): {
838
+ operation: string;
839
+ params: AwsInput;
840
+ } | undefined;
841
+ fetch(request: Request): Promise<Response>;
842
+ unsupported(operation: string): never;
843
+ get(collection: string, id: string, code?: string): AwsInput;
844
+ }
845
+
846
+ type OwnedTransport = (request: Request, namespace: string, send: typeof fetch) => Promise<Response>;
847
+
840
848
  type WebhookEndpoint = {
841
849
  /** Stable id; generated when omitted. */
842
850
  id?: string;
package/dist/index.js CHANGED
@@ -4,8 +4,7 @@ import {
4
4
  document,
5
5
  operationIds,
6
6
  supportedOperationIds
7
- } from "./chunk-HRHCY374.js";
8
- import "./chunk-JJHVNIP7.js";
7
+ } from "./chunk-6XOLU6GX.js";
9
8
  export {
10
9
  ElasticsearchAPI,
11
10
  createRuntime,