From c01bcb05405de4ec81ef55f729de30d7c75031c2 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Mon, 8 Jun 2026 23:56:26 +0000 Subject: [PATCH] feat: rename SDK API target from infra to compute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligns with constructive-db schema routing changes: - infra_public → compute_public - SDK export renamed from 'infra' to 'compute' - API_NAMES updated from ['infra'] to ['compute'] --- sdk/functions-schema/dist/index.d.ts | 2 + sdk/functions-schema/dist/index.js | 4 + sdk/functions-sdk/dist/compute/index.d.ts | 5 + sdk/functions-sdk/dist/compute/index.js | 21 + .../dist/compute/orm/client.d.ts | 97 ++ sdk/functions-sdk/dist/compute/orm/client.js | 152 ++ sdk/functions-sdk/dist/compute/orm/index.d.ts | 51 + sdk/functions-sdk/dist/compute/orm/index.js | 75 + .../dist/compute/orm/input-types.d.ts | 1298 +++++++++++++++++ .../dist/compute/orm/input-types.js | 5 + .../dist/compute/orm/models/index.d.ts | 11 + .../dist/compute/orm/models/index.js | 20 + .../models/platformFunctionDefinition.d.ts | 54 + .../orm/models/platformFunctionDefinition.js | 104 ++ .../models/platformFunctionExecutionLog.d.ts | 54 + .../models/platformFunctionExecutionLog.js | 104 ++ .../models/platformFunctionInvocation.d.ts | 54 + .../orm/models/platformFunctionInvocation.js | 104 ++ .../compute/orm/models/platformNamespace.d.ts | 54 + .../compute/orm/models/platformNamespace.js | 104 ++ .../orm/models/platformNamespaceEvent.d.ts | 54 + .../orm/models/platformNamespaceEvent.js | 104 ++ .../orm/models/platformSecretDefinition.d.ts | 54 + .../orm/models/platformSecretDefinition.js | 104 ++ .../dist/compute/orm/mutation/index.d.ts | 26 + .../dist/compute/orm/mutation/index.js | 21 + .../dist/compute/orm/query-builder.d.ts | 110 ++ .../dist/compute/orm/query-builder.js | 756 ++++++++++ .../dist/compute/orm/realtime.d.ts | 142 ++ .../dist/compute/orm/realtime.js | 104 ++ .../dist/compute/orm/select-types.d.ts | 125 ++ .../dist/compute/orm/select-types.js | 2 + sdk/functions-sdk/dist/compute/orm/types.d.ts | 6 + sdk/functions-sdk/dist/compute/orm/types.js | 23 + sdk/functions-sdk/dist/index.d.ts | 9 + sdk/functions-sdk/dist/index.js | 45 + .../@constructive-io/functions-schema | 1 + 37 files changed, 4059 insertions(+) create mode 100644 sdk/functions-schema/dist/index.d.ts create mode 100644 sdk/functions-schema/dist/index.js create mode 100644 sdk/functions-sdk/dist/compute/index.d.ts create mode 100644 sdk/functions-sdk/dist/compute/index.js create mode 100644 sdk/functions-sdk/dist/compute/orm/client.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/client.js create mode 100644 sdk/functions-sdk/dist/compute/orm/index.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/index.js create mode 100644 sdk/functions-sdk/dist/compute/orm/input-types.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/input-types.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/index.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/index.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformNamespace.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformNamespace.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.js create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.js create mode 100644 sdk/functions-sdk/dist/compute/orm/mutation/index.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/mutation/index.js create mode 100644 sdk/functions-sdk/dist/compute/orm/query-builder.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/query-builder.js create mode 100644 sdk/functions-sdk/dist/compute/orm/realtime.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/realtime.js create mode 100644 sdk/functions-sdk/dist/compute/orm/select-types.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/select-types.js create mode 100644 sdk/functions-sdk/dist/compute/orm/types.d.ts create mode 100644 sdk/functions-sdk/dist/compute/orm/types.js create mode 100644 sdk/functions-sdk/dist/index.d.ts create mode 100644 sdk/functions-sdk/dist/index.js create mode 120000 sdk/functions-sdk/node_modules/@constructive-io/functions-schema diff --git a/sdk/functions-schema/dist/index.d.ts b/sdk/functions-schema/dist/index.d.ts new file mode 100644 index 00000000..9c380727 --- /dev/null +++ b/sdk/functions-schema/dist/index.d.ts @@ -0,0 +1,2 @@ +export declare const API_NAMES: readonly ["compute"]; +export type ApiName = (typeof API_NAMES)[number]; diff --git a/sdk/functions-schema/dist/index.js b/sdk/functions-schema/dist/index.js new file mode 100644 index 00000000..d05b55cd --- /dev/null +++ b/sdk/functions-schema/dist/index.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.API_NAMES = void 0; +exports.API_NAMES = ["compute"]; diff --git a/sdk/functions-sdk/dist/compute/index.d.ts b/sdk/functions-sdk/dist/compute/index.d.ts new file mode 100644 index 00000000..654223e7 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/index.d.ts @@ -0,0 +1,5 @@ +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +export * from './orm'; diff --git a/sdk/functions-sdk/dist/compute/index.js b/sdk/functions-sdk/dist/compute/index.js new file mode 100644 index 00000000..ff43043c --- /dev/null +++ b/sdk/functions-sdk/dist/compute/index.js @@ -0,0 +1,21 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * GraphQL SDK - auto-generated, do not edit + * @generated by @constructive-io/graphql-codegen + */ +__exportStar(require("./orm"), exports); diff --git a/sdk/functions-sdk/dist/compute/orm/client.d.ts b/sdk/functions-sdk/dist/compute/orm/client.d.ts new file mode 100644 index 00000000..7753515c --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/client.d.ts @@ -0,0 +1,97 @@ +/** + * ORM Client - Runtime GraphQL executor + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-query/runtime'; +import type { ConnectionState, ConnectionStateListener, RealtimeConfig, SubscriptionEvent, SubscriptionFieldMeta, Unsubscribe } from './realtime'; +export type { GraphQLAdapter, GraphQLError, QueryResult, } from '@constructive-io/graphql-query/runtime'; +export type { ConnectionState, ConnectionStateListener, RealtimeConfig, SubscribeOptions, SubscriptionEvent, SubscriptionFieldMeta, SubscriptionOperation, Unsubscribe, WsClient, } from './realtime'; +export { RealtimeManager } from './realtime'; +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +export declare class FetchAdapter implements GraphQLAdapter { + private endpoint; + private headers; + private fetchFn; + constructor(endpoint: string, headers?: Record, fetchFn?: typeof globalThis.fetch); + execute(document: string, variables?: Record): Promise>; + setHeaders(headers: Record): void; + getEndpoint(): string; +} +/** + * Configuration for creating an ORM client. + * Either provide endpoint (and optional headers/fetch) for HTTP requests, + * or provide a custom adapter for alternative execution strategies. + */ +export interface OrmClientConfig { + /** GraphQL endpoint URL (required if adapter not provided) */ + endpoint?: string; + /** Default headers for HTTP requests (only used with endpoint) */ + headers?: Record; + /** + * Custom fetch implementation. Defaults to createFetch() from + * @constructive-io/graphql-query/runtime which handles *.localhost + * DNS and Host headers in Node.js. Pass your own for test mocking + * or custom proxy/credentials. + */ + fetch?: typeof globalThis.fetch; + /** Custom adapter for GraphQL execution (overrides endpoint/headers/fetch) */ + adapter?: GraphQLAdapter; + /** + * Optional realtime (WebSocket) configuration. + * When provided, enables subscription methods on models. + * The WebSocket connection is created lazily on first subscribe(). + */ + realtime?: RealtimeConfig; +} +/** + * Error thrown when GraphQL request fails + */ +export declare class GraphQLRequestError extends Error { + readonly errors: GraphQLError[]; + readonly data: unknown; + constructor(errors: GraphQLError[], data?: unknown); +} +export declare class OrmClient { + private adapter; + private realtimeManager?; + constructor(config: OrmClientConfig); + execute(document: string, variables?: Record): Promise>; + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe(meta: SubscriptionFieldMeta, document: string, variables: Record, options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + }): Unsubscribe; + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers: Record): void; + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint(): string; + /** Get current WebSocket connection state */ + getConnectionState(): ConnectionState; + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe; + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number; + /** Whether realtime is configured */ + get isRealtimeEnabled(): boolean; + /** Dispose the realtime manager (close WebSocket) */ + dispose(): void; +} diff --git a/sdk/functions-sdk/dist/compute/orm/client.js b/sdk/functions-sdk/dist/compute/orm/client.js new file mode 100644 index 00000000..56797138 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/client.js @@ -0,0 +1,152 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OrmClient = exports.GraphQLRequestError = exports.FetchAdapter = exports.RealtimeManager = void 0; +const runtime_1 = require("@constructive-io/graphql-query/runtime"); +const realtime_1 = require("./realtime"); +var realtime_2 = require("./realtime"); +Object.defineProperty(exports, "RealtimeManager", { enumerable: true, get: function () { return realtime_2.RealtimeManager; } }); +/** + * Default adapter that uses fetch for HTTP requests. + * + * When no custom fetch is provided, uses @constructive-io/fetch which + * handles *.localhost DNS rewriting and Host header preservation in + * Node.js. Pass a custom fetch to override for test mocking or custom + * proxy/credentials. + */ +class FetchAdapter { + endpoint; + headers; + fetchFn; + constructor(endpoint, headers, fetchFn) { + this.endpoint = endpoint; + this.headers = headers ?? {}; + this.fetchFn = (fetchFn ?? (0, runtime_1.createFetch)()).bind(globalThis); + } + async execute(document, variables) { + const response = await this.fetchFn(this.endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + Accept: 'application/json', + ...this.headers, + }, + body: JSON.stringify({ + query: document, + variables: variables ?? {}, + }), + }); + if (!response.ok) { + return { + ok: false, + data: null, + errors: [{ message: `HTTP ${response.status}: ${response.statusText}` }], + }; + } + const json = (await response.json()); + if (json.errors && json.errors.length > 0) { + return { + ok: false, + data: null, + errors: json.errors, + }; + } + return { + ok: true, + data: json.data, + errors: undefined, + }; + } + setHeaders(headers) { + this.headers = { ...this.headers, ...headers }; + } + getEndpoint() { + return this.endpoint; + } +} +exports.FetchAdapter = FetchAdapter; +/** + * Error thrown when GraphQL request fails + */ +class GraphQLRequestError extends Error { + errors; + data; + constructor(errors, data = null) { + const messages = errors.map((e) => e.message).join('; '); + super(`GraphQL Error: ${messages}`); + this.errors = errors; + this.data = data; + this.name = 'GraphQLRequestError'; + } +} +exports.GraphQLRequestError = GraphQLRequestError; +class OrmClient { + adapter; + realtimeManager; + constructor(config) { + if (config.adapter) { + this.adapter = config.adapter; + } + else if (config.endpoint) { + this.adapter = new FetchAdapter(config.endpoint, config.headers, config.fetch); + } + else { + throw new Error('OrmClientConfig requires either an endpoint or a custom adapter'); + } + if (config.realtime) { + this.realtimeManager = new realtime_1.RealtimeManager(config.realtime); + } + } + async execute(document, variables) { + return this.adapter.execute(document, variables); + } + /** + * Subscribe to a GraphQL subscription operation. + * Used by generated model subscribe() methods. + * @throws Error if realtime is not configured + */ + subscribe(meta, document, variables, options) { + if (!this.realtimeManager) { + throw new Error('Realtime not configured. Pass a `realtime` option to createClient() to enable subscriptions.'); + } + return this.realtimeManager.subscribe(meta, document, variables, options); + } + /** + * Set headers for requests. + * Only works if the adapter supports headers. + */ + setHeaders(headers) { + if (this.adapter.setHeaders) { + this.adapter.setHeaders(headers); + } + } + /** + * Get the endpoint URL. + * Returns empty string if the adapter doesn't have an endpoint. + */ + getEndpoint() { + return this.adapter.getEndpoint?.() ?? ''; + } + /** Get current WebSocket connection state */ + getConnectionState() { + return this.realtimeManager?.getConnectionState() ?? 'disconnected'; + } + /** Register a listener for WebSocket connection state changes */ + onConnectionStateChange(listener) { + if (!this.realtimeManager) + return () => { }; + return this.realtimeManager.onConnectionStateChange(listener); + } + /** Number of active subscriptions */ + getActiveSubscriptionCount() { + return this.realtimeManager?.getActiveSubscriptionCount() ?? 0; + } + /** Whether realtime is configured */ + get isRealtimeEnabled() { + return this.realtimeManager !== undefined; + } + /** Dispose the realtime manager (close WebSocket) */ + dispose() { + this.realtimeManager?.dispose(); + } +} +exports.OrmClient = OrmClient; diff --git a/sdk/functions-sdk/dist/compute/orm/index.d.ts b/sdk/functions-sdk/dist/compute/orm/index.d.ts new file mode 100644 index 00000000..910095c0 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/index.d.ts @@ -0,0 +1,51 @@ +import type { OrmClientConfig } from './client'; +import { PlatformSecretDefinitionModel } from './models/platformSecretDefinition'; +import { PlatformFunctionExecutionLogModel } from './models/platformFunctionExecutionLog'; +import { PlatformNamespaceModel } from './models/platformNamespace'; +import { PlatformFunctionInvocationModel } from './models/platformFunctionInvocation'; +import { PlatformNamespaceEventModel } from './models/platformNamespaceEvent'; +import { PlatformFunctionDefinitionModel } from './models/platformFunctionDefinition'; +export type { OrmClientConfig, QueryResult, GraphQLError, GraphQLAdapter } from './client'; +export { GraphQLRequestError, FetchAdapter } from './client'; +export { QueryBuilder } from './query-builder'; +export * from './select-types'; +export * from './models'; +export { createMutationOperations } from './mutation'; +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +export declare function createClient(config: OrmClientConfig): { + platformSecretDefinition: PlatformSecretDefinitionModel; + platformFunctionExecutionLog: PlatformFunctionExecutionLogModel; + platformNamespace: PlatformNamespaceModel; + platformFunctionInvocation: PlatformFunctionInvocationModel; + platformNamespaceEvent: PlatformNamespaceEventModel; + platformFunctionDefinition: PlatformFunctionDefinitionModel; + mutation: { + provisionBucket: (args: import("./mutation").ProvisionBucketVariables, options: { + select: S; + } & import("./select-types").StrictSelect) => import("./query-builder").QueryBuilder<{ + provisionBucket: import("./select-types").InferSelectResult | null; + }>; + }; +}; diff --git a/sdk/functions-sdk/dist/compute/orm/index.js b/sdk/functions-sdk/dist/compute/orm/index.js new file mode 100644 index 00000000..951351bd --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/index.js @@ -0,0 +1,75 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMutationOperations = exports.QueryBuilder = exports.FetchAdapter = exports.GraphQLRequestError = void 0; +exports.createClient = createClient; +/** + * ORM Client - createClient factory + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +const client_1 = require("./client"); +const platformSecretDefinition_1 = require("./models/platformSecretDefinition"); +const platformFunctionExecutionLog_1 = require("./models/platformFunctionExecutionLog"); +const platformNamespace_1 = require("./models/platformNamespace"); +const platformFunctionInvocation_1 = require("./models/platformFunctionInvocation"); +const platformNamespaceEvent_1 = require("./models/platformNamespaceEvent"); +const platformFunctionDefinition_1 = require("./models/platformFunctionDefinition"); +const mutation_1 = require("./mutation"); +var client_2 = require("./client"); +Object.defineProperty(exports, "GraphQLRequestError", { enumerable: true, get: function () { return client_2.GraphQLRequestError; } }); +Object.defineProperty(exports, "FetchAdapter", { enumerable: true, get: function () { return client_2.FetchAdapter; } }); +var query_builder_1 = require("./query-builder"); +Object.defineProperty(exports, "QueryBuilder", { enumerable: true, get: function () { return query_builder_1.QueryBuilder; } }); +__exportStar(require("./select-types"), exports); +__exportStar(require("./models"), exports); +var mutation_2 = require("./mutation"); +Object.defineProperty(exports, "createMutationOperations", { enumerable: true, get: function () { return mutation_2.createMutationOperations; } }); +/** + * Create an ORM client instance + * + * @example + * ```typescript + * const db = createClient({ + * endpoint: 'https://api.example.com/graphql', + * headers: { Authorization: 'Bearer token' }, + * }); + * + * // Query users + * const users = await db.user.findMany({ + * select: { id: true, name: true }, + * first: 10, + * }).execute(); + * + * // Create a user + * const newUser = await db.user.create({ + * data: { name: 'John', email: 'john@example.com' }, + * select: { id: true }, + * }).execute(); + * ``` + */ +function createClient(config) { + const client = new client_1.OrmClient(config); + return { + platformSecretDefinition: new platformSecretDefinition_1.PlatformSecretDefinitionModel(client), + platformFunctionExecutionLog: new platformFunctionExecutionLog_1.PlatformFunctionExecutionLogModel(client), + platformNamespace: new platformNamespace_1.PlatformNamespaceModel(client), + platformFunctionInvocation: new platformFunctionInvocation_1.PlatformFunctionInvocationModel(client), + platformNamespaceEvent: new platformNamespaceEvent_1.PlatformNamespaceEventModel(client), + platformFunctionDefinition: new platformFunctionDefinition_1.PlatformFunctionDefinitionModel(client), + mutation: (0, mutation_1.createMutationOperations)(client), + }; +} diff --git a/sdk/functions-sdk/dist/compute/orm/input-types.d.ts b/sdk/functions-sdk/dist/compute/orm/input-types.d.ts new file mode 100644 index 00000000..e3244f3b --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/input-types.d.ts @@ -0,0 +1,1298 @@ +/** + * GraphQL types for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface StringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + includes?: string; + notIncludes?: string; + includesInsensitive?: string; + notIncludesInsensitive?: string; + startsWith?: string; + notStartsWith?: string; + startsWithInsensitive?: string; + notStartsWithInsensitive?: string; + endsWith?: string; + notEndsWith?: string; + endsWithInsensitive?: string; + notEndsWithInsensitive?: string; + like?: string; + notLike?: string; + likeInsensitive?: string; + notLikeInsensitive?: string; +} +export interface IntFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface FloatFilter { + isNull?: boolean; + equalTo?: number; + notEqualTo?: number; + distinctFrom?: number; + notDistinctFrom?: number; + in?: number[]; + notIn?: number[]; + lessThan?: number; + lessThanOrEqualTo?: number; + greaterThan?: number; + greaterThanOrEqualTo?: number; +} +export interface BooleanFilter { + isNull?: boolean; + equalTo?: boolean; + notEqualTo?: boolean; +} +export interface UUIDFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; +} +export interface DatetimeFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface DateFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface JSONFilter { + isNull?: boolean; + equalTo?: Record; + notEqualTo?: Record; + distinctFrom?: Record; + notDistinctFrom?: Record; + contains?: Record; + containedBy?: Record; + containsKey?: string; + containsAllKeys?: string[]; + containsAnyKeys?: string[]; +} +export interface BigIntFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BigFloatFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; +} +export interface BitStringFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; +} +export interface InternetAddressFilter { + isNull?: boolean; + equalTo?: string; + notEqualTo?: string; + distinctFrom?: string; + notDistinctFrom?: string; + in?: string[]; + notIn?: string[]; + lessThan?: string; + lessThanOrEqualTo?: string; + greaterThan?: string; + greaterThanOrEqualTo?: string; + contains?: string; + containsOrEqualTo?: string; + containedBy?: string; + containedByOrEqualTo?: string; + containsOrContainedBy?: string; +} +export interface FullTextFilter { + matches?: string; +} +export interface VectorFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; +} +export interface StringListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export interface IntListFilter { + isNull?: boolean; + equalTo?: number[]; + notEqualTo?: number[]; + distinctFrom?: number[]; + notDistinctFrom?: number[]; + lessThan?: number[]; + lessThanOrEqualTo?: number[]; + greaterThan?: number[]; + greaterThanOrEqualTo?: number[]; + contains?: number[]; + containedBy?: number[]; + overlaps?: number[]; + anyEqualTo?: number; + anyNotEqualTo?: number; + anyLessThan?: number; + anyLessThanOrEqualTo?: number; + anyGreaterThan?: number; + anyGreaterThanOrEqualTo?: number; +} +export interface UUIDListFilter { + isNull?: boolean; + equalTo?: string[]; + notEqualTo?: string[]; + distinctFrom?: string[]; + notDistinctFrom?: string[]; + lessThan?: string[]; + lessThanOrEqualTo?: string[]; + greaterThan?: string[]; + greaterThanOrEqualTo?: string[]; + contains?: string[]; + containedBy?: string[]; + overlaps?: string[]; + anyEqualTo?: string; + anyNotEqualTo?: string; + anyLessThan?: string; + anyLessThanOrEqualTo?: string; + anyGreaterThan?: string; + anyGreaterThanOrEqualTo?: string; +} +export type FunctionRequirement = unknown; +/** Global secret name registry — declares which secrets the platform recognizes. Actual values live in app_secrets. */ +export interface PlatformSecretDefinition { + /** Freeform metadata annotations for secret definitions */ + annotations?: Record | null; + createdAt?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Human-readable description of what this secret is used for */ + description?: string | null; + id: string; + /** Whether this row was seeded as a built-in secret definition. Built-in rows are immutable. */ + isBuiltIn?: boolean | null; + /** Key-value metadata for filtering and grouping secret definitions */ + labels?: Record | null; + /** Secret name (must match app_secrets.name for resolution) */ + name?: string | null; + updatedAt?: string | null; +} +/** Function execution logs — structured console output per invocation */ +export interface PlatformFunctionExecutionLog { + /** Log entry timestamp (partition key) */ + createdAt?: string | null; + /** User who triggered the execution (NULL for system/cron) */ + actorId?: string | null; + /** Database this log entry belongs to */ + databaseId?: string | null; + /** Unique log entry identifier */ + id: string; + /** Invocation this log entry belongs to (NULL for jobs) */ + invocationId?: string | null; + /** Log severity: debug, info, warn, error */ + logLevel?: string | null; + /** Log message text */ + message?: string | null; + /** Structured context (labels, trace data, extra fields) */ + metadata?: Record | null; + /** Function routing key (NULL for generic job logs) */ + taskIdentifier?: string | null; +} +/** Logical namespace containers for grouping secrets, config, functions, and other resources */ +export interface PlatformNamespace { + /** Freeform metadata for tooling and operational notes */ + annotations?: Record | null; + createdAt?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Optional human-readable description of this namespace */ + description?: string | null; + id: string; + /** Whether this namespace is active (soft-disable for filtering) */ + isActive?: boolean | null; + /** Key/value pairs for selecting and filtering namespaces */ + labels?: Record | null; + /** Human-readable namespace name (e.g. default, production, oauth) */ + name?: string | null; + /** Globally unique computed namespace identifier via inflection.underscore */ + namespaceName?: string | null; + updatedAt?: string | null; +} +/** Function invocation log — INSERT to call a function (business-layer, metered) */ +export interface PlatformFunctionInvocation { + /** Invocation creation timestamp (partition key) */ + createdAt?: string | null; + /** Who triggered the invocation */ + actorId?: string | null; + /** When execution completed */ + completedAt?: string | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Wall-clock execution time in milliseconds */ + durationMs?: number | null; + /** Error message when status is failed */ + error?: string | null; + /** Resolved function definition ID */ + functionId?: string | null; + /** Unique invocation identifier */ + id: string; + /** FK to app_jobs.jobs — the underlying transport */ + jobId?: string | null; + /** Function input payload */ + payload?: Record | null; + /** Function return value (success) or structured error (failure) */ + result?: Record | null; + /** When execution started */ + startedAt?: string | null; + /** Lifecycle: pending → running → completed/failed/cancelled */ + status?: string | null; + /** Routing slug (scope:name) for the job worker */ + taskIdentifier?: string | null; +} +/** Namespace lifecycle events — audit log of creation, activation, deactivation, label changes */ +export interface PlatformNamespaceEvent { + /** Event timestamp (partition key) */ + createdAt?: string | null; + /** User who triggered this event (NULL for system/automated) */ + actorId?: string | null; + /** CPU usage in millicores at time of event */ + cpuMillicores?: number | null; + /** Database that owns this resource (database-scoped isolation) */ + databaseId?: string | null; + /** Event type: created, activated, deactivated, labels_updated, annotations_updated, renamed */ + eventType?: string | null; + /** Unique event identifier */ + id: string; + /** Memory usage in bytes at time of event */ + memoryBytes?: string | null; + /** Human-readable description of the event */ + message?: string | null; + /** Structured context (old/new values, labels diff, etc.) */ + metadata?: Record | null; + /** Additional resource metrics (gpu, replicas, quotas, etc.) */ + metrics?: Record | null; + /** Namespace this event belongs to */ + namespaceId?: string | null; + /** Network egress in bytes during event window */ + networkEgressBytes?: string | null; + /** Network ingress in bytes during event window */ + networkIngressBytes?: string | null; + /** Number of active pods in the namespace at time of event */ + podCount?: number | null; + /** Storage usage in bytes at time of event */ + storageBytes?: string | null; +} +/** Function definitions — registered cloud functions with routing, queue, and retry configuration */ +export interface PlatformFunctionDefinition { + createdAt?: string | null; + /** Human-readable description of what this function does */ + description?: string | null; + id: string; + /** Whether this function is a built-in platform function (synced from platform) vs user-created */ + isBuiltIn?: boolean | null; + /** Whether this function can be called via function_invocations (public API). Default false = internal-only via add_job() */ + isInvocable?: boolean | null; + /** Maximum retry attempts for the underlying job */ + maxAttempts?: number | null; + /** Function name within scope (e.g. send_verification_link, process_file_embedding) */ + name?: string | null; + /** Namespace this function belongs to (FK to namespaces table) */ + namespaceId?: string | null; + /** Job priority (lower = higher priority) */ + priority?: number | null; + /** Job queue name for serialization (e.g. email, ai, default) */ + queueName?: string | null; + /** Function grouping scope (e.g. email, embed, chunk, custom) */ + scope?: string | null; + /** Optional service URL override for function dispatch. NULL = use gateway convention (gatewayUrl/task_identifier). Set for customer-deployed functions or external endpoints. */ + serviceUrl?: string | null; + /** Computed routing slug: scope:name (used by Knative job worker for dispatch) */ + taskIdentifier?: string | null; + updatedAt?: string | null; + payloadSchema?: Record | null; + /** Embedded config requirements: array of (name, required) tuples */ + requiredConfigs?: FunctionRequirement[] | null; + /** Embedded secret requirements: array of (name, required) tuples */ + requiredSecrets?: FunctionRequirement[] | null; +} +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +export interface PlatformSecretDefinitionRelations { +} +export interface PlatformFunctionExecutionLogRelations { +} +export interface PlatformNamespaceRelations { +} +export interface PlatformFunctionInvocationRelations { +} +export interface PlatformNamespaceEventRelations { +} +export interface PlatformFunctionDefinitionRelations { + namespace?: PlatformNamespace | null; +} +export type PlatformSecretDefinitionWithRelations = PlatformSecretDefinition & PlatformSecretDefinitionRelations; +export type PlatformFunctionExecutionLogWithRelations = PlatformFunctionExecutionLog & PlatformFunctionExecutionLogRelations; +export type PlatformNamespaceWithRelations = PlatformNamespace & PlatformNamespaceRelations; +export type PlatformFunctionInvocationWithRelations = PlatformFunctionInvocation & PlatformFunctionInvocationRelations; +export type PlatformNamespaceEventWithRelations = PlatformNamespaceEvent & PlatformNamespaceEventRelations; +export type PlatformFunctionDefinitionWithRelations = PlatformFunctionDefinition & PlatformFunctionDefinitionRelations; +export type PlatformSecretDefinitionSelect = { + annotations?: boolean; + createdAt?: boolean; + databaseId?: boolean; + description?: boolean; + id?: boolean; + isBuiltIn?: boolean; + labels?: boolean; + name?: boolean; + updatedAt?: boolean; +}; +export type PlatformFunctionExecutionLogSelect = { + createdAt?: boolean; + actorId?: boolean; + databaseId?: boolean; + id?: boolean; + invocationId?: boolean; + logLevel?: boolean; + message?: boolean; + metadata?: boolean; + taskIdentifier?: boolean; +}; +export type PlatformNamespaceSelect = { + annotations?: boolean; + createdAt?: boolean; + databaseId?: boolean; + description?: boolean; + id?: boolean; + isActive?: boolean; + labels?: boolean; + name?: boolean; + namespaceName?: boolean; + updatedAt?: boolean; +}; +export type PlatformFunctionInvocationSelect = { + createdAt?: boolean; + actorId?: boolean; + completedAt?: boolean; + databaseId?: boolean; + durationMs?: boolean; + error?: boolean; + functionId?: boolean; + id?: boolean; + jobId?: boolean; + payload?: boolean; + result?: boolean; + startedAt?: boolean; + status?: boolean; + taskIdentifier?: boolean; +}; +export type PlatformNamespaceEventSelect = { + createdAt?: boolean; + actorId?: boolean; + cpuMillicores?: boolean; + databaseId?: boolean; + eventType?: boolean; + id?: boolean; + memoryBytes?: boolean; + message?: boolean; + metadata?: boolean; + metrics?: boolean; + namespaceId?: boolean; + networkEgressBytes?: boolean; + networkIngressBytes?: boolean; + podCount?: boolean; + storageBytes?: boolean; +}; +export type PlatformFunctionDefinitionSelect = { + createdAt?: boolean; + description?: boolean; + id?: boolean; + isBuiltIn?: boolean; + isInvocable?: boolean; + maxAttempts?: boolean; + name?: boolean; + namespaceId?: boolean; + priority?: boolean; + queueName?: boolean; + scope?: boolean; + serviceUrl?: boolean; + taskIdentifier?: boolean; + updatedAt?: boolean; + payloadSchema?: boolean; + requiredConfigs?: boolean; + requiredSecrets?: boolean; + namespace?: { + select: PlatformNamespaceSelect; + }; +}; +export interface PlatformSecretDefinitionFilter { + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: PlatformSecretDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformSecretDefinitionFilter[]; + /** Negates the expression. */ + not?: PlatformSecretDefinitionFilter; +} +export interface PlatformFunctionExecutionLogFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `invocationId` field. */ + invocationId?: UUIDFilter; + /** Filter by the object’s `logLevel` field. */ + logLevel?: StringFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Checks for all expressions in this list. */ + and?: PlatformFunctionExecutionLogFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformFunctionExecutionLogFilter[]; + /** Negates the expression. */ + not?: PlatformFunctionExecutionLogFilter; +} +export interface PlatformNamespaceFilter { + /** Filter by the object’s `annotations` field. */ + annotations?: JSONFilter; + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `isActive` field. */ + isActive?: BooleanFilter; + /** Filter by the object’s `labels` field. */ + labels?: JSONFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `namespaceName` field. */ + namespaceName?: StringFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Checks for all expressions in this list. */ + and?: PlatformNamespaceFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformNamespaceFilter[]; + /** Negates the expression. */ + not?: PlatformNamespaceFilter; +} +export interface PlatformFunctionInvocationFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `completedAt` field. */ + completedAt?: DatetimeFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `durationMs` field. */ + durationMs?: IntFilter; + /** Filter by the object’s `error` field. */ + error?: StringFilter; + /** Filter by the object’s `functionId` field. */ + functionId?: UUIDFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `jobId` field. */ + jobId?: BigIntFilter; + /** Filter by the object’s `payload` field. */ + payload?: JSONFilter; + /** Filter by the object’s `result` field. */ + result?: JSONFilter; + /** Filter by the object’s `startedAt` field. */ + startedAt?: DatetimeFilter; + /** Filter by the object’s `status` field. */ + status?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Checks for all expressions in this list. */ + and?: PlatformFunctionInvocationFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformFunctionInvocationFilter[]; + /** Negates the expression. */ + not?: PlatformFunctionInvocationFilter; +} +export interface PlatformNamespaceEventFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `actorId` field. */ + actorId?: UUIDFilter; + /** Filter by the object’s `cpuMillicores` field. */ + cpuMillicores?: IntFilter; + /** Filter by the object’s `databaseId` field. */ + databaseId?: UUIDFilter; + /** Filter by the object’s `eventType` field. */ + eventType?: StringFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `memoryBytes` field. */ + memoryBytes?: BigIntFilter; + /** Filter by the object’s `message` field. */ + message?: StringFilter; + /** Filter by the object’s `metadata` field. */ + metadata?: JSONFilter; + /** Filter by the object’s `metrics` field. */ + metrics?: JSONFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `networkEgressBytes` field. */ + networkEgressBytes?: BigIntFilter; + /** Filter by the object’s `networkIngressBytes` field. */ + networkIngressBytes?: BigIntFilter; + /** Filter by the object’s `podCount` field. */ + podCount?: IntFilter; + /** Filter by the object’s `storageBytes` field. */ + storageBytes?: BigIntFilter; + /** Checks for all expressions in this list. */ + and?: PlatformNamespaceEventFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformNamespaceEventFilter[]; + /** Negates the expression. */ + not?: PlatformNamespaceEventFilter; +} +export interface PlatformFunctionDefinitionFilter { + /** Filter by the object’s `createdAt` field. */ + createdAt?: DatetimeFilter; + /** Filter by the object’s `description` field. */ + description?: StringFilter; + /** Filter by the object’s `id` field. */ + id?: UUIDFilter; + /** Filter by the object’s `isBuiltIn` field. */ + isBuiltIn?: BooleanFilter; + /** Filter by the object’s `isInvocable` field. */ + isInvocable?: BooleanFilter; + /** Filter by the object’s `maxAttempts` field. */ + maxAttempts?: IntFilter; + /** Filter by the object’s `name` field. */ + name?: StringFilter; + /** Filter by the object’s `namespaceId` field. */ + namespaceId?: UUIDFilter; + /** Filter by the object’s `priority` field. */ + priority?: IntFilter; + /** Filter by the object’s `queueName` field. */ + queueName?: StringFilter; + /** Filter by the object’s `scope` field. */ + scope?: StringFilter; + /** Filter by the object’s `serviceUrl` field. */ + serviceUrl?: StringFilter; + /** Filter by the object’s `taskIdentifier` field. */ + taskIdentifier?: StringFilter; + /** Filter by the object’s `updatedAt` field. */ + updatedAt?: DatetimeFilter; + /** Filter by the object’s `payloadSchema` field. */ + payloadSchema?: JSONFilter; + /** Checks for all expressions in this list. */ + and?: PlatformFunctionDefinitionFilter[]; + /** Checks for any expressions in this list. */ + or?: PlatformFunctionDefinitionFilter[]; + /** Negates the expression. */ + not?: PlatformFunctionDefinitionFilter; + /** Filter by the object’s `namespace` relation. */ + namespace?: PlatformNamespaceFilter; + /** A related `namespace` exists. */ + namespaceExists?: boolean; +} +export type PlatformSecretDefinitionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ANNOTATIONS_ASC' | 'ANNOTATIONS_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'ID_ASC' | 'ID_DESC' | 'IS_BUILT_IN_ASC' | 'IS_BUILT_IN_DESC' | 'LABELS_ASC' | 'LABELS_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; +export type PlatformFunctionExecutionLogOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'ID_ASC' | 'ID_DESC' | 'INVOCATION_ID_ASC' | 'INVOCATION_ID_DESC' | 'LOG_LEVEL_ASC' | 'LOG_LEVEL_DESC' | 'MESSAGE_ASC' | 'MESSAGE_DESC' | 'METADATA_ASC' | 'METADATA_DESC' | 'TASK_IDENTIFIER_ASC' | 'TASK_IDENTIFIER_DESC'; +export type PlatformNamespaceOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'ANNOTATIONS_ASC' | 'ANNOTATIONS_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'ID_ASC' | 'ID_DESC' | 'IS_ACTIVE_ASC' | 'IS_ACTIVE_DESC' | 'LABELS_ASC' | 'LABELS_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'NAMESPACE_NAME_ASC' | 'NAMESPACE_NAME_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC'; +export type PlatformFunctionInvocationOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'COMPLETED_AT_ASC' | 'COMPLETED_AT_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'DURATION_MS_ASC' | 'DURATION_MS_DESC' | 'ERROR_ASC' | 'ERROR_DESC' | 'FUNCTION_ID_ASC' | 'FUNCTION_ID_DESC' | 'ID_ASC' | 'ID_DESC' | 'JOB_ID_ASC' | 'JOB_ID_DESC' | 'PAYLOAD_ASC' | 'PAYLOAD_DESC' | 'RESULT_ASC' | 'RESULT_DESC' | 'STARTED_AT_ASC' | 'STARTED_AT_DESC' | 'STATUS_ASC' | 'STATUS_DESC' | 'TASK_IDENTIFIER_ASC' | 'TASK_IDENTIFIER_DESC'; +export type PlatformNamespaceEventOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'ACTOR_ID_ASC' | 'ACTOR_ID_DESC' | 'CPU_MILLICORES_ASC' | 'CPU_MILLICORES_DESC' | 'DATABASE_ID_ASC' | 'DATABASE_ID_DESC' | 'EVENT_TYPE_ASC' | 'EVENT_TYPE_DESC' | 'ID_ASC' | 'ID_DESC' | 'MEMORY_BYTES_ASC' | 'MEMORY_BYTES_DESC' | 'MESSAGE_ASC' | 'MESSAGE_DESC' | 'METADATA_ASC' | 'METADATA_DESC' | 'METRICS_ASC' | 'METRICS_DESC' | 'NAMESPACE_ID_ASC' | 'NAMESPACE_ID_DESC' | 'NETWORK_EGRESS_BYTES_ASC' | 'NETWORK_EGRESS_BYTES_DESC' | 'NETWORK_INGRESS_BYTES_ASC' | 'NETWORK_INGRESS_BYTES_DESC' | 'POD_COUNT_ASC' | 'POD_COUNT_DESC' | 'STORAGE_BYTES_ASC' | 'STORAGE_BYTES_DESC'; +export type PlatformFunctionDefinitionOrderBy = 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC' | 'CREATED_AT_ASC' | 'CREATED_AT_DESC' | 'DESCRIPTION_ASC' | 'DESCRIPTION_DESC' | 'ID_ASC' | 'ID_DESC' | 'IS_BUILT_IN_ASC' | 'IS_BUILT_IN_DESC' | 'IS_INVOCABLE_ASC' | 'IS_INVOCABLE_DESC' | 'MAX_ATTEMPTS_ASC' | 'MAX_ATTEMPTS_DESC' | 'NAME_ASC' | 'NAME_DESC' | 'NAMESPACE_ID_ASC' | 'NAMESPACE_ID_DESC' | 'PRIORITY_ASC' | 'PRIORITY_DESC' | 'QUEUE_NAME_ASC' | 'QUEUE_NAME_DESC' | 'SCOPE_ASC' | 'SCOPE_DESC' | 'SERVICE_URL_ASC' | 'SERVICE_URL_DESC' | 'TASK_IDENTIFIER_ASC' | 'TASK_IDENTIFIER_DESC' | 'UPDATED_AT_ASC' | 'UPDATED_AT_DESC' | 'PAYLOAD_SCHEMA_ASC' | 'PAYLOAD_SCHEMA_DESC' | 'REQUIRED_CONFIGS_ASC' | 'REQUIRED_CONFIGS_DESC' | 'REQUIRED_SECRETS_ASC' | 'REQUIRED_SECRETS_DESC'; +export interface CreatePlatformSecretDefinitionInput { + clientMutationId?: string; + platformSecretDefinition: { + annotations?: Record; + databaseId: string; + description?: string; + isBuiltIn?: boolean; + labels?: Record; + name: string; + }; +} +export interface PlatformSecretDefinitionPatch { + annotations?: Record | null; + databaseId?: string | null; + description?: string | null; + isBuiltIn?: boolean | null; + labels?: Record | null; + name?: string | null; +} +export interface UpdatePlatformSecretDefinitionInput { + clientMutationId?: string; + id: string; + platformSecretDefinitionPatch: PlatformSecretDefinitionPatch; +} +export interface DeletePlatformSecretDefinitionInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformFunctionExecutionLogInput { + clientMutationId?: string; + platformFunctionExecutionLog: { + actorId?: string; + databaseId: string; + invocationId?: string; + logLevel?: string; + message: string; + metadata?: Record; + taskIdentifier?: string; + }; +} +export interface PlatformFunctionExecutionLogPatch { + actorId?: string | null; + databaseId?: string | null; + invocationId?: string | null; + logLevel?: string | null; + message?: string | null; + metadata?: Record | null; + taskIdentifier?: string | null; +} +export interface UpdatePlatformFunctionExecutionLogInput { + clientMutationId?: string; + id: string; + platformFunctionExecutionLogPatch: PlatformFunctionExecutionLogPatch; +} +export interface DeletePlatformFunctionExecutionLogInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformNamespaceInput { + clientMutationId?: string; + platformNamespace: { + annotations?: Record; + databaseId: string; + description?: string; + isActive?: boolean; + labels?: Record; + name: string; + namespaceName: string; + }; +} +export interface PlatformNamespacePatch { + annotations?: Record | null; + databaseId?: string | null; + description?: string | null; + isActive?: boolean | null; + labels?: Record | null; + name?: string | null; + namespaceName?: string | null; +} +export interface UpdatePlatformNamespaceInput { + clientMutationId?: string; + id: string; + platformNamespacePatch: PlatformNamespacePatch; +} +export interface DeletePlatformNamespaceInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformFunctionInvocationInput { + clientMutationId?: string; + platformFunctionInvocation: { + actorId?: string; + completedAt?: string; + databaseId: string; + durationMs?: number; + error?: string; + functionId?: string; + jobId?: string; + payload?: Record; + result?: Record; + startedAt?: string; + status?: string; + taskIdentifier: string; + }; +} +export interface PlatformFunctionInvocationPatch { + actorId?: string | null; + completedAt?: string | null; + databaseId?: string | null; + durationMs?: number | null; + error?: string | null; + functionId?: string | null; + jobId?: string | null; + payload?: Record | null; + result?: Record | null; + startedAt?: string | null; + status?: string | null; + taskIdentifier?: string | null; +} +export interface UpdatePlatformFunctionInvocationInput { + clientMutationId?: string; + id: string; + platformFunctionInvocationPatch: PlatformFunctionInvocationPatch; +} +export interface DeletePlatformFunctionInvocationInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformNamespaceEventInput { + clientMutationId?: string; + platformNamespaceEvent: { + actorId?: string; + cpuMillicores?: number; + databaseId: string; + eventType: string; + memoryBytes?: string; + message?: string; + metadata?: Record; + metrics?: Record; + namespaceId: string; + networkEgressBytes?: string; + networkIngressBytes?: string; + podCount?: number; + storageBytes?: string; + }; +} +export interface PlatformNamespaceEventPatch { + actorId?: string | null; + cpuMillicores?: number | null; + databaseId?: string | null; + eventType?: string | null; + memoryBytes?: string | null; + message?: string | null; + metadata?: Record | null; + metrics?: Record | null; + namespaceId?: string | null; + networkEgressBytes?: string | null; + networkIngressBytes?: string | null; + podCount?: number | null; + storageBytes?: string | null; +} +export interface UpdatePlatformNamespaceEventInput { + clientMutationId?: string; + id: string; + platformNamespaceEventPatch: PlatformNamespaceEventPatch; +} +export interface DeletePlatformNamespaceEventInput { + clientMutationId?: string; + id: string; +} +export interface CreatePlatformFunctionDefinitionInput { + clientMutationId?: string; + platformFunctionDefinition: { + description?: string; + isBuiltIn?: boolean; + isInvocable?: boolean; + maxAttempts?: number; + name: string; + namespaceId?: string; + priority?: number; + queueName?: string; + scope: string; + serviceUrl?: string; + taskIdentifier: string; + payloadSchema?: Record; + requiredConfigs?: FunctionRequirementInput[]; + requiredSecrets?: FunctionRequirementInput[]; + }; +} +export interface PlatformFunctionDefinitionPatch { + description?: string | null; + isBuiltIn?: boolean | null; + isInvocable?: boolean | null; + maxAttempts?: number | null; + name?: string | null; + namespaceId?: string | null; + priority?: number | null; + queueName?: string | null; + scope?: string | null; + serviceUrl?: string | null; + taskIdentifier?: string | null; + payloadSchema?: Record | null; + requiredConfigs?: FunctionRequirementInput[] | null; + requiredSecrets?: FunctionRequirementInput[] | null; +} +export interface UpdatePlatformFunctionDefinitionInput { + clientMutationId?: string; + id: string; + platformFunctionDefinitionPatch: PlatformFunctionDefinitionPatch; +} +export interface DeletePlatformFunctionDefinitionInput { + clientMutationId?: string; + id: string; +} +export declare const connectionFieldsMap: Record>; +export interface ProvisionBucketInput { + /** The logical bucket key (e.g., "public", "private") */ + bucketKey: string; + /** + * Owner entity ID for entity-scoped bucket provisioning. + * Omit for app-level (database-wide) storage. + */ + ownerId?: string; +} +export interface ProvisionBucketPayload { + /** Whether provisioning succeeded */ + success: boolean; + /** The S3 bucket name that was provisioned */ + bucketName: string; + /** The access type applied */ + accessType: string; + /** The storage provider used */ + provider: string; + /** The S3 endpoint (null for AWS S3 default) */ + endpoint?: string | null; + /** Error message if provisioning failed */ + error?: string | null; +} +export type ProvisionBucketPayloadSelect = { + success?: boolean; + bucketName?: boolean; + accessType?: boolean; + provider?: boolean; + endpoint?: boolean; + error?: boolean; +}; +export interface CreatePlatformSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformSecretDefinition` that was created by this mutation. */ + platformSecretDefinition?: PlatformSecretDefinition | null; + platformSecretDefinitionEdge?: PlatformSecretDefinitionEdge | null; +} +export type CreatePlatformSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformSecretDefinition?: { + select: PlatformSecretDefinitionSelect; + }; + platformSecretDefinitionEdge?: { + select: PlatformSecretDefinitionEdgeSelect; + }; +}; +export interface UpdatePlatformSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformSecretDefinition` that was updated by this mutation. */ + platformSecretDefinition?: PlatformSecretDefinition | null; + platformSecretDefinitionEdge?: PlatformSecretDefinitionEdge | null; +} +export type UpdatePlatformSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformSecretDefinition?: { + select: PlatformSecretDefinitionSelect; + }; + platformSecretDefinitionEdge?: { + select: PlatformSecretDefinitionEdgeSelect; + }; +}; +export interface DeletePlatformSecretDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformSecretDefinition` that was deleted by this mutation. */ + platformSecretDefinition?: PlatformSecretDefinition | null; + platformSecretDefinitionEdge?: PlatformSecretDefinitionEdge | null; +} +export type DeletePlatformSecretDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformSecretDefinition?: { + select: PlatformSecretDefinitionSelect; + }; + platformSecretDefinitionEdge?: { + select: PlatformSecretDefinitionEdgeSelect; + }; +}; +export interface CreatePlatformFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionExecutionLog` that was created by this mutation. */ + platformFunctionExecutionLog?: PlatformFunctionExecutionLog | null; + platformFunctionExecutionLogEdge?: PlatformFunctionExecutionLogEdge | null; +} +export type CreatePlatformFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + platformFunctionExecutionLog?: { + select: PlatformFunctionExecutionLogSelect; + }; + platformFunctionExecutionLogEdge?: { + select: PlatformFunctionExecutionLogEdgeSelect; + }; +}; +export interface UpdatePlatformFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionExecutionLog` that was updated by this mutation. */ + platformFunctionExecutionLog?: PlatformFunctionExecutionLog | null; + platformFunctionExecutionLogEdge?: PlatformFunctionExecutionLogEdge | null; +} +export type UpdatePlatformFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + platformFunctionExecutionLog?: { + select: PlatformFunctionExecutionLogSelect; + }; + platformFunctionExecutionLogEdge?: { + select: PlatformFunctionExecutionLogEdgeSelect; + }; +}; +export interface DeletePlatformFunctionExecutionLogPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionExecutionLog` that was deleted by this mutation. */ + platformFunctionExecutionLog?: PlatformFunctionExecutionLog | null; + platformFunctionExecutionLogEdge?: PlatformFunctionExecutionLogEdge | null; +} +export type DeletePlatformFunctionExecutionLogPayloadSelect = { + clientMutationId?: boolean; + platformFunctionExecutionLog?: { + select: PlatformFunctionExecutionLogSelect; + }; + platformFunctionExecutionLogEdge?: { + select: PlatformFunctionExecutionLogEdgeSelect; + }; +}; +export interface CreatePlatformNamespacePayload { + clientMutationId?: string | null; + /** The `PlatformNamespace` that was created by this mutation. */ + platformNamespace?: PlatformNamespace | null; + platformNamespaceEdge?: PlatformNamespaceEdge | null; +} +export type CreatePlatformNamespacePayloadSelect = { + clientMutationId?: boolean; + platformNamespace?: { + select: PlatformNamespaceSelect; + }; + platformNamespaceEdge?: { + select: PlatformNamespaceEdgeSelect; + }; +}; +export interface UpdatePlatformNamespacePayload { + clientMutationId?: string | null; + /** The `PlatformNamespace` that was updated by this mutation. */ + platformNamespace?: PlatformNamespace | null; + platformNamespaceEdge?: PlatformNamespaceEdge | null; +} +export type UpdatePlatformNamespacePayloadSelect = { + clientMutationId?: boolean; + platformNamespace?: { + select: PlatformNamespaceSelect; + }; + platformNamespaceEdge?: { + select: PlatformNamespaceEdgeSelect; + }; +}; +export interface DeletePlatformNamespacePayload { + clientMutationId?: string | null; + /** The `PlatformNamespace` that was deleted by this mutation. */ + platformNamespace?: PlatformNamespace | null; + platformNamespaceEdge?: PlatformNamespaceEdge | null; +} +export type DeletePlatformNamespacePayloadSelect = { + clientMutationId?: boolean; + platformNamespace?: { + select: PlatformNamespaceSelect; + }; + platformNamespaceEdge?: { + select: PlatformNamespaceEdgeSelect; + }; +}; +export interface CreatePlatformFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionInvocation` that was created by this mutation. */ + platformFunctionInvocation?: PlatformFunctionInvocation | null; + platformFunctionInvocationEdge?: PlatformFunctionInvocationEdge | null; +} +export type CreatePlatformFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + platformFunctionInvocation?: { + select: PlatformFunctionInvocationSelect; + }; + platformFunctionInvocationEdge?: { + select: PlatformFunctionInvocationEdgeSelect; + }; +}; +export interface UpdatePlatformFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionInvocation` that was updated by this mutation. */ + platformFunctionInvocation?: PlatformFunctionInvocation | null; + platformFunctionInvocationEdge?: PlatformFunctionInvocationEdge | null; +} +export type UpdatePlatformFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + platformFunctionInvocation?: { + select: PlatformFunctionInvocationSelect; + }; + platformFunctionInvocationEdge?: { + select: PlatformFunctionInvocationEdgeSelect; + }; +}; +export interface DeletePlatformFunctionInvocationPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionInvocation` that was deleted by this mutation. */ + platformFunctionInvocation?: PlatformFunctionInvocation | null; + platformFunctionInvocationEdge?: PlatformFunctionInvocationEdge | null; +} +export type DeletePlatformFunctionInvocationPayloadSelect = { + clientMutationId?: boolean; + platformFunctionInvocation?: { + select: PlatformFunctionInvocationSelect; + }; + platformFunctionInvocationEdge?: { + select: PlatformFunctionInvocationEdgeSelect; + }; +}; +export interface CreatePlatformNamespaceEventPayload { + clientMutationId?: string | null; + /** The `PlatformNamespaceEvent` that was created by this mutation. */ + platformNamespaceEvent?: PlatformNamespaceEvent | null; + platformNamespaceEventEdge?: PlatformNamespaceEventEdge | null; +} +export type CreatePlatformNamespaceEventPayloadSelect = { + clientMutationId?: boolean; + platformNamespaceEvent?: { + select: PlatformNamespaceEventSelect; + }; + platformNamespaceEventEdge?: { + select: PlatformNamespaceEventEdgeSelect; + }; +}; +export interface UpdatePlatformNamespaceEventPayload { + clientMutationId?: string | null; + /** The `PlatformNamespaceEvent` that was updated by this mutation. */ + platformNamespaceEvent?: PlatformNamespaceEvent | null; + platformNamespaceEventEdge?: PlatformNamespaceEventEdge | null; +} +export type UpdatePlatformNamespaceEventPayloadSelect = { + clientMutationId?: boolean; + platformNamespaceEvent?: { + select: PlatformNamespaceEventSelect; + }; + platformNamespaceEventEdge?: { + select: PlatformNamespaceEventEdgeSelect; + }; +}; +export interface DeletePlatformNamespaceEventPayload { + clientMutationId?: string | null; + /** The `PlatformNamespaceEvent` that was deleted by this mutation. */ + platformNamespaceEvent?: PlatformNamespaceEvent | null; + platformNamespaceEventEdge?: PlatformNamespaceEventEdge | null; +} +export type DeletePlatformNamespaceEventPayloadSelect = { + clientMutationId?: boolean; + platformNamespaceEvent?: { + select: PlatformNamespaceEventSelect; + }; + platformNamespaceEventEdge?: { + select: PlatformNamespaceEventEdgeSelect; + }; +}; +export interface CreatePlatformFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionDefinition` that was created by this mutation. */ + platformFunctionDefinition?: PlatformFunctionDefinition | null; + platformFunctionDefinitionEdge?: PlatformFunctionDefinitionEdge | null; +} +export type CreatePlatformFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformFunctionDefinition?: { + select: PlatformFunctionDefinitionSelect; + }; + platformFunctionDefinitionEdge?: { + select: PlatformFunctionDefinitionEdgeSelect; + }; +}; +export interface UpdatePlatformFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionDefinition` that was updated by this mutation. */ + platformFunctionDefinition?: PlatformFunctionDefinition | null; + platformFunctionDefinitionEdge?: PlatformFunctionDefinitionEdge | null; +} +export type UpdatePlatformFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformFunctionDefinition?: { + select: PlatformFunctionDefinitionSelect; + }; + platformFunctionDefinitionEdge?: { + select: PlatformFunctionDefinitionEdgeSelect; + }; +}; +export interface DeletePlatformFunctionDefinitionPayload { + clientMutationId?: string | null; + /** The `PlatformFunctionDefinition` that was deleted by this mutation. */ + platformFunctionDefinition?: PlatformFunctionDefinition | null; + platformFunctionDefinitionEdge?: PlatformFunctionDefinitionEdge | null; +} +export type DeletePlatformFunctionDefinitionPayloadSelect = { + clientMutationId?: boolean; + platformFunctionDefinition?: { + select: PlatformFunctionDefinitionSelect; + }; + platformFunctionDefinitionEdge?: { + select: PlatformFunctionDefinitionEdgeSelect; + }; +}; +/** A `PlatformSecretDefinition` edge in the connection. */ +export interface PlatformSecretDefinitionEdge { + cursor?: string | null; + /** The `PlatformSecretDefinition` at the end of the edge. */ + node?: PlatformSecretDefinition | null; +} +export type PlatformSecretDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformSecretDefinitionSelect; + }; +}; +/** A `PlatformFunctionExecutionLog` edge in the connection. */ +export interface PlatformFunctionExecutionLogEdge { + cursor?: string | null; + /** The `PlatformFunctionExecutionLog` at the end of the edge. */ + node?: PlatformFunctionExecutionLog | null; +} +export type PlatformFunctionExecutionLogEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformFunctionExecutionLogSelect; + }; +}; +/** A `PlatformNamespace` edge in the connection. */ +export interface PlatformNamespaceEdge { + cursor?: string | null; + /** The `PlatformNamespace` at the end of the edge. */ + node?: PlatformNamespace | null; +} +export type PlatformNamespaceEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformNamespaceSelect; + }; +}; +/** A `PlatformFunctionInvocation` edge in the connection. */ +export interface PlatformFunctionInvocationEdge { + cursor?: string | null; + /** The `PlatformFunctionInvocation` at the end of the edge. */ + node?: PlatformFunctionInvocation | null; +} +export type PlatformFunctionInvocationEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformFunctionInvocationSelect; + }; +}; +/** A `PlatformNamespaceEvent` edge in the connection. */ +export interface PlatformNamespaceEventEdge { + cursor?: string | null; + /** The `PlatformNamespaceEvent` at the end of the edge. */ + node?: PlatformNamespaceEvent | null; +} +export type PlatformNamespaceEventEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformNamespaceEventSelect; + }; +}; +/** A `PlatformFunctionDefinition` edge in the connection. */ +export interface PlatformFunctionDefinitionEdge { + cursor?: string | null; + /** The `PlatformFunctionDefinition` at the end of the edge. */ + node?: PlatformFunctionDefinition | null; +} +export type PlatformFunctionDefinitionEdgeSelect = { + cursor?: boolean; + node?: { + select: PlatformFunctionDefinitionSelect; + }; +}; +export type FunctionRequirementInput = unknown; diff --git a/sdk/functions-sdk/dist/compute/orm/input-types.js b/sdk/functions-sdk/dist/compute/orm/input-types.js new file mode 100644 index 00000000..3b7ed850 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/input-types.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.connectionFieldsMap = void 0; +// ============ Connection Fields Map ============ +exports.connectionFieldsMap = {}; diff --git a/sdk/functions-sdk/dist/compute/orm/models/index.d.ts b/sdk/functions-sdk/dist/compute/orm/models/index.d.ts new file mode 100644 index 00000000..ecd39c79 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/index.d.ts @@ -0,0 +1,11 @@ +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export { PlatformSecretDefinitionModel } from './platformSecretDefinition'; +export { PlatformFunctionExecutionLogModel } from './platformFunctionExecutionLog'; +export { PlatformNamespaceModel } from './platformNamespace'; +export { PlatformFunctionInvocationModel } from './platformFunctionInvocation'; +export { PlatformNamespaceEventModel } from './platformNamespaceEvent'; +export { PlatformFunctionDefinitionModel } from './platformFunctionDefinition'; diff --git a/sdk/functions-sdk/dist/compute/orm/models/index.js b/sdk/functions-sdk/dist/compute/orm/models/index.js new file mode 100644 index 00000000..1551ec6c --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/index.js @@ -0,0 +1,20 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformFunctionDefinitionModel = exports.PlatformNamespaceEventModel = exports.PlatformFunctionInvocationModel = exports.PlatformNamespaceModel = exports.PlatformFunctionExecutionLogModel = exports.PlatformSecretDefinitionModel = void 0; +/** + * Models barrel export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +var platformSecretDefinition_1 = require("./platformSecretDefinition"); +Object.defineProperty(exports, "PlatformSecretDefinitionModel", { enumerable: true, get: function () { return platformSecretDefinition_1.PlatformSecretDefinitionModel; } }); +var platformFunctionExecutionLog_1 = require("./platformFunctionExecutionLog"); +Object.defineProperty(exports, "PlatformFunctionExecutionLogModel", { enumerable: true, get: function () { return platformFunctionExecutionLog_1.PlatformFunctionExecutionLogModel; } }); +var platformNamespace_1 = require("./platformNamespace"); +Object.defineProperty(exports, "PlatformNamespaceModel", { enumerable: true, get: function () { return platformNamespace_1.PlatformNamespaceModel; } }); +var platformFunctionInvocation_1 = require("./platformFunctionInvocation"); +Object.defineProperty(exports, "PlatformFunctionInvocationModel", { enumerable: true, get: function () { return platformFunctionInvocation_1.PlatformFunctionInvocationModel; } }); +var platformNamespaceEvent_1 = require("./platformNamespaceEvent"); +Object.defineProperty(exports, "PlatformNamespaceEventModel", { enumerable: true, get: function () { return platformNamespaceEvent_1.PlatformNamespaceEventModel; } }); +var platformFunctionDefinition_1 = require("./platformFunctionDefinition"); +Object.defineProperty(exports, "PlatformFunctionDefinitionModel", { enumerable: true, get: function () { return platformFunctionDefinition_1.PlatformFunctionDefinitionModel; } }); diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.d.ts b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.d.ts new file mode 100644 index 00000000..d2310288 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.d.ts @@ -0,0 +1,54 @@ +/** + * PlatformFunctionDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types'; +import type { PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy, CreatePlatformFunctionDefinitionInput, PlatformFunctionDefinitionPatch } from '../input-types'; +export declare class PlatformFunctionDefinitionModel { + private client; + constructor(client: OrmClient); + findMany(args: FindManyArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionDefinitions: ConnectionResult>; + }>; + findFirst(args: FindFirstArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult | null; + }>; + findOne(args: { + id: string; + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionDefinition: InferSelectResult | null; + }>; + create(args: CreateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + createPlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }>; + update(args: UpdateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + updatePlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }>; + delete(args: DeleteArgs<{ + id: string; + }, S> & { + select: S; + } & StrictSelect): QueryBuilder<{ + deletePlatformFunctionDefinition: { + platformFunctionDefinition: InferSelectResult; + }; + }>; +} diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.js b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.js new file mode 100644 index 00000000..28ef0a68 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionDefinition.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformFunctionDefinitionModel = void 0; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +class PlatformFunctionDefinitionModel { + client; + constructor(client) { + this.client = client; + } + findMany(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformFunctionDefinition', 'platformFunctionDefinitions', args.select, { + where: args?.where, + orderBy: args?.orderBy, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, 'PlatformFunctionDefinitionFilter', 'PlatformFunctionDefinitionOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinitions', + document, + variables, + }); + } + findFirst(args) { + const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PlatformFunctionDefinition', 'platformFunctionDefinitions', args.select, { + where: args?.where, + orderBy: args?.orderBy, + }, 'PlatformFunctionDefinitionFilter', 'PlatformFunctionDefinitionOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', + document, + variables, + transform: (data) => ({ + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformFunctionDefinition', 'platformFunctionDefinitions', args.select, { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, 'PlatformFunctionDefinitionFilter', 'PlatformFunctionDefinitionOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionDefinition', + fieldName: 'platformFunctionDefinition', + document, + variables, + transform: (data) => ({ + platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create(args) { + const { document, variables } = (0, query_builder_1.buildCreateDocument)('PlatformFunctionDefinition', 'createPlatformFunctionDefinition', 'platformFunctionDefinition', args.select, args.data, 'CreatePlatformFunctionDefinitionInput', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'createPlatformFunctionDefinition', + document, + variables, + }); + } + update(args) { + const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PlatformFunctionDefinition', 'updatePlatformFunctionDefinition', 'platformFunctionDefinition', args.select, args.where.id, args.data, 'UpdatePlatformFunctionDefinitionInput', 'id', 'platformFunctionDefinitionPatch', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'updatePlatformFunctionDefinition', + document, + variables, + }); + } + delete(args) { + const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PlatformFunctionDefinition', 'deletePlatformFunctionDefinition', 'platformFunctionDefinition', { + id: args.where.id, + }, 'DeletePlatformFunctionDefinitionInput', args.select, input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionDefinition', + fieldName: 'deletePlatformFunctionDefinition', + document, + variables, + }); + } +} +exports.PlatformFunctionDefinitionModel = PlatformFunctionDefinitionModel; diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.d.ts b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.d.ts new file mode 100644 index 00000000..4bfb5a14 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.d.ts @@ -0,0 +1,54 @@ +/** + * PlatformFunctionExecutionLog model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types'; +import type { PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy, CreatePlatformFunctionExecutionLogInput, PlatformFunctionExecutionLogPatch } from '../input-types'; +export declare class PlatformFunctionExecutionLogModel { + private client; + constructor(client: OrmClient); + findMany(args: FindManyArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionExecutionLogs: ConnectionResult>; + }>; + findFirst(args: FindFirstArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult | null; + }>; + findOne(args: { + id: string; + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionExecutionLog: InferSelectResult | null; + }>; + create(args: CreateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + createPlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult; + }; + }>; + update(args: UpdateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + updatePlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult; + }; + }>; + delete(args: DeleteArgs<{ + id: string; + }, S> & { + select: S; + } & StrictSelect): QueryBuilder<{ + deletePlatformFunctionExecutionLog: { + platformFunctionExecutionLog: InferSelectResult; + }; + }>; +} diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.js b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.js new file mode 100644 index 00000000..ac71a62f --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionExecutionLog.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformFunctionExecutionLogModel = void 0; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +class PlatformFunctionExecutionLogModel { + client; + constructor(client) { + this.client = client; + } + findMany(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformFunctionExecutionLog', 'platformFunctionExecutionLogs', args.select, { + where: args?.where, + orderBy: args?.orderBy, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, 'PlatformFunctionExecutionLogFilter', 'PlatformFunctionExecutionLogOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLogs', + document, + variables, + }); + } + findFirst(args) { + const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PlatformFunctionExecutionLog', 'platformFunctionExecutionLogs', args.select, { + where: args?.where, + orderBy: args?.orderBy, + }, 'PlatformFunctionExecutionLogFilter', 'PlatformFunctionExecutionLogOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', + document, + variables, + transform: (data) => ({ + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + findOne(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformFunctionExecutionLog', 'platformFunctionExecutionLogs', args.select, { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, 'PlatformFunctionExecutionLogFilter', 'PlatformFunctionExecutionLogOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'platformFunctionExecutionLog', + document, + variables, + transform: (data) => ({ + platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, + }), + }); + } + create(args) { + const { document, variables } = (0, query_builder_1.buildCreateDocument)('PlatformFunctionExecutionLog', 'createPlatformFunctionExecutionLog', 'platformFunctionExecutionLog', args.select, args.data, 'CreatePlatformFunctionExecutionLogInput', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'createPlatformFunctionExecutionLog', + document, + variables, + }); + } + update(args) { + const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PlatformFunctionExecutionLog', 'updatePlatformFunctionExecutionLog', 'platformFunctionExecutionLog', args.select, args.where.id, args.data, 'UpdatePlatformFunctionExecutionLogInput', 'id', 'platformFunctionExecutionLogPatch', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'updatePlatformFunctionExecutionLog', + document, + variables, + }); + } + delete(args) { + const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PlatformFunctionExecutionLog', 'deletePlatformFunctionExecutionLog', 'platformFunctionExecutionLog', { + id: args.where.id, + }, 'DeletePlatformFunctionExecutionLogInput', args.select, input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionExecutionLog', + fieldName: 'deletePlatformFunctionExecutionLog', + document, + variables, + }); + } +} +exports.PlatformFunctionExecutionLogModel = PlatformFunctionExecutionLogModel; diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.d.ts b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.d.ts new file mode 100644 index 00000000..0e5cdbe0 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.d.ts @@ -0,0 +1,54 @@ +/** + * PlatformFunctionInvocation model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types'; +import type { PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationSelect, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy, CreatePlatformFunctionInvocationInput, PlatformFunctionInvocationPatch } from '../input-types'; +export declare class PlatformFunctionInvocationModel { + private client; + constructor(client: OrmClient); + findMany(args: FindManyArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionInvocations: ConnectionResult>; + }>; + findFirst(args: FindFirstArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult | null; + }>; + findOne(args: { + id: string; + select: S; + } & StrictSelect): QueryBuilder<{ + platformFunctionInvocation: InferSelectResult | null; + }>; + create(args: CreateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + createPlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }>; + update(args: UpdateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + updatePlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }>; + delete(args: DeleteArgs<{ + id: string; + }, S> & { + select: S; + } & StrictSelect): QueryBuilder<{ + deletePlatformFunctionInvocation: { + platformFunctionInvocation: InferSelectResult; + }; + }>; +} diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.js b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.js new file mode 100644 index 00000000..b5fb69f0 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformFunctionInvocation.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformFunctionInvocationModel = void 0; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +class PlatformFunctionInvocationModel { + client; + constructor(client) { + this.client = client; + } + findMany(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformFunctionInvocation', 'platformFunctionInvocations', args.select, { + where: args?.where, + orderBy: args?.orderBy, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, 'PlatformFunctionInvocationFilter', 'PlatformFunctionInvocationOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocations', + document, + variables, + }); + } + findFirst(args) { + const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PlatformFunctionInvocation', 'platformFunctionInvocations', args.select, { + where: args?.where, + orderBy: args?.orderBy, + }, 'PlatformFunctionInvocationFilter', 'PlatformFunctionInvocationOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', + document, + variables, + transform: (data) => ({ + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + findOne(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformFunctionInvocation', 'platformFunctionInvocations', args.select, { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, 'PlatformFunctionInvocationFilter', 'PlatformFunctionInvocationOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformFunctionInvocation', + fieldName: 'platformFunctionInvocation', + document, + variables, + transform: (data) => ({ + platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, + }), + }); + } + create(args) { + const { document, variables } = (0, query_builder_1.buildCreateDocument)('PlatformFunctionInvocation', 'createPlatformFunctionInvocation', 'platformFunctionInvocation', args.select, args.data, 'CreatePlatformFunctionInvocationInput', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'createPlatformFunctionInvocation', + document, + variables, + }); + } + update(args) { + const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PlatformFunctionInvocation', 'updatePlatformFunctionInvocation', 'platformFunctionInvocation', args.select, args.where.id, args.data, 'UpdatePlatformFunctionInvocationInput', 'id', 'platformFunctionInvocationPatch', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'updatePlatformFunctionInvocation', + document, + variables, + }); + } + delete(args) { + const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PlatformFunctionInvocation', 'deletePlatformFunctionInvocation', 'platformFunctionInvocation', { + id: args.where.id, + }, 'DeletePlatformFunctionInvocationInput', args.select, input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformFunctionInvocation', + fieldName: 'deletePlatformFunctionInvocation', + document, + variables, + }); + } +} +exports.PlatformFunctionInvocationModel = PlatformFunctionInvocationModel; diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformNamespace.d.ts b/sdk/functions-sdk/dist/compute/orm/models/platformNamespace.d.ts new file mode 100644 index 00000000..ef15afa8 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformNamespace.d.ts @@ -0,0 +1,54 @@ +/** + * PlatformNamespace model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types'; +import type { PlatformNamespaceWithRelations, PlatformNamespaceSelect, PlatformNamespaceFilter, PlatformNamespaceOrderBy, CreatePlatformNamespaceInput, PlatformNamespacePatch } from '../input-types'; +export declare class PlatformNamespaceModel { + private client; + constructor(client: OrmClient); + findMany(args: FindManyArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformNamespaces: ConnectionResult>; + }>; + findFirst(args: FindFirstArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformNamespace: InferSelectResult | null; + }>; + findOne(args: { + id: string; + select: S; + } & StrictSelect): QueryBuilder<{ + platformNamespace: InferSelectResult | null; + }>; + create(args: CreateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + createPlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }>; + update(args: UpdateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + updatePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }>; + delete(args: DeleteArgs<{ + id: string; + }, S> & { + select: S; + } & StrictSelect): QueryBuilder<{ + deletePlatformNamespace: { + platformNamespace: InferSelectResult; + }; + }>; +} diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformNamespace.js b/sdk/functions-sdk/dist/compute/orm/models/platformNamespace.js new file mode 100644 index 00000000..7228ed2f --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformNamespace.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformNamespaceModel = void 0; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +class PlatformNamespaceModel { + client; + constructor(client) { + this.client = client; + } + findMany(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformNamespace', 'platformNamespaces', args.select, { + where: args?.where, + orderBy: args?.orderBy, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, 'PlatformNamespaceFilter', 'PlatformNamespaceOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespaces', + document, + variables, + }); + } + findFirst(args) { + const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PlatformNamespace', 'platformNamespaces', args.select, { + where: args?.where, + orderBy: args?.orderBy, + }, 'PlatformNamespaceFilter', 'PlatformNamespaceOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', + document, + variables, + transform: (data) => ({ + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), + }); + } + findOne(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformNamespace', 'platformNamespaces', args.select, { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, 'PlatformNamespaceFilter', 'PlatformNamespaceOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformNamespace', + fieldName: 'platformNamespace', + document, + variables, + transform: (data) => ({ + platformNamespace: data.platformNamespaces?.nodes?.[0] ?? null, + }), + }); + } + create(args) { + const { document, variables } = (0, query_builder_1.buildCreateDocument)('PlatformNamespace', 'createPlatformNamespace', 'platformNamespace', args.select, args.data, 'CreatePlatformNamespaceInput', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'createPlatformNamespace', + document, + variables, + }); + } + update(args) { + const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PlatformNamespace', 'updatePlatformNamespace', 'platformNamespace', args.select, args.where.id, args.data, 'UpdatePlatformNamespaceInput', 'id', 'platformNamespacePatch', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'updatePlatformNamespace', + document, + variables, + }); + } + delete(args) { + const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PlatformNamespace', 'deletePlatformNamespace', 'platformNamespace', { + id: args.where.id, + }, 'DeletePlatformNamespaceInput', args.select, input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformNamespace', + fieldName: 'deletePlatformNamespace', + document, + variables, + }); + } +} +exports.PlatformNamespaceModel = PlatformNamespaceModel; diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.d.ts b/sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.d.ts new file mode 100644 index 00000000..bbde652e --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.d.ts @@ -0,0 +1,54 @@ +/** + * PlatformNamespaceEvent model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types'; +import type { PlatformNamespaceEventWithRelations, PlatformNamespaceEventSelect, PlatformNamespaceEventFilter, PlatformNamespaceEventOrderBy, CreatePlatformNamespaceEventInput, PlatformNamespaceEventPatch } from '../input-types'; +export declare class PlatformNamespaceEventModel { + private client; + constructor(client: OrmClient); + findMany(args: FindManyArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformNamespaceEvents: ConnectionResult>; + }>; + findFirst(args: FindFirstArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformNamespaceEvent: InferSelectResult | null; + }>; + findOne(args: { + id: string; + select: S; + } & StrictSelect): QueryBuilder<{ + platformNamespaceEvent: InferSelectResult | null; + }>; + create(args: CreateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + createPlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }>; + update(args: UpdateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + updatePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }>; + delete(args: DeleteArgs<{ + id: string; + }, S> & { + select: S; + } & StrictSelect): QueryBuilder<{ + deletePlatformNamespaceEvent: { + platformNamespaceEvent: InferSelectResult; + }; + }>; +} diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.js b/sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.js new file mode 100644 index 00000000..229ef814 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformNamespaceEvent.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformNamespaceEventModel = void 0; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +class PlatformNamespaceEventModel { + client; + constructor(client) { + this.client = client; + } + findMany(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformNamespaceEvent', 'platformNamespaceEvents', args.select, { + where: args?.where, + orderBy: args?.orderBy, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, 'PlatformNamespaceEventFilter', 'PlatformNamespaceEventOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvents', + document, + variables, + }); + } + findFirst(args) { + const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PlatformNamespaceEvent', 'platformNamespaceEvents', args.select, { + where: args?.where, + orderBy: args?.orderBy, + }, 'PlatformNamespaceEventFilter', 'PlatformNamespaceEventOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', + document, + variables, + transform: (data) => ({ + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), + }); + } + findOne(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformNamespaceEvent', 'platformNamespaceEvents', args.select, { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, 'PlatformNamespaceEventFilter', 'PlatformNamespaceEventOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformNamespaceEvent', + fieldName: 'platformNamespaceEvent', + document, + variables, + transform: (data) => ({ + platformNamespaceEvent: data.platformNamespaceEvents?.nodes?.[0] ?? null, + }), + }); + } + create(args) { + const { document, variables } = (0, query_builder_1.buildCreateDocument)('PlatformNamespaceEvent', 'createPlatformNamespaceEvent', 'platformNamespaceEvent', args.select, args.data, 'CreatePlatformNamespaceEventInput', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'createPlatformNamespaceEvent', + document, + variables, + }); + } + update(args) { + const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PlatformNamespaceEvent', 'updatePlatformNamespaceEvent', 'platformNamespaceEvent', args.select, args.where.id, args.data, 'UpdatePlatformNamespaceEventInput', 'id', 'platformNamespaceEventPatch', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'updatePlatformNamespaceEvent', + document, + variables, + }); + } + delete(args) { + const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PlatformNamespaceEvent', 'deletePlatformNamespaceEvent', 'platformNamespaceEvent', { + id: args.where.id, + }, 'DeletePlatformNamespaceEventInput', args.select, input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformNamespaceEvent', + fieldName: 'deletePlatformNamespaceEvent', + document, + variables, + }); + } +} +exports.PlatformNamespaceEventModel = PlatformNamespaceEventModel; diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.d.ts b/sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.d.ts new file mode 100644 index 00000000..e9a04f15 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.d.ts @@ -0,0 +1,54 @@ +/** + * PlatformSecretDefinition model for ORM client + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect } from '../select-types'; +import type { PlatformSecretDefinitionWithRelations, PlatformSecretDefinitionSelect, PlatformSecretDefinitionFilter, PlatformSecretDefinitionOrderBy, CreatePlatformSecretDefinitionInput, PlatformSecretDefinitionPatch } from '../input-types'; +export declare class PlatformSecretDefinitionModel { + private client; + constructor(client: OrmClient); + findMany(args: FindManyArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformSecretDefinitions: ConnectionResult>; + }>; + findFirst(args: FindFirstArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + platformSecretDefinition: InferSelectResult | null; + }>; + findOne(args: { + id: string; + select: S; + } & StrictSelect): QueryBuilder<{ + platformSecretDefinition: InferSelectResult | null; + }>; + create(args: CreateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + createPlatformSecretDefinition: { + platformSecretDefinition: InferSelectResult; + }; + }>; + update(args: UpdateArgs & { + select: S; + } & StrictSelect): QueryBuilder<{ + updatePlatformSecretDefinition: { + platformSecretDefinition: InferSelectResult; + }; + }>; + delete(args: DeleteArgs<{ + id: string; + }, S> & { + select: S; + } & StrictSelect): QueryBuilder<{ + deletePlatformSecretDefinition: { + platformSecretDefinition: InferSelectResult; + }; + }>; +} diff --git a/sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.js b/sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.js new file mode 100644 index 00000000..ac2868d4 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/models/platformSecretDefinition.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlatformSecretDefinitionModel = void 0; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +class PlatformSecretDefinitionModel { + client; + constructor(client) { + this.client = client; + } + findMany(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformSecretDefinition', 'platformSecretDefinitions', args.select, { + where: args?.where, + orderBy: args?.orderBy, + first: args?.first, + last: args?.last, + after: args?.after, + before: args?.before, + offset: args?.offset, + }, 'PlatformSecretDefinitionFilter', 'PlatformSecretDefinitionOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformSecretDefinition', + fieldName: 'platformSecretDefinitions', + document, + variables, + }); + } + findFirst(args) { + const { document, variables } = (0, query_builder_1.buildFindFirstDocument)('PlatformSecretDefinition', 'platformSecretDefinitions', args.select, { + where: args?.where, + orderBy: args?.orderBy, + }, 'PlatformSecretDefinitionFilter', 'PlatformSecretDefinitionOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformSecretDefinition', + fieldName: 'platformSecretDefinition', + document, + variables, + transform: (data) => ({ + platformSecretDefinition: data.platformSecretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + findOne(args) { + const { document, variables } = (0, query_builder_1.buildFindManyDocument)('PlatformSecretDefinition', 'platformSecretDefinitions', args.select, { + where: { + id: { + equalTo: args.id, + }, + }, + first: 1, + }, 'PlatformSecretDefinitionFilter', 'PlatformSecretDefinitionOrderBy', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'query', + operationName: 'PlatformSecretDefinition', + fieldName: 'platformSecretDefinition', + document, + variables, + transform: (data) => ({ + platformSecretDefinition: data.platformSecretDefinitions?.nodes?.[0] ?? null, + }), + }); + } + create(args) { + const { document, variables } = (0, query_builder_1.buildCreateDocument)('PlatformSecretDefinition', 'createPlatformSecretDefinition', 'platformSecretDefinition', args.select, args.data, 'CreatePlatformSecretDefinitionInput', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformSecretDefinition', + fieldName: 'createPlatformSecretDefinition', + document, + variables, + }); + } + update(args) { + const { document, variables } = (0, query_builder_1.buildUpdateByPkDocument)('PlatformSecretDefinition', 'updatePlatformSecretDefinition', 'platformSecretDefinition', args.select, args.where.id, args.data, 'UpdatePlatformSecretDefinitionInput', 'id', 'platformSecretDefinitionPatch', input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformSecretDefinition', + fieldName: 'updatePlatformSecretDefinition', + document, + variables, + }); + } + delete(args) { + const { document, variables } = (0, query_builder_1.buildDeleteByPkDocument)('PlatformSecretDefinition', 'deletePlatformSecretDefinition', 'platformSecretDefinition', { + id: args.where.id, + }, 'DeletePlatformSecretDefinitionInput', args.select, input_types_1.connectionFieldsMap); + return new query_builder_1.QueryBuilder({ + client: this.client, + operation: 'mutation', + operationName: 'PlatformSecretDefinition', + fieldName: 'deletePlatformSecretDefinition', + document, + variables, + }); + } +} +exports.PlatformSecretDefinitionModel = PlatformSecretDefinitionModel; diff --git a/sdk/functions-sdk/dist/compute/orm/mutation/index.d.ts b/sdk/functions-sdk/dist/compute/orm/mutation/index.d.ts new file mode 100644 index 00000000..cb172dc8 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/mutation/index.d.ts @@ -0,0 +1,26 @@ +/** + * Custom mutation operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +import { OrmClient } from '../client'; +import { QueryBuilder } from '../query-builder'; +import type { InferSelectResult, StrictSelect } from '../select-types'; +import type { ProvisionBucketInput, ProvisionBucketPayload, ProvisionBucketPayloadSelect } from '../input-types'; +/** + * Variables for provisionBucket + * Provision an S3 bucket for a logical bucket in the database. +Reads the bucket config via RLS, then creates and configures +the S3 bucket with the appropriate privacy policies, CORS rules, +and lifecycle settings. + */ +export interface ProvisionBucketVariables { + input: ProvisionBucketInput; +} +export declare function createMutationOperations(client: OrmClient): { + provisionBucket: (args: ProvisionBucketVariables, options: { + select: S; + } & StrictSelect) => QueryBuilder<{ + provisionBucket: InferSelectResult | null; + }>; +}; diff --git a/sdk/functions-sdk/dist/compute/orm/mutation/index.js b/sdk/functions-sdk/dist/compute/orm/mutation/index.js new file mode 100644 index 00000000..55d5f233 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/mutation/index.js @@ -0,0 +1,21 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createMutationOperations = createMutationOperations; +const query_builder_1 = require("../query-builder"); +const input_types_1 = require("../input-types"); +function createMutationOperations(client) { + return { + provisionBucket: (args, options) => new query_builder_1.QueryBuilder({ + client, + operation: 'mutation', + operationName: 'ProvisionBucket', + fieldName: 'provisionBucket', + ...(0, query_builder_1.buildCustomDocument)('mutation', 'ProvisionBucket', 'provisionBucket', options.select, args, [ + { + name: 'input', + type: 'ProvisionBucketInput!', + }, + ], input_types_1.connectionFieldsMap, 'ProvisionBucketPayload'), + }), + }; +} diff --git a/sdk/functions-sdk/dist/compute/orm/query-builder.d.ts b/sdk/functions-sdk/dist/compute/orm/query-builder.d.ts new file mode 100644 index 00000000..49954fd5 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/query-builder.d.ts @@ -0,0 +1,110 @@ +import type { FieldNode } from 'graphql'; +import { OrmClient, QueryResult } from './client'; +export interface QueryBuilderConfig { + client: OrmClient; + operation: 'query' | 'mutation'; + operationName: string; + fieldName: string; + document: string; + variables?: Record; + transform?: (data: any) => TResult; +} +export declare class QueryBuilder { + private config; + constructor(config: QueryBuilderConfig); + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + execute(): Promise>; + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + unwrap(): Promise; + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + unwrapOr(defaultValue: D): Promise; + /** + * Execute and unwrap, calling onError callback on failure + */ + unwrapOrElse(onError: (errors: import('./client').GraphQLError[]) => D): Promise; + toGraphQL(): string; + getVariables(): Record | undefined; +} +export declare function buildSelections(select: Record | undefined, connectionFieldsMap?: Record>, entityType?: string): FieldNode[]; +export declare function buildFindManyDocument(operationName: string, queryField: string, select: TSelect, args: { + where?: TWhere; + orderBy?: string[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +}, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildFindFirstDocument(operationName: string, queryField: string, select: TSelect, args: { + where?: TWhere; + orderBy?: string[]; +}, filterTypeName: string, orderByTypeName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildCreateDocument(operationName: string, mutationField: string, entityField: string, select: TSelect, data: TData, inputTypeName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildUpdateDocument(operationName: string, mutationField: string, entityField: string, select: TSelect, where: TWhere, data: TData, inputTypeName: string, patchFieldName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildUpdateByPkDocument(operationName: string, mutationField: string, entityField: string, select: TSelect, id: string | number, data: TData, inputTypeName: string, idFieldName: string, patchFieldName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildFindOneDocument(operationName: string, queryField: string, id: string | number, select: TSelect, idArgName: string, idTypeName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildDeleteDocument(operationName: string, mutationField: string, entityField: string, where: TWhere, inputTypeName: string, select?: TSelect, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildDeleteByPkDocument(operationName: string, mutationField: string, entityField: string, keys: Record, inputTypeName: string, select?: TSelect, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildJunctionRemoveDocument(operationName: string, mutationField: string, keys: Record, inputTypeName: string): { + document: string; + variables: Record; +}; +export declare function buildCustomDocument(operationType: 'query' | 'mutation', operationName: string, fieldName: string, select: TSelect, args: TArgs, variableDefinitions: Array<{ + name: string; + type: string; +}>, connectionFieldsMap?: Record>, entityType?: string): { + document: string; + variables: Record; +}; +export declare function buildBulkInsertDocument(operationName: string, mutationField: string, select: TSelect, data: TData[], inputTypeName: string, onConflict?: unknown, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildBulkUpsertDocument(operationName: string, mutationField: string, select: TSelect, data: TData[], inputTypeName: string, onConflict: unknown, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildBulkUpdateDocument(operationName: string, mutationField: string, select: TSelect, where: TWhere, data: TData, inputTypeName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; +export declare function buildBulkDeleteDocument(operationName: string, mutationField: string, select: TSelect, where: TWhere, inputTypeName: string, connectionFieldsMap?: Record>): { + document: string; + variables: Record; +}; diff --git a/sdk/functions-sdk/dist/compute/orm/query-builder.js b/sdk/functions-sdk/dist/compute/orm/query-builder.js new file mode 100644 index 00000000..6768a1ce --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/query-builder.js @@ -0,0 +1,756 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.QueryBuilder = void 0; +exports.buildSelections = buildSelections; +exports.buildFindManyDocument = buildFindManyDocument; +exports.buildFindFirstDocument = buildFindFirstDocument; +exports.buildCreateDocument = buildCreateDocument; +exports.buildUpdateDocument = buildUpdateDocument; +exports.buildUpdateByPkDocument = buildUpdateByPkDocument; +exports.buildFindOneDocument = buildFindOneDocument; +exports.buildDeleteDocument = buildDeleteDocument; +exports.buildDeleteByPkDocument = buildDeleteByPkDocument; +exports.buildJunctionRemoveDocument = buildJunctionRemoveDocument; +exports.buildCustomDocument = buildCustomDocument; +exports.buildBulkInsertDocument = buildBulkInsertDocument; +exports.buildBulkUpsertDocument = buildBulkUpsertDocument; +exports.buildBulkUpdateDocument = buildBulkUpdateDocument; +exports.buildBulkDeleteDocument = buildBulkDeleteDocument; +/** + * Query Builder - Builds and executes GraphQL operations + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +const runtime_1 = require("@constructive-io/graphql-query/runtime"); +const t = __importStar(require("gql-ast")); +const client_1 = require("./client"); +class QueryBuilder { + config; + constructor(config) { + this.config = config; + } + /** + * Execute the query and return a discriminated union result + * Use result.ok to check success, or .unwrap() to throw on error + */ + async execute() { + const rawResult = await this.config.client.execute(this.config.document, this.config.variables); + if (!rawResult.ok) { + return rawResult; + } + if (!this.config.transform) { + return rawResult; + } + return { + ok: true, + data: this.config.transform(rawResult.data), + errors: undefined, + }; + } + /** + * Execute and unwrap the result, throwing GraphQLRequestError on failure + * @throws {GraphQLRequestError} If the query returns errors + */ + async unwrap() { + const result = await this.execute(); + if (!result.ok) { + throw new client_1.GraphQLRequestError(result.errors, result.data); + } + return result.data; + } + /** + * Execute and unwrap, returning defaultValue on error instead of throwing + */ + async unwrapOr(defaultValue) { + const result = await this.execute(); + if (!result.ok) { + return defaultValue; + } + return result.data; + } + /** + * Execute and unwrap, calling onError callback on failure + */ + async unwrapOrElse(onError) { + const result = await this.execute(); + if (!result.ok) { + return onError(result.errors); + } + return result.data; + } + toGraphQL() { + return this.config.document; + } + getVariables() { + return this.config.variables; + } +} +exports.QueryBuilder = QueryBuilder; +const OP_QUERY = 'query'; +const OP_MUTATION = 'mutation'; +const ENUM_VALUE_KIND = 'EnumValue'; +// ============================================================================ +// Selection Builders +// ============================================================================ +function buildSelections(select, connectionFieldsMap, entityType) { + if (!select) { + return []; + } + const fields = []; + const entityConnections = entityType ? connectionFieldsMap?.[entityType] : undefined; + for (const [key, value] of Object.entries(select)) { + if (value === false || value === undefined) { + continue; + } + if (value === true) { + fields.push(t.field({ name: key })); + continue; + } + if (typeof value === 'object' && value !== null) { + const nested = value; + // Field with arguments (e.g. requestUploadUrl on bucket types) + if (nested.args && typeof nested.args === 'object') { + const fieldArgs = Object.entries(nested.args).map(([argName, argValue]) => t.argument({ name: argName, value: buildValueAst(argValue) })); + const nestedSelect = nested.select; + if (nestedSelect && typeof nestedSelect === 'object') { + const subSelections = Object.entries(nestedSelect) + .filter(([, v]) => v) + .map(([name]) => t.field({ name })); + fields.push(t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: subSelections.length + ? t.selectionSet({ selections: subSelections }) + : undefined, + })); + } + else { + fields.push(t.field({ + name: key, + args: fieldArgs.length ? fieldArgs : undefined, + })); + } + continue; + } + if (!nested.select || typeof nested.select !== 'object') { + throw new Error(`Invalid selection for field "${key}": nested selections must include a "select" object.`); + } + const relatedEntityType = entityConnections?.[key]; + const nestedSelections = buildSelections(nested.select, connectionFieldsMap, relatedEntityType); + const isConnection = nested.connection === true || + nested.first !== undefined || + nested.filter !== undefined || + relatedEntityType !== undefined; + const args = buildArgs([ + buildOptionalArg('first', nested.first), + nested.filter + ? t.argument({ + name: 'filter', + value: buildValueAst(nested.filter), + }) + : null, + buildEnumListArg('orderBy', nested.orderBy), + ]); + if (isConnection) { + fields.push(t.field({ + name: key, + args, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(nestedSelections), + }), + })); + } + else { + fields.push(t.field({ + name: key, + args, + selectionSet: t.selectionSet({ selections: nestedSelections }), + })); + } + } + } + return fields; +} +// ============================================================================ +// Document Builders +// ============================================================================ +function buildFindManyDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + const variableDefinitions = []; + const queryArgs = []; + const variables = {}; + addVariable({ + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, variableDefinitions, queryArgs, variables); + addVariable({ + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, variableDefinitions, queryArgs, variables); + addVariable({ varName: 'first', typeName: 'Int', value: args.first }, variableDefinitions, queryArgs, variables); + addVariable({ varName: 'last', typeName: 'Int', value: args.last }, variableDefinitions, queryArgs, variables); + addVariable({ varName: 'after', typeName: 'Cursor', value: args.after }, variableDefinitions, queryArgs, variables); + addVariable({ varName: 'before', typeName: 'Cursor', value: args.before }, variableDefinitions, queryArgs, variables); + addVariable({ varName: 'offset', typeName: 'Int', value: args.offset }, variableDefinitions, queryArgs, variables); + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions: variableDefinitions.length ? variableDefinitions : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs.length ? queryArgs : undefined, + selectionSet: t.selectionSet({ + selections: buildConnectionSelections(selections), + }), + }), + ], + }), + }), + ], + }); + return { document: (0, runtime_1.print)(document), variables }; +} +function buildFindFirstDocument(operationName, queryField, select, args, filterTypeName, orderByTypeName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + const variableDefinitions = []; + const queryArgs = []; + const variables = {}; + // Always add first: 1 for findFirst + addVariable({ varName: 'first', typeName: 'Int', value: 1 }, variableDefinitions, queryArgs, variables); + addVariable({ + varName: 'where', + typeName: filterTypeName, + value: args.where, + }, variableDefinitions, queryArgs, variables); + addVariable({ + varName: 'orderBy', + typeName: '[' + orderByTypeName + '!]', + value: args.orderBy?.length ? args.orderBy : undefined, + }, variableDefinitions, queryArgs, variables); + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }), + }), + ], + }); + return { document: (0, runtime_1.print)(document), variables }; +} +function buildCreateDocument(operationName, mutationField, entityField, select, data, inputTypeName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [entityField]: data, + }, + }, + }; +} +function buildUpdateDocument(operationName, mutationField, entityField, select, where, data, inputTypeName, patchFieldName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + id: where.id, + [patchFieldName]: data, + }, + }, + }; +} +function buildUpdateByPkDocument(operationName, mutationField, entityField, select, id, data, inputTypeName, idFieldName, patchFieldName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + [idFieldName]: id, + [patchFieldName]: data, + }, + }, + }; +} +function buildFindOneDocument(operationName, queryField, id, select, idArgName, idTypeName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + const variableDefinitions = [ + t.variableDefinition({ + variable: t.variable({ name: idArgName }), + type: (0, runtime_1.parseType)(idTypeName), + }), + ]; + const queryArgs = [ + t.argument({ + name: idArgName, + value: t.variable({ name: idArgName }), + }), + ]; + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_QUERY, + name: operationName + 'Query', + variableDefinitions, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: queryField, + args: queryArgs, + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + }), + ], + }); + return { + document: (0, runtime_1.print)(document), + variables: { [idArgName]: id }, + }; +} +function buildDeleteDocument(operationName, mutationField, entityField, where, inputTypeName, select, connectionFieldsMap) { + const entitySelections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ + selections: entitySelections, + }), + }), + ], + }), + variables: { + input: { + id: where.id, + }, + }, + }; +} +function buildDeleteByPkDocument(operationName, mutationField, entityField, keys, inputTypeName, select, connectionFieldsMap) { + const entitySelections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ + name: entityField, + selectionSet: t.selectionSet({ selections: entitySelections }), + }), + ], + }), + variables: { + input: keys, + }, + }; +} +function buildJunctionRemoveDocument(operationName, mutationField, keys, inputTypeName) { + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [t.field({ name: 'clientMutationId' })], + }), + variables: { + input: keys, + }, + }; +} +function buildCustomDocument(operationType, operationName, fieldName, select, args, variableDefinitions, connectionFieldsMap, entityType) { + let actualSelect = select; + let isConnection = false; + if (isCustomSelectionWrapper(select)) { + actualSelect = select.select; + isConnection = select.connection === true; + } + const selections = actualSelect + ? buildSelections(actualSelect, connectionFieldsMap, entityType) + : []; + const variableDefs = variableDefinitions.map((definition) => t.variableDefinition({ + variable: t.variable({ name: definition.name }), + type: (0, runtime_1.parseType)(definition.type), + })); + const fieldArgs = variableDefinitions.map((definition) => t.argument({ + name: definition.name, + value: t.variable({ name: definition.name }), + })); + const fieldSelections = isConnection ? buildConnectionSelections(selections) : selections; + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: operationType === 'mutation' ? OP_MUTATION : OP_QUERY, + name: operationName, + variableDefinitions: variableDefs.length ? variableDefs : undefined, + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: fieldName, + args: fieldArgs.length ? fieldArgs : undefined, + selectionSet: fieldSelections.length + ? t.selectionSet({ selections: fieldSelections }) + : undefined, + }), + ], + }), + }), + ], + }); + return { + document: (0, runtime_1.print)(document), + variables: (args ?? {}), + }; +} +function isCustomSelectionWrapper(value) { + if (!value || typeof value !== 'object' || Array.isArray(value)) { + return false; + } + const record = value; + const keys = Object.keys(record); + if (!keys.includes('select') || !keys.includes('connection')) { + return false; + } + if (keys.some((key) => key !== 'select' && key !== 'connection')) { + return false; + } + return !!record.select && typeof record.select === 'object' && !Array.isArray(record.select); +} +// ============================================================================ +// Helper Functions +// ============================================================================ +function buildArgs(args) { + return args.filter((arg) => arg !== null); +} +function buildOptionalArg(name, value) { + if (value === undefined) { + return null; + } + const valueNode = typeof value === 'number' ? t.intValue({ value: value.toString() }) : t.stringValue({ value }); + return t.argument({ name, value: valueNode }); +} +function buildEnumListArg(name, values) { + if (!values || values.length === 0) { + return null; + } + return t.argument({ + name, + value: t.listValue({ + values: values.map((value) => buildEnumValue(value)), + }), + }); +} +function buildEnumValue(value) { + return { + kind: ENUM_VALUE_KIND, + value, + }; +} +function buildPageInfoSelections() { + return [ + t.field({ name: 'hasNextPage' }), + t.field({ name: 'hasPreviousPage' }), + t.field({ name: 'startCursor' }), + t.field({ name: 'endCursor' }), + ]; +} +function buildConnectionSelections(nodeSelections) { + return [ + t.field({ + name: 'nodes', + selectionSet: t.selectionSet({ selections: nodeSelections }), + }), + t.field({ name: 'totalCount' }), + t.field({ + name: 'pageInfo', + selectionSet: t.selectionSet({ selections: buildPageInfoSelections() }), + }), + ]; +} +function buildInputMutationDocument(config) { + const document = t.document({ + definitions: [ + t.operationDefinition({ + operation: OP_MUTATION, + name: config.operationName + 'Mutation', + variableDefinitions: [ + t.variableDefinition({ + variable: t.variable({ name: 'input' }), + type: (0, runtime_1.parseType)(config.inputTypeName + '!'), + }), + ], + selectionSet: t.selectionSet({ + selections: [ + t.field({ + name: config.mutationField, + args: [ + t.argument({ + name: 'input', + value: t.variable({ name: 'input' }), + }), + ], + selectionSet: t.selectionSet({ + selections: config.resultSelections, + }), + }), + ], + }), + }), + ], + }); + return (0, runtime_1.print)(document); +} +function addVariable(spec, definitions, args, variables) { + if (spec.value === undefined || !spec.typeName) + return; + definitions.push(t.variableDefinition({ + variable: t.variable({ name: spec.varName }), + type: (0, runtime_1.parseType)(spec.typeName), + })); + args.push(t.argument({ + name: spec.argName ?? spec.varName, + value: t.variable({ name: spec.varName }), + })); + variables[spec.varName] = spec.value; +} +function buildValueAst(value) { + if (value === null) { + return t.nullValue(); + } + if (typeof value === 'boolean') { + return t.booleanValue({ value }); + } + if (typeof value === 'number') { + return Number.isInteger(value) + ? t.intValue({ value: value.toString() }) + : t.floatValue({ value: value.toString() }); + } + if (typeof value === 'string') { + return t.stringValue({ value }); + } + if (Array.isArray(value)) { + return t.listValue({ + values: value.map((item) => buildValueAst(item)), + }); + } + if (typeof value === 'object' && value !== null) { + const obj = value; + return t.objectValue({ + fields: Object.entries(obj).map(([key, val]) => t.objectField({ + name: key, + value: buildValueAst(val), + })), + }); + } + throw new Error('Unsupported value type: ' + typeof value); +} +// ============================================================================ +// Bulk Mutation Document Builders +// ============================================================================ +function buildBulkInsertDocument(operationName, mutationField, select, data, inputTypeName, onConflict, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + ...(onConflict ? { onConflict } : {}), + }, + }, + }; +} +function buildBulkUpsertDocument(operationName, mutationField, select, data, inputTypeName, onConflict, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + values: data, + onConflict, + }, + }, + }; +} +function buildBulkUpdateDocument(operationName, mutationField, select, where, data, inputTypeName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + patch: data, + }, + }, + }; +} +function buildBulkDeleteDocument(operationName, mutationField, select, where, inputTypeName, connectionFieldsMap) { + const selections = select + ? buildSelections(select, connectionFieldsMap, operationName) + : [t.field({ name: 'id' })]; + return { + document: buildInputMutationDocument({ + operationName, + mutationField, + inputTypeName, + resultSelections: [ + t.field({ name: 'affectedCount' }), + t.field({ + name: 'returning', + selectionSet: t.selectionSet({ selections }), + }), + ], + }), + variables: { + input: { + where, + }, + }, + }; +} diff --git a/sdk/functions-sdk/dist/compute/orm/realtime.d.ts b/sdk/functions-sdk/dist/compute/orm/realtime.d.ts new file mode 100644 index 00000000..a318c9e8 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/realtime.d.ts @@ -0,0 +1,142 @@ +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +interface WsGraphQLError { + readonly message: string; + readonly [key: string]: unknown; +} +interface WsExecutionResult> { + data?: TData | null; + errors?: readonly WsGraphQLError[]; + extensions?: Record; +} +interface WsSink { + next(value: T): void; + error(error: unknown): void; + complete(): void; +} +/** + * Minimal interface matching the graphql-ws Client. + * Consumers pass a concrete instance via RealtimeConfig.client. + */ +export interface WsClient { + subscribe>(payload: { + query: string; + variables?: Record; + }, sink: WsSink>): () => void; + dispose(): void; +} +/** The DML operation that triggered the subscription event */ +export type SubscriptionOperation = 'INSERT' | 'UPDATE' | 'DELETE'; +/** Connection state of the WebSocket */ +export type ConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting'; +/** Listener for connection state changes */ +export type ConnectionStateListener = (state: ConnectionState) => void; +/** Function returned by subscribe() to cancel the subscription */ +export type Unsubscribe = () => void; +/** + * A realtime subscription event delivered to the client. + * + * @typeParam T - The row type of the subscribed table + */ +export interface SubscriptionEvent { + /** The DML operation that triggered this event */ + operation: SubscriptionOperation; + /** The current row data (null for DELETE if row is no longer visible) */ + data: T | null; + /** Previous field values (populated on UPDATE when available) */ + previousValues?: Partial; + /** Server-side timestamp of when the change occurred */ + timestamp: string; +} +/** + * Options for creating a subscription. + * + * @typeParam T - The row type of the subscribed table + * @typeParam TFilter - The filter type for the table + */ +export interface SubscribeOptions> { + /** Server-side filter to limit which events are delivered */ + filter?: TFilter; + /** Called when a subscription event is received */ + onEvent: (event: SubscriptionEvent) => void; + /** Called when the subscription encounters an error */ + onError?: (error: Error) => void; + /** Called when the subscription completes (server-initiated close) */ + onComplete?: () => void; +} +/** + * Metadata about a subscription field, used internally to map + * table names to GraphQL subscription field names and types. + */ +export interface SubscriptionFieldMeta { + /** The GraphQL subscription field name (e.g., 'onContactChanged') */ + fieldName: string; + /** The table name in the source schema (e.g., 'contact') */ + tableName: string; + /** The data field name inside the subscription payload (e.g., 'contact') */ + dataFieldName: string; +} +/** + * Configuration for the realtime (WebSocket) connection. + * Pass this as the `realtime` option in OrmClientConfig. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * + * const client = createOrmClient({ + * endpoint: 'https://api.example.com/graphql', + * realtime: { + * client: createClient({ url: 'wss://api.example.com/graphql' }), + * }, + * }); + * ``` + */ +export interface RealtimeConfig { + /** + * A graphql-ws Client instance (or any object satisfying WsClient). + * The consumer creates this themselves, giving full control over + * connection options, auth, and transport. + * + * @example + * ```ts + * import { createClient } from 'graphql-ws'; + * const wsClient = createClient({ url: 'wss://...' }); + * ``` + */ + client: WsClient; +} +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +export declare class RealtimeManager { + private wsClient; + private connectionState; + private stateListeners; + private activeSubscriptions; + constructor(config: RealtimeConfig); + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe(meta: SubscriptionFieldMeta, document: string, variables: Record, options: { + onEvent: (event: SubscriptionEvent) => void; + onError?: (error: Error) => void; + onComplete?: () => void; + }): Unsubscribe; + /** Register a listener for connection state changes */ + onConnectionStateChange(listener: ConnectionStateListener): Unsubscribe; + /** Get current connection state */ + getConnectionState(): ConnectionState; + /** Number of active subscriptions */ + getActiveSubscriptionCount(): number; + /** Dispose the manager and close the WebSocket connection */ + dispose(): void; + private setConnectionState; +} +export {}; diff --git a/sdk/functions-sdk/dist/compute/orm/realtime.js b/sdk/functions-sdk/dist/compute/orm/realtime.js new file mode 100644 index 00000000..d68d1c70 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/realtime.js @@ -0,0 +1,104 @@ +"use strict"; +/** + * Realtime Manager - WebSocket subscription support + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +// Minimal type shims so this module compiles without graphql-ws +// installed. Consumers supply a WsClient via RealtimeConfig; +// the SDK itself never imports or requires graphql-ws. +Object.defineProperty(exports, "__esModule", { value: true }); +exports.RealtimeManager = void 0; +// ============================================================================ +// RealtimeManager +// ============================================================================ +/** + * Manages a graphql-ws WebSocket client and multiplexes + * subscriptions over it. Created by OrmClient when `realtime` + * config is provided. + */ +class RealtimeManager { + wsClient; + connectionState = 'disconnected'; + stateListeners = new Set(); + activeSubscriptions = 0; + constructor(config) { + this.wsClient = config.client; + } + /** + * Subscribe to a GraphQL subscription operation. + * Models call this with typed metadata and documents. + */ + subscribe(meta, document, variables, options) { + this.activeSubscriptions++; + let disposed = false; + const cleanup = this.wsClient.subscribe({ query: document, variables }, { + next: (result) => { + if (disposed) + return; + if (result.errors) { + options.onError?.(new Error(result.errors.map((e) => e.message).join('; '))); + return; + } + const payload = result.data?.[meta.fieldName]; + if (!payload) + return; + const event = { + operation: payload.event ?? 'UPDATE', + data: payload[meta.dataFieldName] ?? null, + previousValues: payload.previousValues, + timestamp: payload.timestamp ?? new Date().toISOString(), + }; + options.onEvent(event); + }, + error: (err) => { + if (disposed) + return; + options.onError?.(err instanceof Error ? err : new Error(String(err))); + }, + complete: () => { + if (disposed) + return; + options.onComplete?.(); + }, + }); + return () => { + if (disposed) + return; + disposed = true; + this.activeSubscriptions--; + cleanup(); + }; + } + /** Register a listener for connection state changes */ + onConnectionStateChange(listener) { + this.stateListeners.add(listener); + return () => { + this.stateListeners.delete(listener); + }; + } + /** Get current connection state */ + getConnectionState() { + return this.connectionState; + } + /** Number of active subscriptions */ + getActiveSubscriptionCount() { + return this.activeSubscriptions; + } + /** Dispose the manager and close the WebSocket connection */ + dispose() { + this.wsClient.dispose(); + this.stateListeners.clear(); + this.activeSubscriptions = 0; + this.setConnectionState('disconnected'); + } + setConnectionState(state) { + if (this.connectionState === state) + return; + this.connectionState = state; + for (const listener of this.stateListeners) { + listener(state); + } + } +} +exports.RealtimeManager = RealtimeManager; diff --git a/sdk/functions-sdk/dist/compute/orm/select-types.d.ts b/sdk/functions-sdk/dist/compute/orm/select-types.d.ts new file mode 100644 index 00000000..b92e09e4 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/select-types.d.ts @@ -0,0 +1,125 @@ +/** + * Type utilities for select inference + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export interface ConnectionResult { + nodes: T[]; + totalCount: number; + pageInfo: PageInfo; +} +export interface PageInfo { + hasNextPage: boolean; + hasPreviousPage: boolean; + startCursor?: string | null; + endCursor?: string | null; +} +export interface FindManyArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; + first?: number; + last?: number; + after?: string; + before?: string; + offset?: number; +} +export interface FindFirstArgs { + select?: TSelect; + where?: TWhere; + orderBy?: TOrderBy[]; +} +export interface CreateArgs { + data: TData; + select?: TSelect; +} +export interface UpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} +export type FindOneArgs = { + select?: TSelect; +} & Record; +export interface DeleteArgs { + where: TWhere; + select?: TSelect; +} +export interface BulkInsertArgs { + data: TData[]; + select?: TSelect; + onConflict?: TOnConflict; +} +export interface BulkUpsertArgs { + data: TData[]; + select?: TSelect; + onConflict: TOnConflict; +} +export interface BulkUpdateArgs { + where: TWhere; + data: TData; + select?: TSelect; +} +export interface BulkDeleteArgs { + where: TWhere; + select?: TSelect; +} +export interface BulkMutationResult { + affectedCount: number; + returning: T[]; +} +type DepthLevel = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +type DecrementDepth = { + 0: 0; + 1: 0; + 2: 1; + 3: 2; + 4: 3; + 5: 4; + 6: 5; + 7: 6; + 8: 7; + 9: 8; + 10: 9; +}; +/** + * Recursively validates select objects, rejecting unknown keys. + * + * NOTE: Depth is intentionally capped to avoid circular-instantiation issues + * in very large cyclic schemas. + */ +export type DeepExact = Depth extends 0 ? T extends Shape ? T : never : T extends Shape ? Exclude extends never ? { + [K in keyof T]: K extends keyof Shape ? T[K] extends { + select: infer NS; + } ? Extract extends { + select?: infer ShapeNS; + } ? DeepExact & { + select: DeepExact, DecrementDepth[Depth]>; + }, Extract, DecrementDepth[Depth]> : never : T[K] : never; +} : never : never; +/** + * Enforces exact select shape while keeping contextual typing on `S extends XxxSelect`. + * Use this as an intersection in overloads: + * `{ select: S } & StrictSelect`. + */ +export type StrictSelect = S extends DeepExact ? {} : never; +/** + * Hook-optimized strict select variant. + * + * Uses a shallower recursion depth to keep editor autocomplete responsive + * in large schemas while still validating common nested-select mistakes. + */ +export type HookStrictSelect = S extends DeepExact ? {} : never; +/** + * Infer result type from select configuration + */ +export type InferSelectResult = TSelect extends undefined ? TEntity : { + [K in keyof TSelect as TSelect[K] extends false | undefined ? never : K]: TSelect[K] extends true ? K extends keyof TEntity ? TEntity[K] : never : TSelect[K] extends { + select: infer NestedSelect; + } ? K extends keyof TEntity ? NonNullable extends ConnectionResult ? ConnectionResult> : InferSelectResult, NestedSelect> | (null extends TEntity[K] ? null : never) : never : K extends keyof TEntity ? TEntity[K] : never; +}; +export {}; diff --git a/sdk/functions-sdk/dist/compute/orm/select-types.js b/sdk/functions-sdk/dist/compute/orm/select-types.js new file mode 100644 index 00000000..c8ad2e54 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/select-types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/sdk/functions-sdk/dist/compute/orm/types.d.ts b/sdk/functions-sdk/dist/compute/orm/types.d.ts new file mode 100644 index 00000000..27d0ecb8 --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/types.d.ts @@ -0,0 +1,6 @@ +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +export * from './input-types'; diff --git a/sdk/functions-sdk/dist/compute/orm/types.js b/sdk/functions-sdk/dist/compute/orm/types.js new file mode 100644 index 00000000..2d2ed0fa --- /dev/null +++ b/sdk/functions-sdk/dist/compute/orm/types.js @@ -0,0 +1,23 @@ +"use strict"; +/** + * Types re-export + * @generated by @constructive-io/graphql-codegen + * DO NOT EDIT - changes will be overwritten + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// Re-export all types from input-types +__exportStar(require("./input-types"), exports); diff --git a/sdk/functions-sdk/dist/index.d.ts b/sdk/functions-sdk/dist/index.d.ts new file mode 100644 index 00000000..b82e8685 --- /dev/null +++ b/sdk/functions-sdk/dist/index.d.ts @@ -0,0 +1,9 @@ +/** + * @constructive-io/functions-sdk + * + * Auto-generated GraphQL types and ORM client. + * Run `pnpm run generate` to populate this package from the schema files. + * + * @generated by scripts/generate-sdk.ts + */ +export * as compute from './compute'; diff --git a/sdk/functions-sdk/dist/index.js b/sdk/functions-sdk/dist/index.js new file mode 100644 index 00000000..2e67fa86 --- /dev/null +++ b/sdk/functions-sdk/dist/index.js @@ -0,0 +1,45 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || (function () { + var ownKeys = function(o) { + ownKeys = Object.getOwnPropertyNames || function (o) { + var ar = []; + for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys(o); + }; + return function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); + __setModuleDefault(result, mod); + return result; + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.compute = void 0; +/** + * @constructive-io/functions-sdk + * + * Auto-generated GraphQL types and ORM client. + * Run `pnpm run generate` to populate this package from the schema files. + * + * @generated by scripts/generate-sdk.ts + */ +exports.compute = __importStar(require("./compute")); diff --git a/sdk/functions-sdk/node_modules/@constructive-io/functions-schema b/sdk/functions-sdk/node_modules/@constructive-io/functions-schema new file mode 120000 index 00000000..96572b76 --- /dev/null +++ b/sdk/functions-sdk/node_modules/@constructive-io/functions-schema @@ -0,0 +1 @@ +../../../functions-schema \ No newline at end of file