@nsp-labs/agnostic-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE +15 -0
- package/README.md +195 -0
- package/package.json +47 -0
- package/src/generated/openapi.d.ts +1214 -0
- package/src/generated/openapi.js +7 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +24 -0
- package/src/lib/context.d.ts +3 -0
- package/src/lib/context.js +70 -0
- package/src/lib/errors.d.ts +14 -0
- package/src/lib/errors.js +57 -0
- package/src/lib/http-client.d.ts +18 -0
- package/src/lib/http-client.js +65 -0
- package/src/lib/runtime-client.d.ts +91 -0
- package/src/lib/runtime-client.js +394 -0
- package/src/lib/types.d.ts +224 -0
- package/src/lib/types.js +3 -0
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AgnosticRuntime, RuntimeAppAuthNamespace, RuntimeContextNamespace, RuntimeDataNamespace, RuntimeDataRecordsClient, RuntimeDataTableClient, RuntimeDataViewClient, RuntimeDataViewTableClient, RuntimeEventsNamespace, RuntimeGatewayNamespace, RuntimeJobsNamespace, RuntimeWorkflowRunsNamespace, RuntimeWorkflowsNamespace, createAgnosticRuntime, } from './lib/runtime-client';
|
|
2
|
+
export { normalizeApiUrl, resolveRuntimeContext } from './lib/context';
|
|
3
|
+
export { AgnosticRuntimeError } from './lib/errors';
|
|
4
|
+
export type { AgnosticRuntimeConfig, ResolvedRuntimeContext, RuntimeActorMetadata, RuntimeActorType, RuntimeAppAuthActor, RuntimeAppAuthCachePolicy, RuntimeAppAuthRequestLike, RuntimeAppAuthSession, RuntimeAppAuthSessionClaims, RuntimeAppAuthUserClaims, RuntimeAppAuthUserResult, RuntimeCreateRecordInput, RuntimeDataField, RuntimeDataViewState, RuntimeGatewayCallOptions, RuntimeGatewayCallResult, RuntimeIdentityContext, RuntimeListRecordsOptions, RuntimeListWindowOptions, RuntimeQueuedMessage, RuntimeQueueOptions, RuntimeRecord, RuntimeRecordMutation, RuntimeRecordsList, RuntimeRequestOptions, RuntimeRowData, RuntimeRowValue, RuntimeTableWindow, RuntimeUpdateRecordInput, RuntimeWorkflowRun, RuntimeWorkflowStepRun, RuntimeWorkflowWaitOptions, WorkflowRunStatus, } from './lib/types';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgnosticRuntimeError = exports.resolveRuntimeContext = exports.normalizeApiUrl = exports.createAgnosticRuntime = exports.RuntimeWorkflowsNamespace = exports.RuntimeWorkflowRunsNamespace = exports.RuntimeJobsNamespace = exports.RuntimeGatewayNamespace = exports.RuntimeEventsNamespace = exports.RuntimeDataViewTableClient = exports.RuntimeDataViewClient = exports.RuntimeDataTableClient = exports.RuntimeDataRecordsClient = exports.RuntimeDataNamespace = exports.RuntimeContextNamespace = exports.RuntimeAppAuthNamespace = exports.AgnosticRuntime = void 0;
|
|
4
|
+
var runtime_client_1 = require("./lib/runtime-client");
|
|
5
|
+
Object.defineProperty(exports, "AgnosticRuntime", { enumerable: true, get: function () { return runtime_client_1.AgnosticRuntime; } });
|
|
6
|
+
Object.defineProperty(exports, "RuntimeAppAuthNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeAppAuthNamespace; } });
|
|
7
|
+
Object.defineProperty(exports, "RuntimeContextNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeContextNamespace; } });
|
|
8
|
+
Object.defineProperty(exports, "RuntimeDataNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeDataNamespace; } });
|
|
9
|
+
Object.defineProperty(exports, "RuntimeDataRecordsClient", { enumerable: true, get: function () { return runtime_client_1.RuntimeDataRecordsClient; } });
|
|
10
|
+
Object.defineProperty(exports, "RuntimeDataTableClient", { enumerable: true, get: function () { return runtime_client_1.RuntimeDataTableClient; } });
|
|
11
|
+
Object.defineProperty(exports, "RuntimeDataViewClient", { enumerable: true, get: function () { return runtime_client_1.RuntimeDataViewClient; } });
|
|
12
|
+
Object.defineProperty(exports, "RuntimeDataViewTableClient", { enumerable: true, get: function () { return runtime_client_1.RuntimeDataViewTableClient; } });
|
|
13
|
+
Object.defineProperty(exports, "RuntimeEventsNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeEventsNamespace; } });
|
|
14
|
+
Object.defineProperty(exports, "RuntimeGatewayNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeGatewayNamespace; } });
|
|
15
|
+
Object.defineProperty(exports, "RuntimeJobsNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeJobsNamespace; } });
|
|
16
|
+
Object.defineProperty(exports, "RuntimeWorkflowRunsNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeWorkflowRunsNamespace; } });
|
|
17
|
+
Object.defineProperty(exports, "RuntimeWorkflowsNamespace", { enumerable: true, get: function () { return runtime_client_1.RuntimeWorkflowsNamespace; } });
|
|
18
|
+
Object.defineProperty(exports, "createAgnosticRuntime", { enumerable: true, get: function () { return runtime_client_1.createAgnosticRuntime; } });
|
|
19
|
+
var context_1 = require("./lib/context");
|
|
20
|
+
Object.defineProperty(exports, "normalizeApiUrl", { enumerable: true, get: function () { return context_1.normalizeApiUrl; } });
|
|
21
|
+
Object.defineProperty(exports, "resolveRuntimeContext", { enumerable: true, get: function () { return context_1.resolveRuntimeContext; } });
|
|
22
|
+
var errors_1 = require("./lib/errors");
|
|
23
|
+
Object.defineProperty(exports, "AgnosticRuntimeError", { enumerable: true, get: function () { return errors_1.AgnosticRuntimeError; } });
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AgnosticRuntimeConfig, ResolvedRuntimeContext, RuntimeContextEnvironment } from './types';
|
|
2
|
+
export declare function resolveRuntimeContext(config?: AgnosticRuntimeConfig, env?: RuntimeContextEnvironment): ResolvedRuntimeContext;
|
|
3
|
+
export declare function normalizeApiUrl(value: string): string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimeContext = resolveRuntimeContext;
|
|
4
|
+
exports.normalizeApiUrl = normalizeApiUrl;
|
|
5
|
+
const errors_1 = require("./errors");
|
|
6
|
+
const CONTEXT_FIELDS = {
|
|
7
|
+
apiUrl: 'AGNOSTIC_API_URL',
|
|
8
|
+
projectId: 'AGNOSTIC_PROJECT_ID',
|
|
9
|
+
environment: 'AGNOSTIC_ENVIRONMENT',
|
|
10
|
+
token: 'AGNOSTIC_RUNTIME_TOKEN',
|
|
11
|
+
};
|
|
12
|
+
function resolveRuntimeContext(config = {}, env = readRuntimeEnvironment()) {
|
|
13
|
+
const rawContext = {
|
|
14
|
+
apiUrl: firstNonEmpty(config.apiUrl, env.AGNOSTIC_API_URL),
|
|
15
|
+
projectId: firstNonEmpty(config.projectId, env.AGNOSTIC_PROJECT_ID),
|
|
16
|
+
environment: firstNonEmpty(config.environment, env.AGNOSTIC_ENVIRONMENT),
|
|
17
|
+
token: firstNonEmpty(config.token, env.AGNOSTIC_RUNTIME_TOKEN),
|
|
18
|
+
};
|
|
19
|
+
const missing = Object.entries(rawContext)
|
|
20
|
+
.filter(([, value]) => !value)
|
|
21
|
+
.map(([field]) => field);
|
|
22
|
+
if (missing.length > 0) {
|
|
23
|
+
throw new errors_1.AgnosticRuntimeError({
|
|
24
|
+
status: 0,
|
|
25
|
+
code: 'runtime_context_missing',
|
|
26
|
+
message: `Missing Agnostic runtime context: ${missing.join(', ')}`,
|
|
27
|
+
details: {
|
|
28
|
+
missing,
|
|
29
|
+
env: missing.map((field) => CONTEXT_FIELDS[field]),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
apiUrl: normalizeApiUrl(rawContext.apiUrl),
|
|
35
|
+
projectId: rawContext.projectId,
|
|
36
|
+
environment: rawContext.environment,
|
|
37
|
+
token: rawContext.token,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function normalizeApiUrl(value) {
|
|
41
|
+
const url = new URL(value.trim());
|
|
42
|
+
url.pathname = url.pathname.replace(/\/+$/, '') || '/';
|
|
43
|
+
url.search = '';
|
|
44
|
+
url.hash = '';
|
|
45
|
+
let normalized = url.toString().replace(/\/$/, '');
|
|
46
|
+
if (normalized.endsWith('/api/v1')) {
|
|
47
|
+
normalized = normalized.slice(0, -7);
|
|
48
|
+
}
|
|
49
|
+
else if (normalized.endsWith('/api')) {
|
|
50
|
+
normalized = normalized.slice(0, -4);
|
|
51
|
+
}
|
|
52
|
+
return normalized;
|
|
53
|
+
}
|
|
54
|
+
function firstNonEmpty(...values) {
|
|
55
|
+
return values
|
|
56
|
+
.find((value) => typeof value === 'string' && value.trim())
|
|
57
|
+
?.trim();
|
|
58
|
+
}
|
|
59
|
+
function readRuntimeEnvironment() {
|
|
60
|
+
if (typeof process === 'undefined' || !process.env) {
|
|
61
|
+
return {};
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
AGNOSTIC_API_URL: process.env['AGNOSTIC_API_URL'],
|
|
65
|
+
AGNOSTIC_ENVIRONMENT: process.env['AGNOSTIC_ENVIRONMENT'],
|
|
66
|
+
AGNOSTIC_PROJECT_ID: process.env['AGNOSTIC_PROJECT_ID'],
|
|
67
|
+
AGNOSTIC_RUNTIME_TOKEN: process.env['AGNOSTIC_RUNTIME_TOKEN'],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AgnosticRuntimeErrorOptions {
|
|
2
|
+
status?: number;
|
|
3
|
+
code: string;
|
|
4
|
+
message: string;
|
|
5
|
+
details?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare class AgnosticRuntimeError extends Error {
|
|
8
|
+
readonly status: number;
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly details?: unknown;
|
|
11
|
+
constructor(options: AgnosticRuntimeErrorOptions);
|
|
12
|
+
}
|
|
13
|
+
export declare function toRuntimeError(response: Response, payload: unknown, fallbackMessage: string): AgnosticRuntimeError;
|
|
14
|
+
export declare function toNetworkError(error: unknown): AgnosticRuntimeError;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgnosticRuntimeError = void 0;
|
|
4
|
+
exports.toRuntimeError = toRuntimeError;
|
|
5
|
+
exports.toNetworkError = toNetworkError;
|
|
6
|
+
class AgnosticRuntimeError extends Error {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options.message);
|
|
9
|
+
this.name = 'AgnosticRuntimeError';
|
|
10
|
+
this.status = options.status ?? 0;
|
|
11
|
+
this.code = options.code;
|
|
12
|
+
this.details = options.details;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.AgnosticRuntimeError = AgnosticRuntimeError;
|
|
16
|
+
function toRuntimeError(response, payload, fallbackMessage) {
|
|
17
|
+
const message = readString(payload, 'message') ?? fallbackMessage;
|
|
18
|
+
const explicitCode = readString(payload, 'code');
|
|
19
|
+
const errorName = readString(payload, 'error');
|
|
20
|
+
return new AgnosticRuntimeError({
|
|
21
|
+
status: response.status,
|
|
22
|
+
code: explicitCode ??
|
|
23
|
+
normalizeErrorCode(errorName) ??
|
|
24
|
+
`http_${response.status}`,
|
|
25
|
+
message,
|
|
26
|
+
details: payload,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function toNetworkError(error) {
|
|
30
|
+
return new AgnosticRuntimeError({
|
|
31
|
+
status: 0,
|
|
32
|
+
code: 'network_error',
|
|
33
|
+
message: error instanceof Error && error.message
|
|
34
|
+
? error.message
|
|
35
|
+
: 'Network request failed',
|
|
36
|
+
details: error,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function normalizeErrorCode(value) {
|
|
40
|
+
if (!value) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return value
|
|
44
|
+
.trim()
|
|
45
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1_$2')
|
|
46
|
+
.replace(/[^a-zA-Z0-9]+/g, '_')
|
|
47
|
+
.replace(/^_+|_+$/g, '')
|
|
48
|
+
.toLowerCase();
|
|
49
|
+
}
|
|
50
|
+
function readString(payload, key) {
|
|
51
|
+
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
const value = payload[key];
|
|
55
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Client } from 'openapi-fetch';
|
|
2
|
+
import type { paths } from '../generated/openapi';
|
|
3
|
+
import type { ResolvedRuntimeContext, RuntimeActorMetadata, RuntimeRequestOptions } from './types';
|
|
4
|
+
export declare const RUNTIME_ACTOR_HEADER = "x-agnostic-actor";
|
|
5
|
+
export type RuntimeOpenApiClient = Client<paths>;
|
|
6
|
+
export interface RuntimeApiResult {
|
|
7
|
+
data?: unknown;
|
|
8
|
+
error?: unknown;
|
|
9
|
+
response: Response;
|
|
10
|
+
}
|
|
11
|
+
export declare function createRuntimeOpenApiClient(options: {
|
|
12
|
+
actor?: RuntimeActorMetadata | null;
|
|
13
|
+
context: ResolvedRuntimeContext;
|
|
14
|
+
fetch?: typeof fetch;
|
|
15
|
+
}): RuntimeOpenApiClient;
|
|
16
|
+
export declare function runtimeRequestHeaders(options?: RuntimeRequestOptions): Record<string, string> | undefined;
|
|
17
|
+
export declare function unwrapRuntimeResult<T>(result: RuntimeApiResult, fallbackMessage: string): T;
|
|
18
|
+
export declare function unwrapApiEnvelope(payload: unknown): unknown;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RUNTIME_ACTOR_HEADER = void 0;
|
|
4
|
+
exports.createRuntimeOpenApiClient = createRuntimeOpenApiClient;
|
|
5
|
+
exports.runtimeRequestHeaders = runtimeRequestHeaders;
|
|
6
|
+
exports.unwrapRuntimeResult = unwrapRuntimeResult;
|
|
7
|
+
exports.unwrapApiEnvelope = unwrapApiEnvelope;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const openapi_fetch_1 = tslib_1.__importDefault(require("openapi-fetch"));
|
|
10
|
+
const errors_1 = require("./errors");
|
|
11
|
+
exports.RUNTIME_ACTOR_HEADER = 'x-agnostic-actor';
|
|
12
|
+
function createRuntimeOpenApiClient(options) {
|
|
13
|
+
const openapi = (0, openapi_fetch_1.default)({
|
|
14
|
+
baseUrl: options.context.apiUrl,
|
|
15
|
+
fetch: options.fetch,
|
|
16
|
+
});
|
|
17
|
+
openapi.use({
|
|
18
|
+
onRequest({ request }) {
|
|
19
|
+
request.headers.set('Accept', 'application/json');
|
|
20
|
+
request.headers.set('Authorization', `Bearer ${options.context.token}`);
|
|
21
|
+
if (options.actor) {
|
|
22
|
+
request.headers.set(exports.RUNTIME_ACTOR_HEADER, JSON.stringify(options.actor));
|
|
23
|
+
}
|
|
24
|
+
return request;
|
|
25
|
+
},
|
|
26
|
+
onError({ error }) {
|
|
27
|
+
return (0, errors_1.toNetworkError)(error);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return openapi;
|
|
31
|
+
}
|
|
32
|
+
function runtimeRequestHeaders(options) {
|
|
33
|
+
const headers = { ...(options?.headers ?? {}) };
|
|
34
|
+
if (options && 'actor' in options) {
|
|
35
|
+
if (options.actor) {
|
|
36
|
+
headers[exports.RUNTIME_ACTOR_HEADER] = JSON.stringify(options.actor);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
delete headers[exports.RUNTIME_ACTOR_HEADER];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return Object.keys(headers).length > 0 ? headers : undefined;
|
|
43
|
+
}
|
|
44
|
+
function unwrapRuntimeResult(result, fallbackMessage) {
|
|
45
|
+
const payload = result.response.ok
|
|
46
|
+
? result.data
|
|
47
|
+
: (result.error ?? result.data);
|
|
48
|
+
if (!result.response.ok) {
|
|
49
|
+
throw (0, errors_1.toRuntimeError)(result.response, payload, fallbackMessage);
|
|
50
|
+
}
|
|
51
|
+
return unwrapApiEnvelope(payload);
|
|
52
|
+
}
|
|
53
|
+
function unwrapApiEnvelope(payload) {
|
|
54
|
+
if (!isPlainObject(payload)) {
|
|
55
|
+
return payload;
|
|
56
|
+
}
|
|
57
|
+
if ('data' in payload && ('success' in payload || 'message' in payload)) {
|
|
58
|
+
return payload['data'];
|
|
59
|
+
}
|
|
60
|
+
return payload;
|
|
61
|
+
}
|
|
62
|
+
function isPlainObject(value) {
|
|
63
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=http-client.js.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type RuntimeOpenApiClient } from './http-client';
|
|
2
|
+
import type { AgnosticRuntimeConfig, ResolvedRuntimeContext, RuntimeAppAuthRequestLike, RuntimeAppAuthSession, RuntimeAppAuthUserResult, RuntimeCreateRecordInput, RuntimeGatewayCallOptions, RuntimeGatewayCallResult, RuntimeIdentityContext, RuntimeListRecordsOptions, RuntimeListWindowOptions, RuntimeQueuedMessage, RuntimeQueueOptions, RuntimeRecordMutation, RuntimeRecordsList, RuntimeRequestOptions, RuntimeRowData, RuntimeTableWindow, RuntimeUpdateRecordInput, RuntimeWorkflowRun, RuntimeWorkflowStepRun, RuntimeWorkflowWaitOptions } from './types';
|
|
3
|
+
export declare class AgnosticRuntime {
|
|
4
|
+
readonly auth: RuntimeAppAuthNamespace;
|
|
5
|
+
readonly context: RuntimeContextNamespace;
|
|
6
|
+
readonly data: RuntimeDataNamespace;
|
|
7
|
+
readonly events: RuntimeEventsNamespace;
|
|
8
|
+
readonly jobs: RuntimeJobsNamespace;
|
|
9
|
+
readonly gateway: RuntimeGatewayNamespace;
|
|
10
|
+
readonly workflows: RuntimeWorkflowsNamespace;
|
|
11
|
+
readonly workflowRuns: RuntimeWorkflowRunsNamespace;
|
|
12
|
+
private readonly openapi;
|
|
13
|
+
private readonly runtimeContext;
|
|
14
|
+
constructor(config?: AgnosticRuntimeConfig);
|
|
15
|
+
getRuntimeContext(): ResolvedRuntimeContext;
|
|
16
|
+
}
|
|
17
|
+
export declare class RuntimeAppAuthNamespace {
|
|
18
|
+
private readonly openapi;
|
|
19
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
20
|
+
requireSession(request: RuntimeAppAuthRequestLike | string, options?: RuntimeRequestOptions): Promise<RuntimeAppAuthSession>;
|
|
21
|
+
getUser(userId: string, options?: RuntimeRequestOptions): Promise<RuntimeAppAuthUserResult>;
|
|
22
|
+
}
|
|
23
|
+
export declare function createAgnosticRuntime(config?: AgnosticRuntimeConfig): AgnosticRuntime;
|
|
24
|
+
export declare class RuntimeContextNamespace {
|
|
25
|
+
private readonly openapi;
|
|
26
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
27
|
+
get(options?: RuntimeRequestOptions): Promise<RuntimeIdentityContext>;
|
|
28
|
+
}
|
|
29
|
+
export declare class RuntimeDataNamespace {
|
|
30
|
+
private readonly openapi;
|
|
31
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
32
|
+
table(tableName: string): RuntimeDataTableClient;
|
|
33
|
+
view(viewId: string): RuntimeDataViewClient;
|
|
34
|
+
}
|
|
35
|
+
export declare class RuntimeDataTableClient {
|
|
36
|
+
private readonly tableName;
|
|
37
|
+
readonly records: RuntimeDataRecordsClient;
|
|
38
|
+
constructor(openapi: RuntimeOpenApiClient, tableName: string);
|
|
39
|
+
}
|
|
40
|
+
export declare class RuntimeDataRecordsClient {
|
|
41
|
+
private readonly openapi;
|
|
42
|
+
private readonly tableName;
|
|
43
|
+
constructor(openapi: RuntimeOpenApiClient, tableName: string);
|
|
44
|
+
list(query?: RuntimeListRecordsOptions, options?: RuntimeRequestOptions): Promise<RuntimeRecordsList>;
|
|
45
|
+
create(input: RuntimeCreateRecordInput | RuntimeRowData, options?: RuntimeRequestOptions): Promise<RuntimeRecordMutation>;
|
|
46
|
+
update(recordId: string, input: RuntimeUpdateRecordInput | RuntimeRowData, options?: RuntimeRequestOptions): Promise<RuntimeRecordMutation>;
|
|
47
|
+
delete(recordId: string, options?: RuntimeRequestOptions): Promise<RuntimeRecordMutation>;
|
|
48
|
+
}
|
|
49
|
+
export declare class RuntimeDataViewClient {
|
|
50
|
+
readonly table: RuntimeDataViewTableClient;
|
|
51
|
+
constructor(openapi: RuntimeOpenApiClient, viewId: string);
|
|
52
|
+
}
|
|
53
|
+
export declare class RuntimeDataViewTableClient {
|
|
54
|
+
private readonly openapi;
|
|
55
|
+
private readonly viewId;
|
|
56
|
+
constructor(openapi: RuntimeOpenApiClient, viewId: string);
|
|
57
|
+
window(query?: RuntimeListWindowOptions, options?: RuntimeRequestOptions): Promise<RuntimeTableWindow>;
|
|
58
|
+
}
|
|
59
|
+
export declare class RuntimeEventsNamespace {
|
|
60
|
+
private readonly openapi;
|
|
61
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
62
|
+
publish(eventName: string, payload?: Record<string, unknown>, options?: RuntimeQueueOptions & RuntimeRequestOptions): Promise<RuntimeQueuedMessage>;
|
|
63
|
+
publishBatch(eventName: string, messages: Array<{
|
|
64
|
+
payload?: Record<string, unknown>;
|
|
65
|
+
options?: RuntimeQueueOptions & RuntimeRequestOptions;
|
|
66
|
+
}>, options?: RuntimeRequestOptions): Promise<RuntimeQueuedMessage[]>;
|
|
67
|
+
}
|
|
68
|
+
export declare class RuntimeJobsNamespace {
|
|
69
|
+
private readonly openapi;
|
|
70
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
71
|
+
enqueue(jobName: string, payload?: Record<string, unknown>, options?: RuntimeQueueOptions & RuntimeRequestOptions): Promise<RuntimeQueuedMessage>;
|
|
72
|
+
}
|
|
73
|
+
export declare class RuntimeGatewayNamespace {
|
|
74
|
+
private readonly openapi;
|
|
75
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
76
|
+
call(routeName: string, payload?: Record<string, unknown>, options?: RuntimeGatewayCallOptions): Promise<RuntimeGatewayCallResult>;
|
|
77
|
+
}
|
|
78
|
+
export declare class RuntimeWorkflowsNamespace {
|
|
79
|
+
private readonly openapi;
|
|
80
|
+
private readonly workflowRuns;
|
|
81
|
+
constructor(openapi: RuntimeOpenApiClient, workflowRuns: RuntimeWorkflowRunsNamespace);
|
|
82
|
+
start(workflowSlug: string, inputPayload?: Record<string, unknown>, options?: RuntimeRequestOptions): Promise<RuntimeWorkflowRun>;
|
|
83
|
+
getRun(runId: string, options?: RuntimeRequestOptions): Promise<RuntimeWorkflowRun>;
|
|
84
|
+
}
|
|
85
|
+
export declare class RuntimeWorkflowRunsNamespace {
|
|
86
|
+
private readonly openapi;
|
|
87
|
+
constructor(openapi: RuntimeOpenApiClient);
|
|
88
|
+
get(runId: string, options?: RuntimeRequestOptions): Promise<RuntimeWorkflowRun>;
|
|
89
|
+
wait(runId: string, options?: RuntimeWorkflowWaitOptions): Promise<RuntimeWorkflowRun>;
|
|
90
|
+
listSteps(runId: string, options?: RuntimeRequestOptions): Promise<RuntimeWorkflowStepRun[]>;
|
|
91
|
+
}
|