diff --git a/apps/web-ui/app/entry.client.tsx b/apps/web-ui/app/entry.client.tsx index afdfc0ce..97512674 100644 --- a/apps/web-ui/app/entry.client.tsx +++ b/apps/web-ui/app/entry.client.tsx @@ -1,12 +1,15 @@ import { RemixBrowser } from '@remix-run/react'; import { startTransition, StrictMode } from 'react'; import { hydrateRoot } from 'react-dom/client'; +import { register } from '@restate/data-access/middleware-service-worker'; -startTransition(() => { - hydrateRoot( - document, - - - - ); +register().then(() => { + startTransition(() => { + hydrateRoot( + document, + + + + ); + }); }); diff --git a/apps/web-ui/vite.config.ts b/apps/web-ui/vite.config.ts index e0486913..2bb6a657 100644 --- a/apps/web-ui/vite.config.ts +++ b/apps/web-ui/vite.config.ts @@ -12,6 +12,7 @@ export default defineConfig(({ mode }) => { const ADMIN_BASE_URL = env['ADMIN_BASE_URL'] || ''; const SERVER_HEADERS = { 'Set-Cookie': `adminBaseUrl=${ADMIN_BASE_URL}; SameSite=Strict; Path=/`, + 'Service-Worker-Allowed': '/', }; return { @@ -51,9 +52,9 @@ export default defineConfig(({ mode }) => { ], // Uncomment this if you are using workers. - // worker: { - // plugins: [ nxViteTsPaths() ], - // }, + worker: { + plugins: () => [nxViteTsPaths()], + }, build: { commonjsOptions: { transformMixedEsModules: true, diff --git a/libs/data-access/admin-api/project.json b/libs/data-access/admin-api/project.json index 334c7165..ef4dfabb 100644 --- a/libs/data-access/admin-api/project.json +++ b/libs/data-access/admin-api/project.json @@ -10,9 +10,12 @@ "executor": "nx:run-commands", "options": { "commands": [ - "redocly lint ./libs/data-access/admin-api/src/lib/api/spec.json || true", - "openapi-typescript ./libs/data-access/admin-api/src/lib/api/spec.json -o ./libs/data-access/admin-api/src/lib/api/index.d.ts" - ] + "./libs/data-access/admin-api/src/merge.mjs", + "redocly lint ./libs/data-access/admin-api/src/lib/api/output.json || true", + "openapi-typescript ./libs/data-access/admin-api/src/lib/api/output.json -o ./libs/data-access/admin-api/src/lib/api/index.d.ts", + "nx format" + ], + "parallel": false } } } diff --git a/libs/data-access/admin-api/src/lib/api/hooks.ts b/libs/data-access/admin-api/src/lib/api/hooks.ts index 2736320d..3b5425f8 100644 --- a/libs/data-access/admin-api/src/lib/api/hooks.ts +++ b/libs/data-access/admin-api/src/lib/api/hooks.ts @@ -227,3 +227,14 @@ export function useServiceOpenApi( return { ...results, queryKey: queryOptions.queryKey }; } + +export function useListInvocations( + options?: HookQueryOptions<'/query/invocations', 'get'> +) { + const baseUrl = useAdminBaseUrl(); + + return useQuery({ + ...adminApi('query', '/query/invocations', 'get', { baseUrl }), + ...options, + }); +} diff --git a/libs/data-access/admin-api/src/lib/api/index.d.ts b/libs/data-access/admin-api/src/lib/api/index.d.ts index 661981f9..89d46ec7 100644 --- a/libs/data-access/admin-api/src/lib/api/index.d.ts +++ b/libs/data-access/admin-api/src/lib/api/index.d.ts @@ -301,6 +301,46 @@ export interface paths { patch?: never; trace?: never; }; + '/query': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Query journal + * @description Query journal + */ + post: operations['query']; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + '/query/invocations': { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * List invocations + * @description List invocations + */ + get: operations['list_invocations']; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; } export type webhooks = Record; export interface components { @@ -503,15 +543,14 @@ export interface components { ListDeploymentsResponse: { deployments: components['schemas']['DeploymentResponse'][]; }; - DeploymentResponse: { - id: components['schemas']['String']; - /** - * Services - * @description List of services exposed by this deployment. - */ - services: components['schemas']['ServiceNameRevPair'][]; - } & ( + DeploymentResponse: | { + id: components['schemas']['String']; + /** + * Services + * @description List of services exposed by this deployment. + */ + services: components['schemas']['ServiceNameRevPair'][]; uri: string; protocol_type: components['schemas']['ProtocolType']; http_version: string; @@ -525,6 +564,12 @@ export interface components { max_protocol_version: number; } | { + id: components['schemas']['String']; + /** + * Services + * @description List of services exposed by this deployment. + */ + services: components['schemas']['ServiceNameRevPair'][]; arn: components['schemas']['LambdaARN']; assume_role_arn?: string | null; additional_headers?: { @@ -535,8 +580,7 @@ export interface components { min_protocol_version: number; /** Format: int32 */ max_protocol_version: number; - } - ); + }; ServiceNameRevPair: { name: string; /** Format: uint32 */ @@ -648,14 +692,7 @@ export interface components { id: components['schemas']['String']; services: components['schemas']['ServiceMetadata'][]; }; - DetailedDeploymentResponse: { - id: components['schemas']['String']; - /** - * Services - * @description List of services exposed by this deployment. - */ - services: components['schemas']['ServiceMetadata'][]; - } & ( + DetailedDeploymentResponse: | { uri: string; protocol_type: components['schemas']['ProtocolType']; @@ -668,6 +705,12 @@ export interface components { min_protocol_version: number; /** Format: int32 */ max_protocol_version: number; + id: components['schemas']['String']; + /** + * Services + * @description List of services exposed by this deployment. + */ + services: components['schemas']['ServiceMetadata'][]; } | { arn: components['schemas']['LambdaARN']; @@ -680,8 +723,13 @@ export interface components { min_protocol_version: number; /** Format: int32 */ max_protocol_version: number; - } - ); + id?: components['schemas']['String']; + /** + * Services + * @description List of services exposed by this deployment. + */ + services: components['schemas']['ServiceMetadata'][]; + }; }; responses: never; parameters: never; @@ -1793,4 +1841,144 @@ export interface operations { }; }; }; + query: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + 'application/json': { + query: string; + }; + }; + }; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': Record; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 403: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 404: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 409: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 503: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + }; + }; + list_invocations: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + 200: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': Record; + }; + }; + 400: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 403: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 404: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 409: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + 503: { + headers: { + [name: string]: unknown; + }; + content: { + 'application/json': components['schemas']['ErrorDescriptionResponse']; + }; + }; + }; + }; } diff --git a/libs/data-access/admin-api/src/lib/api/output.json b/libs/data-access/admin-api/src/lib/api/output.json new file mode 100644 index 00000000..d853dae1 --- /dev/null +++ b/libs/data-access/admin-api/src/lib/api/output.json @@ -0,0 +1,2225 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Query API", + "version": "1.1.3" + }, + "paths": { + "/services/{service}/state": { + "post": { + "tags": ["service"], + "summary": "Modify a service state", + "description": "Modify service state", + "operationId": "modify_service_state", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModifyServiceStateRequest" + } + } + }, + "required": true + }, + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/health": { + "get": { + "tags": ["health"], + "summary": "Health check", + "description": "Check REST API Health.", + "operationId": "health", + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invocations/{invocation_id}": { + "delete": { + "tags": ["invocation"], + "summary": "Delete an invocation", + "description": "Delete the given invocation. By default, an invocation is terminated by gracefully cancelling it. This ensures virtual object state consistency. Alternatively, an invocation can be killed which does not guarantee consistency for virtual object instance state, in-flight invocations to other services, etc. A stored completed invocation can also be purged", + "operationId": "delete_invocation", + "parameters": [ + { + "name": "invocation_id", + "in": "path", + "description": "Invocation identifier.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "mode", + "in": "query", + "description": "If cancel, it will gracefully terminate the invocation. If kill, it will terminate the invocation with a hard stop. If purge, it will only cleanup the response for completed invocations, and leave unaffected an in-flight invocation.", + "style": "simple", + "schema": { + "$ref": "#/components/schemas/DeletionMode" + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/services/{service}/openapi": { + "get": { + "tags": ["service"], + "summary": "Get service OpenAPI", + "description": "Get the service OpenAPI 3.1 contract.", + "operationId": "get_service_openapi", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OpenAPI 3.1 of the service", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/subscriptions/{subscription}": { + "get": { + "tags": ["subscription"], + "summary": "Get subscription", + "description": "Get subscription", + "operationId": "get_subscription", + "parameters": [ + { + "name": "subscription", + "in": "path", + "description": "Subscription identifier", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + }, + "delete": { + "tags": ["subscription"], + "summary": "Delete subscription", + "description": "Delete subscription.", + "operationId": "delete_subscription", + "parameters": [ + { + "name": "subscription", + "in": "path", + "description": "Subscription identifier", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/subscriptions": { + "get": { + "tags": ["subscription"], + "summary": "List subscriptions", + "description": "List all subscriptions.", + "operationId": "list_subscriptions", + "parameters": [ + { + "name": "sink", + "in": "query", + "description": "Filter by the exact specified sink.", + "style": "simple", + "schema": { + "type": "string" + } + }, + { + "name": "source", + "in": "query", + "description": "Filter by the exact specified source.", + "style": "simple", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListSubscriptionsResponse" + } + } + } + } + } + }, + "post": { + "tags": ["subscription"], + "summary": "Create subscription", + "description": "Create subscription.", + "operationId": "create_subscription", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSubscriptionRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscriptionResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/services": { + "get": { + "tags": ["service"], + "summary": "List services", + "description": "List all registered services.", + "operationId": "list_services", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListServicesResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/services/{service}/handlers/{handler}": { + "get": { + "tags": ["service_handler"], + "summary": "Get service handler", + "description": "Get the handler of a service", + "operationId": "get_service_handler", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "handler", + "in": "path", + "description": "Handler name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HandlerMetadata" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/services/{service}": { + "get": { + "tags": ["service"], + "summary": "Get service", + "description": "Get a registered service.", + "operationId": "get_service", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + }, + "patch": { + "tags": ["service"], + "summary": "Modify a service", + "description": "Modify a registered service.", + "operationId": "modify_service", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModifyServiceRequest" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/version": { + "get": { + "tags": ["version"], + "summary": "Admin version information", + "description": "Obtain admin version information.", + "operationId": "version", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VersionInformation" + } + } + } + } + } + } + }, + "/deployments": { + "get": { + "tags": ["deployment"], + "summary": "List deployments", + "description": "List all registered deployments.", + "operationId": "list_deployments", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListDeploymentsResponse" + } + } + } + } + } + }, + "post": { + "tags": ["deployment"], + "summary": "Create deployment", + "description": "Create deployment. Restate will invoke the endpoint to gather additional information required for registration, such as the services exposed by the deployment. If the deployment is already registered, this method will fail unless `force` is set to `true`.", + "operationId": "create_deployment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterDeploymentRequest" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterDeploymentResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/services/{service}/handlers": { + "get": { + "tags": ["service_handler"], + "summary": "List service handlers", + "description": "List all the handlers of the given service.", + "operationId": "list_service_handlers", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListServiceHandlersResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/deployments/{deployment}": { + "get": { + "tags": ["deployment"], + "summary": "Get deployment", + "description": "Get deployment metadata", + "operationId": "get_deployment", + "parameters": [ + { + "name": "deployment", + "in": "path", + "description": "Deployment identifier", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DetailedDeploymentResponse" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + }, + "delete": { + "tags": ["deployment"], + "summary": "Delete deployment", + "description": "Delete deployment. Currently it's supported to remove a deployment only using the force flag", + "operationId": "delete_deployment", + "parameters": [ + { + "name": "deployment", + "in": "path", + "description": "Deployment identifier", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "force", + "in": "query", + "description": "If true, the deployment will be forcefully deleted. This might break in-flight invocations, use with caution.", + "style": "simple", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "202": { + "description": "Accepted" + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "501": { + "description": "Not implemented. Only using the force flag is supported at the moment." + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/openapi": { + "get": { + "tags": ["openapi"], + "summary": "OpenAPI specification", + "externalDocs": { + "url": "https://swagger.io/specification/" + }, + "operationId": "openapi_spec", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + } + } + } + } + }, + "/query": { + "post": { + "tags": ["query"], + "summary": "Query journal", + "description": "Query journal", + "operationId": "query", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["query"], + "properties": { + "query": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/query/invocations": { + "get": { + "tags": ["query-invocation"], + "summary": "List invocations", + "description": "List invocations", + "operationId": "list_invocations", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "ModifyServiceStateRequest": { + "type": "object", + "required": ["new_state", "object_key"], + "properties": { + "version": { + "title": "Version", + "description": "If set, the latest version of the state is compared with this value and the operation will fail when the versions differ.", + "type": "string", + "nullable": true + }, + "object_key": { + "title": "Service key", + "description": "To what virtual object key to apply this change", + "type": "string" + }, + "new_state": { + "title": "New State", + "description": "The new state to replace the previous state with", + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0 + } + } + } + } + }, + "ErrorDescriptionResponse": { + "title": "Error description response", + "description": "Error details of the response", + "type": "object", + "required": ["message"], + "properties": { + "message": { + "type": "string" + }, + "restate_code": { + "title": "Restate code", + "description": "Restate error code describing this error", + "type": "string", + "nullable": true + } + } + }, + "DeletionMode": { + "type": "string", + "enum": ["Cancel", "Kill", "Purge"] + }, + "SubscriptionResponse": { + "type": "object", + "required": ["id", "options", "sink", "source"], + "properties": { + "id": { + "$ref": "#/components/schemas/String" + }, + "source": { + "type": "string" + }, + "sink": { + "type": "string" + }, + "options": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "String": { + "type": "string" + }, + "ListSubscriptionsResponse": { + "type": "object", + "required": ["subscriptions"], + "properties": { + "subscriptions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubscriptionResponse" + } + } + } + }, + "ListServicesResponse": { + "type": "object", + "required": ["services"], + "properties": { + "services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + }, + "ServiceMetadata": { + "type": "object", + "required": [ + "deployment_id", + "handlers", + "idempotency_retention", + "name", + "public", + "revision", + "ty" + ], + "properties": { + "name": { + "title": "Name", + "description": "Fully qualified name of the service", + "type": "string" + }, + "handlers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HandlerMetadata" + } + }, + "ty": { + "$ref": "#/components/schemas/ServiceType" + }, + "deployment_id": { + "title": "Deployment Id", + "description": "Deployment exposing the latest revision of the service.", + "type": "string" + }, + "revision": { + "title": "Revision", + "description": "Latest revision of the service.", + "type": "integer", + "format": "uint32", + "minimum": 0 + }, + "public": { + "title": "Public", + "description": "If true, the service can be invoked through the ingress. If false, the service can be invoked only from another Restate service.", + "type": "boolean" + }, + "idempotency_retention": { + "title": "Idempotency retention", + "description": "The retention duration of idempotent requests for this service.", + "type": "string" + }, + "workflow_completion_retention": { + "title": "Workflow completion retention", + "description": "The retention duration of workflows. Only available on workflow services.", + "type": "string", + "nullable": true + }, + "inactivity_timeout": { + "title": "Inactivity timeout", + "description": "This timer guards against stalled service/handler invocations. Once it expires, Restate triggers a graceful termination by asking the service invocation to suspend (which preserves intermediate progress).\n\nThe 'abort timeout' is used to abort the invocation, in case it doesn't react to the request to suspend.\n\nCan be configured using the [`humantime`](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html) format.\n\nThis overrides the default inactivity timeout set in invoker options.", + "type": "string", + "nullable": true + }, + "abort_timeout": { + "title": "Abort timeout", + "description": "This timer guards against stalled service/handler invocations that are supposed to terminate. The abort timeout is started after the 'inactivity timeout' has expired and the service/handler invocation has been asked to gracefully terminate. Once the timer expires, it will abort the service/handler invocation.\n\nThis timer potentially **interrupts** user code. If the user code needs longer to gracefully terminate, then this value needs to be set accordingly.\n\nCan be configured using the [`humantime`](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html) format.\n\nThis overrides the default abort timeout set in invoker options.", + "type": "string", + "nullable": true + } + } + }, + "HandlerMetadata": { + "type": "object", + "required": ["input_description", "name", "output_description", "ty"], + "properties": { + "name": { + "type": "string" + }, + "ty": { + "$ref": "#/components/schemas/HandlerMetadataType" + }, + "input_description": { + "title": "Human readable input description", + "description": "If empty, no schema was provided by the user at discovery time.", + "type": "string" + }, + "output_description": { + "title": "Human readable output description", + "description": "If empty, no schema was provided by the user at discovery time.", + "type": "string" + }, + "input_json_schema": { + "title": "Input JSON Schema", + "description": "JSON Schema of the handler input", + "nullable": true + }, + "output_json_schema": { + "title": "Output JSON Schema", + "description": "JSON Schema of the handler output", + "nullable": true + } + } + }, + "HandlerMetadataType": { + "type": "string", + "enum": ["Exclusive", "Shared", "Workflow"] + }, + "ServiceType": { + "type": "string", + "enum": ["Service", "VirtualObject", "Workflow"] + }, + "VersionInformation": { + "type": "object", + "required": [ + "max_admin_api_version", + "min_admin_api_version", + "version" + ], + "properties": { + "version": { + "title": "Admin server version", + "description": "Version of the admin server", + "type": "string" + }, + "min_admin_api_version": { + "title": "Min admin API version", + "description": "Minimum supported admin API version by the admin server", + "type": "integer", + "format": "uint16", + "minimum": 0 + }, + "max_admin_api_version": { + "title": "Max admin API version", + "description": "Maximum supported admin API version by the admin server", + "type": "integer", + "format": "uint16", + "minimum": 0 + } + } + }, + "ModifyServiceRequest": { + "type": "object", + "properties": { + "public": { + "title": "Public", + "description": "If true, the service can be invoked through the ingress. If false, the service can be invoked only from another Restate service.", + "type": "boolean", + "nullable": true + }, + "idempotency_retention": { + "title": "Idempotency retention", + "description": "Modify the retention of idempotent requests for this service.\n\nCan be configured using the [`humantime`](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html) format or the ISO8601.", + "type": "string", + "nullable": true + }, + "workflow_completion_retention": { + "title": "Workflow completion retention", + "description": "Modify the retention of the workflow completion. This can be modified only for workflow services!\n\nCan be configured using the [`humantime`](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html) format or the ISO8601.", + "type": "string", + "nullable": true + }, + "inactivity_timeout": { + "title": "Inactivity timeout", + "description": "This timer guards against stalled service/handler invocations. Once it expires, Restate triggers a graceful termination by asking the service invocation to suspend (which preserves intermediate progress).\n\nThe 'abort timeout' is used to abort the invocation, in case it doesn't react to the request to suspend.\n\nCan be configured using the [`humantime`](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html) format or the ISO8601.\n\nThis overrides the default inactivity timeout set in invoker options.", + "type": "string", + "nullable": true + }, + "abort_timeout": { + "title": "Abort timeout", + "description": "This timer guards against stalled service/handler invocations that are supposed to terminate. The abort timeout is started after the 'inactivity timeout' has expired and the service/handler invocation has been asked to gracefully terminate. Once the timer expires, it will abort the service/handler invocation.\n\nThis timer potentially **interrupts** user code. If the user code needs longer to gracefully terminate, then this value needs to be set accordingly.\n\nCan be configured using the [`humantime`](https://docs.rs/humantime/latest/humantime/fn.parse_duration.html) format or the ISO8601.\n\nThis overrides the default abort timeout set in invoker options.", + "type": "string", + "nullable": true + } + } + }, + "ListDeploymentsResponse": { + "type": "object", + "required": ["deployments"], + "properties": { + "deployments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/DeploymentResponse" + } + } + } + }, + "DeploymentResponse": { + "type": "object", + "anyOf": [ + { + "type": "object", + "required": [ + "created_at", + "http_version", + "max_protocol_version", + "min_protocol_version", + "protocol_type", + "uri", + "id", + "services" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceNameRevPair" + } + }, + "uri": { + "type": "string" + }, + "protocol_type": { + "$ref": "#/components/schemas/ProtocolType" + }, + "http_version": { + "type": "string" + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + } + } + }, + { + "type": "object", + "required": [ + "arn", + "created_at", + "max_protocol_version", + "min_protocol_version", + "id", + "services" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceNameRevPair" + } + }, + "arn": { + "$ref": "#/components/schemas/LambdaARN" + }, + "assume_role_arn": { + "type": "string", + "nullable": true + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + } + } + } + ] + }, + "ServiceNameRevPair": { + "type": "object", + "required": ["name", "revision"], + "properties": { + "name": { + "type": "string" + }, + "revision": { + "type": "integer", + "format": "uint32", + "minimum": 0 + } + } + }, + "ProtocolType": { + "type": "string", + "enum": ["RequestResponse", "BidiStream"] + }, + "LambdaARN": { + "type": "string", + "format": "arn" + }, + "CreateSubscriptionRequest": { + "type": "object", + "required": ["sink", "source"], + "properties": { + "source": { + "title": "Source", + "description": "Source uri. Accepted forms:\n\n* `kafka:///`, e.g. `kafka://my-cluster/my-topic`", + "type": "string" + }, + "sink": { + "title": "Sink", + "description": "Sink uri. Accepted forms:\n\n* `service:///`, e.g. `service://Counter/count`", + "type": "string" + }, + "options": { + "title": "Options", + "description": "Additional options to apply to the subscription.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + } + } + }, + "ListServiceHandlersResponse": { + "type": "object", + "required": ["handlers"], + "properties": { + "handlers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/HandlerMetadata" + } + } + } + }, + "RegisterDeploymentRequest": { + "anyOf": [ + { + "type": "object", + "required": ["uri"], + "properties": { + "uri": { + "title": "Uri", + "description": "Uri to use to discover/invoke the http deployment.", + "type": "string" + }, + "additional_headers": { + "title": "Additional headers", + "description": "Additional headers added to the discover/invoke requests to the deployment.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "use_http_11": { + "title": "Use http1.1", + "description": "If `true`, discovery will be attempted using a client that defaults to HTTP1.1 instead of a prior-knowledge HTTP2 client. HTTP2 may still be used for TLS servers that advertise HTTP2 support via ALPN. HTTP1.1 deployments will only work in request-response mode.", + "default": false, + "type": "boolean" + }, + "force": { + "title": "Force", + "description": "If `true`, it will override, if existing, any deployment using the same `uri`. Beware that this can lead in-flight invocations to an unrecoverable error state.\n\nBy default, this is `true` but it might change in future to `false`.\n\nSee the [versioning documentation](https://docs.restate.dev/operate/versioning) for more information.", + "default": true, + "type": "boolean" + }, + "dry_run": { + "title": "Dry-run mode", + "description": "If `true`, discovery will run but the deployment will not be registered. This is useful to see the impact of a new deployment before registering it.", + "default": false, + "type": "boolean" + } + } + }, + { + "type": "object", + "required": ["arn"], + "properties": { + "arn": { + "title": "ARN", + "description": "ARN to use to discover/invoke the lambda deployment.", + "type": "string" + }, + "assume_role_arn": { + "title": "Assume role ARN", + "description": "Optional ARN of a role to assume when invoking the addressed Lambda, to support role chaining", + "type": "string", + "nullable": true + }, + "additional_headers": { + "title": "Additional headers", + "description": "Additional headers added to the discover/invoke requests to the deployment.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "nullable": true + }, + "force": { + "title": "Force", + "description": "If `true`, it will override, if existing, any deployment using the same `uri`. Beware that this can lead in-flight invocations to an unrecoverable error state.\n\nBy default, this is `true` but it might change in future to `false`.\n\nSee the [versioning documentation](https://docs.restate.dev/operate/versioning) for more information.", + "default": true, + "type": "boolean" + }, + "dry_run": { + "title": "Dry-run mode", + "description": "If `true`, discovery will run but the deployment will not be registered. This is useful to see the impact of a new deployment before registering it.", + "default": false, + "type": "boolean" + } + } + } + ] + }, + "RegisterDeploymentResponse": { + "type": "object", + "required": ["id", "services"], + "properties": { + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + }, + "DetailedDeploymentResponse": { + "type": "object", + "anyOf": [ + { + "type": "object", + "required": [ + "created_at", + "http_version", + "max_protocol_version", + "min_protocol_version", + "protocol_type", + "uri", + "id", + "services" + ], + "properties": { + "uri": { + "type": "string" + }, + "protocol_type": { + "$ref": "#/components/schemas/ProtocolType" + }, + "http_version": { + "type": "string" + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + }, + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + }, + { + "type": "object", + "required": [ + "arn", + "created_at", + "max_protocol_version", + "min_protocol_version", + "ide", + "services" + ], + "properties": { + "arn": { + "$ref": "#/components/schemas/LambdaARN" + }, + "assume_role_arn": { + "type": "string", + "nullable": true + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + }, + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + } + ] + } + } + } +} diff --git a/libs/data-access/admin-api/src/lib/api/query.json b/libs/data-access/admin-api/src/lib/api/query.json new file mode 100644 index 00000000..786cc937 --- /dev/null +++ b/libs/data-access/admin-api/src/lib/api/query.json @@ -0,0 +1,488 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Query API", + "version": "1.1.3" + }, + "paths": { + "/query": { + "post": { + "tags": ["query"], + "summary": "Query journal", + "description": "Query journal", + "operationId": "query", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["query"], + "properties": { + "query": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/services/{service}/openapi": { + "get": { + "tags": ["service"], + "summary": "Get service OpenAPI", + "description": "Get the service OpenAPI 3.1 contract.", + "operationId": "get_service_openapi", + "parameters": [ + { + "name": "service", + "in": "path", + "description": "Fully qualified service name.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OpenAPI 3.1 of the service", + "content": { + "application/json": { + "schema": {} + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + }, + "/query/invocations": { + "get": { + "tags": ["query-invocation"], + "summary": "List invocations", + "description": "List invocations", + "operationId": "list_invocations", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "400": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "403": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "404": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "409": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "500": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + }, + "503": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorDescriptionResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "DetailedDeploymentResponse": { + "type": "object", + "anyOf": [ + { + "type": "object", + "required": [ + "created_at", + "http_version", + "max_protocol_version", + "min_protocol_version", + "protocol_type", + "uri", + "id", + "services" + ], + "properties": { + "uri": { + "type": "string" + }, + "protocol_type": { + "$ref": "#/components/schemas/ProtocolType" + }, + "http_version": { + "type": "string" + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + }, + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + }, + { + "type": "object", + "required": [ + "arn", + "created_at", + "max_protocol_version", + "min_protocol_version", + "ide", + "services" + ], + "properties": { + "arn": { + "$ref": "#/components/schemas/LambdaARN" + }, + "assume_role_arn": { + "type": "string", + "nullable": true + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + }, + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceMetadata" + } + } + } + } + ] + }, + "DeploymentResponse": { + "type": "object", + "anyOf": [ + { + "type": "object", + "required": [ + "created_at", + "http_version", + "max_protocol_version", + "min_protocol_version", + "protocol_type", + "uri", + "id", + "services" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceNameRevPair" + } + }, + "uri": { + "type": "string" + }, + "protocol_type": { + "$ref": "#/components/schemas/ProtocolType" + }, + "http_version": { + "type": "string" + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + } + } + }, + { + "type": "object", + "required": [ + "arn", + "created_at", + "max_protocol_version", + "min_protocol_version", + "id", + "services" + ], + "properties": { + "id": { + "$ref": "#/components/schemas/String" + }, + "services": { + "title": "Services", + "description": "List of services exposed by this deployment.", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceNameRevPair" + } + }, + "arn": { + "$ref": "#/components/schemas/LambdaARN" + }, + "assume_role_arn": { + "type": "string", + "nullable": true + }, + "additional_headers": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "created_at": { + "type": "string" + }, + "min_protocol_version": { + "type": "integer", + "format": "int32" + }, + "max_protocol_version": { + "type": "integer", + "format": "int32" + } + } + } + ] + } + } + } +} diff --git a/libs/data-access/admin-api/src/merge.mjs b/libs/data-access/admin-api/src/merge.mjs new file mode 100755 index 00000000..902e7cdc --- /dev/null +++ b/libs/data-access/admin-api/src/merge.mjs @@ -0,0 +1,32 @@ +#!/usr/bin/env node + +import query from './lib/api/query.json' assert { type: 'json' }; +import spec from './lib/api/spec.json' assert { type: 'json' }; +import { writeFileSync } from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +// Use fileURLToPath and import.meta.url to get the current directory path +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const output = { + ...spec, + ...query, + paths: { + ...spec.paths, + ...query.paths, + }, + components: { + schemas: { + ...spec.components.schemas, + ...query.components.schemas, + }, + }, +}; +writeFileSync( + path.join(__dirname, './lib/api/output.json'), + JSON.stringify(output, null, 2), + 'utf8' +); +// console.log(output); diff --git a/libs/data-access/middleware-service-worker/.babelrc b/libs/data-access/middleware-service-worker/.babelrc new file mode 100644 index 00000000..1ea870ea --- /dev/null +++ b/libs/data-access/middleware-service-worker/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "@nx/react/babel", + { + "runtime": "automatic", + "useBuiltIns": "usage" + } + ] + ], + "plugins": [] +} diff --git a/libs/data-access/middleware-service-worker/README.md b/libs/data-access/middleware-service-worker/README.md new file mode 100644 index 00000000..29d979a5 --- /dev/null +++ b/libs/data-access/middleware-service-worker/README.md @@ -0,0 +1,7 @@ +# middleware-service-worker + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test middleware-service-worker` to execute the unit tests via [Vitest](https://vitest.dev/). diff --git a/libs/data-access/middleware-service-worker/eslint.config.js b/libs/data-access/middleware-service-worker/eslint.config.js new file mode 100644 index 00000000..2016babe --- /dev/null +++ b/libs/data-access/middleware-service-worker/eslint.config.js @@ -0,0 +1,12 @@ +const nx = require('@nx/eslint-plugin'); +const baseConfig = require('../../../eslint.config.js'); + +module.exports = [ + ...baseConfig, + ...nx.configs['flat/react'], + { + files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'], + // Override or add rules here + rules: {}, + }, +]; diff --git a/libs/data-access/middleware-service-worker/project.json b/libs/data-access/middleware-service-worker/project.json new file mode 100644 index 00000000..585ca0c8 --- /dev/null +++ b/libs/data-access/middleware-service-worker/project.json @@ -0,0 +1,9 @@ +{ + "name": "middleware-service-worker", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/data-access/middleware-service-worker/src", + "projectType": "library", + "tags": [], + "// targets": "to see all targets run: nx show project middleware-service-worker --web", + "targets": {} +} diff --git a/libs/data-access/middleware-service-worker/src/index.ts b/libs/data-access/middleware-service-worker/src/index.ts new file mode 100644 index 00000000..6d741c7f --- /dev/null +++ b/libs/data-access/middleware-service-worker/src/index.ts @@ -0,0 +1 @@ +export * from './lib/register'; diff --git a/libs/data-access/middleware-service-worker/src/lib/query.ts b/libs/data-access/middleware-service-worker/src/lib/query.ts new file mode 100644 index 00000000..c3fcb726 --- /dev/null +++ b/libs/data-access/middleware-service-worker/src/lib/query.ts @@ -0,0 +1,20 @@ +function query(query: string, { baseUrl }: { baseUrl: string }) { + return fetch(`${baseUrl}/query`, { + method: 'POST', + body: JSON.stringify({ query }), + headers: { Accept: 'application/json', 'Content-Type': 'application/json' }, + }); +} + +function listInvocations(baseUrl: string) { + return query('SELECT * FROM sys_invocation', { baseUrl }); +} + +export function queryMiddlerWare(req: Request) { + const { url, method } = req; + if (url.endsWith('/query/invocations') && method.toUpperCase() === 'GET') { + const urlObj = new URL(url); + const baseUrl = `${urlObj.protocol}//${urlObj.host}`; + return listInvocations(baseUrl); + } +} diff --git a/libs/data-access/middleware-service-worker/src/lib/register.ts b/libs/data-access/middleware-service-worker/src/lib/register.ts new file mode 100644 index 00000000..23418bd9 --- /dev/null +++ b/libs/data-access/middleware-service-worker/src/lib/register.ts @@ -0,0 +1,27 @@ +/// +import workerUrl from './worker?worker&url'; + +export async function register() { + if ('serviceWorker' in navigator) { + try { + const registrations = await navigator.serviceWorker.getRegistrations(); + await Promise.all( + registrations.map((registration) => { + // Unregister service worker that triggers a registration + // This will make sure always the updated worker gets registered + // Also works with hard reload + return registration.unregister(); + }) + ); + + await navigator.serviceWorker.register(workerUrl, { + scope: '/', + type: 'module', + }); + + await navigator.serviceWorker.ready; + } catch (error) { + console.error(`Registration failed with ${error}`); + } + } +} diff --git a/libs/data-access/middleware-service-worker/src/lib/worker.ts b/libs/data-access/middleware-service-worker/src/lib/worker.ts new file mode 100644 index 00000000..f5e74fff --- /dev/null +++ b/libs/data-access/middleware-service-worker/src/lib/worker.ts @@ -0,0 +1,24 @@ +/// + +import { queryMiddlerWare } from './query'; + +export type {}; +declare const self: ServiceWorkerGlobalScope; + +self.addEventListener('install', (event) => { + // Force the waiting service worker to become the active service worker + self.skipWaiting(); +}); + +self.addEventListener('activate', (event) => { + // Make sure we wait until service worker is active + event.waitUntil(self.clients.claim()); + // You can clean up old caches here +}); + +self.addEventListener('fetch', (event) => { + const response = queryMiddlerWare(event.request); + if (response) { + event.respondWith(response); + } +}); diff --git a/libs/data-access/middleware-service-worker/tsconfig.json b/libs/data-access/middleware-service-worker/tsconfig.json new file mode 100644 index 00000000..4daaf45c --- /dev/null +++ b/libs/data-access/middleware-service-worker/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "jsx": "react-jsx", + "allowJs": false, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../../tsconfig.base.json" +} diff --git a/libs/data-access/middleware-service-worker/tsconfig.lib.json b/libs/data-access/middleware-service-worker/tsconfig.lib.json new file mode 100644 index 00000000..61dcc663 --- /dev/null +++ b/libs/data-access/middleware-service-worker/tsconfig.lib.json @@ -0,0 +1,32 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "node", + "@nx/react/typings/cssmodule.d.ts", + "@nx/react/typings/image.d.ts" + ] + }, + "exclude": [ + "**/*.spec.ts", + "**/*.test.ts", + "**/*.spec.tsx", + "**/*.test.tsx", + "**/*.spec.js", + "**/*.test.js", + "**/*.spec.jsx", + "**/*.test.jsx", + "vite.config.ts", + "vitest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx" + ], + "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"] +} diff --git a/libs/data-access/middleware-service-worker/tsconfig.spec.json b/libs/data-access/middleware-service-worker/tsconfig.spec.json new file mode 100644 index 00000000..05a0e183 --- /dev/null +++ b/libs/data-access/middleware-service-worker/tsconfig.spec.json @@ -0,0 +1,26 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../../dist/out-tsc", + "types": [ + "vitest/globals", + "vitest/importMeta", + "vite/client", + "node", + "vitest" + ] + }, + "include": [ + "vite.config.ts", + "vitest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ] +} diff --git a/libs/data-access/middleware-service-worker/vite.config.ts b/libs/data-access/middleware-service-worker/vite.config.ts new file mode 100644 index 00000000..26cbe0ec --- /dev/null +++ b/libs/data-access/middleware-service-worker/vite.config.ts @@ -0,0 +1,27 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'; +import { nxCopyAssetsPlugin } from '@nx/vite/plugins/nx-copy-assets.plugin'; + +export default defineConfig({ + root: __dirname, + cacheDir: + '../../../node_modules/.vite/libs/data-access/middleware-service-worker', + plugins: [react(), nxViteTsPaths(), nxCopyAssetsPlugin(['*.md'])], + // Uncomment this if you are using workers. + worker: { + plugins: () => [nxViteTsPaths()], + }, + test: { + watch: false, + globals: true, + environment: 'jsdom', + include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + reporters: ['default'], + coverage: { + reportsDirectory: + '../../../coverage/libs/data-access/middleware-service-worker', + provider: 'v8', + }, + }, +}); diff --git a/libs/features/invocations-route/src/lib/invocations.route.tsx b/libs/features/invocations-route/src/lib/invocations.route.tsx index f920da9a..39e50235 100644 --- a/libs/features/invocations-route/src/lib/invocations.route.tsx +++ b/libs/features/invocations-route/src/lib/invocations.route.tsx @@ -1,7 +1,11 @@ +import { useListInvocations } from '@restate/data-access/admin-api'; import { Code, Snippet } from '@restate/ui/code'; import { Link } from '@restate/ui/link'; function Component() { + const { data } = useListInvocations(); + console.log(data); + return (
diff --git a/package.json b/package.json index 3911e99c..83257efc 100644 --- a/package.json +++ b/package.json @@ -119,7 +119,9 @@ "send@<0.19.0": ">=0.19.0", "cookie@<0.7.0": ">=0.7.0", "@stoplight/json-schema-viewer": "4.16.2", - "@sentry/browser@<7.119.1": ">=7.119.1" + "@sentry/browser@<7.119.1": ">=7.119.1", + "cross-spawn@<7.0.5": ">=7.0.5", + "@eslint/plugin-kit@<0.2.3": ">=0.2.3" }, "peerDependencyRules": { "allowAny": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2df12246..eef5e6d5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,8 @@ overrides: cookie@<0.7.0: '>=0.7.0' '@stoplight/json-schema-viewer': 4.16.2 '@sentry/browser@<7.119.1': '>=7.119.1' + cross-spawn@<7.0.5: '>=7.0.5' + '@eslint/plugin-kit@<0.2.3': '>=0.2.3' importers: @@ -1696,8 +1698,8 @@ packages: resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.1.0': - resolution: {integrity: sha512-autAXT203ixhqei9xt+qkYOvY8l6LAFIdT2UXc/RPNeUVfqRF1BV94GTJyVPFKT8nFM6MyVJhjLj9E8JWvf5zQ==} + '@eslint/plugin-kit@0.2.3': + resolution: {integrity: sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@exodus/schemasafe@1.3.0': @@ -5152,11 +5154,8 @@ packages: cross-fetch@3.1.8: resolution: {integrity: sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==} - cross-spawn@5.1.0: - resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} - - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} crypt@0.0.2: @@ -7522,9 +7521,6 @@ packages: resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} engines: {node: 14 || >=16.14} - lru-cache@4.1.5: - resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} - lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -8964,9 +8960,6 @@ packages: prr@1.0.1: resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} - pseudomap@1.0.2: - resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} @@ -9562,18 +9555,10 @@ packages: shallowequal@1.1.0: resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} - shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} - shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} @@ -10878,9 +10863,6 @@ packages: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} - yallist@2.1.2: - resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} @@ -12268,7 +12250,7 @@ snapshots: '@eslint/object-schema@2.1.4': {} - '@eslint/plugin-kit@0.1.0': + '@eslint/plugin-kit@0.2.3': dependencies: levn: 0.4.1 @@ -14969,7 +14951,7 @@ snapshots: cacache: 17.1.4 chalk: 4.1.2 chokidar: 3.6.0 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 dotenv: 16.4.5 es-module-lexer: 1.5.4 esbuild: 0.17.6 @@ -17546,13 +17528,7 @@ snapshots: transitivePeerDependencies: - encoding - cross-spawn@5.1.0: - dependencies: - lru-cache: 4.1.5 - shebang-command: 1.2.0 - which: 1.3.1 - - cross-spawn@7.0.3: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -18433,13 +18409,13 @@ snapshots: '@eslint/config-array': 0.18.0 '@eslint/eslintrc': 3.1.0 '@eslint/js': 9.10.0 - '@eslint/plugin-kit': 0.1.0 + '@eslint/plugin-kit': 0.2.3 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.3.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 debug: 4.3.7(supports-color@9.4.0) escape-string-regexp: 4.0.0 eslint-scope: 8.1.0 @@ -18555,7 +18531,7 @@ snapshots: execa@0.7.0: dependencies: - cross-spawn: 5.1.0 + cross-spawn: 7.0.6 get-stream: 3.0.0 is-stream: 1.1.0 npm-run-path: 2.0.2 @@ -18565,7 +18541,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -18577,7 +18553,7 @@ snapshots: execa@8.0.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 get-stream: 8.0.1 human-signals: 5.0.0 is-stream: 3.0.0 @@ -18819,7 +18795,7 @@ snapshots: foreground-child@3.2.1: dependencies: - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 signal-exit: 4.1.0 fork-ts-checker-webpack-plugin@7.2.13(typescript@5.5.4)(webpack@5.95.0(@swc/core@1.5.7(@swc/helpers@0.5.11))(esbuild@0.19.12)): @@ -20440,11 +20416,6 @@ snapshots: lru-cache@10.2.2: {} - lru-cache@4.1.5: - dependencies: - pseudomap: 1.0.2 - yallist: 2.1.2 - lru-cache@5.1.1: dependencies: yallist: 3.1.1 @@ -22211,8 +22182,6 @@ snapshots: prr@1.0.1: optional: true - pseudomap@1.0.2: {} - psl@1.9.0: {} public-encrypt@4.0.3: @@ -22762,7 +22731,7 @@ snapshots: resolve@1.22.8: dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -23044,16 +23013,10 @@ snapshots: shallowequal@1.1.0: {} - shebang-command@1.2.0: - dependencies: - shebang-regex: 1.0.0 - shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 - shebang-regex@1.0.0: {} - shebang-regex@3.0.0: {} shell-quote@1.8.1: {} @@ -24566,8 +24529,6 @@ snapshots: y18n@5.0.8: {} - yallist@2.1.2: {} - yallist@3.1.1: {} yallist@4.0.0: {} diff --git a/tsconfig.base.json b/tsconfig.base.json index 1a9d879e..25bd31ad 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -27,6 +27,9 @@ "@restate/data-access/admin-api/spec": [ "libs/data-access/admin-api/src/api.ts" ], + "@restate/data-access/middleware-service-worker": [ + "libs/data-access/middleware-service-worker/src/index.ts" + ], "@restate/features/explainers": ["libs/features/explainers/src/index.ts"], "@restate/features/health": ["libs/features/health/src/index.ts"], "@restate/features/invocations-route": [