@relyio/sdk 0.16.0 → 0.18.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 +23 -0
- package/dist/automations/index.cjs +70 -0
- package/dist/automations/index.d.cts +1309 -0
- package/dist/automations/index.d.ts +1309 -0
- package/dist/automations/index.js +5 -0
- package/dist/{chunk-RSHMA4KT.cjs → chunk-2SPPU2WG.cjs} +68 -68
- package/dist/chunk-7I3SC7SV.cjs +40 -0
- package/dist/chunk-DI6KFDBO.js +43 -0
- package/dist/chunk-EDE2H37D.js +686 -0
- package/dist/chunk-HDHBYYEY.js +36 -0
- package/dist/{chunk-RLLZUFDB.cjs → chunk-IFKF72VJ.cjs} +718 -331
- package/dist/chunk-L6DXCKVQ.cjs +50 -0
- package/dist/chunk-LSI26ZN2.cjs +535 -0
- package/dist/{chunk-TZL374LS.cjs → chunk-M7MWNV3Q.cjs} +21 -21
- package/dist/{chunk-H6IBQSMM.js → chunk-NJQK5STK.js} +3 -3
- package/dist/chunk-R6E4HE7R.js +520 -0
- package/dist/chunk-SHSK7UUY.cjs +706 -0
- package/dist/{chunk-BBUB7C2Z.js → chunk-W2A4OTCI.js} +3 -3
- package/dist/chunk-W7JFHSFM.js +18718 -0
- package/dist/{chunk-5UMY6CS4.js → chunk-ZAKEY6DY.js} +3 -3
- package/dist/chunk-ZAMAR3X2.cjs +18759 -0
- package/dist/{chunk-NIUOPIIB.js → chunk-ZHTJ7GXH.js} +400 -19
- package/dist/{chunk-LSRPMNPT.cjs → chunk-ZO6QDYJG.cjs} +7 -7
- package/dist/client/index.cjs +8 -7
- package/dist/client/index.d.cts +4 -3
- package/dist/client/index.d.ts +4 -3
- package/dist/client/index.js +6 -5
- package/dist/{define-content-type-LkI0rS2W.d.cts → define-content-type-NEQDrvdq.d.cts} +3420 -749
- package/dist/{define-content-type-CAWSlgn0.d.ts → define-content-type-fb-WCD5e.d.ts} +3420 -749
- package/dist/{define-schema-Dxu3RoHV.d.ts → define-schema-DZhtvLiK.d.cts} +157 -10
- package/dist/{define-schema-wlsJOrnY.d.cts → define-schema-Dlwh6l_J.d.ts} +157 -10
- package/dist/dev-handshake/index.cjs +9 -9
- package/dist/dev-handshake/index.js +2 -2
- package/dist/extensions/index.cjs +80 -0
- package/dist/extensions/index.d.cts +792 -0
- package/dist/extensions/index.d.ts +792 -0
- package/dist/extensions/index.js +76 -0
- package/dist/functions/index.cjs +68 -0
- package/dist/functions/index.d.cts +6 -0
- package/dist/functions/index.d.ts +6 -0
- package/dist/functions/index.js +59 -0
- package/dist/{index-CGtYxUuh.d.ts → index-C4LqrNd1.d.ts} +1 -1
- package/dist/{index-CcHmRALk.d.cts → index-Dnmt_UOo.d.cts} +1 -1
- package/dist/{index-D80MXUkf.d.cts → index-DwHcL6x5.d.cts} +103 -442
- package/dist/{index-BH8JksfG.d.ts → index-M3luH06A.d.ts} +103 -442
- package/dist/index.cjs +204 -185
- package/dist/index.d.cts +93 -13
- package/dist/index.d.ts +93 -13
- package/dist/index.js +11 -16
- package/dist/markdown/index.cjs +382 -382
- package/dist/markdown/index.js +1 -1
- package/dist/preview/index.cjs +11 -10
- package/dist/preview/index.js +3 -2
- package/dist/register-B53i97A9.d.ts +677 -0
- package/dist/register-BYCs0FpF.d.cts +677 -0
- package/dist/rich-text/index.cjs +12 -12
- package/dist/rich-text/index.d.cts +2 -2
- package/dist/rich-text/index.d.ts +2 -2
- package/dist/rich-text/index.js +2 -2
- package/dist/schema/index.cjs +62 -34
- package/dist/schema/index.d.cts +127 -5
- package/dist/schema/index.d.ts +127 -5
- package/dist/schema/index.js +2 -2
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.cjs +20 -20
- package/dist/utils/index.js +2 -2
- package/package.json +21 -3
- package/dist/chunk-7BZW6XYJ.cjs +0 -433
- package/dist/chunk-CQHEG7QA.js +0 -411
- package/dist/chunk-DIZY6CKM.js +0 -950
- package/dist/chunk-GHYB6IZK.cjs +0 -983
- package/dist/chunk-MWMSFIWN.cjs +0 -17
- package/dist/chunk-XQ4QHWZE.js +0 -13
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { extensionTrigger } from '../chunk-R6E4HE7R.js';
|
|
2
|
+
import '../chunk-W7JFHSFM.js';
|
|
3
|
+
import { EXTENSION_SURFACES } from '../chunk-EDE2H37D.js';
|
|
4
|
+
import { __name } from '../chunk-DI6KFDBO.js';
|
|
5
|
+
|
|
6
|
+
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
7
|
+
|
|
8
|
+
// src/extensions/index.ts
|
|
9
|
+
var DECLARED = "declared";
|
|
10
|
+
var SURFACES = EXTENSION_SURFACES;
|
|
11
|
+
function handleOf(slug) {
|
|
12
|
+
const surface = SURFACES[slug];
|
|
13
|
+
if (surface === void 0) {
|
|
14
|
+
throw new TypeError(
|
|
15
|
+
`"${slug}" is no Extension relyio/extensions.ts can declare: ${Object.keys(SURFACES).join(", ")}`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
...Object.fromEntries(
|
|
20
|
+
Object.entries(surface.actions).map(([name, { action }]) => [
|
|
21
|
+
name,
|
|
22
|
+
{ _tag: "action", extension: slug, action }
|
|
23
|
+
])
|
|
24
|
+
),
|
|
25
|
+
...Object.fromEntries(
|
|
26
|
+
Object.entries(surface.triggers).map(([name, { trigger }]) => [
|
|
27
|
+
name,
|
|
28
|
+
(options) => extensionTrigger(slug, trigger, options)
|
|
29
|
+
])
|
|
30
|
+
)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
__name(handleOf, "handleOf");
|
|
34
|
+
function settingsOf(slug, settings) {
|
|
35
|
+
if (typeof settings !== "object" || settings === null || Array.isArray(settings)) {
|
|
36
|
+
throw new TypeError(`${slug}'s settings are an object: ${slug}: { \u2026 }`);
|
|
37
|
+
}
|
|
38
|
+
return Object.fromEntries(
|
|
39
|
+
Object.entries(settings).filter(([, value]) => value !== void 0).map(([key, value]) => {
|
|
40
|
+
if (typeof value !== "string") {
|
|
41
|
+
throw new TypeError(`${slug}.${key} is text: a setting is never anything else`);
|
|
42
|
+
}
|
|
43
|
+
return [key, value];
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
__name(settingsOf, "settingsOf");
|
|
48
|
+
function defineExtensions(config) {
|
|
49
|
+
const slugs = Object.keys(config).filter(
|
|
50
|
+
(slug) => config[slug] !== void 0
|
|
51
|
+
);
|
|
52
|
+
const declared = Object.fromEntries(
|
|
53
|
+
slugs.map((slug) => [
|
|
54
|
+
slug,
|
|
55
|
+
{ settings: settingsOf(slug, config[slug]) }
|
|
56
|
+
])
|
|
57
|
+
);
|
|
58
|
+
return {
|
|
59
|
+
_tag: "extensions",
|
|
60
|
+
[DECLARED]: declared,
|
|
61
|
+
...Object.fromEntries(slugs.map((slug) => [slug, handleOf(slug)]))
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
__name(defineExtensions, "defineExtensions");
|
|
65
|
+
function isExtensionsFile(value) {
|
|
66
|
+
return typeof value === "object" && value !== null && value._tag === "extensions" && typeof value[DECLARED] === "object";
|
|
67
|
+
}
|
|
68
|
+
__name(isExtensionsFile, "isExtensionsFile");
|
|
69
|
+
function extensionsDeclarationOf(file) {
|
|
70
|
+
return file[DECLARED];
|
|
71
|
+
}
|
|
72
|
+
__name(extensionsDeclarationOf, "extensionsDeclarationOf");
|
|
73
|
+
|
|
74
|
+
export { defineExtensions, extensionsDeclarationOf, isExtensionsFile };
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkZAMAR3X2_cjs = require('../chunk-ZAMAR3X2.cjs');
|
|
4
|
+
var chunkL6DXCKVQ_cjs = require('../chunk-L6DXCKVQ.cjs');
|
|
5
|
+
|
|
6
|
+
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
7
|
+
|
|
8
|
+
// src/functions/index.ts
|
|
9
|
+
function isBatchRefused(error) {
|
|
10
|
+
return error instanceof Error && error.name === "BatchRefused" && "operation" in error;
|
|
11
|
+
}
|
|
12
|
+
chunkL6DXCKVQ_cjs.__name(isBatchRefused, "isBatchRefused");
|
|
13
|
+
function isActionRefused(error) {
|
|
14
|
+
return error instanceof Error && error.name === "ActionRefused" && "code" in error;
|
|
15
|
+
}
|
|
16
|
+
chunkL6DXCKVQ_cjs.__name(isActionRefused, "isActionRefused");
|
|
17
|
+
function respond(response) {
|
|
18
|
+
return {
|
|
19
|
+
_tag: "function-response",
|
|
20
|
+
status: response.status,
|
|
21
|
+
headers: { ...response.headers },
|
|
22
|
+
body: response.body ?? null
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
chunkL6DXCKVQ_cjs.__name(respond, "respond");
|
|
26
|
+
function defineFunction(config) {
|
|
27
|
+
const actions = (config.actions ?? []).map(({ extension, action }) => ({ extension, action }));
|
|
28
|
+
const declaration = {
|
|
29
|
+
...config.description === void 0 ? {} : { description: config.description },
|
|
30
|
+
runtime: config.runtime ?? "isolate",
|
|
31
|
+
...config.container === void 0 ? {} : { container: { size: config.container.size } },
|
|
32
|
+
...config.limits === void 0 ? {} : { limits: { ...config.limits } },
|
|
33
|
+
input: chunkZAMAR3X2_cjs.compileKeyedMembers(config.input ?? {}),
|
|
34
|
+
...config.output === void 0 ? {} : { output: chunkZAMAR3X2_cjs.compileKeyedMembers(config.output) },
|
|
35
|
+
records: { read: [...config.records?.read ?? []], write: [...config.records?.write ?? []] },
|
|
36
|
+
content: config.content ?? "none",
|
|
37
|
+
network: (config.network ?? []).map((host) => ({ ...host })),
|
|
38
|
+
secrets: Object.fromEntries(
|
|
39
|
+
Object.entries(config.secrets ?? {}).map(([name, secret]) => [
|
|
40
|
+
name,
|
|
41
|
+
{ hosts: [...secret.hosts] }
|
|
42
|
+
])
|
|
43
|
+
),
|
|
44
|
+
// Absent when it declares none, so a Function declaring none hashes as it did before
|
|
45
|
+
...actions.length === 0 ? {} : { actions },
|
|
46
|
+
...config.route === void 0 ? {} : { route: config.route },
|
|
47
|
+
...config.tool === void 0 ? {} : { tool: { description: config.tool.description } },
|
|
48
|
+
...config.schedule === void 0 ? {} : { schedule: { ...config.schedule } }
|
|
49
|
+
};
|
|
50
|
+
return { _tag: "function", declaration, run: config.run };
|
|
51
|
+
}
|
|
52
|
+
chunkL6DXCKVQ_cjs.__name(defineFunction, "defineFunction");
|
|
53
|
+
function isFunctionDefinition(value) {
|
|
54
|
+
return typeof value === "object" && value !== null && value._tag === "function" && typeof value.run === "function" && typeof value.declaration === "object";
|
|
55
|
+
}
|
|
56
|
+
chunkL6DXCKVQ_cjs.__name(isFunctionDefinition, "isFunctionDefinition");
|
|
57
|
+
|
|
58
|
+
Object.defineProperty(exports, "fields", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return chunkZAMAR3X2_cjs.fields; }
|
|
61
|
+
});
|
|
62
|
+
exports.defineFunction = defineFunction;
|
|
63
|
+
exports.isActionRefused = isActionRefused;
|
|
64
|
+
exports.isBatchRefused = isBatchRefused;
|
|
65
|
+
exports.isFunctionDefinition = isFunctionDefinition;
|
|
66
|
+
exports.respond = respond;
|
|
67
|
+
//# sourceMappingURL=index.cjs.map
|
|
68
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { f as FunctionActionHandle, e as FunctionActionReach, A as FunctionActionRefused, z as FunctionActions, t as FunctionBatchRefused, s as FunctionBatchResult, C as FunctionCapabilities, G as FunctionConfig, a as FunctionContainerSize, y as FunctionContent, o as FunctionCounterMove, l as FunctionDeclaration, H as FunctionDefinition, b as FunctionDuration, k as FunctionFieldDeclaration, n as FunctionFile, I as FunctionInputOf, d as FunctionNetworkHost, J as FunctionOutputOf, r as FunctionRecordBatch, p as FunctionRecordReader, m as FunctionRecordTypeName, q as FunctionRecordWriter, v as FunctionRecords, D as FunctionResponse, h as FunctionRoute, c as FunctionRouteMethod, x as FunctionRunInfo, F as FunctionRuntime, j as FunctionSchedule, g as FunctionSecretDeclaration, i as FunctionTool, w as FunctionWayIn, K as defineFunction, B as isActionRefused, u as isBatchRefused, L as isFunctionDefinition, E as respond } from '../automations/index.cjs';
|
|
2
|
+
import '../register-BYCs0FpF.cjs';
|
|
3
|
+
import '../define-schema-DZhtvLiK.cjs';
|
|
4
|
+
import '../define-content-type-NEQDrvdq.cjs';
|
|
5
|
+
export { fields } from '../schema/index.cjs';
|
|
6
|
+
import '../rich-text.d-BWc-5gX1.cjs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { f as FunctionActionHandle, e as FunctionActionReach, A as FunctionActionRefused, z as FunctionActions, t as FunctionBatchRefused, s as FunctionBatchResult, C as FunctionCapabilities, G as FunctionConfig, a as FunctionContainerSize, y as FunctionContent, o as FunctionCounterMove, l as FunctionDeclaration, H as FunctionDefinition, b as FunctionDuration, k as FunctionFieldDeclaration, n as FunctionFile, I as FunctionInputOf, d as FunctionNetworkHost, J as FunctionOutputOf, r as FunctionRecordBatch, p as FunctionRecordReader, m as FunctionRecordTypeName, q as FunctionRecordWriter, v as FunctionRecords, D as FunctionResponse, h as FunctionRoute, c as FunctionRouteMethod, x as FunctionRunInfo, F as FunctionRuntime, j as FunctionSchedule, g as FunctionSecretDeclaration, i as FunctionTool, w as FunctionWayIn, K as defineFunction, B as isActionRefused, u as isBatchRefused, L as isFunctionDefinition, E as respond } from '../automations/index.js';
|
|
2
|
+
import '../register-B53i97A9.js';
|
|
3
|
+
import '../define-schema-Dlwh6l_J.js';
|
|
4
|
+
import '../define-content-type-fb-WCD5e.js';
|
|
5
|
+
export { fields } from '../schema/index.js';
|
|
6
|
+
import '../rich-text.d-BWc-5gX1.js';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { compileKeyedMembers } from '../chunk-W7JFHSFM.js';
|
|
2
|
+
export { fields } from '../chunk-W7JFHSFM.js';
|
|
3
|
+
import { __name } from '../chunk-DI6KFDBO.js';
|
|
4
|
+
|
|
5
|
+
/* RelyIO SDK - Built with ❤️ by the RelyIO Team */
|
|
6
|
+
|
|
7
|
+
// src/functions/index.ts
|
|
8
|
+
function isBatchRefused(error) {
|
|
9
|
+
return error instanceof Error && error.name === "BatchRefused" && "operation" in error;
|
|
10
|
+
}
|
|
11
|
+
__name(isBatchRefused, "isBatchRefused");
|
|
12
|
+
function isActionRefused(error) {
|
|
13
|
+
return error instanceof Error && error.name === "ActionRefused" && "code" in error;
|
|
14
|
+
}
|
|
15
|
+
__name(isActionRefused, "isActionRefused");
|
|
16
|
+
function respond(response) {
|
|
17
|
+
return {
|
|
18
|
+
_tag: "function-response",
|
|
19
|
+
status: response.status,
|
|
20
|
+
headers: { ...response.headers },
|
|
21
|
+
body: response.body ?? null
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
__name(respond, "respond");
|
|
25
|
+
function defineFunction(config) {
|
|
26
|
+
const actions = (config.actions ?? []).map(({ extension, action }) => ({ extension, action }));
|
|
27
|
+
const declaration = {
|
|
28
|
+
...config.description === void 0 ? {} : { description: config.description },
|
|
29
|
+
runtime: config.runtime ?? "isolate",
|
|
30
|
+
...config.container === void 0 ? {} : { container: { size: config.container.size } },
|
|
31
|
+
...config.limits === void 0 ? {} : { limits: { ...config.limits } },
|
|
32
|
+
input: compileKeyedMembers(config.input ?? {}),
|
|
33
|
+
...config.output === void 0 ? {} : { output: compileKeyedMembers(config.output) },
|
|
34
|
+
records: { read: [...config.records?.read ?? []], write: [...config.records?.write ?? []] },
|
|
35
|
+
content: config.content ?? "none",
|
|
36
|
+
network: (config.network ?? []).map((host) => ({ ...host })),
|
|
37
|
+
secrets: Object.fromEntries(
|
|
38
|
+
Object.entries(config.secrets ?? {}).map(([name, secret]) => [
|
|
39
|
+
name,
|
|
40
|
+
{ hosts: [...secret.hosts] }
|
|
41
|
+
])
|
|
42
|
+
),
|
|
43
|
+
// Absent when it declares none, so a Function declaring none hashes as it did before
|
|
44
|
+
...actions.length === 0 ? {} : { actions },
|
|
45
|
+
...config.route === void 0 ? {} : { route: config.route },
|
|
46
|
+
...config.tool === void 0 ? {} : { tool: { description: config.tool.description } },
|
|
47
|
+
...config.schedule === void 0 ? {} : { schedule: { ...config.schedule } }
|
|
48
|
+
};
|
|
49
|
+
return { _tag: "function", declaration, run: config.run };
|
|
50
|
+
}
|
|
51
|
+
__name(defineFunction, "defineFunction");
|
|
52
|
+
function isFunctionDefinition(value) {
|
|
53
|
+
return typeof value === "object" && value !== null && value._tag === "function" && typeof value.run === "function" && typeof value.declaration === "object";
|
|
54
|
+
}
|
|
55
|
+
__name(isFunctionDefinition, "isFunctionDefinition");
|
|
56
|
+
|
|
57
|
+
export { defineFunction, isActionRefused, isBatchRefused, isFunctionDefinition, respond };
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as RichTextHeading, b as RichTextValue, y as RichTextTable, h as RichTextCodeGroup, e as RichTextBlock, l as RichTextInline, t as RichTextNode, w as RichTextSpan, r as RichTextMark, A as AnyRichTextEntryLink, c as RichTextShapeValue } from './rich-text.d-BWc-5gX1.js';
|
|
2
|
-
import {
|
|
2
|
+
import { cQ as BaseContent } from './define-content-type-fb-WCD5e.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The DOM↔field binding contract, as the one pure helper that emits it.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as RichTextHeading, b as RichTextValue, y as RichTextTable, h as RichTextCodeGroup, e as RichTextBlock, l as RichTextInline, t as RichTextNode, w as RichTextSpan, r as RichTextMark, A as AnyRichTextEntryLink, c as RichTextShapeValue } from './rich-text.d-BWc-5gX1.cjs';
|
|
2
|
-
import {
|
|
2
|
+
import { cQ as BaseContent } from './define-content-type-NEQDrvdq.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The DOM↔field binding contract, as the one pure helper that emits it.
|