@spinajs/orm-api 2.0.180 → 2.0.181

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 (108) hide show
  1. package/lib/cjs/PlainJsonCollectionTransformer.d.ts +8 -8
  2. package/lib/cjs/PlainJsonCollectionTransformer.js +29 -29
  3. package/lib/cjs/PlainJsonCollectionTransformer.js.map +1 -1
  4. package/lib/cjs/config/orm-api.d.ts +16 -16
  5. package/lib/cjs/config/orm-api.js +24 -24
  6. package/lib/cjs/controllers/JsonApi.js +244 -244
  7. package/lib/cjs/controllers/crud/Create.d.ts +15 -15
  8. package/lib/cjs/controllers/crud/Create.js +144 -144
  9. package/lib/cjs/controllers/crud/Create.js.map +1 -1
  10. package/lib/cjs/controllers/crud/Delete.d.ts +15 -15
  11. package/lib/cjs/controllers/crud/Delete.js +157 -157
  12. package/lib/cjs/controllers/crud/Delete.js.map +1 -1
  13. package/lib/cjs/controllers/crud/Read.d.ts +39 -39
  14. package/lib/cjs/controllers/crud/Read.js +226 -226
  15. package/lib/cjs/controllers/crud/Read.js.map +1 -1
  16. package/lib/cjs/controllers/crud/Update.d.ts +12 -12
  17. package/lib/cjs/controllers/crud/Update.js +98 -98
  18. package/lib/cjs/controllers/crud/Update.js.map +1 -1
  19. package/lib/cjs/dto/QueryArgs.d.ts +8 -8
  20. package/lib/cjs/dto/QueryArgs.js +27 -27
  21. package/lib/cjs/dto/QueryArgs.js.map +1 -1
  22. package/lib/cjs/dto/QueryFilter.d.ts +5 -5
  23. package/lib/cjs/dto/QueryFilter.js +30 -30
  24. package/lib/cjs/dto/QueryFilter.js.map +1 -1
  25. package/lib/cjs/dto/QueryIncludes.d.ts +4 -4
  26. package/lib/cjs/dto/QueryIncludes.js +30 -30
  27. package/lib/cjs/dto/QueryIncludes.js.map +1 -1
  28. package/lib/cjs/hydrators/QueryFilterHydrator.d.ts +4 -4
  29. package/lib/cjs/hydrators/QueryFilterHydrator.js +14 -14
  30. package/lib/cjs/hydrators/QueryIncludesHydrator.d.ts +4 -4
  31. package/lib/cjs/hydrators/QueryIncludesHydrator.js +20 -20
  32. package/lib/cjs/index.d.ts +28 -28
  33. package/lib/cjs/index.js +100 -100
  34. package/lib/cjs/index.js.map +1 -1
  35. package/lib/cjs/interfaces.d.ts +41 -41
  36. package/lib/cjs/interfaces.js +49 -49
  37. package/lib/cjs/interfaces.js.map +1 -1
  38. package/lib/cjs/middleware.d.ts +21 -21
  39. package/lib/cjs/middleware.js +30 -30
  40. package/lib/cjs/policies/FindModelType.d.ts +7 -7
  41. package/lib/cjs/policies/FindModelType.js +42 -42
  42. package/lib/cjs/policies/FindModelType.js.map +1 -1
  43. package/lib/cjs/route-args/ModelType.d.ts +12 -12
  44. package/lib/cjs/route-args/ModelType.js +38 -38
  45. package/lib/cjs/route-args/ModelType.js.map +1 -1
  46. package/lib/cjs/schemas/QueryArgs.schema.d.ts +19 -19
  47. package/lib/cjs/schemas/QueryArgs.schema.js +12 -12
  48. package/lib/cjs/schemas/QueryFilter.schema.d.ts +20 -20
  49. package/lib/cjs/schemas/QueryFilter.schema.js +15 -15
  50. package/lib/cjs/schemas/QueryIncludes.schema.d.ts +7 -7
  51. package/lib/cjs/schemas/QueryIncludes.schema.js +9 -9
  52. package/lib/mjs/PlainJsonCollectionTransformer.d.ts +8 -8
  53. package/lib/mjs/PlainJsonCollectionTransformer.js +26 -26
  54. package/lib/mjs/PlainJsonCollectionTransformer.js.map +1 -1
  55. package/lib/mjs/config/orm-api.d.ts +16 -16
  56. package/lib/mjs/config/orm-api.js +22 -22
  57. package/lib/mjs/controllers/JsonApi.d.ts +1 -1
  58. package/lib/mjs/controllers/JsonApi.js +245 -245
  59. package/lib/mjs/controllers/crud/Create.d.ts +15 -15
  60. package/lib/mjs/controllers/crud/Create.js +138 -138
  61. package/lib/mjs/controllers/crud/Create.js.map +1 -1
  62. package/lib/mjs/controllers/crud/Crud.d.ts +1 -1
  63. package/lib/mjs/controllers/crud/Crud.js +1 -1
  64. package/lib/mjs/controllers/crud/Delete.d.ts +15 -15
  65. package/lib/mjs/controllers/crud/Delete.js +154 -154
  66. package/lib/mjs/controllers/crud/Delete.js.map +1 -1
  67. package/lib/mjs/controllers/crud/Read.d.ts +39 -39
  68. package/lib/mjs/controllers/crud/Read.js +223 -223
  69. package/lib/mjs/controllers/crud/Read.js.map +1 -1
  70. package/lib/mjs/controllers/crud/Update.d.ts +12 -12
  71. package/lib/mjs/controllers/crud/Update.js +95 -95
  72. package/lib/mjs/controllers/crud/Update.js.map +1 -1
  73. package/lib/mjs/dto/QueryArgs.d.ts +8 -8
  74. package/lib/mjs/dto/QueryArgs.js +21 -21
  75. package/lib/mjs/dto/QueryArgs.js.map +1 -1
  76. package/lib/mjs/dto/QueryFilter.d.ts +5 -5
  77. package/lib/mjs/dto/QueryFilter.js +24 -24
  78. package/lib/mjs/dto/QueryFilter.js.map +1 -1
  79. package/lib/mjs/dto/QueryIncludes.d.ts +4 -4
  80. package/lib/mjs/dto/QueryIncludes.js +24 -24
  81. package/lib/mjs/dto/QueryIncludes.js.map +1 -1
  82. package/lib/mjs/hydrators/QueryFilterHydrator.d.ts +4 -4
  83. package/lib/mjs/hydrators/QueryFilterHydrator.js +10 -10
  84. package/lib/mjs/hydrators/QueryIncludesHydrator.d.ts +4 -4
  85. package/lib/mjs/hydrators/QueryIncludesHydrator.js +13 -13
  86. package/lib/mjs/index.d.ts +28 -28
  87. package/lib/mjs/index.js +94 -94
  88. package/lib/mjs/index.js.map +1 -1
  89. package/lib/mjs/interfaces.d.ts +41 -41
  90. package/lib/mjs/interfaces.js +44 -44
  91. package/lib/mjs/interfaces.js.map +1 -1
  92. package/lib/mjs/middleware.d.ts +21 -21
  93. package/lib/mjs/middleware.js +26 -26
  94. package/lib/mjs/policies/FindModelType.d.ts +7 -7
  95. package/lib/mjs/policies/FindModelType.js +39 -39
  96. package/lib/mjs/policies/FindModelType.js.map +1 -1
  97. package/lib/mjs/route-args/ModelType.d.ts +12 -12
  98. package/lib/mjs/route-args/ModelType.js +34 -34
  99. package/lib/mjs/route-args/ModelType.js.map +1 -1
  100. package/lib/mjs/schemas/QueryArgs.schema.d.ts +19 -19
  101. package/lib/mjs/schemas/QueryArgs.schema.js +10 -10
  102. package/lib/mjs/schemas/QueryFilter.schema.d.ts +20 -20
  103. package/lib/mjs/schemas/QueryFilter.schema.js +13 -13
  104. package/lib/mjs/schemas/QueryIncludes.schema.d.ts +7 -7
  105. package/lib/mjs/schemas/QueryIncludes.schema.js +7 -7
  106. package/lib/tsconfig.cjs.tsbuildinfo +1 -1
  107. package/lib/tsconfig.mjs.tsbuildinfo +1 -1
  108. package/package.json +12 -12
@@ -1,35 +1,35 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- var __metadata = (this && this.__metadata) || function (k, v) {
8
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
- };
10
- import { Orm } from '@spinajs/orm';
11
- import { Injectable, Autoinject } from '@spinajs/di';
12
- import { RouteArgs, Parameter, Route } from '@spinajs/http';
13
- export function ModelType() {
14
- return Route(Parameter('ModelTypeRouteArgs'));
15
- }
16
- let ModelTypeRouteArgs = class ModelTypeRouteArgs extends RouteArgs {
17
- get SupportedType() {
18
- return 'ModelTypeRouteArgs';
19
- }
20
- async extract(callData, param, req, _res, _route) {
21
- return Promise.resolve({
22
- CallData: callData,
23
- Args: this.Orm.Models.find((x) => x.name.toLowerCase() === req.params[param.Name].trim().toLowerCase()).type,
24
- });
25
- }
26
- };
27
- __decorate([
28
- Autoinject(Orm),
29
- __metadata("design:type", Orm)
30
- ], ModelTypeRouteArgs.prototype, "Orm", void 0);
31
- ModelTypeRouteArgs = __decorate([
32
- Injectable()
33
- ], ModelTypeRouteArgs);
34
- export { ModelTypeRouteArgs };
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __metadata = (this && this.__metadata) || function (k, v) {
8
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
+ };
10
+ import { Orm } from '@spinajs/orm';
11
+ import { Injectable, Autoinject } from '@spinajs/di';
12
+ import { RouteArgs, Parameter, Route } from '@spinajs/http';
13
+ export function ModelType() {
14
+ return Route(Parameter('ModelTypeRouteArgs'));
15
+ }
16
+ let ModelTypeRouteArgs = class ModelTypeRouteArgs extends RouteArgs {
17
+ get SupportedType() {
18
+ return 'ModelTypeRouteArgs';
19
+ }
20
+ async extract(callData, param, req, _res, _route) {
21
+ return Promise.resolve({
22
+ CallData: callData,
23
+ Args: this.Orm.Models.find((x) => x.name.toLowerCase() === req.params[param.Name].trim().toLowerCase()).type,
24
+ });
25
+ }
26
+ };
27
+ __decorate([
28
+ Autoinject(Orm),
29
+ __metadata("design:type", Orm)
30
+ ], ModelTypeRouteArgs.prototype, "Orm", void 0);
31
+ ModelTypeRouteArgs = __decorate([
32
+ Injectable()
33
+ ], ModelTypeRouteArgs);
34
+ export { ModelTypeRouteArgs };
35
35
  //# sourceMappingURL=ModelType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ModelType.js","sourceRoot":"","sources":["../../../src/route-args/ModelType.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAA+B,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAGjG,MAAM,UAAU,SAAS;IACrB,OAAO,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAClD,CAAC;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,SAAS;IAI7C,IAAW,aAAa;QACpB,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,QAAoB,EAAE,KAAsB,EAAE,GAAoB,EAAE,IAAsB,EAAE,MAAe;QAC5H,OAAO,OAAO,CAAC,OAAO,CAAC;YACnB,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI;SAC/G,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAbG;IAAC,UAAU,CAAC,GAAG,CAAC;8BACD,GAAG;+CAAC;AAFV,kBAAkB;IAD9B,UAAU,EAAE;GACA,kBAAkB,CAc9B;SAdY,kBAAkB"}
1
+ {"version":3,"file":"ModelType.js","sourceRoot":"","sources":["../../../src/route-args/ModelType.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAA+B,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAGjG,MAAM,UAAU,SAAS;IACrB,OAAO,KAAK,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;AAClD,CAAC;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,SAAS;IAI7C,IAAW,aAAa;QACpB,OAAO,oBAAoB,CAAC;IAChC,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,QAAoB,EAAE,KAAsB,EAAE,GAAoB,EAAE,IAAsB,EAAE,MAAe;QAC5H,OAAO,OAAO,CAAC,OAAO,CAAC;YACnB,QAAQ,EAAE,QAAQ;YAClB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI;SAC/G,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAZa;IADT,UAAU,CAAC,GAAG,CAAC;8BACD,GAAG;+CAAC;AAFV,kBAAkB;IAD9B,UAAU,EAAE;GACA,kBAAkB,CAc9B"}
@@ -1,20 +1,20 @@
1
- declare const QueryArgsSchema: {
2
- type: string;
3
- properties: {
4
- page: {
5
- type: string;
6
- };
7
- perPage: {
8
- type: string;
9
- };
10
- orderDirection: {
11
- type: string;
12
- enum: string[];
13
- };
14
- order: {
15
- type: string;
16
- };
17
- };
18
- };
19
- export default QueryArgsSchema;
1
+ declare const QueryArgsSchema: {
2
+ type: string;
3
+ properties: {
4
+ page: {
5
+ type: string;
6
+ };
7
+ perPage: {
8
+ type: string;
9
+ };
10
+ orderDirection: {
11
+ type: string;
12
+ enum: string[];
13
+ };
14
+ order: {
15
+ type: string;
16
+ };
17
+ };
18
+ };
19
+ export default QueryArgsSchema;
20
20
  //# sourceMappingURL=QueryArgs.schema.d.ts.map
@@ -1,11 +1,11 @@
1
- const QueryArgsSchema = {
2
- type: 'object',
3
- properties: {
4
- page: { type: 'number' },
5
- perPage: { type: 'number' },
6
- orderDirection: { type: 'string', enum: ['ASC', 'DESC'] },
7
- order: { type: 'string' },
8
- },
9
- };
10
- export default QueryArgsSchema;
1
+ const QueryArgsSchema = {
2
+ type: 'object',
3
+ properties: {
4
+ page: { type: 'number' },
5
+ perPage: { type: 'number' },
6
+ orderDirection: { type: 'string', enum: ['ASC', 'DESC'] },
7
+ order: { type: 'string' },
8
+ },
9
+ };
10
+ export default QueryArgsSchema;
11
11
  //# sourceMappingURL=QueryArgs.schema.js.map
@@ -1,21 +1,21 @@
1
- declare const QueryFilterSchema: {
2
- type: string;
3
- items: {
4
- type: string;
5
- properties: {
6
- key: {
7
- type: string;
8
- };
9
- val: {
10
- type: string;
11
- };
12
- op: {
13
- type: string;
14
- enum: string[];
15
- };
16
- };
17
- required: string[];
18
- };
19
- };
20
- export default QueryFilterSchema;
1
+ declare const QueryFilterSchema: {
2
+ type: string;
3
+ items: {
4
+ type: string;
5
+ properties: {
6
+ key: {
7
+ type: string;
8
+ };
9
+ val: {
10
+ type: string;
11
+ };
12
+ op: {
13
+ type: string;
14
+ enum: string[];
15
+ };
16
+ };
17
+ required: string[];
18
+ };
19
+ };
20
+ export default QueryFilterSchema;
21
21
  //# sourceMappingURL=QueryFilter.schema.d.ts.map
@@ -1,14 +1,14 @@
1
- const QueryFilterSchema = {
2
- type: 'array',
3
- items: {
4
- type: 'object',
5
- properties: {
6
- key: { type: 'string' },
7
- val: { type: 'number' },
8
- op: { type: 'string', enum: ['=', '!=', 'like', '<', '>', '<=', '>='] },
9
- },
10
- required: ['key', 'val'],
11
- },
12
- };
13
- export default QueryFilterSchema;
1
+ const QueryFilterSchema = {
2
+ type: 'array',
3
+ items: {
4
+ type: 'object',
5
+ properties: {
6
+ key: { type: 'string' },
7
+ val: { type: 'number' },
8
+ op: { type: 'string', enum: ['=', '!=', 'like', '<', '>', '<=', '>='] },
9
+ },
10
+ required: ['key', 'val'],
11
+ },
12
+ };
13
+ export default QueryFilterSchema;
14
14
  //# sourceMappingURL=QueryFilter.schema.js.map
@@ -1,8 +1,8 @@
1
- declare const QueryIncludesSchema: {
2
- type: string;
3
- items: {
4
- type: string;
5
- };
6
- };
7
- export default QueryIncludesSchema;
1
+ declare const QueryIncludesSchema: {
2
+ type: string;
3
+ items: {
4
+ type: string;
5
+ };
6
+ };
7
+ export default QueryIncludesSchema;
8
8
  //# sourceMappingURL=QueryIncludes.schema.d.ts.map
@@ -1,8 +1,8 @@
1
- const QueryIncludesSchema = {
2
- type: 'array',
3
- items: {
4
- type: 'string',
5
- },
6
- };
7
- export default QueryIncludesSchema;
1
+ const QueryIncludesSchema = {
2
+ type: 'array',
3
+ items: {
4
+ type: 'string',
5
+ },
6
+ };
7
+ export default QueryIncludesSchema;
8
8
  //# sourceMappingURL=QueryIncludes.schema.js.map