@opra/common 0.29.0 → 0.29.1

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/browser.js CHANGED
@@ -1417,7 +1417,7 @@ var FieldClass = class {
1417
1417
  }
1418
1418
  exportSchema(options) {
1419
1419
  return omitUndefined({
1420
- type: this.type.name ? this.type.name : this.type.exportSchema(options),
1420
+ type: this.type ? this.type.name ? this.type.name : this.type.exportSchema(options) : void 0,
1421
1421
  description: this.description,
1422
1422
  isArray: this.isArray,
1423
1423
  default: this.default,
@@ -1647,6 +1647,8 @@ var ComplexTypeClass = class extends DataType {
1647
1647
  let f;
1648
1648
  if (overwriteField) {
1649
1649
  f = { ...overwriteField };
1650
+ if (!field)
1651
+ f.type = this.document.getDataType("any");
1650
1652
  Object.setPrototypeOf(f, field || ApiField.prototype);
1651
1653
  } else
1652
1654
  f = field;
@@ -10354,9 +10356,9 @@ var CrudOperation = class extends Endpoint {
10354
10356
  this.encodeReturning = vg7.isAny();
10355
10357
  this.returnType = init.returnType instanceof DataType ? init.returnType : this.resource.document.getDataType(init.returnType || "any");
10356
10358
  this.encodeReturning = this.returnType.generateCodec("encode", { operation: "read" });
10357
- if (init.options.inputOverwriteFields)
10359
+ if (init.options?.inputOverwriteFields)
10358
10360
  this.inputOverwriteFields = new ResponsiveMap(init.options.inputOverwriteFields);
10359
- if (init.options.outputOverwriteFields)
10361
+ if (init.options?.outputOverwriteFields)
10360
10362
  this.outputOverwriteFields = new ResponsiveMap(init.options.outputOverwriteFields);
10361
10363
  }
10362
10364
  exportSchema(options) {
@@ -192,6 +192,8 @@ class ComplexTypeClass extends data_type_js_1.DataType {
192
192
  let f;
193
193
  if (overwriteField) {
194
194
  f = { ...overwriteField };
195
+ if (!field)
196
+ f.type = this.document.getDataType('any');
195
197
  Object.setPrototypeOf(f, field || field_js_1.ApiField.prototype);
196
198
  }
197
199
  else
@@ -23,7 +23,8 @@ class FieldClass {
23
23
  }
24
24
  exportSchema(options) {
25
25
  return (0, index_js_1.omitUndefined)({
26
- type: this.type.name ? this.type.name : this.type.exportSchema(options),
26
+ type: this.type ?
27
+ (this.type.name ? this.type.name : this.type.exportSchema(options)) : undefined,
27
28
  description: this.description,
28
29
  isArray: this.isArray,
29
30
  default: this.default,
@@ -22,9 +22,9 @@ class CrudOperation extends endpoint_js_1.Endpoint {
22
22
  this.returnType = init.returnType instanceof data_type_js_1.DataType
23
23
  ? init.returnType : this.resource.document.getDataType(init.returnType || 'any');
24
24
  this.encodeReturning = this.returnType.generateCodec('encode', { operation: 'read' });
25
- if (init.options.inputOverwriteFields)
25
+ if (init.options?.inputOverwriteFields)
26
26
  this.inputOverwriteFields = new index_js_1.ResponsiveMap(init.options.inputOverwriteFields);
27
- if (init.options.outputOverwriteFields)
27
+ if (init.options?.outputOverwriteFields)
28
28
  this.outputOverwriteFields = new index_js_1.ResponsiveMap(init.options.outputOverwriteFields);
29
29
  }
30
30
  exportSchema(options) {
@@ -188,6 +188,8 @@ export class ComplexTypeClass extends DataType {
188
188
  let f;
189
189
  if (overwriteField) {
190
190
  f = { ...overwriteField };
191
+ if (!field)
192
+ f.type = this.document.getDataType('any');
191
193
  Object.setPrototypeOf(f, field || ApiField.prototype);
192
194
  }
193
195
  else
@@ -19,7 +19,8 @@ export class FieldClass {
19
19
  }
20
20
  exportSchema(options) {
21
21
  return omitUndefined({
22
- type: this.type.name ? this.type.name : this.type.exportSchema(options),
22
+ type: this.type ?
23
+ (this.type.name ? this.type.name : this.type.exportSchema(options)) : undefined,
23
24
  description: this.description,
24
25
  isArray: this.isArray,
25
26
  default: this.default,
@@ -18,9 +18,9 @@ export class CrudOperation extends Endpoint {
18
18
  this.returnType = init.returnType instanceof DataType
19
19
  ? init.returnType : this.resource.document.getDataType(init.returnType || 'any');
20
20
  this.encodeReturning = this.returnType.generateCodec('encode', { operation: 'read' });
21
- if (init.options.inputOverwriteFields)
21
+ if (init.options?.inputOverwriteFields)
22
22
  this.inputOverwriteFields = new ResponsiveMap(init.options.inputOverwriteFields);
23
- if (init.options.outputOverwriteFields)
23
+ if (init.options?.outputOverwriteFields)
24
24
  this.outputOverwriteFields = new ResponsiveMap(init.options.outputOverwriteFields);
25
25
  }
26
26
  exportSchema(options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/common",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "description": "Opra common package",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -75,4 +75,4 @@
75
75
  "opra",
76
76
  "common"
77
77
  ]
78
- }
78
+ }