@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.
@@ -54,71 +54,77 @@ export declare function apiFunctionParamToJsonSchema(definition: ApiFunctionPara
54
54
  type: string;
55
55
  pattern?: undefined;
56
56
  items?: undefined;
57
- additionalProperties?: undefined;
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
- additionalProperties?: undefined;
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
- additionalProperties?: undefined;
74
- properties?: undefined;
71
+ anyOf?: undefined;
75
72
  "x-webframez-type"?: undefined;
76
73
  enum?: undefined;
77
74
  } | {
78
- type: string;
79
- additionalProperties: boolean;
80
- properties: {
81
- download_url: {
82
- type: string;
83
- };
84
- file_id: {
85
- type: string;
86
- };
87
- mime_type: {
88
- type: string;
89
- };
90
- file_name: {
91
- type: string;
92
- };
93
- url: {
94
- type: string;
95
- };
96
- download_link: {
97
- type: string;
98
- };
99
- file_url: {
100
- type: string;
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
- content_base64: {
103
- type: string;
104
- };
105
- data_url: {
106
- type: string;
107
- };
108
- id: {
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
- additionalProperties?: undefined;
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
- try {
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
- type: "object",
313
- additionalProperties: true,
314
- properties: {
315
- download_url: { type: "string" },
316
- file_id: { type: "string" },
317
- mime_type: { type: "string" },
318
- file_name: { type: "string" },
319
- url: { type: "string" },
320
- download_link: { type: "string" },
321
- file_url: { type: "string" },
322
- content_base64: { type: "string" },
323
- data_url: { type: "string" },
324
- id: { type: "string" },
325
- filename: { type: "string" },
326
- name: { type: "string" },
327
- mime: { type: "string" },
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.3.46",
3
+ "version": "0.3.47",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",