@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 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["x-fetch"] = appendQueryString(options, context.domain, context.tail);
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["x-nested"] = typeof nested === "string" ? nested : toJSONSchemaInternal(
287
- { type: "collection", spec: nested },
288
- {
289
- ...context,
290
- domain: domain || context.domain,
291
- tail: [...context.tail, field.name]
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["x-fetch"] = appendQueryString(options, context.domain, context.tail);
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["x-nested"] = typeof nested === "string" ? nested : toJSONSchemaInternal(
260
- { type: "collection", spec: nested },
261
- {
262
- ...context,
263
- domain: domain || context.domain,
264
- tail: [...context.tail, field.name]
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makehq/forman-schema",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Forman Schema Tools",
5
5
  "license": "MIT",
6
6
  "author": "Make",