@webtypen/webframez-core 0.3.46 → 0.3.47
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/Api/ApiFunctionUtils.d.ts +55 -50
- package/dist/Api/ApiFunctionUtils.js +27 -25
- package/package.json +1 -1
|
@@ -54,71 +54,77 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
54
54
|
type: string;
|
|
55
55
|
pattern?: undefined;
|
|
56
56
|
items?: undefined;
|
|
57
|
-
|
|
58
|
-
properties?: undefined;
|
|
57
|
+
anyOf?: undefined;
|
|
59
58
|
"x-webframez-type"?: undefined;
|
|
60
59
|
enum?: undefined;
|
|
61
60
|
} | {
|
|
62
61
|
type: string;
|
|
63
62
|
pattern: string;
|
|
64
63
|
items?: undefined;
|
|
65
|
-
|
|
66
|
-
properties?: undefined;
|
|
64
|
+
anyOf?: undefined;
|
|
67
65
|
"x-webframez-type"?: undefined;
|
|
68
66
|
enum?: undefined;
|
|
69
67
|
} | {
|
|
70
68
|
type: string;
|
|
71
69
|
items: {};
|
|
72
70
|
pattern?: undefined;
|
|
73
|
-
|
|
74
|
-
properties?: undefined;
|
|
71
|
+
anyOf?: undefined;
|
|
75
72
|
"x-webframez-type"?: undefined;
|
|
76
73
|
enum?: undefined;
|
|
77
74
|
} | {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
75
|
+
anyOf: ({
|
|
76
|
+
type: string;
|
|
77
|
+
additionalProperties: boolean;
|
|
78
|
+
properties: {
|
|
79
|
+
download_url: {
|
|
80
|
+
type: string;
|
|
81
|
+
};
|
|
82
|
+
file_id: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
mime_type: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
file_name: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
url: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
download_link: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
file_url: {
|
|
98
|
+
type: string;
|
|
99
|
+
};
|
|
100
|
+
content_base64: {
|
|
101
|
+
type: string;
|
|
102
|
+
};
|
|
103
|
+
data_url: {
|
|
104
|
+
type: string;
|
|
105
|
+
};
|
|
106
|
+
id: {
|
|
107
|
+
type: string;
|
|
108
|
+
};
|
|
109
|
+
filename: {
|
|
110
|
+
type: string;
|
|
111
|
+
};
|
|
112
|
+
name: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
mime: {
|
|
116
|
+
type: string;
|
|
117
|
+
};
|
|
101
118
|
};
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
type: string;
|
|
110
|
-
};
|
|
111
|
-
filename: {
|
|
112
|
-
type: string;
|
|
113
|
-
};
|
|
114
|
-
name: {
|
|
115
|
-
type: string;
|
|
116
|
-
};
|
|
117
|
-
mime: {
|
|
118
|
-
type: string;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
119
|
+
description?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
additionalProperties?: undefined;
|
|
124
|
+
properties?: undefined;
|
|
125
|
+
})[];
|
|
121
126
|
"x-webframez-type": string;
|
|
127
|
+
type?: undefined;
|
|
122
128
|
pattern?: undefined;
|
|
123
129
|
items?: undefined;
|
|
124
130
|
enum?: undefined;
|
|
@@ -127,8 +133,7 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
127
133
|
type?: undefined;
|
|
128
134
|
pattern?: undefined;
|
|
129
135
|
items?: undefined;
|
|
130
|
-
|
|
131
|
-
properties?: undefined;
|
|
136
|
+
anyOf?: undefined;
|
|
132
137
|
"x-webframez-type"?: undefined;
|
|
133
138
|
};
|
|
134
139
|
export declare function toApiFunctionHttpResult(res: Response, result: any): Response;
|
|
@@ -255,15 +255,9 @@ function coerceApiFunctionParam(key, value, definition) {
|
|
|
255
255
|
return value;
|
|
256
256
|
}
|
|
257
257
|
if (typeof value === "string") {
|
|
258
|
-
|
|
259
|
-
const parsed = JSON.parse(value);
|
|
260
|
-
if (isPlainApiObject(parsed)) {
|
|
261
|
-
return parsed;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
catch (_error) { }
|
|
258
|
+
return value;
|
|
265
259
|
}
|
|
266
|
-
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be a file reference object`, 400);
|
|
260
|
+
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be a file reference string or object`, 400);
|
|
267
261
|
}
|
|
268
262
|
return value;
|
|
269
263
|
}
|
|
@@ -309,23 +303,31 @@ function apiFunctionParamToJsonSchema(definition) {
|
|
|
309
303
|
return { type: "object" };
|
|
310
304
|
if (type === "file") {
|
|
311
305
|
return {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
306
|
+
anyOf: [
|
|
307
|
+
{
|
|
308
|
+
type: "object",
|
|
309
|
+
additionalProperties: true,
|
|
310
|
+
properties: {
|
|
311
|
+
download_url: { type: "string" },
|
|
312
|
+
file_id: { type: "string" },
|
|
313
|
+
mime_type: { type: "string" },
|
|
314
|
+
file_name: { type: "string" },
|
|
315
|
+
url: { type: "string" },
|
|
316
|
+
download_link: { type: "string" },
|
|
317
|
+
file_url: { type: "string" },
|
|
318
|
+
content_base64: { type: "string" },
|
|
319
|
+
data_url: { type: "string" },
|
|
320
|
+
id: { type: "string" },
|
|
321
|
+
filename: { type: "string" },
|
|
322
|
+
name: { type: "string" },
|
|
323
|
+
mime: { type: "string" },
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
type: "string",
|
|
328
|
+
description: "Connector runtime file reference string. Local paths must be rewritten by the ChatGPT connector before reaching the server.",
|
|
329
|
+
},
|
|
330
|
+
],
|
|
329
331
|
"x-webframez-type": "file",
|
|
330
332
|
};
|
|
331
333
|
}
|
package/package.json
CHANGED