skedyul 1.2.14 → 1.2.17
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/dist/cli/index.js +49 -5
- package/dist/config/types/model.d.ts +18 -1
- package/dist/dedicated/server.js +41 -1
- package/dist/esm/index.mjs +54 -5
- package/dist/index.js +55 -5
- package/dist/schemas.d.ts +31 -0
- package/dist/server/dedicated.d.ts +2 -2
- package/dist/server.js +41 -1
- package/dist/serverless/server.mjs +41 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1069,7 +1069,13 @@ function getEffectiveConfig() {
|
|
|
1069
1069
|
if (requestConfig?.baseUrl && requestConfig?.apiToken) {
|
|
1070
1070
|
return requestConfig;
|
|
1071
1071
|
}
|
|
1072
|
-
|
|
1072
|
+
if (globalConfig.baseUrl && globalConfig.apiToken) {
|
|
1073
|
+
return globalConfig;
|
|
1074
|
+
}
|
|
1075
|
+
return {
|
|
1076
|
+
baseUrl: process.env.SKEDYUL_API_URL ?? process.env.SKEDYUL_NODE_URL ?? globalConfig.baseUrl,
|
|
1077
|
+
apiToken: process.env.SKEDYUL_API_TOKEN ?? globalConfig.apiToken
|
|
1078
|
+
};
|
|
1073
1079
|
}
|
|
1074
1080
|
function configure(options) {
|
|
1075
1081
|
globalConfig = {
|
|
@@ -1083,11 +1089,9 @@ async function callCore(method, params) {
|
|
|
1083
1089
|
const requestConfig = requestConfigStorage.getStore();
|
|
1084
1090
|
console.log(`[callCore] Method: ${method}, Config state:`, {
|
|
1085
1091
|
hasRequestConfig: !!requestConfig,
|
|
1086
|
-
requestConfigBaseUrl: requestConfig?.baseUrl ? "set" : "not set",
|
|
1087
1092
|
requestConfigApiToken: requestConfig?.apiToken ? `set (${requestConfig.apiToken.length} chars)` : "not set",
|
|
1088
|
-
globalConfigBaseUrl: globalConfig.baseUrl ? "set" : "not set",
|
|
1089
1093
|
globalConfigApiToken: globalConfig.apiToken ? `set (${globalConfig.apiToken.length} chars)` : "not set",
|
|
1090
|
-
|
|
1094
|
+
processEnvApiToken: process.env.SKEDYUL_API_TOKEN ? `set (${process.env.SKEDYUL_API_TOKEN.length} chars)` : "not set",
|
|
1091
1095
|
effectiveApiToken: apiToken ? `set (${apiToken.length} chars)` : "not set"
|
|
1092
1096
|
});
|
|
1093
1097
|
if (!baseUrl) {
|
|
@@ -2948,7 +2952,7 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
2948
2952
|
}
|
|
2949
2953
|
|
|
2950
2954
|
// src/server/dedicated.ts
|
|
2951
|
-
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, webhookRegistry) {
|
|
2955
|
+
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
2952
2956
|
const port = getListeningPort(config);
|
|
2953
2957
|
const httpServer = import_http2.default.createServer(
|
|
2954
2958
|
async (req, res) => {
|
|
@@ -2965,6 +2969,26 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
2965
2969
|
sendJSON(res, 200, state.getHealthStatus());
|
|
2966
2970
|
return;
|
|
2967
2971
|
}
|
|
2972
|
+
if (pathname === "/config" && req.method === "GET") {
|
|
2973
|
+
sendJSON(res, 200, {
|
|
2974
|
+
name: config.metadata.name,
|
|
2975
|
+
version: config.metadata.version,
|
|
2976
|
+
computeLayer: config.computeLayer,
|
|
2977
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
2978
|
+
name: tool.name || key,
|
|
2979
|
+
description: tool.description,
|
|
2980
|
+
timeout: tool.timeout,
|
|
2981
|
+
retries: tool.retries,
|
|
2982
|
+
triggers: tool.triggers
|
|
2983
|
+
})),
|
|
2984
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
2985
|
+
name: w.name,
|
|
2986
|
+
description: w.description,
|
|
2987
|
+
methods: w.methods
|
|
2988
|
+
})) : []
|
|
2989
|
+
});
|
|
2990
|
+
return;
|
|
2991
|
+
}
|
|
2968
2992
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
2969
2993
|
const handle = pathname.slice("/webhooks/".length);
|
|
2970
2994
|
const webhookDef = webhookRegistry[handle];
|
|
@@ -4052,6 +4076,25 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
4052
4076
|
if (path14 === "/health" && method === "GET") {
|
|
4053
4077
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
4054
4078
|
}
|
|
4079
|
+
if (path14 === "/config" && method === "GET") {
|
|
4080
|
+
return createResponse(200, {
|
|
4081
|
+
name: config.metadata.name,
|
|
4082
|
+
version: config.metadata.version,
|
|
4083
|
+
computeLayer: config.computeLayer,
|
|
4084
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
4085
|
+
name: tool.name || key,
|
|
4086
|
+
description: tool.description,
|
|
4087
|
+
timeout: tool.timeout,
|
|
4088
|
+
retries: tool.retries,
|
|
4089
|
+
triggers: tool.triggers
|
|
4090
|
+
})),
|
|
4091
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
4092
|
+
name: w.name,
|
|
4093
|
+
description: w.description,
|
|
4094
|
+
methods: w.methods
|
|
4095
|
+
})) : []
|
|
4096
|
+
}, headers);
|
|
4097
|
+
}
|
|
4055
4098
|
if (path14 === "/mcp" && method === "POST") {
|
|
4056
4099
|
let body;
|
|
4057
4100
|
try {
|
|
@@ -4425,6 +4468,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
4425
4468
|
callTool,
|
|
4426
4469
|
state,
|
|
4427
4470
|
mcpServer,
|
|
4471
|
+
registry,
|
|
4428
4472
|
webhookRegistry
|
|
4429
4473
|
);
|
|
4430
4474
|
}
|
|
@@ -30,6 +30,13 @@ export type FieldType = 'string' | 'long_string' | 'text' | 'number' | 'boolean'
|
|
|
30
30
|
* - 'restrict': Prevent deletion if references exist
|
|
31
31
|
*/
|
|
32
32
|
export type OnDelete = 'none' | 'cascade' | 'restrict';
|
|
33
|
+
/**
|
|
34
|
+
* Field requirement types.
|
|
35
|
+
* - 'optional': Field is never required
|
|
36
|
+
* - 'on_create': Field is required only when creating new records
|
|
37
|
+
* - 'required': Field is always required (create and update)
|
|
38
|
+
*/
|
|
39
|
+
export type FieldRequirementType = 'optional' | 'on_create' | 'required';
|
|
33
40
|
/**
|
|
34
41
|
* Inline field definition for options and validation constraints.
|
|
35
42
|
*/
|
|
@@ -79,7 +86,17 @@ export interface FieldDefinition {
|
|
|
79
86
|
* - Omitted: Auto-creates workplace definition as <subdomain>/<model>/<field>
|
|
80
87
|
*/
|
|
81
88
|
definition?: InlineFieldDefinition | string;
|
|
82
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Field requirement type.
|
|
91
|
+
* - 'optional': Field is never required (default)
|
|
92
|
+
* - 'on_create': Field is required only when creating new records
|
|
93
|
+
* - 'required': Field is always required (create and update)
|
|
94
|
+
*/
|
|
95
|
+
requirement?: FieldRequirementType;
|
|
96
|
+
/**
|
|
97
|
+
* Whether this field is required.
|
|
98
|
+
* @deprecated Use `requirement` instead. Maps to 'required' if true, 'optional' if false.
|
|
99
|
+
*/
|
|
83
100
|
required?: boolean;
|
|
84
101
|
/** Whether this field must be unique across all records */
|
|
85
102
|
unique?: boolean;
|
package/dist/dedicated/server.js
CHANGED
|
@@ -770,7 +770,7 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
// src/server/dedicated.ts
|
|
773
|
-
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, webhookRegistry) {
|
|
773
|
+
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
774
774
|
const port = getListeningPort(config);
|
|
775
775
|
const httpServer = import_http2.default.createServer(
|
|
776
776
|
async (req, res) => {
|
|
@@ -787,6 +787,26 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
787
787
|
sendJSON(res, 200, state.getHealthStatus());
|
|
788
788
|
return;
|
|
789
789
|
}
|
|
790
|
+
if (pathname === "/config" && req.method === "GET") {
|
|
791
|
+
sendJSON(res, 200, {
|
|
792
|
+
name: config.metadata.name,
|
|
793
|
+
version: config.metadata.version,
|
|
794
|
+
computeLayer: config.computeLayer,
|
|
795
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
796
|
+
name: tool.name || key,
|
|
797
|
+
description: tool.description,
|
|
798
|
+
timeout: tool.timeout,
|
|
799
|
+
retries: tool.retries,
|
|
800
|
+
triggers: tool.triggers
|
|
801
|
+
})),
|
|
802
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
803
|
+
name: w.name,
|
|
804
|
+
description: w.description,
|
|
805
|
+
methods: w.methods
|
|
806
|
+
})) : []
|
|
807
|
+
});
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
790
810
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
791
811
|
const handle = pathname.slice("/webhooks/".length);
|
|
792
812
|
const webhookDef = webhookRegistry[handle];
|
|
@@ -1874,6 +1894,25 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1874
1894
|
if (path === "/health" && method === "GET") {
|
|
1875
1895
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
1876
1896
|
}
|
|
1897
|
+
if (path === "/config" && method === "GET") {
|
|
1898
|
+
return createResponse(200, {
|
|
1899
|
+
name: config.metadata.name,
|
|
1900
|
+
version: config.metadata.version,
|
|
1901
|
+
computeLayer: config.computeLayer,
|
|
1902
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
1903
|
+
name: tool.name || key,
|
|
1904
|
+
description: tool.description,
|
|
1905
|
+
timeout: tool.timeout,
|
|
1906
|
+
retries: tool.retries,
|
|
1907
|
+
triggers: tool.triggers
|
|
1908
|
+
})),
|
|
1909
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
1910
|
+
name: w.name,
|
|
1911
|
+
description: w.description,
|
|
1912
|
+
methods: w.methods
|
|
1913
|
+
})) : []
|
|
1914
|
+
}, headers);
|
|
1915
|
+
}
|
|
1877
1916
|
if (path === "/mcp" && method === "POST") {
|
|
1878
1917
|
let body;
|
|
1879
1918
|
try {
|
|
@@ -2247,6 +2286,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
2247
2286
|
callTool,
|
|
2248
2287
|
state,
|
|
2249
2288
|
mcpServer,
|
|
2289
|
+
registry,
|
|
2250
2290
|
webhookRegistry
|
|
2251
2291
|
);
|
|
2252
2292
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -163,11 +163,15 @@ var AppFieldVisibilitySchema = z2.object({
|
|
|
163
163
|
list: z2.boolean().optional(),
|
|
164
164
|
filters: z2.boolean().optional()
|
|
165
165
|
});
|
|
166
|
+
var FieldRequirementTypeSchema = z2.enum(["optional", "on_create", "required"]);
|
|
166
167
|
var ModelFieldDefinitionSchema = z2.object({
|
|
167
168
|
handle: z2.string(),
|
|
168
169
|
label: z2.string(),
|
|
169
170
|
type: FieldDataTypeSchema.optional(),
|
|
170
171
|
definition: z2.union([InlineFieldDefinitionSchema, z2.string()]).optional(),
|
|
172
|
+
/** Field requirement type: 'optional', 'on_create', or 'required' */
|
|
173
|
+
requirement: FieldRequirementTypeSchema.optional(),
|
|
174
|
+
/** @deprecated Use `requirement` instead */
|
|
171
175
|
required: z2.boolean().optional(),
|
|
172
176
|
unique: z2.boolean().optional(),
|
|
173
177
|
system: z2.boolean().optional(),
|
|
@@ -958,7 +962,13 @@ function getEffectiveConfig() {
|
|
|
958
962
|
if (requestConfig?.baseUrl && requestConfig?.apiToken) {
|
|
959
963
|
return requestConfig;
|
|
960
964
|
}
|
|
961
|
-
|
|
965
|
+
if (globalConfig.baseUrl && globalConfig.apiToken) {
|
|
966
|
+
return globalConfig;
|
|
967
|
+
}
|
|
968
|
+
return {
|
|
969
|
+
baseUrl: process.env.SKEDYUL_API_URL ?? process.env.SKEDYUL_NODE_URL ?? globalConfig.baseUrl,
|
|
970
|
+
apiToken: process.env.SKEDYUL_API_TOKEN ?? globalConfig.apiToken
|
|
971
|
+
};
|
|
962
972
|
}
|
|
963
973
|
function configure(options) {
|
|
964
974
|
globalConfig = {
|
|
@@ -975,11 +985,9 @@ async function callCore(method, params) {
|
|
|
975
985
|
const requestConfig = requestConfigStorage.getStore();
|
|
976
986
|
console.log(`[callCore] Method: ${method}, Config state:`, {
|
|
977
987
|
hasRequestConfig: !!requestConfig,
|
|
978
|
-
requestConfigBaseUrl: requestConfig?.baseUrl ? "set" : "not set",
|
|
979
988
|
requestConfigApiToken: requestConfig?.apiToken ? `set (${requestConfig.apiToken.length} chars)` : "not set",
|
|
980
|
-
globalConfigBaseUrl: globalConfig.baseUrl ? "set" : "not set",
|
|
981
989
|
globalConfigApiToken: globalConfig.apiToken ? `set (${globalConfig.apiToken.length} chars)` : "not set",
|
|
982
|
-
|
|
990
|
+
processEnvApiToken: process.env.SKEDYUL_API_TOKEN ? `set (${process.env.SKEDYUL_API_TOKEN.length} chars)` : "not set",
|
|
983
991
|
effectiveApiToken: apiToken ? `set (${apiToken.length} chars)` : "not set"
|
|
984
992
|
});
|
|
985
993
|
if (!baseUrl) {
|
|
@@ -2448,7 +2456,7 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
2448
2456
|
}
|
|
2449
2457
|
|
|
2450
2458
|
// src/server/dedicated.ts
|
|
2451
|
-
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, webhookRegistry) {
|
|
2459
|
+
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
2452
2460
|
const port = getListeningPort(config);
|
|
2453
2461
|
const httpServer = http.createServer(
|
|
2454
2462
|
async (req, res) => {
|
|
@@ -2465,6 +2473,26 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
2465
2473
|
sendJSON(res, 200, state.getHealthStatus());
|
|
2466
2474
|
return;
|
|
2467
2475
|
}
|
|
2476
|
+
if (pathname === "/config" && req.method === "GET") {
|
|
2477
|
+
sendJSON(res, 200, {
|
|
2478
|
+
name: config.metadata.name,
|
|
2479
|
+
version: config.metadata.version,
|
|
2480
|
+
computeLayer: config.computeLayer,
|
|
2481
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
2482
|
+
name: tool.name || key,
|
|
2483
|
+
description: tool.description,
|
|
2484
|
+
timeout: tool.timeout,
|
|
2485
|
+
retries: tool.retries,
|
|
2486
|
+
triggers: tool.triggers
|
|
2487
|
+
})),
|
|
2488
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
2489
|
+
name: w.name,
|
|
2490
|
+
description: w.description,
|
|
2491
|
+
methods: w.methods
|
|
2492
|
+
})) : []
|
|
2493
|
+
});
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2468
2496
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
2469
2497
|
const handle = pathname.slice("/webhooks/".length);
|
|
2470
2498
|
const webhookDef = webhookRegistry[handle];
|
|
@@ -3552,6 +3580,25 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3552
3580
|
if (path2 === "/health" && method === "GET") {
|
|
3553
3581
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
3554
3582
|
}
|
|
3583
|
+
if (path2 === "/config" && method === "GET") {
|
|
3584
|
+
return createResponse(200, {
|
|
3585
|
+
name: config.metadata.name,
|
|
3586
|
+
version: config.metadata.version,
|
|
3587
|
+
computeLayer: config.computeLayer,
|
|
3588
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
3589
|
+
name: tool.name || key,
|
|
3590
|
+
description: tool.description,
|
|
3591
|
+
timeout: tool.timeout,
|
|
3592
|
+
retries: tool.retries,
|
|
3593
|
+
triggers: tool.triggers
|
|
3594
|
+
})),
|
|
3595
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
3596
|
+
name: w.name,
|
|
3597
|
+
description: w.description,
|
|
3598
|
+
methods: w.methods
|
|
3599
|
+
})) : []
|
|
3600
|
+
}, headers);
|
|
3601
|
+
}
|
|
3555
3602
|
if (path2 === "/mcp" && method === "POST") {
|
|
3556
3603
|
let body;
|
|
3557
3604
|
try {
|
|
@@ -3925,6 +3972,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
3925
3972
|
callTool,
|
|
3926
3973
|
state,
|
|
3927
3974
|
mcpServer,
|
|
3975
|
+
registry,
|
|
3928
3976
|
webhookRegistry
|
|
3929
3977
|
);
|
|
3930
3978
|
}
|
|
@@ -4171,6 +4219,7 @@ export {
|
|
|
4171
4219
|
FieldDataTypeSchema,
|
|
4172
4220
|
FieldOptionSchema,
|
|
4173
4221
|
FieldOwnerSchema,
|
|
4222
|
+
FieldRequirementTypeSchema,
|
|
4174
4223
|
FieldSettingButtonPropsSchema,
|
|
4175
4224
|
FieldSettingComponentDefinitionSchema,
|
|
4176
4225
|
FileSettingComponentDefinitionSchema,
|
package/dist/index.js
CHANGED
|
@@ -57,6 +57,7 @@ __export(index_exports, {
|
|
|
57
57
|
FieldDataTypeSchema: () => FieldDataTypeSchema,
|
|
58
58
|
FieldOptionSchema: () => FieldOptionSchema,
|
|
59
59
|
FieldOwnerSchema: () => FieldOwnerSchema,
|
|
60
|
+
FieldRequirementTypeSchema: () => FieldRequirementTypeSchema,
|
|
60
61
|
FieldSettingButtonPropsSchema: () => FieldSettingButtonPropsSchema,
|
|
61
62
|
FieldSettingComponentDefinitionSchema: () => FieldSettingComponentDefinitionSchema,
|
|
62
63
|
FileSettingComponentDefinitionSchema: () => FileSettingComponentDefinitionSchema,
|
|
@@ -328,11 +329,15 @@ var AppFieldVisibilitySchema = import_v42.z.object({
|
|
|
328
329
|
list: import_v42.z.boolean().optional(),
|
|
329
330
|
filters: import_v42.z.boolean().optional()
|
|
330
331
|
});
|
|
332
|
+
var FieldRequirementTypeSchema = import_v42.z.enum(["optional", "on_create", "required"]);
|
|
331
333
|
var ModelFieldDefinitionSchema = import_v42.z.object({
|
|
332
334
|
handle: import_v42.z.string(),
|
|
333
335
|
label: import_v42.z.string(),
|
|
334
336
|
type: FieldDataTypeSchema.optional(),
|
|
335
337
|
definition: import_v42.z.union([InlineFieldDefinitionSchema, import_v42.z.string()]).optional(),
|
|
338
|
+
/** Field requirement type: 'optional', 'on_create', or 'required' */
|
|
339
|
+
requirement: FieldRequirementTypeSchema.optional(),
|
|
340
|
+
/** @deprecated Use `requirement` instead */
|
|
336
341
|
required: import_v42.z.boolean().optional(),
|
|
337
342
|
unique: import_v42.z.boolean().optional(),
|
|
338
343
|
system: import_v42.z.boolean().optional(),
|
|
@@ -1123,7 +1128,13 @@ function getEffectiveConfig() {
|
|
|
1123
1128
|
if (requestConfig?.baseUrl && requestConfig?.apiToken) {
|
|
1124
1129
|
return requestConfig;
|
|
1125
1130
|
}
|
|
1126
|
-
|
|
1131
|
+
if (globalConfig.baseUrl && globalConfig.apiToken) {
|
|
1132
|
+
return globalConfig;
|
|
1133
|
+
}
|
|
1134
|
+
return {
|
|
1135
|
+
baseUrl: process.env.SKEDYUL_API_URL ?? process.env.SKEDYUL_NODE_URL ?? globalConfig.baseUrl,
|
|
1136
|
+
apiToken: process.env.SKEDYUL_API_TOKEN ?? globalConfig.apiToken
|
|
1137
|
+
};
|
|
1127
1138
|
}
|
|
1128
1139
|
function configure(options) {
|
|
1129
1140
|
globalConfig = {
|
|
@@ -1140,11 +1151,9 @@ async function callCore(method, params) {
|
|
|
1140
1151
|
const requestConfig = requestConfigStorage.getStore();
|
|
1141
1152
|
console.log(`[callCore] Method: ${method}, Config state:`, {
|
|
1142
1153
|
hasRequestConfig: !!requestConfig,
|
|
1143
|
-
requestConfigBaseUrl: requestConfig?.baseUrl ? "set" : "not set",
|
|
1144
1154
|
requestConfigApiToken: requestConfig?.apiToken ? `set (${requestConfig.apiToken.length} chars)` : "not set",
|
|
1145
|
-
globalConfigBaseUrl: globalConfig.baseUrl ? "set" : "not set",
|
|
1146
1155
|
globalConfigApiToken: globalConfig.apiToken ? `set (${globalConfig.apiToken.length} chars)` : "not set",
|
|
1147
|
-
|
|
1156
|
+
processEnvApiToken: process.env.SKEDYUL_API_TOKEN ? `set (${process.env.SKEDYUL_API_TOKEN.length} chars)` : "not set",
|
|
1148
1157
|
effectiveApiToken: apiToken ? `set (${apiToken.length} chars)` : "not set"
|
|
1149
1158
|
});
|
|
1150
1159
|
if (!baseUrl) {
|
|
@@ -2613,7 +2622,7 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
2613
2622
|
}
|
|
2614
2623
|
|
|
2615
2624
|
// src/server/dedicated.ts
|
|
2616
|
-
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, webhookRegistry) {
|
|
2625
|
+
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
2617
2626
|
const port = getListeningPort(config);
|
|
2618
2627
|
const httpServer = import_http2.default.createServer(
|
|
2619
2628
|
async (req, res) => {
|
|
@@ -2630,6 +2639,26 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
2630
2639
|
sendJSON(res, 200, state.getHealthStatus());
|
|
2631
2640
|
return;
|
|
2632
2641
|
}
|
|
2642
|
+
if (pathname === "/config" && req.method === "GET") {
|
|
2643
|
+
sendJSON(res, 200, {
|
|
2644
|
+
name: config.metadata.name,
|
|
2645
|
+
version: config.metadata.version,
|
|
2646
|
+
computeLayer: config.computeLayer,
|
|
2647
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
2648
|
+
name: tool.name || key,
|
|
2649
|
+
description: tool.description,
|
|
2650
|
+
timeout: tool.timeout,
|
|
2651
|
+
retries: tool.retries,
|
|
2652
|
+
triggers: tool.triggers
|
|
2653
|
+
})),
|
|
2654
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
2655
|
+
name: w.name,
|
|
2656
|
+
description: w.description,
|
|
2657
|
+
methods: w.methods
|
|
2658
|
+
})) : []
|
|
2659
|
+
});
|
|
2660
|
+
return;
|
|
2661
|
+
}
|
|
2633
2662
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
2634
2663
|
const handle = pathname.slice("/webhooks/".length);
|
|
2635
2664
|
const webhookDef = webhookRegistry[handle];
|
|
@@ -3717,6 +3746,25 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
3717
3746
|
if (path2 === "/health" && method === "GET") {
|
|
3718
3747
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
3719
3748
|
}
|
|
3749
|
+
if (path2 === "/config" && method === "GET") {
|
|
3750
|
+
return createResponse(200, {
|
|
3751
|
+
name: config.metadata.name,
|
|
3752
|
+
version: config.metadata.version,
|
|
3753
|
+
computeLayer: config.computeLayer,
|
|
3754
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
3755
|
+
name: tool.name || key,
|
|
3756
|
+
description: tool.description,
|
|
3757
|
+
timeout: tool.timeout,
|
|
3758
|
+
retries: tool.retries,
|
|
3759
|
+
triggers: tool.triggers
|
|
3760
|
+
})),
|
|
3761
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
3762
|
+
name: w.name,
|
|
3763
|
+
description: w.description,
|
|
3764
|
+
methods: w.methods
|
|
3765
|
+
})) : []
|
|
3766
|
+
}, headers);
|
|
3767
|
+
}
|
|
3720
3768
|
if (path2 === "/mcp" && method === "POST") {
|
|
3721
3769
|
let body;
|
|
3722
3770
|
try {
|
|
@@ -4090,6 +4138,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
4090
4138
|
callTool,
|
|
4091
4139
|
state,
|
|
4092
4140
|
mcpServer,
|
|
4141
|
+
registry,
|
|
4093
4142
|
webhookRegistry
|
|
4094
4143
|
);
|
|
4095
4144
|
}
|
|
@@ -4337,6 +4386,7 @@ var index_default = { z: import_v44.z };
|
|
|
4337
4386
|
FieldDataTypeSchema,
|
|
4338
4387
|
FieldOptionSchema,
|
|
4339
4388
|
FieldOwnerSchema,
|
|
4389
|
+
FieldRequirementTypeSchema,
|
|
4340
4390
|
FieldSettingButtonPropsSchema,
|
|
4341
4391
|
FieldSettingComponentDefinitionSchema,
|
|
4342
4392
|
FileSettingComponentDefinitionSchema,
|
package/dist/schemas.d.ts
CHANGED
|
@@ -181,6 +181,11 @@ export declare const AppFieldVisibilitySchema: z.ZodObject<{
|
|
|
181
181
|
list: z.ZodOptional<z.ZodBoolean>;
|
|
182
182
|
filters: z.ZodOptional<z.ZodBoolean>;
|
|
183
183
|
}, z.core.$strip>;
|
|
184
|
+
export declare const FieldRequirementTypeSchema: z.ZodEnum<{
|
|
185
|
+
required: "required";
|
|
186
|
+
optional: "optional";
|
|
187
|
+
on_create: "on_create";
|
|
188
|
+
}>;
|
|
184
189
|
export declare const ModelFieldDefinitionSchema: z.ZodObject<{
|
|
185
190
|
handle: z.ZodString;
|
|
186
191
|
label: z.ZodString;
|
|
@@ -211,6 +216,11 @@ export declare const ModelFieldDefinitionSchema: z.ZodObject<{
|
|
|
211
216
|
relatedModel: z.ZodOptional<z.ZodString>;
|
|
212
217
|
pattern: z.ZodOptional<z.ZodString>;
|
|
213
218
|
}, z.core.$strip>, z.ZodString]>>;
|
|
219
|
+
requirement: z.ZodOptional<z.ZodEnum<{
|
|
220
|
+
required: "required";
|
|
221
|
+
optional: "optional";
|
|
222
|
+
on_create: "on_create";
|
|
223
|
+
}>>;
|
|
214
224
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
215
225
|
unique: z.ZodOptional<z.ZodBoolean>;
|
|
216
226
|
system: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -265,6 +275,11 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
|
|
|
265
275
|
relatedModel: z.ZodOptional<z.ZodString>;
|
|
266
276
|
pattern: z.ZodOptional<z.ZodString>;
|
|
267
277
|
}, z.core.$strip>, z.ZodString]>>;
|
|
278
|
+
requirement: z.ZodOptional<z.ZodEnum<{
|
|
279
|
+
required: "required";
|
|
280
|
+
optional: "optional";
|
|
281
|
+
on_create: "on_create";
|
|
282
|
+
}>>;
|
|
268
283
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
269
284
|
unique: z.ZodOptional<z.ZodBoolean>;
|
|
270
285
|
system: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2973,6 +2988,11 @@ export declare const InstallConfigSchema: z.ZodObject<{
|
|
|
2973
2988
|
relatedModel: z.ZodOptional<z.ZodString>;
|
|
2974
2989
|
pattern: z.ZodOptional<z.ZodString>;
|
|
2975
2990
|
}, z.core.$strip>, z.ZodString]>>;
|
|
2991
|
+
requirement: z.ZodOptional<z.ZodEnum<{
|
|
2992
|
+
required: "required";
|
|
2993
|
+
optional: "optional";
|
|
2994
|
+
on_create: "on_create";
|
|
2995
|
+
}>>;
|
|
2976
2996
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
2977
2997
|
unique: z.ZodOptional<z.ZodBoolean>;
|
|
2978
2998
|
system: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3090,6 +3110,11 @@ export declare const ProvisionConfigSchema: z.ZodObject<{
|
|
|
3090
3110
|
relatedModel: z.ZodOptional<z.ZodString>;
|
|
3091
3111
|
pattern: z.ZodOptional<z.ZodString>;
|
|
3092
3112
|
}, z.core.$strip>, z.ZodString]>>;
|
|
3113
|
+
requirement: z.ZodOptional<z.ZodEnum<{
|
|
3114
|
+
required: "required";
|
|
3115
|
+
optional: "optional";
|
|
3116
|
+
on_create: "on_create";
|
|
3117
|
+
}>>;
|
|
3093
3118
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3094
3119
|
unique: z.ZodOptional<z.ZodBoolean>;
|
|
3095
3120
|
system: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -3770,6 +3795,11 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
|
|
|
3770
3795
|
relatedModel: z.ZodOptional<z.ZodString>;
|
|
3771
3796
|
pattern: z.ZodOptional<z.ZodString>;
|
|
3772
3797
|
}, z.core.$strip>, z.ZodString]>>;
|
|
3798
|
+
requirement: z.ZodOptional<z.ZodEnum<{
|
|
3799
|
+
required: "required";
|
|
3800
|
+
optional: "optional";
|
|
3801
|
+
on_create: "on_create";
|
|
3802
|
+
}>>;
|
|
3773
3803
|
required: z.ZodOptional<z.ZodBoolean>;
|
|
3774
3804
|
unique: z.ZodOptional<z.ZodBoolean>;
|
|
3775
3805
|
system: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -4405,6 +4435,7 @@ export declare const SkedyulConfigSchema: z.ZodObject<{
|
|
|
4405
4435
|
export type ParsedSkedyulConfig = z.infer<typeof SkedyulConfigSchema>;
|
|
4406
4436
|
export declare function safeParseConfig(data: unknown): ParsedSkedyulConfig | null;
|
|
4407
4437
|
export type FieldOwner = z.infer<typeof FieldOwnerSchema>;
|
|
4438
|
+
export type FieldRequirementType = z.infer<typeof FieldRequirementTypeSchema>;
|
|
4408
4439
|
export type FieldOption = z.infer<typeof FieldOptionSchema>;
|
|
4409
4440
|
export type InlineFieldDefinition = z.infer<typeof InlineFieldDefinitionSchema>;
|
|
4410
4441
|
export type RelationshipCardinality = z.infer<typeof RelationshipCardinalitySchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { SkedyulServerConfig, SkedyulServerInstance, ToolCallResponse, ToolMetadata, WebhookRegistry } from '../types';
|
|
2
|
+
import type { SkedyulServerConfig, SkedyulServerInstance, ToolCallResponse, ToolMetadata, ToolRegistry, WebhookRegistry } from '../types';
|
|
3
3
|
import type { RequestState } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* Creates a dedicated (long-running HTTP) server instance
|
|
6
6
|
*/
|
|
7
|
-
export declare function createDedicatedServerInstance(config: SkedyulServerConfig, tools: ToolMetadata[], callTool: (nameRaw: unknown, argsRaw: unknown) => Promise<ToolCallResponse>, state: RequestState, mcpServer: McpServer, webhookRegistry?: WebhookRegistry): SkedyulServerInstance;
|
|
7
|
+
export declare function createDedicatedServerInstance(config: SkedyulServerConfig, tools: ToolMetadata[], callTool: (nameRaw: unknown, argsRaw: unknown) => Promise<ToolCallResponse>, state: RequestState, mcpServer: McpServer, registry: ToolRegistry, webhookRegistry?: WebhookRegistry): SkedyulServerInstance;
|
package/dist/server.js
CHANGED
|
@@ -770,7 +770,7 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
770
770
|
}
|
|
771
771
|
|
|
772
772
|
// src/server/dedicated.ts
|
|
773
|
-
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, webhookRegistry) {
|
|
773
|
+
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
774
774
|
const port = getListeningPort(config);
|
|
775
775
|
const httpServer = import_http2.default.createServer(
|
|
776
776
|
async (req, res) => {
|
|
@@ -787,6 +787,26 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
787
787
|
sendJSON(res, 200, state.getHealthStatus());
|
|
788
788
|
return;
|
|
789
789
|
}
|
|
790
|
+
if (pathname === "/config" && req.method === "GET") {
|
|
791
|
+
sendJSON(res, 200, {
|
|
792
|
+
name: config.metadata.name,
|
|
793
|
+
version: config.metadata.version,
|
|
794
|
+
computeLayer: config.computeLayer,
|
|
795
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
796
|
+
name: tool.name || key,
|
|
797
|
+
description: tool.description,
|
|
798
|
+
timeout: tool.timeout,
|
|
799
|
+
retries: tool.retries,
|
|
800
|
+
triggers: tool.triggers
|
|
801
|
+
})),
|
|
802
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
803
|
+
name: w.name,
|
|
804
|
+
description: w.description,
|
|
805
|
+
methods: w.methods
|
|
806
|
+
})) : []
|
|
807
|
+
});
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
790
810
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
791
811
|
const handle = pathname.slice("/webhooks/".length);
|
|
792
812
|
const webhookDef = webhookRegistry[handle];
|
|
@@ -1874,6 +1894,25 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1874
1894
|
if (path === "/health" && method === "GET") {
|
|
1875
1895
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
1876
1896
|
}
|
|
1897
|
+
if (path === "/config" && method === "GET") {
|
|
1898
|
+
return createResponse(200, {
|
|
1899
|
+
name: config.metadata.name,
|
|
1900
|
+
version: config.metadata.version,
|
|
1901
|
+
computeLayer: config.computeLayer,
|
|
1902
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
1903
|
+
name: tool.name || key,
|
|
1904
|
+
description: tool.description,
|
|
1905
|
+
timeout: tool.timeout,
|
|
1906
|
+
retries: tool.retries,
|
|
1907
|
+
triggers: tool.triggers
|
|
1908
|
+
})),
|
|
1909
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
1910
|
+
name: w.name,
|
|
1911
|
+
description: w.description,
|
|
1912
|
+
methods: w.methods
|
|
1913
|
+
})) : []
|
|
1914
|
+
}, headers);
|
|
1915
|
+
}
|
|
1877
1916
|
if (path === "/mcp" && method === "POST") {
|
|
1878
1917
|
let body;
|
|
1879
1918
|
try {
|
|
@@ -2247,6 +2286,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
2247
2286
|
callTool,
|
|
2248
2287
|
state,
|
|
2249
2288
|
mcpServer,
|
|
2289
|
+
registry,
|
|
2250
2290
|
webhookRegistry
|
|
2251
2291
|
);
|
|
2252
2292
|
}
|
|
@@ -709,7 +709,7 @@ function printStartupLog(config, tools, webhookRegistry, port) {
|
|
|
709
709
|
}
|
|
710
710
|
|
|
711
711
|
// src/server/dedicated.ts
|
|
712
|
-
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, webhookRegistry) {
|
|
712
|
+
function createDedicatedServerInstance(config, tools, callTool, state, mcpServer, registry, webhookRegistry) {
|
|
713
713
|
const port = getListeningPort(config);
|
|
714
714
|
const httpServer = http.createServer(
|
|
715
715
|
async (req, res) => {
|
|
@@ -726,6 +726,26 @@ function createDedicatedServerInstance(config, tools, callTool, state, mcpServer
|
|
|
726
726
|
sendJSON(res, 200, state.getHealthStatus());
|
|
727
727
|
return;
|
|
728
728
|
}
|
|
729
|
+
if (pathname === "/config" && req.method === "GET") {
|
|
730
|
+
sendJSON(res, 200, {
|
|
731
|
+
name: config.metadata.name,
|
|
732
|
+
version: config.metadata.version,
|
|
733
|
+
computeLayer: config.computeLayer,
|
|
734
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
735
|
+
name: tool.name || key,
|
|
736
|
+
description: tool.description,
|
|
737
|
+
timeout: tool.timeout,
|
|
738
|
+
retries: tool.retries,
|
|
739
|
+
triggers: tool.triggers
|
|
740
|
+
})),
|
|
741
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
742
|
+
name: w.name,
|
|
743
|
+
description: w.description,
|
|
744
|
+
methods: w.methods
|
|
745
|
+
})) : []
|
|
746
|
+
});
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
729
749
|
if (pathname.startsWith("/webhooks/") && webhookRegistry) {
|
|
730
750
|
const handle = pathname.slice("/webhooks/".length);
|
|
731
751
|
const webhookDef = webhookRegistry[handle];
|
|
@@ -1813,6 +1833,25 @@ function createServerlessInstance(config, tools, callTool, state, mcpServer, reg
|
|
|
1813
1833
|
if (path === "/health" && method === "GET") {
|
|
1814
1834
|
return createResponse(200, state.getHealthStatus(), headers);
|
|
1815
1835
|
}
|
|
1836
|
+
if (path === "/config" && method === "GET") {
|
|
1837
|
+
return createResponse(200, {
|
|
1838
|
+
name: config.metadata.name,
|
|
1839
|
+
version: config.metadata.version,
|
|
1840
|
+
computeLayer: config.computeLayer,
|
|
1841
|
+
tools: Object.entries(registry).map(([key, tool]) => ({
|
|
1842
|
+
name: tool.name || key,
|
|
1843
|
+
description: tool.description,
|
|
1844
|
+
timeout: tool.timeout,
|
|
1845
|
+
retries: tool.retries,
|
|
1846
|
+
triggers: tool.triggers
|
|
1847
|
+
})),
|
|
1848
|
+
webhooks: webhookRegistry ? Object.values(webhookRegistry).map((w) => ({
|
|
1849
|
+
name: w.name,
|
|
1850
|
+
description: w.description,
|
|
1851
|
+
methods: w.methods
|
|
1852
|
+
})) : []
|
|
1853
|
+
}, headers);
|
|
1854
|
+
}
|
|
1816
1855
|
if (path === "/mcp" && method === "POST") {
|
|
1817
1856
|
let body;
|
|
1818
1857
|
try {
|
|
@@ -2186,6 +2225,7 @@ function createSkedyulServer(config, registry, webhookRegistry) {
|
|
|
2186
2225
|
callTool,
|
|
2187
2226
|
state,
|
|
2188
2227
|
mcpServer,
|
|
2228
|
+
registry,
|
|
2189
2229
|
webhookRegistry
|
|
2190
2230
|
);
|
|
2191
2231
|
}
|