@webtypen/webframez-core 0.3.47 → 0.3.48
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 +28 -55
- package/dist/Api/ApiFunctionUtils.js +10 -29
- package/package.json +1 -1
|
@@ -54,77 +54,48 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
54
54
|
type: string;
|
|
55
55
|
pattern?: undefined;
|
|
56
56
|
items?: undefined;
|
|
57
|
-
|
|
57
|
+
additionalProperties?: undefined;
|
|
58
|
+
required?: undefined;
|
|
59
|
+
properties?: undefined;
|
|
58
60
|
"x-webframez-type"?: undefined;
|
|
59
61
|
enum?: undefined;
|
|
60
62
|
} | {
|
|
61
63
|
type: string;
|
|
62
64
|
pattern: string;
|
|
63
65
|
items?: undefined;
|
|
64
|
-
|
|
66
|
+
additionalProperties?: undefined;
|
|
67
|
+
required?: undefined;
|
|
68
|
+
properties?: undefined;
|
|
65
69
|
"x-webframez-type"?: undefined;
|
|
66
70
|
enum?: undefined;
|
|
67
71
|
} | {
|
|
68
72
|
type: string;
|
|
69
73
|
items: {};
|
|
70
74
|
pattern?: undefined;
|
|
71
|
-
|
|
75
|
+
additionalProperties?: undefined;
|
|
76
|
+
required?: undefined;
|
|
77
|
+
properties?: undefined;
|
|
72
78
|
"x-webframez-type"?: undefined;
|
|
73
79
|
enum?: undefined;
|
|
74
80
|
} | {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
-
};
|
|
81
|
+
type: string;
|
|
82
|
+
additionalProperties: boolean;
|
|
83
|
+
required: string[];
|
|
84
|
+
properties: {
|
|
85
|
+
download_url: {
|
|
86
|
+
type: string;
|
|
87
|
+
};
|
|
88
|
+
file_id: {
|
|
89
|
+
type: string;
|
|
118
90
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
91
|
+
mime_type: {
|
|
92
|
+
type: string;
|
|
93
|
+
};
|
|
94
|
+
file_name: {
|
|
95
|
+
type: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
126
98
|
"x-webframez-type": string;
|
|
127
|
-
type?: undefined;
|
|
128
99
|
pattern?: undefined;
|
|
129
100
|
items?: undefined;
|
|
130
101
|
enum?: undefined;
|
|
@@ -133,7 +104,9 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
|
|
|
133
104
|
type?: undefined;
|
|
134
105
|
pattern?: undefined;
|
|
135
106
|
items?: undefined;
|
|
136
|
-
|
|
107
|
+
additionalProperties?: undefined;
|
|
108
|
+
required?: undefined;
|
|
109
|
+
properties?: undefined;
|
|
137
110
|
"x-webframez-type"?: undefined;
|
|
138
111
|
};
|
|
139
112
|
export declare function toApiFunctionHttpResult(res: Response, result: any): Response;
|
|
@@ -254,10 +254,7 @@ function coerceApiFunctionParam(key, value, definition) {
|
|
|
254
254
|
if (isPlainApiObject(value)) {
|
|
255
255
|
return value;
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
return value;
|
|
259
|
-
}
|
|
260
|
-
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be a file reference string or object`, 400);
|
|
257
|
+
throw new ApiFunctionRuntimeError(`Parameter "${key}" must be an OpenAI file reference object`, 400);
|
|
261
258
|
}
|
|
262
259
|
return value;
|
|
263
260
|
}
|
|
@@ -303,31 +300,15 @@ function apiFunctionParamToJsonSchema(definition) {
|
|
|
303
300
|
return { type: "object" };
|
|
304
301
|
if (type === "file") {
|
|
305
302
|
return {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
],
|
|
303
|
+
type: "object",
|
|
304
|
+
additionalProperties: true,
|
|
305
|
+
required: ["download_url", "file_id"],
|
|
306
|
+
properties: {
|
|
307
|
+
download_url: { type: "string" },
|
|
308
|
+
file_id: { type: "string" },
|
|
309
|
+
mime_type: { type: "string" },
|
|
310
|
+
file_name: { type: "string" },
|
|
311
|
+
},
|
|
331
312
|
"x-webframez-type": "file",
|
|
332
313
|
};
|
|
333
314
|
}
|
package/package.json
CHANGED