@webtypen/webframez-core 0.3.45 → 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 +16 -20
- package/dist/Api/ApiFunctionUtils.js +13 -10
- package/package.json +1 -1
|
@@ -56,8 +56,6 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
56
56
|
items?: undefined;
|
|
57
57
|
anyOf?: undefined;
|
|
58
58
|
"x-webframez-type"?: undefined;
|
|
59
|
-
"x-openai-file-parameter"?: undefined;
|
|
60
|
-
"x-openai-file-arg-rewrite"?: undefined;
|
|
61
59
|
enum?: undefined;
|
|
62
60
|
} | {
|
|
63
61
|
type: string;
|
|
@@ -65,8 +63,6 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
65
63
|
items?: undefined;
|
|
66
64
|
anyOf?: undefined;
|
|
67
65
|
"x-webframez-type"?: undefined;
|
|
68
|
-
"x-openai-file-parameter"?: undefined;
|
|
69
|
-
"x-openai-file-arg-rewrite"?: undefined;
|
|
70
66
|
enum?: undefined;
|
|
71
67
|
} | {
|
|
72
68
|
type: string;
|
|
@@ -74,23 +70,25 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
74
70
|
pattern?: undefined;
|
|
75
71
|
anyOf?: undefined;
|
|
76
72
|
"x-webframez-type"?: undefined;
|
|
77
|
-
"x-openai-file-parameter"?: undefined;
|
|
78
|
-
"x-openai-file-arg-rewrite"?: undefined;
|
|
79
73
|
enum?: undefined;
|
|
80
74
|
} | {
|
|
81
75
|
anyOf: ({
|
|
82
|
-
type: string;
|
|
83
|
-
description: string;
|
|
84
|
-
additionalProperties?: undefined;
|
|
85
|
-
properties?: undefined;
|
|
86
|
-
} | {
|
|
87
76
|
type: string;
|
|
88
77
|
additionalProperties: boolean;
|
|
89
78
|
properties: {
|
|
90
|
-
|
|
79
|
+
download_url: {
|
|
91
80
|
type: string;
|
|
92
81
|
};
|
|
93
|
-
|
|
82
|
+
file_id: {
|
|
83
|
+
type: string;
|
|
84
|
+
};
|
|
85
|
+
mime_type: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
file_name: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
url: {
|
|
94
92
|
type: string;
|
|
95
93
|
};
|
|
96
94
|
download_link: {
|
|
@@ -117,15 +115,15 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
117
115
|
mime: {
|
|
118
116
|
type: string;
|
|
119
117
|
};
|
|
120
|
-
mime_type: {
|
|
121
|
-
type: string;
|
|
122
|
-
};
|
|
123
118
|
};
|
|
124
119
|
description?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
type: string;
|
|
122
|
+
description: string;
|
|
123
|
+
additionalProperties?: undefined;
|
|
124
|
+
properties?: undefined;
|
|
125
125
|
})[];
|
|
126
126
|
"x-webframez-type": string;
|
|
127
|
-
"x-openai-file-parameter": boolean;
|
|
128
|
-
"x-openai-file-arg-rewrite": boolean;
|
|
129
127
|
type?: undefined;
|
|
130
128
|
pattern?: undefined;
|
|
131
129
|
items?: undefined;
|
|
@@ -137,8 +135,6 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
137
135
|
items?: undefined;
|
|
138
136
|
anyOf?: undefined;
|
|
139
137
|
"x-webframez-type"?: undefined;
|
|
140
|
-
"x-openai-file-parameter"?: undefined;
|
|
141
|
-
"x-openai-file-arg-rewrite"?: undefined;
|
|
142
138
|
};
|
|
143
139
|
export declare function toApiFunctionHttpResult(res: Response, result: any): Response;
|
|
144
140
|
export declare function toApiFunctionPayload(result: any): any;
|
|
@@ -251,10 +251,13 @@ function coerceApiFunctionParam(key, value, definition) {
|
|
|
251
251
|
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be an object`, 400);
|
|
252
252
|
}
|
|
253
253
|
if (type === "file") {
|
|
254
|
-
if (
|
|
254
|
+
if (isPlainApiObject(value)) {
|
|
255
|
+
return value;
|
|
256
|
+
}
|
|
257
|
+
if (typeof value === "string") {
|
|
255
258
|
return value;
|
|
256
259
|
}
|
|
257
|
-
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be a file
|
|
260
|
+
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be a file reference string or object`, 400);
|
|
258
261
|
}
|
|
259
262
|
return value;
|
|
260
263
|
}
|
|
@@ -301,16 +304,15 @@ function apiFunctionParamToJsonSchema(definition) {
|
|
|
301
304
|
if (type === "file") {
|
|
302
305
|
return {
|
|
303
306
|
anyOf: [
|
|
304
|
-
{
|
|
305
|
-
type: "string",
|
|
306
|
-
description: "Local ChatGPT runtime file path, downloadable URL, Data-URL, or Base64 content.",
|
|
307
|
-
},
|
|
308
307
|
{
|
|
309
308
|
type: "object",
|
|
310
309
|
additionalProperties: true,
|
|
311
310
|
properties: {
|
|
312
|
-
url: { type: "string" },
|
|
313
311
|
download_url: { type: "string" },
|
|
312
|
+
file_id: { type: "string" },
|
|
313
|
+
mime_type: { type: "string" },
|
|
314
|
+
file_name: { type: "string" },
|
|
315
|
+
url: { type: "string" },
|
|
314
316
|
download_link: { type: "string" },
|
|
315
317
|
file_url: { type: "string" },
|
|
316
318
|
content_base64: { type: "string" },
|
|
@@ -319,13 +321,14 @@ function apiFunctionParamToJsonSchema(definition) {
|
|
|
319
321
|
filename: { type: "string" },
|
|
320
322
|
name: { type: "string" },
|
|
321
323
|
mime: { type: "string" },
|
|
322
|
-
mime_type: { type: "string" },
|
|
323
324
|
},
|
|
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
|
+
},
|
|
325
330
|
],
|
|
326
331
|
"x-webframez-type": "file",
|
|
327
|
-
"x-openai-file-parameter": true,
|
|
328
|
-
"x-openai-file-arg-rewrite": true,
|
|
329
332
|
};
|
|
330
333
|
}
|
|
331
334
|
if (type === "option" && Array.isArray(definition.options) && definition.options.length > 0) {
|
package/package.json
CHANGED