apps 0.0.1-beta.0 → 0.0.1-beta.10
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/README.md +145 -30
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/{chunk-36DNRFZQ.js → chunk-27F7W2LG.js} +1 -1
- package/js/{chunk-VFUZI3NY.js → chunk-57RKNWL2.js} +4 -4
- package/js/{chunk-BPEFS4YF.js → chunk-5T57N25Q.js} +122 -18
- package/js/chunk-72JNVHPK.js +41 -0
- package/js/{chunk-2OTCEKL2.js → chunk-CDL5PM2Q.js} +2643 -1646
- package/js/{chunk-KWTCHVLT.js → chunk-CRDWFA74.js} +69 -54
- package/js/chunk-CZ7CSFO4.js +39 -0
- package/js/{chunk-WIDTG42X.js → chunk-EPT3ZP52.js} +79 -26
- package/js/chunk-FL2QR3XW.js +507 -0
- package/js/{chunk-3ANFZFCV.js → chunk-IJX4CYZO.js} +15 -18
- package/js/chunk-IPI4MFSN.js +78 -0
- package/js/chunk-JU7VHODU.js +104 -0
- package/js/chunk-KUMBKVJD.js +39 -0
- package/js/{chunk-YDR4CPJA.js → chunk-M3B3DE4K.js} +8 -8
- package/js/chunk-MKWZPDR6.js +63 -0
- package/js/{chunk-7JXHF5IF.js → chunk-N7YDVXYJ.js} +49 -1
- package/js/chunk-NKLWZJLE.js +172 -0
- package/js/{chunk-OWD2YICM.js → chunk-ODEIDRGW.js} +116 -88
- package/js/{chunk-D6BKYP2L.js → chunk-PJJ24GU7.js} +4 -4
- package/js/{chunk-EP6AEUZO.js → chunk-PZB6T6KU.js} +1 -1
- package/js/chunk-R3EV5FTO.js +97 -0
- package/js/chunk-RFVIONFX.js +189 -0
- package/js/{chunk-W7Q5EOTS.js → chunk-UK573G7W.js} +32 -32
- package/js/chunk-UVL56Z6E.js +6641 -0
- package/js/{chunk-Q2FD5IBM.js → chunk-V5KNQVCT.js} +505 -124
- package/js/{chunk-SBKHUC5L.js → chunk-VFZKSM3T.js} +5 -25
- package/js/{chunk-HP7E42X6.js → chunk-WLE7WX2U.js} +1158 -232
- package/js/{chunk-X3YBZCJW.js → chunk-YXQHV65J.js} +58 -62
- package/js/chunk-Z5M2LQOZ.js +209 -0
- package/js/{chunk-R6JMJSVT.js → chunk-ZQINWV4W.js} +60 -20
- package/js/client.js +11 -27
- package/js/contracts.js +138 -27
- package/js/effect.js +20 -15
- package/js/es-APDZKREY.js +40968 -0
- package/js/graphql.js +220 -123
- package/js/host.js +75 -19
- package/js/index.js +261 -117
- package/js/mcp/effect.js +24 -17
- package/js/mcp/stdio.js +26 -21
- package/js/mcp.js +127 -26
- package/js/openapi.js +3048 -150
- package/js/operations/approval.js +1 -1
- package/js/react.js +4 -4
- package/js/skills/effect.js +11 -0
- package/js/skills.js +893 -0
- package/js/storage/facet.js +7 -7
- package/js/ui/auth/contracts.js +9 -10
- package/js/ui/auth.js +17 -15
- package/js/ui/contracts.js +5 -5
- package/js/ui/serving.js +14 -13
- package/package.json +9 -1
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +119 -0
- package/types/app-cache/src/index.d.ts +93 -0
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/app-data/src/implementation/schema.d.ts +2 -17
- package/types/apps/src/contracts/api-response-error.d.ts +43 -0
- package/types/apps/src/contracts/app.d.ts +16 -4
- package/types/apps/src/contracts/cache.d.ts +44 -0
- package/types/apps/src/contracts/dynamic-skills.d.ts +10 -0
- package/types/apps/src/contracts/failure.d.ts +25 -0
- package/types/apps/src/contracts/graphql.d.ts +18 -1
- package/types/apps/src/contracts/host.d.ts +76 -528
- package/types/apps/src/contracts/mcp.d.ts +19 -1
- package/types/apps/src/contracts/openapi-compile.d.ts +11 -0
- package/types/apps/src/contracts/openapi-document.d.ts +53 -0
- package/types/apps/src/contracts/openapi.d.ts +160 -30
- package/types/apps/src/contracts/operations.d.ts +0 -5
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +1589 -0
- package/types/apps/src/contracts/protocols/2.d.ts +668 -0
- package/types/apps/src/contracts/protocols/3.d.ts +676 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1229 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1090 -0
- package/types/apps/src/contracts/provider-error.d.ts +15 -0
- package/types/apps/src/contracts/provider.d.ts +69 -6
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/skills.d.ts +122 -0
- package/types/apps/src/contracts/storage.d.ts +3 -3
- package/types/apps/src/contracts/swagger-client.d.ts +29 -0
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/workflows.d.ts +34 -3
- package/types/apps/src/graphql.d.ts +5 -7
- package/types/apps/src/host.d.ts +1 -0
- package/types/apps/src/implementation/account-router.d.ts +12 -0
- package/types/apps/src/implementation/app.d.ts +5 -4
- package/types/apps/src/implementation/cache-session.d.ts +7 -0
- package/types/apps/src/implementation/cache.d.ts +8 -0
- package/types/apps/src/implementation/catalog-cache.d.ts +36 -0
- package/types/apps/src/implementation/dynamic-skills.d.ts +7 -0
- package/types/apps/src/implementation/elicitation.d.ts +13 -13
- package/types/apps/src/implementation/failure-detail.d.ts +25 -0
- package/types/apps/src/implementation/git.d.ts +25 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +7 -0
- package/types/apps/src/implementation/graphql.d.ts +81 -3
- package/types/apps/src/implementation/inflate.d.ts +16 -0
- package/types/apps/src/implementation/input-problems.d.ts +3 -0
- package/types/apps/src/implementation/mcp-call.d.ts +3 -2
- package/types/apps/src/implementation/mcp-catalog.d.ts +9 -0
- package/types/apps/src/implementation/mcp-client.d.ts +39 -22
- package/types/apps/src/implementation/mcp-stdio.d.ts +1 -1
- package/types/apps/src/implementation/mcp-tools.d.ts +6 -3
- package/types/apps/src/implementation/mcp.d.ts +55 -2
- package/types/apps/src/implementation/openapi-compile.d.ts +120 -0
- package/types/apps/src/implementation/openapi-document.d.ts +51 -0
- package/types/apps/src/implementation/openapi-names.d.ts +18 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -4
- package/types/apps/src/implementation/openapi-source.d.ts +36 -0
- package/types/apps/src/implementation/openapi.d.ts +39 -3
- package/types/apps/src/implementation/operations.d.ts +26 -3
- package/types/apps/src/implementation/protocol-operations.d.ts +3 -4
- package/types/apps/src/implementation/provider-error.d.ts +10 -0
- package/types/apps/src/implementation/provider.d.ts +9 -4
- package/types/apps/src/implementation/router-catalog.d.ts +225 -0
- package/types/apps/src/implementation/router.d.ts +59 -0
- package/types/apps/src/implementation/schema.d.ts +11 -6
- package/types/apps/src/implementation/skill-files.d.ts +10 -0
- package/types/apps/src/implementation/skills.d.ts +43 -0
- package/types/apps/src/implementation/storage.d.ts +5 -3
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/implementation/ui-auth.d.ts +11 -5
- package/types/apps/src/implementation/ui-serving.d.ts +4 -2
- package/types/apps/src/implementation/webhooks.d.ts +1 -1
- package/types/apps/src/implementation/workflow-context.d.ts +11 -3
- package/types/apps/src/index.d.ts +11 -3
- package/types/apps/src/mcp-stdio.d.ts +2 -5
- package/types/apps/src/mcp.d.ts +8 -7
- package/types/apps/src/openapi.d.ts +8 -6
- package/types/apps/src/skills.d.ts +75 -0
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/telemetry/src/browser-operations.d.ts +5 -2
- package/types/telemetry/src/config.d.ts +2 -0
- package/js/chunk-22WRQZT7.js +0 -389
- package/js/chunk-BKVL7XAJ.js +0 -47
- package/js/chunk-C24KEZXR.js +0 -59
- package/js/chunk-LOKGDT6B.js +0 -28
- package/js/chunk-MLKGABMK.js +0 -9
- package/types/apps/src/implementation/account-operations.d.ts +0 -32
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Alias,
|
|
3
|
+
Composer,
|
|
4
|
+
Document,
|
|
5
|
+
Lexer,
|
|
6
|
+
LineCounter,
|
|
7
|
+
Pair,
|
|
8
|
+
Parser,
|
|
9
|
+
Scalar,
|
|
10
|
+
Schema,
|
|
11
|
+
YAMLError,
|
|
12
|
+
YAMLMap,
|
|
13
|
+
YAMLParseError,
|
|
14
|
+
YAMLSeq,
|
|
15
|
+
YAMLWarning,
|
|
16
|
+
browser_default,
|
|
17
|
+
cst_exports,
|
|
18
|
+
isAlias,
|
|
19
|
+
isCollection,
|
|
20
|
+
isDocument,
|
|
21
|
+
isMap,
|
|
22
|
+
isNode,
|
|
23
|
+
isPair,
|
|
24
|
+
isScalar,
|
|
25
|
+
isSeq,
|
|
26
|
+
parse,
|
|
27
|
+
parseAllDocuments,
|
|
28
|
+
parseDocument,
|
|
29
|
+
stringify,
|
|
30
|
+
visit,
|
|
31
|
+
visitAsync
|
|
32
|
+
} from "./chunk-UVL56Z6E.js";
|
|
33
|
+
import "./chunk-CZ7CSFO4.js";
|
|
34
|
+
export {
|
|
35
|
+
Alias,
|
|
36
|
+
cst_exports as CST,
|
|
37
|
+
Composer,
|
|
38
|
+
Document,
|
|
39
|
+
Lexer,
|
|
40
|
+
LineCounter,
|
|
41
|
+
Pair,
|
|
42
|
+
Parser,
|
|
43
|
+
Scalar,
|
|
44
|
+
Schema,
|
|
45
|
+
YAMLError,
|
|
46
|
+
YAMLMap,
|
|
47
|
+
YAMLParseError,
|
|
48
|
+
YAMLSeq,
|
|
49
|
+
YAMLWarning,
|
|
50
|
+
browser_default as default,
|
|
51
|
+
isAlias,
|
|
52
|
+
isCollection,
|
|
53
|
+
isDocument,
|
|
54
|
+
isMap,
|
|
55
|
+
isNode,
|
|
56
|
+
isPair,
|
|
57
|
+
isScalar,
|
|
58
|
+
isSeq,
|
|
59
|
+
parse,
|
|
60
|
+
parseAllDocuments,
|
|
61
|
+
parseDocument,
|
|
62
|
+
stringify,
|
|
63
|
+
visit,
|
|
64
|
+
visitAsync
|
|
65
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
fromWeb,
|
|
5
5
|
layerMergedContext,
|
|
6
6
|
make2 as make
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UK573G7W.js";
|
|
8
8
|
import {
|
|
9
9
|
Reference,
|
|
10
10
|
Service,
|
|
@@ -17,12 +17,12 @@ import {
|
|
|
17
17
|
succeed4 as succeed,
|
|
18
18
|
toReadableStreamEffect,
|
|
19
19
|
tryPromise
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
21
21
|
import {
|
|
22
22
|
__export
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-CZ7CSFO4.js";
|
|
24
24
|
|
|
25
|
-
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@
|
|
25
|
+
// ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect+effect@c7d1ffff31a3e2ae0b0b+a654a55b752bdb24/node_modules/effect/dist/unstable/http/FetchHttpClient.js
|
|
26
26
|
var FetchHttpClient_exports = {};
|
|
27
27
|
__export(FetchHttpClient_exports, {
|
|
28
28
|
Fetch: () => Fetch,
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
JsonObject,
|
|
2
3
|
ValidationError
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-27F7W2LG.js";
|
|
4
5
|
import {
|
|
6
|
+
Cause_exports,
|
|
5
7
|
Effect_exports,
|
|
8
|
+
Exit_exports,
|
|
9
|
+
SchemaGetter_exports,
|
|
6
10
|
SchemaIssue_exports,
|
|
7
11
|
SchemaParser_exports,
|
|
8
12
|
Schema_exports
|
|
9
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CDL5PM2Q.js";
|
|
10
14
|
|
|
11
15
|
// ../../node_modules/.bun/@cfworker+json-schema@4.1.1/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js
|
|
12
16
|
function deepCompareStrict(a, b) {
|
|
@@ -1129,12 +1133,30 @@ function object(fields) {
|
|
|
1129
1133
|
const entries = Object.entries(fields).map(
|
|
1130
1134
|
([key, field]) => [key, decoderOf(field)]
|
|
1131
1135
|
);
|
|
1132
|
-
const decoder =
|
|
1136
|
+
const decoder = entries.length === 0 ? withJsonSchemaDocument(
|
|
1137
|
+
// Native Struct({}) accepts every non-null value and retains undeclared fields.
|
|
1138
|
+
Schema_exports.Record(Schema_exports.String, Schema_exports.Unknown).pipe(
|
|
1139
|
+
Schema_exports.decodeTo(Schema_exports.Record(Schema_exports.String, Schema_exports.Never), {
|
|
1140
|
+
decode: SchemaGetter_exports.transform(() => ({})),
|
|
1141
|
+
encode: SchemaGetter_exports.transform((value) => value)
|
|
1142
|
+
})
|
|
1143
|
+
),
|
|
1144
|
+
{ type: "object", properties: {}, additionalProperties: false }
|
|
1145
|
+
) : Schema_exports.Struct(Object.fromEntries(entries));
|
|
1133
1146
|
return { ...wrap(decoder, false), fields: Object.freeze({ ...fields }) };
|
|
1134
1147
|
}
|
|
1135
1148
|
var ImportedJsonSchema = /* @__PURE__ */ Symbol("apps.JsonSchemaDocument");
|
|
1136
1149
|
var importedJsonSchema = (decoder) => ImportedJsonSchema in decoder ? decoder[ImportedJsonSchema] : void 0;
|
|
1137
1150
|
var withJsonSchemaDocument = (decoder, document) => Object.assign(decoder, { [ImportedJsonSchema]: document });
|
|
1151
|
+
var once = (compute) => {
|
|
1152
|
+
let state;
|
|
1153
|
+
return () => (state ??= { value: compute() }).value;
|
|
1154
|
+
};
|
|
1155
|
+
var withLazyJsonSchemaDocument = (decoder, document) => Object.defineProperty(decoder, ImportedJsonSchema, {
|
|
1156
|
+
configurable: true,
|
|
1157
|
+
enumerable: true,
|
|
1158
|
+
get: once(document)
|
|
1159
|
+
});
|
|
1138
1160
|
var nestJsonSchema = (input, pointer) => {
|
|
1139
1161
|
const document = structuredClone(input);
|
|
1140
1162
|
const lookup = dereference(document);
|
|
@@ -1232,6 +1254,40 @@ function interpretedDocument(value) {
|
|
|
1232
1254
|
}
|
|
1233
1255
|
return Object.fromEntries(entries);
|
|
1234
1256
|
}
|
|
1257
|
+
var containerKeywords = /* @__PURE__ */ new Set([
|
|
1258
|
+
"$ref",
|
|
1259
|
+
"$recursiveRef",
|
|
1260
|
+
"$dynamicRef",
|
|
1261
|
+
"properties",
|
|
1262
|
+
"patternProperties",
|
|
1263
|
+
"additionalProperties",
|
|
1264
|
+
"unevaluatedProperties",
|
|
1265
|
+
"propertyNames",
|
|
1266
|
+
"items",
|
|
1267
|
+
"prefixItems",
|
|
1268
|
+
"additionalItems",
|
|
1269
|
+
"unevaluatedItems",
|
|
1270
|
+
"contains",
|
|
1271
|
+
"allOf",
|
|
1272
|
+
"if",
|
|
1273
|
+
"then",
|
|
1274
|
+
"else",
|
|
1275
|
+
"dependentSchemas"
|
|
1276
|
+
]);
|
|
1277
|
+
var jsonSchemaProblems = (errors) => {
|
|
1278
|
+
const problems = errors.flatMap(({ keyword, instanceLocation, error }) => {
|
|
1279
|
+
if (containerKeywords.has(keyword)) return [];
|
|
1280
|
+
const path = instanceLocation.replace(/^#\/?/, "").split("/").filter((segment) => segment !== "").map((segment) => decodeURIComponent(segment).replace(/~1/g, "/").replace(/~0/g, "~")).map((segment) => /^\d+$/.test(segment) ? Number(segment) : segment);
|
|
1281
|
+
const required = keyword === "required" ? /required property "([^"]*)"/.exec(error) : null;
|
|
1282
|
+
const expected = keyword === "type" ? /Expected "([^.]*)"\.?$/.exec(error) : null;
|
|
1283
|
+
const issue = required !== null ? { path: [...path, required[1] ?? ""], issue: "Missing key" } : {
|
|
1284
|
+
path,
|
|
1285
|
+
issue: expected !== null ? `Expected ${(expected[1] ?? "").replace(/"/g, "")}` : keyword === "const" || keyword === "enum" ? "Expected one of the allowed values" : `Failed the "${keyword}" constraint`
|
|
1286
|
+
};
|
|
1287
|
+
return [issue];
|
|
1288
|
+
});
|
|
1289
|
+
return problems.length === 0 ? false : problems;
|
|
1290
|
+
};
|
|
1235
1291
|
var compileJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
1236
1292
|
const validator = yield* Effect_exports.try({
|
|
1237
1293
|
try: () => {
|
|
@@ -1266,7 +1322,8 @@ var compileJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
|
1266
1322
|
Schema_exports.makeFilter(
|
|
1267
1323
|
(value) => {
|
|
1268
1324
|
try {
|
|
1269
|
-
|
|
1325
|
+
const result = validator.validate(value);
|
|
1326
|
+
return result.valid || jsonSchemaProblems(result.errors);
|
|
1270
1327
|
} catch {
|
|
1271
1328
|
return false;
|
|
1272
1329
|
}
|
|
@@ -1276,27 +1333,71 @@ var compileJsonSchemaDecoder = (document) => Effect_exports.gen(function* () {
|
|
|
1276
1333
|
);
|
|
1277
1334
|
return Object.assign(decoder, { [ImportedJsonSchema]: document });
|
|
1278
1335
|
});
|
|
1279
|
-
var
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
|
|
1336
|
+
var lazyDecoder = (document) => {
|
|
1337
|
+
const read = once(document);
|
|
1338
|
+
let compiled;
|
|
1339
|
+
const compile = Effect_exports.suspend(
|
|
1340
|
+
() => compiled ?? compileJsonSchemaDecoder(read()).pipe(
|
|
1341
|
+
// An interrupted compilation is not a result; the next decode compiles again.
|
|
1342
|
+
Effect_exports.onExit(
|
|
1343
|
+
(exit) => Effect_exports.sync(() => {
|
|
1344
|
+
if (Exit_exports.isSuccess(exit) || !Cause_exports.hasInterrupts(exit.cause)) compiled = exit;
|
|
1345
|
+
})
|
|
1346
|
+
)
|
|
1347
|
+
)
|
|
1283
1348
|
);
|
|
1284
|
-
const compiled = yield* Effect_exports.cached(compileJsonSchemaDecoder(document));
|
|
1285
1349
|
const decoder = Schema_exports.declareConstructor()(
|
|
1286
1350
|
[],
|
|
1287
|
-
() => (
|
|
1288
|
-
Effect_exports.mapError(
|
|
1289
|
-
|
|
1290
|
-
),
|
|
1291
|
-
Effect_exports.flatMap((schema) => SchemaParser_exports.decodeUnknownEffect(schema)(input2, options))
|
|
1351
|
+
() => (input, _ast, options) => compile.pipe(
|
|
1352
|
+
Effect_exports.mapError(() => new SchemaIssue_exports.InvalidValue({ message: "Unsupported JSON Schema" })),
|
|
1353
|
+
Effect_exports.flatMap((schema) => SchemaParser_exports.decodeUnknownEffect(schema)(input, options))
|
|
1292
1354
|
)
|
|
1293
1355
|
);
|
|
1294
|
-
return
|
|
1356
|
+
return withLazyJsonSchemaDocument(decoder, read);
|
|
1357
|
+
};
|
|
1358
|
+
var lazyJsonSchemaDecoder = (document) => Effect_exports.sync(() => lazyDecoder(document));
|
|
1359
|
+
var isJsonValue = Schema_exports.is(Schema_exports.Json);
|
|
1360
|
+
var jsonDocument = (input) => {
|
|
1361
|
+
if (typeof input !== "object" || input === null || Array.isArray(input)) return void 0;
|
|
1362
|
+
const keys = Object.keys(input);
|
|
1363
|
+
const values = keys.map((key) => Reflect.get(input, key));
|
|
1364
|
+
if (!isJsonValue(values)) return void 0;
|
|
1365
|
+
const document = {};
|
|
1366
|
+
keys.forEach(
|
|
1367
|
+
(key, index) => Object.defineProperty(document, key, {
|
|
1368
|
+
value: values[index],
|
|
1369
|
+
enumerable: true,
|
|
1370
|
+
writable: true,
|
|
1371
|
+
configurable: true
|
|
1372
|
+
})
|
|
1373
|
+
);
|
|
1374
|
+
return document;
|
|
1375
|
+
};
|
|
1376
|
+
var jsonSchemaDecoder = (input) => Effect_exports.suspend(() => {
|
|
1377
|
+
const document = jsonDocument(input);
|
|
1378
|
+
return document === void 0 ? Effect_exports.fail(new ValidationError()) : lazyJsonSchemaDecoder(() => document);
|
|
1295
1379
|
});
|
|
1296
|
-
var jsonSchema = (input) =>
|
|
1380
|
+
var jsonSchema = (input) => {
|
|
1381
|
+
const document = jsonDocument(input);
|
|
1382
|
+
if (document === void 0) throw new ValidationError();
|
|
1383
|
+
return wrap(
|
|
1384
|
+
lazyDecoder(() => document),
|
|
1385
|
+
false
|
|
1386
|
+
);
|
|
1387
|
+
};
|
|
1297
1388
|
var storageFieldOf = (schema) => schema[StorageField];
|
|
1298
1389
|
var id = (table) => wrap(Schema_exports.NonEmptyString, false, { kind: "id", references: table });
|
|
1299
1390
|
var userId = () => wrap(Schema_exports.NonEmptyString, false, { kind: "userId" });
|
|
1391
|
+
var jsonSchemaDocument = (decoder) => {
|
|
1392
|
+
const imported = importedJsonSchema(decoder);
|
|
1393
|
+
if (imported !== void 0) return Schema_exports.decodeUnknownEffect(JsonObject)(imported);
|
|
1394
|
+
const document = Schema_exports.toJsonSchemaDocument(decoder);
|
|
1395
|
+
return Schema_exports.decodeUnknownEffect(JsonObject)({
|
|
1396
|
+
...document.schema,
|
|
1397
|
+
$defs: document.definitions,
|
|
1398
|
+
$schema: "https://json-schema.org/draft/2020-12/schema"
|
|
1399
|
+
});
|
|
1400
|
+
};
|
|
1300
1401
|
|
|
1301
1402
|
export {
|
|
1302
1403
|
decoderOf,
|
|
@@ -1312,12 +1413,15 @@ export {
|
|
|
1312
1413
|
array,
|
|
1313
1414
|
object,
|
|
1314
1415
|
importedJsonSchema,
|
|
1315
|
-
|
|
1416
|
+
once,
|
|
1417
|
+
withLazyJsonSchemaDocument,
|
|
1316
1418
|
nestJsonSchema,
|
|
1317
1419
|
compileJsonSchemaDecoder,
|
|
1420
|
+
lazyJsonSchemaDecoder,
|
|
1318
1421
|
jsonSchemaDecoder,
|
|
1319
1422
|
jsonSchema,
|
|
1320
1423
|
storageFieldOf,
|
|
1321
1424
|
id,
|
|
1322
|
-
userId
|
|
1425
|
+
userId,
|
|
1426
|
+
jsonSchemaDocument
|
|
1323
1427
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
fixedRouter
|
|
3
|
+
} from "./chunk-FL2QR3XW.js";
|
|
4
|
+
import {
|
|
5
|
+
nativeOperation,
|
|
6
|
+
operationDeclaration,
|
|
7
|
+
routerDeclaration
|
|
8
|
+
} from "./chunk-Z5M2LQOZ.js";
|
|
9
|
+
|
|
10
|
+
// src/implementation/protocol-operations.ts
|
|
11
|
+
var protocolOperations = (operations, kinds = {}) => {
|
|
12
|
+
const declared = {};
|
|
13
|
+
for (const [name, operation] of Object.entries(operations)) {
|
|
14
|
+
const kind = Object.hasOwn(kinds, name) ? kinds[name] ?? "mutation" : operation.readOnly === true ? "query" : "mutation";
|
|
15
|
+
const native = {
|
|
16
|
+
description: operation.description,
|
|
17
|
+
...operation.title === void 0 ? {} : { title: operation.title },
|
|
18
|
+
...operation.annotations === void 0 ? {} : { annotations: operation.annotations },
|
|
19
|
+
...operation._meta === void 0 ? {} : { _meta: operation._meta },
|
|
20
|
+
input: operation.input,
|
|
21
|
+
run: operation.run
|
|
22
|
+
};
|
|
23
|
+
const output = Object.getOwnPropertyDescriptor(operation, "outputSchema");
|
|
24
|
+
const withOutput = (target) => output === void 0 || output.get === void 0 && output.value === void 0 ? target : Object.defineProperty(target, "outputSchema", { ...output, enumerable: true });
|
|
25
|
+
declared[name] = operationDeclaration(withOutput({ ...native, kind }));
|
|
26
|
+
}
|
|
27
|
+
return declared;
|
|
28
|
+
};
|
|
29
|
+
var protocolRouter = (operations, kinds = {}) => {
|
|
30
|
+
const native = {};
|
|
31
|
+
for (const [name, declaration] of Object.entries(protocolOperations(operations, kinds))) {
|
|
32
|
+
const operation = nativeOperation(declaration);
|
|
33
|
+
if (operation !== void 0) native[name] = operation;
|
|
34
|
+
}
|
|
35
|
+
return routerDeclaration(fixedRouter(native));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
protocolOperations,
|
|
40
|
+
protocolRouter
|
|
41
|
+
};
|