@mochabug/adapt-sdk 0.1.14 → 0.1.16
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/api.d.ts +277 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/cjs/api.cjs +1 -1
- package/dist/cjs/api.cjs.map +4 -4
- package/dist/cjs/frontend.cjs +1 -1
- package/dist/cjs/frontend.cjs.map +3 -3
- package/dist/cjs/router.cjs +1 -1
- package/dist/cjs/router.cjs.map +4 -4
- package/dist/cjs/types.cjs.map +1 -1
- package/dist/esm/api.mjs +1 -1
- package/dist/esm/api.mjs.map +4 -4
- package/dist/esm/frontend.mjs +1 -1
- package/dist/esm/frontend.mjs.map +3 -3
- package/dist/esm/router.mjs +1 -1
- package/dist/esm/router.mjs.map +4 -4
- package/dist/genproto/mochabugapis/adapt/runtime/v1/configurator_service_pb.d.ts +947 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/configurator_service_pb.d.ts.map +1 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/executor_service_pb.d.ts +1155 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/executor_service_pb.d.ts.map +1 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/fileforge_service_pb.d.ts +3653 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/fileforge_service_pb.d.ts.map +1 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.d.ts +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.d.ts.map +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/plugin_service_pb.d.ts +554 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/plugin_service_pb.d.ts.map +1 -0
- package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.d.ts +84 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.d.ts +0 -2721
- package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.d.ts.map +0 -1
package/dist/cjs/types.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/types.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Global type definitions for the Mochabug Adapt Plugin system.\n * These types define the runtime environment and APIs available to plugins.\n */\n\n/**\n * Execution context providing lifecycle management for asynchronous operations.\n */\nexport interface ExecutionContext {\n waitUntil(promise: Promise<any>): void;\n passThroughOnException(): void;\n abort(reason?: any): void;\n}\n\nexport interface SocketInfo {\n remoteAddress?: string;\n localAddress?: string;\n}\n\nexport interface Socket {\n get readable(): ReadableStream;\n get writable(): WritableStream;\n get closed(): Promise<void>;\n get opened(): Promise<SocketInfo>;\n get upgraded(): boolean;\n get secureTransport(): 'on' | 'off' | 'starttls';\n close(): Promise<void>;\n startTls(options?: TlsOptions): Socket;\n}\n\nexport interface TlsOptions {\n expectedServerHostname?: string;\n}\n\nexport interface SocketOptions {\n secureTransport?: 'on' | 'off' | 'starttls';\n allowHalfOpen: boolean;\n highWaterMark?: number | bigint;\n}\n\nexport interface SocketAddress {\n hostname: string;\n port: number;\n}\n\nexport interface Fetcher {\n fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;\n connect(address: SocketAddress | string, options?: SocketOptions): Socket;\n}\n\n/**\n * Environment represents an interface that holds\n * all the common runtime functionality between a plugin - configurator / executor\n *\n * @interface\n */\nexport interface Environment {\n /**\n * assets is a Fetcher that wraps the Web Platform API fetch function.\n * It provides access to files inside the assetsDir, as defined in the manifest.json file,\n * without requiring authentication.\n *\n * Note: This is a simple interface to the directory content and is not suitable for serving\n * a full-fledged website. For example, it does not attempt to guess the `Content-Type` header.\n * You may want to wrap this Fetcher in a plugin that fills in the metadata as required.\n *\n * A GET request targeting a directory (instead of a file) returns a basic JSON directory\n * listing, like:\n *\n * [\n * {\"name\":\"foo\",\"type\":\"file\"},\n * {\"name\":\"bar\",\"type\":\"directory\"}\n * ]\n *\n * For file requests, the `Content-Type` will be `application/octet-stream`, while for\n * directory listings, it will be `application/json`. Files will have a `Content-Length`\n * header, while directories will not.\n *\n * HEAD requests are optimized to perform a stat() without actually opening the file.\n *\n * Example Request for fetching an index.html file:\n * GET http://./index.html\n *\n * Example Response:\n * HTTP/1.1 200 OK\n * Content-Type: application/octet-stream\n * Content-Length: 12345\n *\n * <html>\n * ...\n * </html>\n *\n * @type {Fetcher}\n */\n assets: Fetcher;\n\n /**\n * HTTP Proxy fetcher for secure requests with TLS configuration and dynamic header injection.\n * Requests are proxied through the runtime which handles certificate validation, mTLS, and\n * template variable substitution.\n *\n * Service Types:\n * - \"plugin:name\" - System-level services (shared across all vertices)\n * - \"user:name\" - Vertex-level services (per-user configuration)\n *\n * Required Headers:\n * - X-Mochabug-Adapt-Plugin-HttpProxy-Token: Bearer token\n * - X-Mochabug-Adapt-Plugin-HttpProxy-Path: \"plugin:name\" or \"user:name\"\n * - Host: Target host (auto-set by helper methods)\n *\n * TLS Modes (from service definition):\n * - MODE_SERVER_ONLY: Validates server cert against CA bundle\n * - MODE_MTLS: Mutual auth requiring client cert + private key\n *\n * Header Injection:\n * - Template syntax: \"Bearer %ACCESS_TOKEN%\" (Envoy-style)\n * - Variables resolved from runtime configuration\n * - Injected headers override caller's headers\n *\n * Error Codes:\n * - 400: Invalid header format\n * - 401: Invalid token or no permission\n * - 412: Service not configured or unavailable\n *\n * Usage (prefer helper methods):\n * ```typescript\n * const fetch = api.userHttpProxy(\"stripe_api\");\n * const res = await fetch(\"https://api.stripe.com/v1/charges\");\n * ```\n *\n * @type {Fetcher}\n */\n httpproxy: Fetcher;\n\n /**\n * See the runtime.proto/PluginService for a complete reference\n */\n plugin: Fetcher;\n}\n\n/**\n * The environment available to a executor of a plugin vertex\n * See the runtime.proto/ExecutorService for a complete reference\n *\n * @interface ExecutorEnvironment\n */\nexport interface ExecutorEnvironment extends Environment {\n executor: Fetcher;\n}\n\n/**\n * The environment available to a configurator of a plugin vertex\n * See the runtime.proto/ConfiguratorService for a complete reference\n *\n * @interface ConfiguratorEnvironment\n * @property {Fetcher} configurator - the configurator API\n */\nexport interface ConfiguratorEnvironment extends Environment {\n configurator: Fetcher;\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * Global type definitions for the Mochabug Adapt Plugin system.\n * These types define the runtime environment and APIs available to plugins.\n */\n\n/**\n * Execution context providing lifecycle management for asynchronous operations.\n */\nexport interface ExecutionContext {\n waitUntil(promise: Promise<any>): void;\n passThroughOnException(): void;\n abort(reason?: any): void;\n}\n\nexport interface SocketInfo {\n remoteAddress?: string;\n localAddress?: string;\n}\n\nexport interface Socket {\n get readable(): ReadableStream;\n get writable(): WritableStream;\n get closed(): Promise<void>;\n get opened(): Promise<SocketInfo>;\n get upgraded(): boolean;\n get secureTransport(): 'on' | 'off' | 'starttls';\n close(): Promise<void>;\n startTls(options?: TlsOptions): Socket;\n}\n\nexport interface TlsOptions {\n expectedServerHostname?: string;\n}\n\nexport interface SocketOptions {\n secureTransport?: 'on' | 'off' | 'starttls';\n allowHalfOpen: boolean;\n highWaterMark?: number | bigint;\n}\n\nexport interface SocketAddress {\n hostname: string;\n port: number;\n}\n\nexport interface Fetcher {\n fetch(input: string | URL | Request, init?: RequestInit): Promise<Response>;\n connect(address: SocketAddress | string, options?: SocketOptions): Socket;\n}\n\n/**\n * Environment represents an interface that holds\n * all the common runtime functionality between a plugin - configurator / executor\n *\n * @interface\n */\nexport interface Environment {\n /**\n * assets is a Fetcher that wraps the Web Platform API fetch function.\n * It provides access to files inside the assetsDir, as defined in the manifest.json file,\n * without requiring authentication.\n *\n * Note: This is a simple interface to the directory content and is not suitable for serving\n * a full-fledged website. For example, it does not attempt to guess the `Content-Type` header.\n * You may want to wrap this Fetcher in a plugin that fills in the metadata as required.\n *\n * A GET request targeting a directory (instead of a file) returns a basic JSON directory\n * listing, like:\n *\n * [\n * {\"name\":\"foo\",\"type\":\"file\"},\n * {\"name\":\"bar\",\"type\":\"directory\"}\n * ]\n *\n * For file requests, the `Content-Type` will be `application/octet-stream`, while for\n * directory listings, it will be `application/json`. Files will have a `Content-Length`\n * header, while directories will not.\n *\n * HEAD requests are optimized to perform a stat() without actually opening the file.\n *\n * Example Request for fetching an index.html file:\n * GET http://./index.html\n *\n * Example Response:\n * HTTP/1.1 200 OK\n * Content-Type: application/octet-stream\n * Content-Length: 12345\n *\n * <html>\n * ...\n * </html>\n *\n * @type {Fetcher}\n */\n assets: Fetcher;\n\n /**\n * HTTP Proxy fetcher for secure requests with TLS configuration and dynamic header injection.\n * Requests are proxied through the runtime which handles certificate validation, mTLS, and\n * template variable substitution.\n *\n * Service Types:\n * - \"plugin:name\" - System-level services (shared across all vertices)\n * - \"user:name\" - Vertex-level services (per-user configuration)\n *\n * Required Headers:\n * - X-Mochabug-Adapt-Plugin-HttpProxy-Token: Bearer token\n * - X-Mochabug-Adapt-Plugin-HttpProxy-Path: \"plugin:name\" or \"user:name\"\n * - Host: Target host (auto-set by helper methods)\n *\n * TLS Modes (from service definition):\n * - MODE_SERVER_ONLY: Validates server cert against CA bundle\n * - MODE_MTLS: Mutual auth requiring client cert + private key\n *\n * Header Injection:\n * - Template syntax: \"Bearer %ACCESS_TOKEN%\" (Envoy-style)\n * - Variables resolved from runtime configuration\n * - Injected headers override caller's headers\n *\n * Error Codes:\n * - 400: Invalid header format\n * - 401: Invalid token or no permission\n * - 412: Service not configured or unavailable\n *\n * Usage (prefer helper methods):\n * ```typescript\n * const fetch = api.userHttpProxy(\"stripe_api\");\n * const res = await fetch(\"https://api.stripe.com/v1/charges\");\n * ```\n *\n * @type {Fetcher}\n */\n httpproxy: Fetcher;\n\n /**\n * See the runtime.proto/PluginService for a complete reference\n */\n plugin: Fetcher;\n\n /**\n * See the runtime.proto/FileForgeService for a complete reference.\n * Provides file transformation and manipulation capabilities including:\n * - Document rendering (HTML/Markdown/Office to PDF)\n * - Image transformation (resize, crop, rotate, filters, etc.)\n * - PDF manipulation (merge, split, encrypt, convert, flatten)\n */\n fileforge: Fetcher;\n}\n\n/**\n * The environment available to a executor of a plugin vertex\n * See the runtime.proto/ExecutorService for a complete reference\n *\n * @interface ExecutorEnvironment\n */\nexport interface ExecutorEnvironment extends Environment {\n executor: Fetcher;\n}\n\n/**\n * The environment available to a configurator of a plugin vertex\n * See the runtime.proto/ConfiguratorService for a complete reference\n *\n * @interface ConfiguratorEnvironment\n * @property {Fetcher} configurator - the configurator API\n */\nexport interface ConfiguratorEnvironment extends Environment {\n configurator: Fetcher;\n}\n"],
|
|
5
5
|
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
6
|
"names": ["types_exports", "__toCommonJS"]
|
|
7
7
|
}
|