@opra/common 1.2.1 → 1.2.3

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.
Files changed (73) hide show
  1. package/browser/index.cjs +5 -5
  2. package/browser/index.mjs +5 -5
  3. package/cjs/document/api-document.js +2 -1
  4. package/cjs/document/common/api-base.js +2 -2
  5. package/cjs/document/common/value.js +2 -2
  6. package/cjs/document/data-type/api-field.js +2 -2
  7. package/cjs/document/data-type/complex-type.js +5 -5
  8. package/cjs/document/data-type/data-type.js +2 -2
  9. package/cjs/document/data-type/enum-type.js +4 -3
  10. package/cjs/document/data-type/mapped-type.js +4 -4
  11. package/cjs/document/data-type/mixin-type.js +2 -1
  12. package/cjs/document/data-type/simple-type.js +4 -3
  13. package/cjs/document/decorators/complex-type.decorator.js +2 -3
  14. package/cjs/document/decorators/http-controller.decorator.js +5 -7
  15. package/cjs/document/decorators/http-operation.decorator.js +1 -3
  16. package/cjs/document/decorators/rpc-controller.decorator.js +5 -7
  17. package/cjs/document/decorators/rpc-operation.decorator.js +2 -3
  18. package/cjs/document/decorators/simple-type.decorator.js +2 -4
  19. package/cjs/document/factory/http-api.factory.js +2 -1
  20. package/cjs/document/factory/rpc-api.factory.js +2 -1
  21. package/cjs/document/http/http-controller.js +2 -1
  22. package/cjs/document/http/http-media-type.js +2 -2
  23. package/cjs/document/http/http-multipart-field.js +2 -2
  24. package/cjs/document/http/http-operation-response.js +2 -2
  25. package/cjs/document/http/http-operation.js +2 -1
  26. package/cjs/document/http/http-parameter.js +2 -2
  27. package/cjs/document/http/http-request-body.js +2 -2
  28. package/cjs/document/rpc/rpc-controller.js +2 -1
  29. package/cjs/document/rpc/rpc-header.js +2 -2
  30. package/cjs/document/rpc/rpc-operation-response.js +2 -2
  31. package/cjs/document/rpc/rpc-operation.js +4 -4
  32. package/cjs/exception/opra-exception.js +4 -4
  33. package/cjs/filter/filter-rules.js +2 -1
  34. package/cjs/helpers/function-utils.js +2 -2
  35. package/cjs/helpers/object-utils.js +7 -48
  36. package/cjs/helpers/type-guards.js +0 -16
  37. package/esm/document/api-document.js +2 -1
  38. package/esm/document/common/api-base.js +1 -1
  39. package/esm/document/common/value.js +1 -1
  40. package/esm/document/data-type/api-field.js +1 -1
  41. package/esm/document/data-type/complex-type.js +1 -1
  42. package/esm/document/data-type/data-type.js +1 -1
  43. package/esm/document/data-type/enum-type.js +2 -1
  44. package/esm/document/data-type/mapped-type.js +1 -1
  45. package/esm/document/data-type/mixin-type.js +2 -1
  46. package/esm/document/data-type/simple-type.js +3 -2
  47. package/esm/document/decorators/complex-type.decorator.js +2 -2
  48. package/esm/document/decorators/http-controller.decorator.js +1 -2
  49. package/esm/document/decorators/http-operation.decorator.js +1 -2
  50. package/esm/document/decorators/rpc-controller.decorator.js +2 -3
  51. package/esm/document/decorators/rpc-operation.decorator.js +2 -2
  52. package/esm/document/decorators/simple-type.decorator.js +2 -3
  53. package/esm/document/factory/http-api.factory.js +2 -1
  54. package/esm/document/factory/rpc-api.factory.js +2 -1
  55. package/esm/document/http/http-controller.js +2 -1
  56. package/esm/document/http/http-media-type.js +1 -1
  57. package/esm/document/http/http-multipart-field.js +1 -1
  58. package/esm/document/http/http-operation-response.js +1 -1
  59. package/esm/document/http/http-operation.js +2 -1
  60. package/esm/document/http/http-parameter.js +1 -1
  61. package/esm/document/http/http-request-body.js +1 -1
  62. package/esm/document/rpc/rpc-controller.js +2 -1
  63. package/esm/document/rpc/rpc-header.js +1 -1
  64. package/esm/document/rpc/rpc-operation-response.js +1 -1
  65. package/esm/document/rpc/rpc-operation.js +1 -1
  66. package/esm/exception/opra-exception.js +1 -1
  67. package/esm/filter/filter-rules.js +2 -1
  68. package/esm/helpers/function-utils.js +1 -1
  69. package/esm/helpers/object-utils.js +4 -41
  70. package/esm/helpers/type-guards.js +0 -13
  71. package/package.json +2 -4
  72. package/types/helpers/object-utils.d.ts +0 -4
  73. package/types/helpers/type-guards.d.ts +0 -4
@@ -2,6 +2,7 @@
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.ApiDocument = void 0;
5
+ const objects_1 = require("@jsopen/objects");
5
6
  const super_fast_md5_1 = require("super-fast-md5");
6
7
  const index_js_1 = require("../helpers/index.js");
7
8
  const index_js_2 = require("../schema/index.js");
@@ -65,7 +66,7 @@ class ApiDocument extends document_element_js_1.DocumentElement {
65
66
  * Export as Opra schema definition object
66
67
  */
67
68
  export() {
68
- const out = (0, index_js_1.omitUndefined)({
69
+ const out = (0, objects_1.omitUndefined)({
69
70
  spec: index_js_2.OpraSchema.SpecVersion,
70
71
  id: this.id,
71
72
  url: this.url,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiBase = void 0;
4
- const index_js_1 = require("../../helpers/index.js");
4
+ const objects_1 = require("@jsopen/objects");
5
5
  const constants_js_1 = require("../constants.js");
6
6
  const document_element_js_1 = require("./document-element.js");
7
7
  class ApiBase extends document_element_js_1.DocumentElement {
@@ -12,7 +12,7 @@ class ApiBase extends document_element_js_1.DocumentElement {
12
12
  this.description = init.description;
13
13
  }
14
14
  toJSON() {
15
- return (0, index_js_1.omitUndefined)({
15
+ return (0, objects_1.omitUndefined)({
16
16
  transport: this.transport,
17
17
  name: this.name,
18
18
  description: this.description,
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Value = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
- const index_js_1 = require("../../helpers/index.js");
6
6
  const document_element_js_1 = require("./document-element.js");
7
7
  exports.Value = function (owner, initArgs) {
8
8
  if (!this)
@@ -22,7 +22,7 @@ exports.Value = function (owner, initArgs) {
22
22
  class ValueClass extends document_element_js_1.DocumentElement {
23
23
  toJSON() {
24
24
  const typeName = this.type ? this.node.getDataTypeNameWithNs(this.type) : undefined;
25
- return (0, index_js_1.omitUndefined)({
25
+ return (0, objects_1.omitUndefined)({
26
26
  type: this.type ? (typeName ? typeName : this.type.toJSON()) : 'any',
27
27
  description: this.description,
28
28
  isArray: this.isArray,
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ApiField = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
- const index_js_1 = require("../../helpers/index.js");
6
6
  const document_element_js_1 = require("../common/document-element.js");
7
7
  const constants_js_1 = require("../constants.js");
8
8
  const api_field_decorator_js_1 = require("../decorators/api-field-decorator.js");
@@ -50,7 +50,7 @@ exports.ApiField = function (...args) {
50
50
  class ApiFieldClass extends document_element_js_1.DocumentElement {
51
51
  toJSON() {
52
52
  const typeName = this.type ? this.node.getDataTypeNameWithNs(this.type) : undefined;
53
- return (0, index_js_1.omitUndefined)({
53
+ return (0, objects_1.omitUndefined)({
54
54
  type: typeName ? typeName : this.type?.toJSON(),
55
55
  description: this.description,
56
56
  isArray: this.isArray || undefined,
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComplexType = void 0;
4
4
  require("reflect-metadata");
5
+ const objects_1 = require("@jsopen/objects");
5
6
  const ts_gems_1 = require("ts-gems");
6
- const index_js_1 = require("../../helpers/index.js");
7
- const index_js_2 = require("../../schema/index.js");
7
+ const index_js_1 = require("../../schema/index.js");
8
8
  const document_init_context_js_1 = require("../common/document-init-context.js");
9
9
  const constants_js_1 = require("../constants.js");
10
10
  const complex_type_decorator_js_1 = require("../decorators/complex-type.decorator.js");
@@ -23,7 +23,7 @@ exports.ComplexType = function (...args) {
23
23
  const context = args[2] || new document_init_context_js_1.DocumentInitContext({ maxErrors: 0 });
24
24
  complex_type_base_js_1.ComplexTypeBase.call(this, owner, initArgs, context);
25
25
  const _this = (0, ts_gems_1.asMutable)(this);
26
- _this.kind = index_js_2.OpraSchema.ComplexType.Kind;
26
+ _this.kind = index_js_1.OpraSchema.ComplexType.Kind;
27
27
  if (initArgs.base) {
28
28
  context.enter('.base', () => {
29
29
  // noinspection SuspiciousTypeOfGuard
@@ -73,7 +73,7 @@ class ComplexTypeClass extends complex_type_base_js_1.ComplexTypeBase {
73
73
  }
74
74
  toJSON() {
75
75
  const baseName = this.base ? this.node.getDataTypeNameWithNs(this.base) : undefined;
76
- const out = (0, index_js_1.omitUndefined)({
76
+ const out = (0, objects_1.omitUndefined)({
77
77
  ...complex_type_base_js_1.ComplexTypeBase.prototype.toJSON.call(this),
78
78
  kind: this.kind,
79
79
  base: this.base ? (baseName ? baseName : this.base.toJSON()) : undefined,
@@ -98,7 +98,7 @@ class ComplexTypeClass extends complex_type_base_js_1.ComplexTypeBase {
98
98
  if (i)
99
99
  out.fields = fields;
100
100
  }
101
- return (0, index_js_1.omitUndefined)(out);
101
+ return (0, objects_1.omitUndefined)(out);
102
102
  }
103
103
  }
104
104
  exports.ComplexType.prototype = ComplexTypeClass.prototype;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DataType = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
- const index_js_1 = require("../../helpers/index.js");
6
6
  const document_element_js_1 = require("../common/document-element.js");
7
7
  const constants_js_1 = require("../constants.js");
8
8
  const inspect_util_js_1 = require("../utils/inspect.util.js");
@@ -34,7 +34,7 @@ class DataTypeClass extends document_element_js_1.DocumentElement {
34
34
  return !this.name;
35
35
  }
36
36
  toJSON() {
37
- return (0, index_js_1.omitUndefined)({
37
+ return (0, objects_1.omitUndefined)({
38
38
  kind: this.kind,
39
39
  description: this.description,
40
40
  abstract: this.abstract,
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EnumType = void 0;
4
4
  require("reflect-metadata");
5
+ const objects_1 = require("@jsopen/objects");
5
6
  const ts_gems_1 = require("ts-gems");
6
7
  const valgen_1 = require("valgen");
7
8
  const index_js_1 = require("../../helpers/index.js");
@@ -52,7 +53,7 @@ class EnumTypeClass extends data_type_js_1.DataType {
52
53
  }
53
54
  toJSON() {
54
55
  const baseName = this.base ? this.node.getDataTypeNameWithNs(this.base) : undefined;
55
- return (0, index_js_1.omitUndefined)({
56
+ return (0, objects_1.omitUndefined)({
56
57
  ...data_type_js_1.DataType.prototype.toJSON.call(this),
57
58
  base: this.base ? (baseName ? baseName : this.base.toJSON()) : undefined,
58
59
  attributes: (0, index_js_1.cloneObject)(this.ownAttributes),
@@ -78,7 +79,7 @@ function EnumTypeFactory(enumSource, ...args) {
78
79
  attributes = {};
79
80
  enumSource.forEach(k => {
80
81
  const description = options?.meanings?.[k];
81
- attributes[k] = (0, index_js_1.omitUndefined)({ description });
82
+ attributes[k] = (0, objects_1.omitUndefined)({ description });
82
83
  });
83
84
  }
84
85
  else {
@@ -89,7 +90,7 @@ function EnumTypeFactory(enumSource, ...args) {
89
90
  }
90
91
  Object.keys(enumSource).forEach(k => {
91
92
  const description = options?.meanings?.[k];
92
- attributes[enumSource[k]] = (0, index_js_1.omitUndefined)({ alias: k, description });
93
+ attributes[enumSource[k]] = (0, objects_1.omitUndefined)({ alias: k, description });
93
94
  });
94
95
  }
95
96
  const metadata = {
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MappedType = void 0;
4
4
  require("reflect-metadata");
5
+ const objects_1 = require("@jsopen/objects");
5
6
  const ts_gems_1 = require("ts-gems");
6
- const index_js_1 = require("../../helpers/index.js");
7
- const index_js_2 = require("../../schema/index.js");
7
+ const index_js_1 = require("../../schema/index.js");
8
8
  const api_field_js_1 = require("./api-field.js");
9
9
  const complex_type_base_js_1 = require("./complex-type-base.js");
10
10
  const data_type_js_1 = require("./data-type.js");
@@ -19,7 +19,7 @@ exports.MappedType = function (...args) {
19
19
  const [owner, initArgs, context] = args;
20
20
  complex_type_base_js_1.ComplexTypeBase.call(this, owner, initArgs, context);
21
21
  const _this = (0, ts_gems_1.asMutable)(this);
22
- _this.kind = index_js_2.OpraSchema.MappedType.Kind;
22
+ _this.kind = index_js_1.OpraSchema.MappedType.Kind;
23
23
  if (initArgs.base) {
24
24
  // noinspection SuspiciousTypeOfGuard
25
25
  if (!(initArgs.base instanceof complex_type_base_js_1.ComplexTypeBase)) {
@@ -83,7 +83,7 @@ class MappedTypeClass extends complex_type_base_js_1.ComplexTypeBase {
83
83
  }
84
84
  toJSON() {
85
85
  const baseName = this.base ? this.node.getDataTypeNameWithNs(this.base) : undefined;
86
- return (0, index_js_1.omitUndefined)({
86
+ return (0, objects_1.omitUndefined)({
87
87
  ...complex_type_base_js_1.ComplexTypeBase.prototype.toJSON.call(this),
88
88
  base: baseName ? baseName : this.base.toJSON(),
89
89
  kind: this.kind,
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MixinType = void 0;
4
4
  require("reflect-metadata");
5
+ const objects_1 = require("@jsopen/objects");
5
6
  const ts_gems_1 = require("ts-gems");
6
7
  const index_js_1 = require("../../helpers/index.js");
7
8
  const index_js_2 = require("../../schema/index.js");
@@ -57,7 +58,7 @@ class MixinTypeClass extends complex_type_base_js_1.ComplexTypeBase {
57
58
  return false;
58
59
  }
59
60
  toJSON() {
60
- return (0, index_js_1.omitUndefined)({
61
+ return (0, objects_1.omitUndefined)({
61
62
  ...complex_type_base_js_1.ComplexTypeBase.prototype.toJSON.call(this),
62
63
  kind: this.kind,
63
64
  types: this.types.map(t => {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SimpleType = void 0;
4
4
  require("reflect-metadata");
5
+ const objects_1 = require("@jsopen/objects");
5
6
  const ts_gems_1 = require("ts-gems");
6
7
  const valgen_1 = require("valgen");
7
8
  const index_js_1 = require("../../helpers/index.js");
@@ -80,7 +81,7 @@ class SimpleTypeClass extends data_type_js_1.DataType {
80
81
  return valgen_1.isAny;
81
82
  }
82
83
  toJSON() {
83
- const attributes = (0, index_js_1.omitUndefined)(this.ownAttributes);
84
+ const attributes = (0, objects_1.omitUndefined)(this.ownAttributes);
84
85
  let properties;
85
86
  if (this.properties && typeof this.properties.toJSON === 'function') {
86
87
  properties = this.properties.toJSON(this.properties, this.owner);
@@ -88,7 +89,7 @@ class SimpleTypeClass extends data_type_js_1.DataType {
88
89
  else
89
90
  properties = this.properties ? (0, index_js_1.cloneObject)(this.properties) : {};
90
91
  const baseName = this.base ? this.node.getDataTypeNameWithNs(this.base) : undefined;
91
- const out = (0, index_js_1.omitUndefined)({
92
+ const out = (0, objects_1.omitUndefined)({
92
93
  ...data_type_js_1.DataType.prototype.toJSON.apply(this),
93
94
  base: this.base ? (baseName ? baseName : this.base.toJSON()) : undefined,
94
95
  attributes: attributes && Object.keys(attributes).length ? attributes : undefined,
@@ -96,7 +97,7 @@ class SimpleTypeClass extends data_type_js_1.DataType {
96
97
  });
97
98
  if (Object.keys(this.ownNameMappings).length)
98
99
  out.nameMappings = { ...this.ownNameMappings };
99
- return out;
100
+ return (0, objects_1.omitUndefined)(out, true);
100
101
  }
101
102
  }
102
103
  exports.SimpleType.prototype = SimpleTypeClass.prototype;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ComplexTypeDecorator = ComplexTypeDecorator;
4
- const tslib_1 = require("tslib");
5
- const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
4
+ const objects_1 = require("@jsopen/objects");
6
5
  const index_js_1 = require("../../schema/index.js");
7
6
  const constants_js_1 = require("../constants.js");
8
7
  function ComplexTypeDecorator(options) {
@@ -27,6 +26,6 @@ function ComplexTypeDecorator(options) {
27
26
  metadata.name = name;
28
27
  // Merge options
29
28
  if (options)
30
- Object.assign(metadata, (0, lodash_omit_1.default)(options, ['kind', 'name', 'base', 'fields']));
29
+ Object.assign(metadata, (0, objects_1.omit)(options, ['name']));
31
30
  };
32
31
  }
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpControllerDecoratorFactory = HttpControllerDecoratorFactory;
4
- const tslib_1 = require("tslib");
5
- const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
6
- const putil_merge_1 = tslib_1.__importDefault(require("putil-merge"));
4
+ const objects_1 = require("@jsopen/objects");
7
5
  const index_js_1 = require("../../schema/index.js");
8
6
  const constants_js_1 = require("../constants.js");
9
7
  const CLASS_NAME_PATTERN = /^(.*)(Controller)$/;
@@ -19,15 +17,15 @@ function HttpControllerDecoratorFactory(options) {
19
17
  const metadata = {};
20
18
  const baseMetadata = Reflect.getOwnMetadata(constants_js_1.HTTP_CONTROLLER_METADATA, Object.getPrototypeOf(target));
21
19
  if (baseMetadata)
22
- (0, putil_merge_1.default)(metadata, baseMetadata, { deep: true });
20
+ (0, objects_1.merge)(metadata, baseMetadata, { deep: true });
23
21
  const oldMetadata = Reflect.getOwnMetadata(constants_js_1.HTTP_CONTROLLER_METADATA, target);
24
22
  if (oldMetadata)
25
- (0, putil_merge_1.default)(metadata, oldMetadata, { deep: true });
26
- (0, putil_merge_1.default)(metadata, {
23
+ (0, objects_1.merge)(metadata, oldMetadata, { deep: true });
24
+ (0, objects_1.merge)(metadata, {
27
25
  kind: index_js_1.OpraSchema.HttpController.Kind,
28
26
  name,
29
27
  path: name,
30
- ...(0, lodash_omit_1.default)(options, ['kind', 'name', 'instance', 'endpoints', 'key']),
28
+ ...(0, objects_1.omit)(options, ['kind', 'name', 'instance', 'endpoints', 'key']),
31
29
  }, { deep: true });
32
30
  Reflect.defineMetadata(constants_js_1.HTTP_CONTROLLER_METADATA, metadata, target);
33
31
  for (const fn of decoratorChain)
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpOperationDecoratorFactory = HttpOperationDecoratorFactory;
4
- const tslib_1 = require("tslib");
5
- const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
6
4
  const index_js_1 = require("../../enums/index.js");
7
5
  const index_js_2 = require("../../schema/index.js");
8
6
  const constants_js_1 = require("../constants.js");
@@ -14,8 +12,8 @@ function HttpOperationDecoratorFactory(decoratorChain, options) {
14
12
  if (typeof propertyKey !== 'string')
15
13
  throw new TypeError(`Symbol properties can not be decorated`);
16
14
  const operationMetadata = {
15
+ ...options,
17
16
  kind: index_js_2.OpraSchema.HttpOperation.Kind,
18
- ...(0, lodash_omit_1.default)(options, ['kind']),
19
17
  };
20
18
  const controllerMetadata = (Reflect.getOwnMetadata(constants_js_1.HTTP_CONTROLLER_METADATA, target.constructor) ||
21
19
  {});
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcControllerDecoratorFactory = RpcControllerDecoratorFactory;
4
- const tslib_1 = require("tslib");
5
- const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
6
- const putil_merge_1 = tslib_1.__importDefault(require("putil-merge"));
4
+ const objects_1 = require("@jsopen/objects");
7
5
  const index_js_1 = require("../../schema/index.js");
8
6
  const constants_js_1 = require("../constants.js");
9
7
  const CLASS_NAME_PATTERN = /^(.*)(Controller)$/;
@@ -20,15 +18,15 @@ function RpcControllerDecoratorFactory(options) {
20
18
  const metadata = {};
21
19
  const baseMetadata = Reflect.getOwnMetadata(constants_js_1.RPC_CONTROLLER_METADATA, Object.getPrototypeOf(target));
22
20
  if (baseMetadata)
23
- (0, putil_merge_1.default)(metadata, baseMetadata, { deep: true });
21
+ (0, objects_1.merge)(metadata, baseMetadata, { deep: true });
24
22
  const oldMetadata = Reflect.getOwnMetadata(constants_js_1.RPC_CONTROLLER_METADATA, target);
25
23
  if (oldMetadata)
26
- (0, putil_merge_1.default)(metadata, oldMetadata, { deep: true });
27
- (0, putil_merge_1.default)(metadata, {
24
+ (0, objects_1.merge)(metadata, oldMetadata, { deep: true });
25
+ (0, objects_1.merge)(metadata, {
26
+ ...options,
28
27
  kind: index_js_1.OpraSchema.RpcController.Kind,
29
28
  name,
30
29
  path: name,
31
- ...(0, lodash_omit_1.default)(options, ['kind', 'name', 'instance', 'endpoints', 'key']),
32
30
  }, { deep: true });
33
31
  Reflect.defineMetadata(constants_js_1.RPC_CONTROLLER_METADATA, metadata, target);
34
32
  for (const fn of decoratorChain)
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcOperationDecoratorFactory = RpcOperationDecoratorFactory;
4
- const tslib_1 = require("tslib");
5
- const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
4
+ const objects_1 = require("@jsopen/objects");
6
5
  const index_js_1 = require("../../schema/index.js");
7
6
  const constants_js_1 = require("../constants.js");
8
7
  const augmentationRegistry = [];
@@ -17,8 +16,8 @@ function RpcOperationDecoratorFactory(decoratorChain, payloadType, options) {
17
16
  const operationMetadata = {
18
17
  kind: index_js_1.OpraSchema.RpcOperation.Kind,
19
18
  channel: propertyKey,
20
- ...(0, lodash_omit_1.default)(options, ['kind']),
21
19
  payloadType,
20
+ ...(0, objects_1.omit)(options, ['kind', 'payloadType']),
22
21
  };
23
22
  const controllerMetadata = (Reflect.getOwnMetadata(constants_js_1.RPC_CONTROLLER_METADATA, target.constructor) ||
24
23
  {});
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SimpleTypeDecoratorFactory = SimpleTypeDecoratorFactory;
4
4
  exports.AttributeDecoratorFactory = AttributeDecoratorFactory;
5
- const tslib_1 = require("tslib");
6
- const lodash_omit_1 = tslib_1.__importDefault(require("lodash.omit"));
7
5
  const index_js_1 = require("../../schema/index.js");
8
6
  const constants_js_1 = require("../constants.js");
9
7
  function SimpleTypeDecoratorFactory(options) {
@@ -25,10 +23,10 @@ function SimpleTypeDecoratorFactory(options) {
25
23
  }
26
24
  }
27
25
  const metadata = Reflect.getOwnMetadata(constants_js_1.DATATYPE_METADATA, target) || {};
26
+ if (options)
27
+ Object.assign(metadata, options);
28
28
  metadata.kind = index_js_1.OpraSchema.SimpleType.Kind;
29
29
  metadata.name = name;
30
- if (options)
31
- Object.assign(metadata, (0, lodash_omit_1.default)(options, ['kind', 'name']));
32
30
  Reflect.defineMetadata(constants_js_1.DATATYPE_METADATA, metadata, target);
33
31
  };
34
32
  decorator.Example = (value, description) => {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpApiFactory = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const index_js_1 = require("../../helpers/index.js");
5
6
  const constants_js_1 = require("../constants.js");
6
7
  const http_api_js_1 = require("../http/http-api.js");
@@ -69,7 +70,7 @@ class HttpApiFactory {
69
70
  }
70
71
  }
71
72
  static async _resolveControllerMetadata(context, parent, thunk) {
72
- if (typeof thunk === 'function' && !(0, index_js_1.isConstructor)(thunk)) {
73
+ if (typeof thunk === 'function' && !(0, objects_1.isConstructor)(thunk)) {
73
74
  thunk = parent instanceof http_controller_js_1.HttpController ? thunk(parent.instance) : thunk();
74
75
  }
75
76
  thunk = await (0, index_js_1.resolveThunk)(thunk);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcApiFactory = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const index_js_1 = require("../../helpers/index.js");
5
6
  const constants_js_1 = require("../constants.js");
6
7
  const rpc_api_js_1 = require("../rpc/rpc-api.js");
@@ -41,7 +42,7 @@ class RpcApiFactory {
41
42
  return api;
42
43
  }
43
44
  static async _createController(context, parent, thunk, name) {
44
- if (typeof thunk === 'function' && !(0, index_js_1.isConstructor)(thunk)) {
45
+ if (typeof thunk === 'function' && !(0, objects_1.isConstructor)(thunk)) {
45
46
  thunk = thunk();
46
47
  }
47
48
  thunk = await (0, index_js_1.resolveThunk)(thunk);
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpController = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
6
+ const objects_1 = require("@jsopen/objects");
6
7
  const ts_gems_1 = require("ts-gems");
7
8
  const index_js_1 = require("../../helpers/index.js");
8
9
  const index_js_2 = require("../../schema/index.js");
@@ -114,7 +115,7 @@ class HttpControllerClass extends document_element_js_1.DocumentElement {
114
115
  *
115
116
  */
116
117
  toJSON() {
117
- const out = (0, index_js_1.omitUndefined)({
118
+ const out = (0, objects_1.omitUndefined)({
118
119
  kind: this.kind,
119
120
  description: this.description,
120
121
  path: this.path,
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpMediaType = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const type_is_1 = tslib_1.__importDefault(require("@browsery/type-is"));
6
+ const objects_1 = require("@jsopen/objects");
6
7
  const ts_gems_1 = require("ts-gems");
7
8
  const valgen_1 = require("valgen");
8
- const index_js_1 = require("../../helpers/index.js");
9
9
  const document_element_js_1 = require("../common/document-element.js");
10
10
  const data_type_js_1 = require("../data-type/data-type.js");
11
11
  exports.HttpMediaType = function (owner, initArgs) {
@@ -48,7 +48,7 @@ class HttpMediaTypeClass extends document_element_js_1.DocumentElement {
48
48
  }
49
49
  toJSON() {
50
50
  const typeName = this.type ? this.node.getDataTypeNameWithNs(this.type) : undefined;
51
- const out = (0, index_js_1.omitUndefined)({
51
+ const out = (0, objects_1.omitUndefined)({
52
52
  description: this.description,
53
53
  contentType: this.contentType,
54
54
  contentEncoding: this.contentEncoding,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpMultipartField = void 0;
4
- const index_js_1 = require("../../helpers/index.js");
4
+ const objects_1 = require("@jsopen/objects");
5
5
  const parse_regexp_util_js_1 = require("../utils/parse-regexp.util.js");
6
6
  const http_media_type_js_1 = require("./http-media-type.js");
7
7
  /**
@@ -21,7 +21,7 @@ class HttpMultipartField extends http_media_type_js_1.HttpMediaType {
21
21
  this.required = initArgs.required;
22
22
  }
23
23
  toJSON() {
24
- return (0, index_js_1.omitUndefined)({
24
+ return (0, objects_1.omitUndefined)({
25
25
  fieldName: this.fieldName,
26
26
  fieldType: this.fieldType,
27
27
  required: this.required,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpOperationResponse = void 0;
4
- const index_js_1 = require("../../helpers/index.js");
4
+ const objects_1 = require("@jsopen/objects");
5
5
  const http_media_type_js_1 = require("./http-media-type.js");
6
6
  const http_status_range_js_1 = require("./http-status-range.js");
7
7
  /**
@@ -25,7 +25,7 @@ class HttpOperationResponse extends http_media_type_js_1.HttpMediaType {
25
25
  }
26
26
  toJSON() {
27
27
  const statusCode = this.statusCode.map(x => x.toJSON());
28
- const out = (0, index_js_1.omitUndefined)({
28
+ const out = (0, objects_1.omitUndefined)({
29
29
  ...super.toJSON(),
30
30
  statusCode: statusCode.length === 1 && typeof statusCode[0] === 'number' ? statusCode[0] : statusCode,
31
31
  partial: this.partial,
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpOperation = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
6
+ const objects_1 = require("@jsopen/objects");
6
7
  const ts_gems_1 = require("ts-gems");
7
8
  const index_js_1 = require("../../helpers/index.js");
8
9
  const index_js_2 = require("../../schema/index.js");
@@ -69,7 +70,7 @@ class HttpOperationClass extends document_element_js_1.DocumentElement {
69
70
  return this.path || '/';
70
71
  }
71
72
  toJSON() {
72
- const out = (0, index_js_1.omitUndefined)({
73
+ const out = (0, objects_1.omitUndefined)({
73
74
  kind: index_js_2.OpraSchema.HttpOperation.Kind,
74
75
  description: this.description,
75
76
  method: this.method,
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpParameter = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
- const index_js_1 = require("../../helpers/index.js");
6
6
  const value_js_1 = require("../common/value.js");
7
7
  const parse_regexp_util_js_1 = require("../utils/parse-regexp.util.js");
8
8
  exports.HttpParameter = function (owner, initArgs) {
@@ -34,7 +34,7 @@ exports.HttpParameter = function (owner, initArgs) {
34
34
  */
35
35
  class HttpParameterClass extends value_js_1.Value {
36
36
  toJSON() {
37
- return (0, index_js_1.omitUndefined)({
37
+ return (0, objects_1.omitUndefined)({
38
38
  ...super.toJSON(),
39
39
  name: this.name,
40
40
  location: this.location,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpRequestBody = void 0;
4
- const index_js_1 = require("../../helpers/index.js");
4
+ const objects_1 = require("@jsopen/objects");
5
5
  const document_element_js_1 = require("../common/document-element.js");
6
6
  /**
7
7
  * @class HttpRequestBody
@@ -12,7 +12,7 @@ class HttpRequestBody extends document_element_js_1.DocumentElement {
12
12
  this.content = [];
13
13
  }
14
14
  toJSON() {
15
- return (0, index_js_1.omitUndefined)({
15
+ return (0, objects_1.omitUndefined)({
16
16
  description: this.description,
17
17
  required: this.required,
18
18
  maxContentSize: this.maxContentSize,
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcController = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
6
  const index_js_1 = require("../../helpers/index.js");
6
7
  const index_js_2 = require("../../schema/index.js");
@@ -64,7 +65,7 @@ class RpcControllerClass extends document_element_js_1.DocumentElement {
64
65
  *
65
66
  */
66
67
  toJSON() {
67
- const out = (0, index_js_1.omitUndefined)({
68
+ const out = (0, objects_1.omitUndefined)({
68
69
  kind: this.kind,
69
70
  description: this.description,
70
71
  });
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcHeader = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
- const index_js_1 = require("../../helpers/index.js");
6
6
  const value_js_1 = require("../common/value.js");
7
7
  const parse_regexp_util_js_1 = require("../utils/parse-regexp.util.js");
8
8
  exports.RpcHeader = function (owner, initArgs) {
@@ -29,7 +29,7 @@ exports.RpcHeader = function (owner, initArgs) {
29
29
  */
30
30
  class RpcHeaderClass extends value_js_1.Value {
31
31
  toJSON() {
32
- return (0, index_js_1.omitUndefined)({
32
+ return (0, objects_1.omitUndefined)({
33
33
  ...super.toJSON(),
34
34
  name: this.name,
35
35
  required: this.required,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcOperationResponse = void 0;
4
- const index_js_1 = require("../../helpers/index.js");
4
+ const objects_1 = require("@jsopen/objects");
5
5
  const document_element_js_1 = require("../common/document-element.js");
6
6
  const data_type_js_1 = require("../data-type/data-type.js");
7
7
  /**
@@ -40,7 +40,7 @@ class RpcOperationResponse extends document_element_js_1.DocumentElement {
40
40
  }
41
41
  }
42
42
  toJSON() {
43
- const out = (0, index_js_1.omitUndefined)({
43
+ const out = (0, objects_1.omitUndefined)({
44
44
  description: this.description,
45
45
  channel: this.channel,
46
46
  payloadType: this.payloadType.name ? this.payloadType.name : this.payloadType.toJSON(),
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RpcOperation = void 0;
4
+ const objects_1 = require("@jsopen/objects");
4
5
  const ts_gems_1 = require("ts-gems");
5
- const index_js_1 = require("../../helpers/index.js");
6
- const index_js_2 = require("../../schema/index.js");
6
+ const index_js_1 = require("../../schema/index.js");
7
7
  const data_type_map_js_1 = require("../common/data-type-map.js");
8
8
  const document_element_js_1 = require("../common/document-element.js");
9
9
  const constants_js_1 = require("../constants.js");
@@ -59,8 +59,8 @@ class RpcOperationClass extends document_element_js_1.DocumentElement {
59
59
  }
60
60
  }
61
61
  toJSON() {
62
- const out = (0, index_js_1.omitUndefined)({
63
- kind: index_js_2.OpraSchema.RpcOperation.Kind,
62
+ const out = (0, objects_1.omitUndefined)({
63
+ kind: index_js_1.OpraSchema.RpcOperation.Kind,
64
64
  description: this.description,
65
65
  channel: this.channel,
66
66
  payloadType: this.payloadType.name ? this.payloadType.name : this.payloadType.toJSON(),