@crvouga/mockingbird-runtime 0.0.0-stage → 0.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.
Files changed (81) hide show
  1. package/README.md +131 -2
  2. package/dist/adapter-node.d.ts +2521 -0
  3. package/dist/adapter-node.js +6920 -0
  4. package/dist/adapter-node.js.map +7 -0
  5. package/dist/admin-ui.js +25 -0
  6. package/dist/admin-ui.js.map +7 -0
  7. package/dist/chunk-2KDYLZXC.js +118 -0
  8. package/dist/chunk-2KDYLZXC.js.map +7 -0
  9. package/dist/chunk-2Y25NPCV.js +1289 -0
  10. package/dist/chunk-2Y25NPCV.js.map +7 -0
  11. package/dist/chunk-4SAK6MQT.js +246 -0
  12. package/dist/chunk-4SAK6MQT.js.map +7 -0
  13. package/dist/chunk-ANCCZFF2.js +778 -0
  14. package/dist/chunk-ANCCZFF2.js.map +7 -0
  15. package/dist/chunk-EBGYPQPA.js +198 -0
  16. package/dist/chunk-EBGYPQPA.js.map +7 -0
  17. package/dist/chunk-EQLY2YOA.js +274 -0
  18. package/dist/chunk-EQLY2YOA.js.map +7 -0
  19. package/dist/chunk-G62YDIIJ.js +7664 -0
  20. package/dist/chunk-G62YDIIJ.js.map +7 -0
  21. package/dist/chunk-HU6IOAFC.js +437 -0
  22. package/dist/chunk-HU6IOAFC.js.map +7 -0
  23. package/dist/chunk-RNAHPNUJ.js +97 -0
  24. package/dist/chunk-RNAHPNUJ.js.map +7 -0
  25. package/dist/chunk-UP4QOSFD.js +87 -0
  26. package/dist/chunk-UP4QOSFD.js.map +7 -0
  27. package/dist/chunk-XNS34BPF.js +2489 -0
  28. package/dist/chunk-XNS34BPF.js.map +7 -0
  29. package/dist/core.d.ts +356 -0
  30. package/dist/core.js +51 -0
  31. package/dist/core.js.map +7 -0
  32. package/dist/crypto-XS5XCMRJ.js +21 -0
  33. package/dist/crypto-XS5XCMRJ.js.map +7 -0
  34. package/dist/helpers-UD7CG4WQ.js +18 -0
  35. package/dist/helpers-UD7CG4WQ.js.map +7 -0
  36. package/dist/http-codec.d.ts +72 -0
  37. package/dist/http-codec.js +25 -0
  38. package/dist/http-codec.js.map +7 -0
  39. package/dist/http-provider.d.ts +3243 -0
  40. package/dist/http-provider.js +37920 -0
  41. package/dist/http-provider.js.map +7 -0
  42. package/dist/index.d.ts +10 -0
  43. package/dist/index.js +23 -0
  44. package/dist/index.js.map +7 -0
  45. package/dist/mqtt-broker/node.d.ts +632 -0
  46. package/dist/mqtt-broker/node.js +355 -0
  47. package/dist/mqtt-broker/node.js.map +7 -0
  48. package/dist/mqtt-broker.d.ts +990 -0
  49. package/dist/mqtt-broker.js +913 -0
  50. package/dist/mqtt-broker.js.map +7 -0
  51. package/dist/openapi-metadata.d.ts +290 -0
  52. package/dist/openapi-metadata.js +28 -0
  53. package/dist/openapi-metadata.js.map +7 -0
  54. package/dist/openapi.d.ts +252 -0
  55. package/dist/openapi.js +45 -0
  56. package/dist/openapi.js.map +7 -0
  57. package/dist/preview/artifacts.d.ts +19 -0
  58. package/dist/preview/artifacts.js +40 -0
  59. package/dist/preview/artifacts.js.map +7 -0
  60. package/dist/preview/bridge.d.ts +21 -0
  61. package/dist/preview/bridge.js +9 -0
  62. package/dist/preview/bridge.js.map +7 -0
  63. package/dist/preview/harness.d.ts +12 -0
  64. package/dist/preview/harness.js +65 -0
  65. package/dist/preview/harness.js.map +7 -0
  66. package/dist/preview/host.d.ts +30 -0
  67. package/dist/preview/host.js +70 -0
  68. package/dist/preview/host.js.map +7 -0
  69. package/dist/service/admin.d.ts +106 -0
  70. package/dist/service/admin.js +340 -0
  71. package/dist/service/admin.js.map +7 -0
  72. package/dist/service.d.ts +2665 -0
  73. package/dist/service.js +264 -0
  74. package/dist/service.js.map +7 -0
  75. package/dist/sqlite.d.ts +69 -0
  76. package/dist/sqlite.js +19 -0
  77. package/dist/sqlite.js.map +7 -0
  78. package/dist/ui.d.ts +37 -0
  79. package/dist/ui.js +702 -0
  80. package/dist/ui.js.map +7 -0
  81. package/package.json +135 -4
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../openapi/metadata/src/types.ts", "../../openapi/metadata/src/read.ts", "../../openapi/metadata/src/annotate.ts", "../../openapi/metadata/src/validate.ts"],
4
+ "sourcesContent": ["/**\n * Mockingbird's OpenAPI extensions. They are deliberately generic: nothing here knows about any\n * particular provider. Provider specifics live in each provider's `openapi.yaml`.\n */\n\n/** `x-mockingbird` on an operation. */\nexport type OperationExtension = {\n /** Opt in to a terminal path parameter spanning slash-separated segments. */\n path?: { parameter: string; allowEmpty?: boolean }\n /** `false` marks an operation the mock explicitly does not implement. Default `true`. */\n supported?: boolean\n /** Human explanation, required when `supported: false` or `parity.enabled: false`. */\n reason?: string\n parity?: {\n /** Whether the differential runner generates this operation. Defaults to `supported`. */\n enabled?: boolean\n /** `false` for operations that must never hit a real account (destructive, billing\u2026). Default `true`. */\n safe?: boolean\n reason?: string\n }\n}\n\nexport type OperationMetadata = {\n path?: { parameter: string; allowEmpty?: boolean }\n supported: boolean\n reason: string | undefined\n parity: { enabled: boolean; safe: boolean; reason: string | undefined }\n}\n\n/** `x-mockingbird-resource`: this string value is the identity of a resource. */\nexport type ResourceIdentityExtension = { type: string; identity: true }\n\n/** `x-mockingbird-resource-ref`: this value must reference an existing resource of `type`. */\nexport type ResourceRefExtension = {\n type: string\n /** A well-formed id that does not exist, used to exercise not-found behaviour. */\n missing?: string\n}\n\nexport const VOLATILE_KINDS = [\"id\", \"timestamp\", \"token\", \"url\", \"account\", \"opaque\"] as const\nexport type VolatileKind = (typeof VOLATILE_KINDS)[number]\n\n/** `x-mockingbird-volatile`: nondeterministic on the real side; compared by shape only. */\nexport type VolatileExtension = { kind: VolatileKind }\n\nexport const SCOPE_VALUES = [\"run-id\", \"walk-start-unix\", \"walk-start-iso\"] as const\nexport type ScopeValue = (typeof SCOPE_VALUES)[number]\n\n/** `x-mockingbird-scope`: always generate this run-scoped value instead of a random one. */\nexport type ScopeExtension = { value: ScopeValue }\n\n/** `x-mockingbird-unsupported`: the mock does not implement this parameter/property. */\nexport type UnsupportedExtension = true | { reason?: string }\n\nexport type SchemaMetadata = {\n resource: ResourceIdentityExtension | undefined\n resourceRef: ResourceRefExtension | undefined\n volatile: VolatileExtension | undefined\n scope: ScopeExtension | undefined\n unsupported: { reason: string | undefined } | undefined\n}\n\nexport const EXTENSION_KEYS = {\n operation: \"x-mockingbird\",\n resource: \"x-mockingbird-resource\",\n resourceRef: \"x-mockingbird-resource-ref\",\n volatile: \"x-mockingbird-volatile\",\n scope: \"x-mockingbird-scope\",\n unsupported: \"x-mockingbird-unsupported\",\n parityHeader: \"x-mockingbird-parity-header\",\n} as const\n", "import type {\n HeaderObject,\n OpenAPIDocument,\n OperationObject,\n ParameterObject,\n ResponseObject,\n SchemaObject,\n} from \"@crvouga/mockingbird-openapi\"\nimport { deref, resolveSchema } from \"@crvouga/mockingbird-openapi\"\nimport {\n EXTENSION_KEYS,\n type OperationExtension,\n type OperationMetadata,\n SCOPE_VALUES,\n type SchemaMetadata,\n VOLATILE_KINDS,\n} from \"./types.js\"\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value)\n\nconst extensionOf = (holder: object, key: string): unknown =>\n (holder as Record<string, unknown>)[key]\n\n/** Read `x-mockingbird` from an operation, applying defaults. */\nexport const operationMetadata = (operation: OperationObject): OperationMetadata => {\n const raw = extensionOf(operation, EXTENSION_KEYS.operation)\n const ext: OperationExtension = isRecord(raw) ? (raw as OperationExtension) : {}\n const supported = ext.supported ?? true\n const parity = ext.parity ?? {}\n return {\n ...(ext.path === undefined ? {} : { path: ext.path }),\n supported,\n reason: typeof ext.reason === \"string\" ? ext.reason : undefined,\n parity: {\n enabled: supported && (parity.enabled ?? true),\n safe: parity.safe ?? true,\n reason: typeof parity.reason === \"string\" ? parity.reason : undefined,\n },\n }\n}\n\nconst readResource = (raw: unknown): SchemaMetadata[\"resource\"] => {\n if (!isRecord(raw) || typeof raw.type !== \"string\" || raw.identity !== true) return undefined\n return { type: raw.type, identity: true }\n}\n\nconst readResourceRef = (raw: unknown): SchemaMetadata[\"resourceRef\"] => {\n if (!isRecord(raw) || typeof raw.type !== \"string\") return undefined\n return { type: raw.type, ...(typeof raw.missing === \"string\" ? { missing: raw.missing } : {}) }\n}\n\nconst readVolatile = (raw: unknown): SchemaMetadata[\"volatile\"] => {\n if (!isRecord(raw) || typeof raw.kind !== \"string\") return undefined\n const kind = VOLATILE_KINDS.find((k) => k === raw.kind)\n return kind === undefined ? undefined : { kind }\n}\n\nconst readScope = (raw: unknown): SchemaMetadata[\"scope\"] => {\n if (!isRecord(raw) || typeof raw.value !== \"string\") return undefined\n const value = SCOPE_VALUES.find((v) => v === raw.value)\n return value === undefined ? undefined : { value }\n}\n\nconst readUnsupported = (raw: unknown): SchemaMetadata[\"unsupported\"] => {\n if (raw === true) return { reason: undefined }\n if (isRecord(raw)) return { reason: typeof raw.reason === \"string\" ? raw.reason : undefined }\n return undefined\n}\n\n/**\n * Read Mockingbird's schema-level extensions from a (resolved) schema or parameter.\n * Extensions on a `$ref` wrapper win over the target's, matching {@link resolveSchema}.\n */\nexport const schemaMetadata = (holder: SchemaObject | ParameterObject): SchemaMetadata => ({\n resource: readResource(extensionOf(holder, EXTENSION_KEYS.resource)),\n resourceRef: readResourceRef(extensionOf(holder, EXTENSION_KEYS.resourceRef)),\n volatile: readVolatile(extensionOf(holder, EXTENSION_KEYS.volatile)),\n scope: readScope(extensionOf(holder, EXTENSION_KEYS.scope)),\n unsupported: readUnsupported(extensionOf(holder, EXTENSION_KEYS.unsupported)),\n})\n\n/** Metadata of a parameter: extensions on the parameter itself win over its schema's. */\nexport const parameterMetadata = (\n document: OpenAPIDocument,\n parameter: ParameterObject,\n): SchemaMetadata => {\n const own = schemaMetadata(parameter)\n const fromSchema = parameter.schema\n ? schemaMetadata(resolveSchema(document, parameter.schema))\n : undefined\n return {\n resource: own.resource ?? fromSchema?.resource,\n resourceRef: own.resourceRef ?? fromSchema?.resourceRef,\n volatile: own.volatile ?? fromSchema?.volatile,\n scope: own.scope ?? fromSchema?.scope,\n unsupported: own.unsupported ?? fromSchema?.unsupported,\n }\n}\n\n/** Lower-cased names of response headers flagged with `x-mockingbird-parity-header: true`. */\nexport const parityHeaders = (document: OpenAPIDocument, response: ResponseObject): string[] => {\n const names: string[] = []\n for (const [name, raw] of Object.entries(response.headers ?? {})) {\n const header = deref<HeaderObject>(document, raw)\n if (extensionOf(header, EXTENSION_KEYS.parityHeader) === true) names.push(name.toLowerCase())\n }\n return names.sort()\n}\n", "import type { OpenAPIDocument, SchemaObject } from \"@crvouga/mockingbird-openapi\"\nimport { jsonTypeOf, resolveSchema, schemaTypes, validateValue } from \"@crvouga/mockingbird-openapi\"\nimport { schemaMetadata } from \"./read.js\"\nimport type { VolatileKind } from \"./types.js\"\n\nexport type JsonPath = Array<string | number>\n\nexport type Annotation =\n | { kind: \"identity\"; path: JsonPath; type: string }\n | { kind: \"volatile\"; path: JsonPath; volatile: VolatileKind }\n\nconst typeMatches = (schema: SchemaObject, value: unknown) => {\n const types = schemaTypes(schema)\n if (types.length === 0) return true\n const actual = jsonTypeOf(value)\n return types.some((t) => t === actual || (t === \"number\" && actual === \"integer\"))\n}\n\n/**\n * Pick the branch of a union that describes `value`: first a fully valid branch, then the first\n * whose declared type matches. Returns `undefined` when nothing plausibly applies.\n */\nconst selectBranch = (\n document: OpenAPIDocument,\n branches: SchemaObject[],\n value: unknown,\n): SchemaObject | undefined => {\n const resolved = branches.map((b) => resolveSchema(document, b))\n const valid = resolved.find((b) => validateValue(document, b, value).length === 0)\n if (valid) return valid\n return resolved.find((b) => typeMatches(b, value))\n}\n\n/**\n * Walk `value` guided by `schema` and report every identity / volatile location.\n * Values with no schema coverage (unknown properties, unmatched union branches) yield nothing,\n * which means they are compared strictly by the canonicalizer.\n */\nexport const annotateValue = (\n document: OpenAPIDocument,\n schema: SchemaObject,\n value: unknown,\n path: JsonPath = [],\n): Annotation[] => {\n const out: Annotation[] = []\n const go = (node: SchemaObject, current: unknown, at: JsonPath, depth: number) => {\n if (depth > 64) return\n const resolved = resolveSchema(document, node)\n const meta = schemaMetadata(resolved)\n if (meta.resource && typeof current === \"string\")\n out.push({ kind: \"identity\", path: at, type: meta.resource.type })\n else if (meta.volatile && current !== undefined) {\n // Include null: nullable volatiles (sample_id) must collapse null vs string.\n out.push({ kind: \"volatile\", path: at, volatile: meta.volatile.kind })\n }\n if (resolved.allOf) for (const branch of resolved.allOf) go(branch, current, at, depth + 1)\n const union = resolved.oneOf ?? resolved.anyOf\n if (union) {\n const branch = selectBranch(document, union, current)\n if (branch) go(branch, current, at, depth + 1)\n }\n if (Array.isArray(current)) {\n current.forEach((item, index) => {\n const itemSchema = resolved.prefixItems?.[index] ?? resolved.items\n if (itemSchema) go(itemSchema, item, [...at, index], depth + 1)\n })\n return\n }\n if (typeof current === \"object\" && current !== null) {\n for (const [key, item] of Object.entries(current)) {\n const property = resolved.properties?.[key]\n if (property) go(property, item, [...at, key], depth + 1)\n else if (typeof resolved.additionalProperties === \"object\") {\n go(resolved.additionalProperties, item, [...at, key], depth + 1)\n }\n }\n }\n }\n go(schema, value, path, 0)\n return out\n}\n\nexport const pathKey = (path: JsonPath) => path.map((segment) => JSON.stringify(segment)).join(\".\")\n", "import type { OpenAPIDocument, SchemaObject } from \"@crvouga/mockingbird-openapi\"\nimport {\n listOperations,\n resolveSchema,\n schemaTypes,\n walkSchema,\n} from \"@crvouga/mockingbird-openapi\"\nimport { operationMetadata, parameterMetadata, schemaMetadata } from \"./read.js\"\nimport { EXTENSION_KEYS } from \"./types.js\"\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value)\n\n/**\n * Semantic checks for Mockingbird extensions:\n * - malformed extension objects\n * - identities and references must be strings\n * - `supported: false` / `parity.enabled: false` need a reason\n * - every referenced resource type is produced by some identity in the document\n */\nexport const validateMetadata = (document: OpenAPIDocument): string[] => {\n const issues: string[] = []\n const producedTypes = new Set<string>()\n const referencedTypes = new Map<string, string>()\n\n const inspectSchema = (schema: SchemaObject, at: string) => {\n const raw = schema as Record<string, unknown>\n for (const key of [\n EXTENSION_KEYS.resource,\n EXTENSION_KEYS.resourceRef,\n EXTENSION_KEYS.volatile,\n EXTENSION_KEYS.scope,\n ]) {\n if (key in raw && !isRecord(raw[key])) issues.push(`${at}: ${key} must be an object`)\n }\n const meta = schemaMetadata(schema)\n if (isRecord(raw[EXTENSION_KEYS.resource]) && !meta.resource)\n issues.push(`${at}: ${EXTENSION_KEYS.resource} needs { type, identity: true }`)\n if (isRecord(raw[EXTENSION_KEYS.resourceRef]) && !meta.resourceRef)\n issues.push(`${at}: ${EXTENSION_KEYS.resourceRef} needs { type }`)\n if (isRecord(raw[EXTENSION_KEYS.volatile]) && !meta.volatile)\n issues.push(`${at}: ${EXTENSION_KEYS.volatile} has an unknown kind`)\n if (isRecord(raw[EXTENSION_KEYS.scope]) && !meta.scope)\n issues.push(`${at}: ${EXTENSION_KEYS.scope} has an unknown value`)\n const types = schemaTypes(resolveSchema(document, schema)).filter((t) => t !== \"null\")\n if (meta.resource) {\n producedTypes.add(meta.resource.type)\n if (types.length > 0 && !types.includes(\"string\"))\n issues.push(`${at}: resource identities must be strings`)\n }\n if (meta.resourceRef) {\n referencedTypes.set(meta.resourceRef.type, at)\n if (types.length > 0 && !types.includes(\"string\"))\n issues.push(`${at}: resource references must be strings`)\n }\n }\n\n for (const [name, schema] of Object.entries(document.components?.schemas ?? {})) {\n walkSchema(document, schema, (node, path) =>\n inspectSchema(node, `components.schemas.${name}/${path.join(\"/\")}`),\n )\n }\n\n for (const operation of listOperations(document)) {\n const label = `${operation.method.toUpperCase()} ${operation.path}`\n const raw = operation.operation[EXTENSION_KEYS.operation]\n if (raw !== undefined && !isRecord(raw))\n issues.push(`${label}: ${EXTENSION_KEYS.operation} must be an object`)\n if (isRecord(raw) && raw.path !== undefined) {\n const path = raw.path\n if (\n !isRecord(path) ||\n typeof path.parameter !== \"string\" ||\n !path.parameter ||\n !operation.path.endsWith(`/{${path.parameter}}`) ||\n (path.allowEmpty !== undefined && typeof path.allowEmpty !== \"boolean\")\n )\n issues.push(`${label}: path needs a terminal { parameter, allowEmpty?: boolean }`)\n }\n const meta = operationMetadata(operation.operation)\n if (!meta.supported && meta.reason === undefined)\n issues.push(`${label}: unsupported operations need a reason`)\n if (meta.supported && !meta.parity.enabled && meta.parity.reason === undefined) {\n issues.push(`${label}: parity-disabled operations need parity.reason`)\n }\n for (const parameter of operation.parameters) {\n const pm = parameterMetadata(document, parameter)\n if (pm.resourceRef)\n referencedTypes.set(pm.resourceRef.type, `${label} parameter ${parameter.name}`)\n if (parameter.schema) {\n walkSchema(document, parameter.schema, (node, path) =>\n inspectSchema(node, `${label} parameter ${parameter.name}/${path.join(\"/\")}`),\n )\n }\n }\n for (const [mediaType, media] of Object.entries(operation.requestBody?.content ?? {})) {\n if (media.schema)\n walkSchema(document, media.schema, (node, path) =>\n inspectSchema(node, `${label} body ${mediaType}/${path.join(\"/\")}`),\n )\n }\n for (const [status, response] of Object.entries(operation.responses)) {\n for (const [mediaType, media] of Object.entries(response.content ?? {})) {\n if (media.schema)\n walkSchema(document, media.schema, (node, path) =>\n inspectSchema(node, `${label} ${status} ${mediaType}/${path.join(\"/\")}`),\n )\n }\n }\n }\n\n for (const [type, at] of referencedTypes) {\n if (!producedTypes.has(type))\n issues.push(\n `${at}: references resource type ${JSON.stringify(type)} but no identity produces it`,\n )\n }\n return issues\n}\n\n/** Every resource type produced by an identity somewhere in the document. */\nexport const resourceTypes = (document: OpenAPIDocument): string[] => {\n const types = new Set<string>()\n const inspect = (schema: SchemaObject) => {\n const meta = schemaMetadata(schema)\n if (meta.resource) types.add(meta.resource.type)\n }\n for (const schema of Object.values(document.components?.schemas ?? {}))\n walkSchema(document, schema, inspect)\n for (const operation of listOperations(document)) {\n for (const response of Object.values(operation.responses)) {\n for (const media of Object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