@makehq/forman-schema 1.1.0 → 1.1.2
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/index.cjs +19 -9
- package/dist/index.js +19 -9
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -240,7 +240,12 @@ function handleSelectType(field, result, context) {
|
|
|
240
240
|
const nested = isObject(field.options) ? isObject(field.options.nested) ? field.options.nested.store : field.options.nested : void 0;
|
|
241
241
|
const domain = isObject(field.options) ? isObject(field.options.nested) && field.options.nested.domain ? field.options.nested.domain : void 0 : void 0;
|
|
242
242
|
if (typeof options === "string") {
|
|
243
|
-
result
|
|
243
|
+
Object.defineProperty(result, "x-fetch", {
|
|
244
|
+
configurable: true,
|
|
245
|
+
enumerable: true,
|
|
246
|
+
writable: true,
|
|
247
|
+
value: appendQueryString(options, context.domain, context.tail)
|
|
248
|
+
});
|
|
244
249
|
} else if (options?.some((option) => option.label || option.nested)) {
|
|
245
250
|
result.oneOf = (options || []).map((option) => {
|
|
246
251
|
const localNested = (isObject(option.nested) ? option.nested.store : option.nested) || nested;
|
|
@@ -283,14 +288,19 @@ function handleSelectType(field, result, context) {
|
|
|
283
288
|
}
|
|
284
289
|
root.addFields(nested, [...context.tail, field.name]);
|
|
285
290
|
} else if (nested) {
|
|
286
|
-
result
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
Object.defineProperty(result, "x-nested", {
|
|
292
|
+
configurable: true,
|
|
293
|
+
enumerable: true,
|
|
294
|
+
writable: true,
|
|
295
|
+
value: typeof nested === "string" ? nested : toJSONSchemaInternal(
|
|
296
|
+
{ type: "collection", spec: nested },
|
|
297
|
+
{
|
|
298
|
+
...context,
|
|
299
|
+
domain: domain || context.domain,
|
|
300
|
+
tail: [...context.tail, field.name]
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
});
|
|
294
304
|
}
|
|
295
305
|
return result;
|
|
296
306
|
}
|
package/dist/index.js
CHANGED
|
@@ -213,7 +213,12 @@ function handleSelectType(field, result, context) {
|
|
|
213
213
|
const nested = isObject(field.options) ? isObject(field.options.nested) ? field.options.nested.store : field.options.nested : void 0;
|
|
214
214
|
const domain = isObject(field.options) ? isObject(field.options.nested) && field.options.nested.domain ? field.options.nested.domain : void 0 : void 0;
|
|
215
215
|
if (typeof options === "string") {
|
|
216
|
-
result
|
|
216
|
+
Object.defineProperty(result, "x-fetch", {
|
|
217
|
+
configurable: true,
|
|
218
|
+
enumerable: true,
|
|
219
|
+
writable: true,
|
|
220
|
+
value: appendQueryString(options, context.domain, context.tail)
|
|
221
|
+
});
|
|
217
222
|
} else if (options?.some((option) => option.label || option.nested)) {
|
|
218
223
|
result.oneOf = (options || []).map((option) => {
|
|
219
224
|
const localNested = (isObject(option.nested) ? option.nested.store : option.nested) || nested;
|
|
@@ -256,14 +261,19 @@ function handleSelectType(field, result, context) {
|
|
|
256
261
|
}
|
|
257
262
|
root.addFields(nested, [...context.tail, field.name]);
|
|
258
263
|
} else if (nested) {
|
|
259
|
-
result
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
Object.defineProperty(result, "x-nested", {
|
|
265
|
+
configurable: true,
|
|
266
|
+
enumerable: true,
|
|
267
|
+
writable: true,
|
|
268
|
+
value: typeof nested === "string" ? nested : toJSONSchemaInternal(
|
|
269
|
+
{ type: "collection", spec: nested },
|
|
270
|
+
{
|
|
271
|
+
...context,
|
|
272
|
+
domain: domain || context.domain,
|
|
273
|
+
tail: [...context.tail, field.name]
|
|
274
|
+
}
|
|
275
|
+
)
|
|
276
|
+
});
|
|
267
277
|
}
|
|
268
278
|
return result;
|
|
269
279
|
}
|