taon 21.0.53 → 21.0.54

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 (114) hide show
  1. package/bin/taon +5 -5
  2. package/bin/taon-debug +5 -5
  3. package/bin/taon-debug-brk +4 -4
  4. package/browser/package.json +1 -1
  5. package/browser-prod/package.json +1 -1
  6. package/lib/build-info._auto-generated_.d.ts +1 -1
  7. package/lib/build-info._auto-generated_.js +1 -1
  8. package/lib/package.json +1 -1
  9. package/lib/ui/index.js +2 -2
  10. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  11. package/lib-prod/base-classes/base-abstract-entity.js +17 -31
  12. package/lib-prod/base-classes/base-angular-service.js +83 -55
  13. package/lib-prod/base-classes/base-class.js +33 -35
  14. package/lib-prod/base-classes/base-context.js +17 -19
  15. package/lib-prod/base-classes/base-controller.js +146 -154
  16. package/lib-prod/base-classes/base-crud-controller.js +250 -221
  17. package/lib-prod/base-classes/base-custom-repository.js +7 -18
  18. package/lib-prod/base-classes/base-electron-service.js +49 -0
  19. package/lib-prod/base-classes/base-entity.js +20 -30
  20. package/lib-prod/base-classes/base-file-upload.middleware.js +72 -75
  21. package/lib-prod/base-classes/base-injector.js +176 -194
  22. package/lib-prod/base-classes/base-middleware.js +8 -5
  23. package/lib-prod/base-classes/base-migration.js +19 -22
  24. package/lib-prod/base-classes/base-provider.js +7 -5
  25. package/lib-prod/base-classes/base-repository.js +601 -573
  26. package/lib-prod/base-classes/base-subscriber-for-entity.js +143 -152
  27. package/lib-prod/base-classes/base.js +18 -0
  28. package/lib-prod/build-info._auto-generated_.js +26 -14
  29. package/lib-prod/config/controller-config.js +24 -24
  30. package/lib-prod/config/controller-options.js +2 -5
  31. package/lib-prod/config/method-config.js +6 -8
  32. package/lib-prod/config/param-config.js +2 -8
  33. package/lib-prod/constants.js +29 -25
  34. package/lib-prod/context-db-migrations.js +327 -324
  35. package/lib-prod/create-context.js +211 -146
  36. package/lib-prod/decorators/classes/controller-decorator.js +16 -20
  37. package/lib-prod/decorators/classes/entity-decorator.js +26 -47
  38. package/lib-prod/decorators/classes/middleware-decorator.js +14 -24
  39. package/lib-prod/decorators/classes/migration-decorator.js +13 -22
  40. package/lib-prod/decorators/classes/provider-decorator.js +13 -23
  41. package/lib-prod/decorators/classes/repository-decorator.js +13 -22
  42. package/lib-prod/decorators/classes/subscriber-decorator.js +13 -23
  43. package/lib-prod/decorators/decorator-abstract-opt.js +1 -4
  44. package/lib-prod/decorators/http/http-decorators.js +20 -5
  45. package/lib-prod/decorators/http/http-methods-decorators.js +91 -133
  46. package/lib-prod/decorators/http/http-params-decorators.js +36 -62
  47. package/lib-prod/dependency-injection/di-container.js +28 -29
  48. package/lib-prod/endpoint-context-storage.js +27 -32
  49. package/lib-prod/endpoint-context.js +2294 -1930
  50. package/lib-prod/entity-process.js +209 -198
  51. package/lib-prod/env/env.angular-node-app.js +66 -130
  52. package/lib-prod/env/env.docs-webapp.js +66 -130
  53. package/lib-prod/env/env.electron-app.js +66 -130
  54. package/lib-prod/env/env.mobile-app.js +66 -130
  55. package/lib-prod/env/env.npm-lib-and-cli-tool.js +66 -130
  56. package/lib-prod/env/env.vscode-plugin.js +66 -130
  57. package/lib-prod/env/index.js +6 -6
  58. package/lib-prod/express-types.js +1 -0
  59. package/lib-prod/formly/formly.models.js +1 -0
  60. package/lib-prod/formly/fromly.js +196 -175
  61. package/lib-prod/formly/type-from-entity.js +45 -52
  62. package/lib-prod/get-response-value.js +21 -18
  63. package/lib-prod/global-state/taon-global-state/index.js +6 -5
  64. package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.js +18 -19
  65. package/lib-prod/global-state/taon-global-state/taon-global-state.constants.js +6 -9
  66. package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js +40 -46
  67. package/lib-prod/global-state/taon-global-state/taon-global-state.entity.js +33 -46
  68. package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.js +10 -20
  69. package/lib-prod/global-state/taon-global-state/taon-global-state.models.js +43 -33
  70. package/lib-prod/global-state/taon-global-state/taon-global-state.provider.js +10 -20
  71. package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js +43 -44
  72. package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.js +20 -27
  73. package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js +10 -10
  74. package/lib-prod/global-state/taon-transaction-registry/index.js +11 -10
  75. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js +20 -21
  76. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.js +4 -7
  77. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js +34 -39
  78. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.js +34 -54
  79. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js +10 -20
  80. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.js +7 -10
  81. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.js +10 -20
  82. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.js +29 -34
  83. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js +20 -27
  84. package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js +4 -5
  85. package/lib-prod/helpers/class-helpers.js +210 -177
  86. package/lib-prod/helpers/clone-obj.js +16 -20
  87. package/lib-prod/helpers/taon-helpers.js +132 -114
  88. package/lib-prod/index._auto-generated_.js +5 -0
  89. package/lib-prod/index.js +248 -227
  90. package/lib-prod/inject.js +88 -33
  91. package/lib-prod/migrations/index.js +2 -1
  92. package/lib-prod/migrations/migrations_index._auto-generated_.js +3 -0
  93. package/lib-prod/models.js +72 -103
  94. package/lib-prod/orm/columns.js +58 -118
  95. package/lib-prod/orm/index.js +56 -1
  96. package/lib-prod/package.json +1 -1
  97. package/lib-prod/realtime/realtime-client.js +188 -186
  98. package/lib-prod/realtime/realtime-core.js +77 -78
  99. package/lib-prod/realtime/realtime-server.js +225 -240
  100. package/lib-prod/realtime/realtime-strategy/index.js +4 -4
  101. package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js +273 -219
  102. package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js +267 -240
  103. package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.js +26 -20
  104. package/lib-prod/realtime/realtime-strategy/realtime-strategy.js +10 -13
  105. package/lib-prod/realtime/realtime-subs-manager.js +82 -90
  106. package/lib-prod/realtime/realtime.models.js +2 -0
  107. package/lib-prod/symbols.js +104 -105
  108. package/lib-prod/ui/index.js +1 -5
  109. package/lib-prod/ui/taon-admin-mode-configuration/index.js +1 -5
  110. package/lib-prod/validators.js +43 -37
  111. package/lib-prod.split-namespaces.json +31 -91
  112. package/package.json +1 -1
  113. package/websql/package.json +1 -1
  114. package/websql-prod/package.json +1 -1
@@ -1,60 +1,34 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
10
- };
11
- var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
12
- import { ___NS__isArray, ___NS__isFunction, ___NS__isString, Helpers__NS__error, Helpers__NS__warn } from "tnp-core/lib-prod";
13
- import { TaonController } from "../decorators/classes/controller-decorator";
14
- import {
15
- GET,
16
- PUT,
17
- DELETE,
18
- POST,
19
- PATCH
20
- } from "../decorators/http/http-methods-decorators";
21
- import { Query, Body } from "../decorators/http/http-params-decorators";
22
- import { ClassHelpers__NS__getClassFnFromObject, ClassHelpers__NS__getName } from "../helpers/class-helpers";
23
- import { Symbols__NS__metadata, Symbols__NS__old } from "../symbols";
24
- import { Validators__NS__preventUndefinedModel } from "../validators";
25
- import { TaonBaseController } from "./base-controller";
26
- let TaonBaseCrudController = class extends TaonBaseController {
27
- //#region fields
28
- db;
29
- //#endregion
30
- //#region init
31
- async _() {
32
- if (!___NS__isFunction(this.entityClassResolveFn)) {
33
- Helpers__NS__warn(
34
- `Skipping initing CRUD controller ${ClassHelpers__NS__getName(
35
- this
36
- )} because entityClassResolveFn is not provided.`
37
- );
38
- return;
39
- }
40
- let entityClassFn = this.entityClassResolveFn();
41
- this.db = this.injectRepo(entityClassFn);
42
- if (entityClassFn) {
43
- const configEntity = Reflect.getMetadata(
44
- Symbols__NS__metadata.options.entity,
45
- ClassHelpers__NS__getClassFnFromObject(this)
46
- );
47
- if (configEntity?.createTable === false) {
48
- Helpers__NS__warn(
49
- `Table for entity ${ClassHelpers__NS__getName(
50
- entityClassFn
51
- )} will not be created. Crud will not work properly.`
52
- );
53
- }
54
- } else {
55
- Helpers__NS__error(`Entity class not provided for controller ${ClassHelpers__NS__getName(
56
- this
57
- )}.
1
+ //#region imports
2
+ import { ___NS__isArray, ___NS__isFunction, ___NS__isString, Helpers__NS__error, Helpers__NS__warn } from 'tnp-core/lib-prod';
3
+ import { TaonController } from '../decorators/classes/controller-decorator';
4
+ import { GET, PUT, DELETE, POST, PATCH, } from '../decorators/http/http-methods-decorators';
5
+ import { Query, Body } from '../decorators/http/http-params-decorators';
6
+ import { ClassHelpers__NS__getClassFnFromObject, ClassHelpers__NS__getName } from '../helpers/class-helpers';
7
+ import { Symbols__NS__metadata, Symbols__NS__old } from '../symbols';
8
+ import { Validators__NS__preventUndefinedModel } from '../validators';
9
+ import { TaonBaseController } from './base-controller';
10
+ //#endregion
11
+ /**
12
+ * Please override property entityClassFn with entity class.
13
+ */
14
+ let TaonBaseCrudController = class TaonBaseCrudController extends TaonBaseController {
15
+ //#endregion
16
+ //#region init
17
+ async _() {
18
+ if (!___NS__isFunction(this.entityClassResolveFn)) {
19
+ Helpers__NS__warn(`Skipping initing CRUD controller ${ClassHelpers__NS__getName(this)} because entityClassResolveFn is not provided.`);
20
+ return;
21
+ }
22
+ let entityClassFn = this.entityClassResolveFn();
23
+ this.db = this.injectRepo(entityClassFn);
24
+ if (entityClassFn) {
25
+ const configEntity = Reflect.getMetadata(Symbols__NS__metadata.options.entity, ClassHelpers__NS__getClassFnFromObject(this));
26
+ if (configEntity?.createTable === false) {
27
+ Helpers__NS__warn(`Table for entity ${ClassHelpers__NS__getName(entityClassFn)} will not be created. Crud will not work properly.`);
28
+ }
29
+ }
30
+ else {
31
+ Helpers__NS__error(`Entity class not provided for controller ${ClassHelpers__NS__getName(this)}.
58
32
 
59
33
  Please provide entity as class property entityClassFn:
60
34
 
@@ -65,171 +39,226 @@ let TaonBaseCrudController = class extends TaonBaseController {
65
39
  }
66
40
 
67
41
  `);
42
+ }
43
+ await super._();
68
44
  }
69
- await super._();
70
- }
71
- bufforedChanges(id, property, alreadyLength) {
72
- return async (request, response) => {
73
- const model = await this.db.getBy(id);
74
- if (model === void 0) {
75
- return;
76
- }
77
- Validators__NS__preventUndefinedModel(model, id);
78
- let value = model[property];
79
- let result;
80
- if (___NS__isString(value) || ___NS__isArray(value)) {
81
- result = value.slice(alreadyLength);
82
- }
83
- return result;
84
- };
85
- }
86
- pagination(pageNumber = 1, pageSize = 10, search = "") {
87
- return async (request, response) => {
88
- if (this.db.repositoryExists) {
89
- const query = {
90
- page: pageNumber,
91
- take: pageSize,
92
- keyword: search
45
+ //#endregion
46
+ //#region bufferd changes
47
+ bufforedChanges(id, property, alreadyLength) {
48
+ //#region @websqlFunc
49
+ return async (request, response) => {
50
+ const model = await this.db.getBy(id);
51
+ if (model === void 0) {
52
+ return;
53
+ }
54
+ Validators__NS__preventUndefinedModel(model, id);
55
+ let value = model[property];
56
+ let result;
57
+ if (___NS__isString(value) || ___NS__isArray(value)) {
58
+ result = value.slice(alreadyLength);
59
+ }
60
+ return result;
93
61
  };
94
- const take = query.take || 10;
95
- const page = query.page || 1;
96
- const skip = (page - 1) * take;
97
- const keyword = query.keyword || "";
98
- const [result, total] = await this.db.findAndCount({
99
- // where: { name: Like('%' + keyword + '%') },
100
- // order: { name: "DESC" },
101
- take,
102
- skip
103
- });
104
- response?.setHeader(Symbols__NS__old.X_TOTAL_COUNT, total);
105
- return result;
106
- }
107
- return [];
108
- };
109
- }
110
- getAll() {
111
- return async (request, response) => {
112
- if (this.db.repositoryExists) {
113
- const { models, totalCount } = await this.db.getAll();
114
- response?.setHeader(Symbols__NS__old.X_TOTAL_COUNT, totalCount);
115
- return models;
116
- }
117
- return [];
118
- };
119
- }
120
- getBy(id) {
121
- return async () => {
122
- const model = await this.db.getBy(id);
123
- return model;
124
- };
125
- }
126
- updateById(id, item) {
127
- return async () => {
128
- const model = await this.db.updateById(id, item);
129
- return model;
130
- };
131
- }
132
- patchById(id, item) {
133
- return async () => {
134
- const model = await this.db.updateById(id, item);
135
- return model;
136
- };
137
- }
138
- bulkUpdate(items) {
139
- return async () => {
140
- if (!Array.isArray(items) || items?.length === 0) {
141
- return [];
142
- }
143
- const { models } = await this.db.bulkUpdate(items);
144
- return models;
145
- };
146
- }
147
- deleteById(id) {
148
- return async () => {
149
- const model = await this.db.deleteById(id);
150
- return model;
151
- };
152
- }
153
- bulkDelete(ids) {
154
- return async () => {
155
- const models = await this.db.bulkDelete(ids);
156
- return models;
157
- };
158
- }
159
- clearTable() {
160
- return async () => {
161
- await this.db.clear();
162
- };
163
- }
164
- save(item) {
165
- return async () => {
166
- const model = await this.db.save(item);
167
- return model;
168
- };
169
- }
170
- bulkCreate(items) {
171
- return async () => {
172
- const models = await this.db.bulkCreate(items);
173
- return models;
174
- };
175
- }
176
- //#endregion
62
+ //#endregion
63
+ }
64
+ //#endregion
65
+ //#region pagintation
66
+ pagination(pageNumber = 1, pageSize = 10, search = '') {
67
+ //#region @websqlFunc
68
+ return async (request, response) => {
69
+ if (this.db.repositoryExists) {
70
+ const query = {
71
+ page: pageNumber,
72
+ take: pageSize,
73
+ keyword: search,
74
+ };
75
+ // console.log({
76
+ // query
77
+ // })
78
+ const take = query.take || 10;
79
+ const page = query.page || 1;
80
+ const skip = (page - 1) * take;
81
+ const keyword = query.keyword || '';
82
+ const [result, total] = await this.db.findAndCount({
83
+ // where: { name: Like('%' + keyword + '%') },
84
+ // order: { name: "DESC" },
85
+ take: take,
86
+ skip: skip,
87
+ });
88
+ response?.setHeader(Symbols__NS__old.X_TOTAL_COUNT, total);
89
+ // const lastPage = Math.ceil(total / take);
90
+ // const nextPage = page + 1 > lastPage ? null : page + 1;
91
+ // const prevPage = page - 1 < 1 ? null : page - 1;
92
+ // console.log({
93
+ // result,
94
+ // total
95
+ // })
96
+ return result;
97
+ }
98
+ return [];
99
+ };
100
+ //#endregion
101
+ }
102
+ //#endregion
103
+ //#region get all
104
+ getAll() {
105
+ //#region @websqlFunc
106
+ return async (request, response) => {
107
+ if (this.db.repositoryExists) {
108
+ const { models, totalCount } = await this.db.getAll();
109
+ response?.setHeader(Symbols__NS__old.X_TOTAL_COUNT, totalCount);
110
+ return models;
111
+ }
112
+ return [];
113
+ };
114
+ //#endregion
115
+ }
116
+ //#endregion
117
+ //#region get by id
118
+ getBy(id) {
119
+ //#region @websqlFunc
120
+ return async () => {
121
+ const model = await this.db.getBy(id);
122
+ return model;
123
+ };
124
+ //#endregion
125
+ }
126
+ //#endregion
127
+ //#region update by id
128
+ updateById(id, item) {
129
+ //#region @websqlFunc
130
+ return async () => {
131
+ const model = await this.db.updateById(id, item);
132
+ return model;
133
+ };
134
+ //#endregion
135
+ }
136
+ //#endregion
137
+ //#region patch by id
138
+ patchById(id, item) {
139
+ //#region @websqlFunc
140
+ return async () => {
141
+ const model = await this.db.updateById(id, item);
142
+ return model;
143
+ };
144
+ //#endregion
145
+ }
146
+ //#endregion
147
+ //#region bulk update
148
+ bulkUpdate(items) {
149
+ //#region @websqlFunc
150
+ return async () => {
151
+ if (!Array.isArray(items) || items?.length === 0) {
152
+ return [];
153
+ }
154
+ const { models } = await this.db.bulkUpdate(items);
155
+ return models;
156
+ };
157
+ //#endregion
158
+ }
159
+ //#endregion
160
+ //#region delete by id
161
+ deleteById(id) {
162
+ //#region @websqlFunc
163
+ return async () => {
164
+ const model = await this.db.deleteById(id);
165
+ return model;
166
+ };
167
+ //#endregion
168
+ }
169
+ //#endregion
170
+ //#region bulk delete
171
+ bulkDelete(ids) {
172
+ //#region @websqlFunc
173
+ return async () => {
174
+ const models = await this.db.bulkDelete(ids);
175
+ return models;
176
+ };
177
+ //#endregion
178
+ }
179
+ //#endregion
180
+ //#region bulk delete
181
+ clearTable() {
182
+ //#region @websqlFunc
183
+ return async () => {
184
+ await this.db.clear();
185
+ };
186
+ //#endregion
187
+ }
188
+ //#endregion
189
+ //#region create
190
+ save(item) {
191
+ //#region @websqlFunc
192
+ return async () => {
193
+ const model = await this.db.save(item);
194
+ return model;
195
+ };
196
+ //#endregion
197
+ }
198
+ //#endregion
199
+ //#region bulk create
200
+ bulkCreate(items) {
201
+ //#region @websqlFunc
202
+ return async () => {
203
+ const models = await this.db.bulkCreate(items);
204
+ return models;
205
+ };
206
+ //#endregion
207
+ }
177
208
  };
178
- __decorateClass([
179
- GET(),
180
- __decorateParam(0, Query(`id`)),
181
- __decorateParam(1, Query(`property`)),
182
- __decorateParam(2, Query("alreadyLength"))
183
- ], TaonBaseCrudController.prototype, "bufforedChanges", 1);
184
- __decorateClass([
185
- GET(),
186
- __decorateParam(0, Query("pageNumber")),
187
- __decorateParam(1, Query("pageSize")),
188
- __decorateParam(2, Query("search"))
189
- ], TaonBaseCrudController.prototype, "pagination", 1);
190
- __decorateClass([
191
- GET()
192
- ], TaonBaseCrudController.prototype, "getAll", 1);
193
- __decorateClass([
194
- GET(),
195
- __decorateParam(0, Query(`id`))
196
- ], TaonBaseCrudController.prototype, "getBy", 1);
197
- __decorateClass([
198
- PUT(),
199
- __decorateParam(0, Query(`id`)),
200
- __decorateParam(1, Body())
201
- ], TaonBaseCrudController.prototype, "updateById", 1);
202
- __decorateClass([
203
- PATCH(),
204
- __decorateParam(0, Query(`id`)),
205
- __decorateParam(1, Body())
206
- ], TaonBaseCrudController.prototype, "patchById", 1);
207
- __decorateClass([
208
- PUT(),
209
- __decorateParam(0, Body())
210
- ], TaonBaseCrudController.prototype, "bulkUpdate", 1);
211
- __decorateClass([
212
- DELETE(),
213
- __decorateParam(0, Query(`id`))
214
- ], TaonBaseCrudController.prototype, "deleteById", 1);
215
- __decorateClass([
216
- DELETE(),
217
- __decorateParam(0, Query(`ids`))
218
- ], TaonBaseCrudController.prototype, "bulkDelete", 1);
219
- __decorateClass([
220
- DELETE()
221
- ], TaonBaseCrudController.prototype, "clearTable", 1);
222
- __decorateClass([
223
- POST(),
224
- __decorateParam(0, Body())
225
- ], TaonBaseCrudController.prototype, "save", 1);
226
- __decorateClass([
227
- POST(),
228
- __decorateParam(0, Body())
229
- ], TaonBaseCrudController.prototype, "bulkCreate", 1);
230
- TaonBaseCrudController = __decorateClass([
231
- TaonController({ className: "TaonBaseCrudController" })
209
+ __decorate([
210
+ GET(),
211
+ __param(0, Query(`id`)),
212
+ __param(1, Query(`property`)),
213
+ __param(2, Query('alreadyLength'))
214
+ ], TaonBaseCrudController.prototype, "bufforedChanges", null);
215
+ __decorate([
216
+ GET(),
217
+ __param(0, Query('pageNumber')),
218
+ __param(1, Query('pageSize')),
219
+ __param(2, Query('search'))
220
+ ], TaonBaseCrudController.prototype, "pagination", null);
221
+ __decorate([
222
+ GET()
223
+ ], TaonBaseCrudController.prototype, "getAll", null);
224
+ __decorate([
225
+ GET(),
226
+ __param(0, Query(`id`))
227
+ ], TaonBaseCrudController.prototype, "getBy", null);
228
+ __decorate([
229
+ PUT(),
230
+ __param(0, Query(`id`)),
231
+ __param(1, Body())
232
+ ], TaonBaseCrudController.prototype, "updateById", null);
233
+ __decorate([
234
+ PATCH(),
235
+ __param(0, Query(`id`)),
236
+ __param(1, Body())
237
+ ], TaonBaseCrudController.prototype, "patchById", null);
238
+ __decorate([
239
+ PUT(),
240
+ __param(0, Body())
241
+ ], TaonBaseCrudController.prototype, "bulkUpdate", null);
242
+ __decorate([
243
+ DELETE(),
244
+ __param(0, Query(`id`))
245
+ ], TaonBaseCrudController.prototype, "deleteById", null);
246
+ __decorate([
247
+ DELETE(),
248
+ __param(0, Query(`ids`))
249
+ ], TaonBaseCrudController.prototype, "bulkDelete", null);
250
+ __decorate([
251
+ DELETE()
252
+ ], TaonBaseCrudController.prototype, "clearTable", null);
253
+ __decorate([
254
+ POST(),
255
+ __param(0, Body())
256
+ ], TaonBaseCrudController.prototype, "save", null);
257
+ __decorate([
258
+ POST(),
259
+ __param(0, Body())
260
+ ], TaonBaseCrudController.prototype, "bulkCreate", null);
261
+ TaonBaseCrudController = __decorate([
262
+ TaonController({ className: 'TaonBaseCrudController' })
232
263
  ], TaonBaseCrudController);
233
- export {
234
- TaonBaseCrudController
235
- };
264
+ export { TaonBaseCrudController };
@@ -1,20 +1,9 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
1
+ import { TaonRepository } from '../decorators/classes/repository-decorator';
2
+ import { TaonBaseInjector } from './base-injector';
3
+ //#endregion
4
+ let TaonBaseCustomRepository = class TaonBaseCustomRepository extends TaonBaseInjector {
10
5
  };
11
- import { TaonRepository } from "../decorators/classes/repository-decorator";
12
- import { TaonBaseInjector } from "./base-injector";
13
- let TaonBaseCustomRepository = class extends TaonBaseInjector {
14
- };
15
- TaonBaseCustomRepository = __decorateClass([
16
- TaonRepository({ className: "TaonBaseCustomRepository" })
6
+ TaonBaseCustomRepository = __decorate([
7
+ TaonRepository({ className: 'TaonBaseCustomRepository' })
17
8
  ], TaonBaseCustomRepository);
18
- export {
19
- TaonBaseCustomRepository
20
- };
9
+ export { TaonBaseCustomRepository };
@@ -0,0 +1,49 @@
1
+ // TODO any purpose for this ?
2
+ // //#region imports
3
+ // import * as childProcess from 'child_process';
4
+ // import * as fs from 'fs';
5
+ // import { Injectable } from '@angular/core';
6
+ // import { ipcRenderer, webFrame } from 'electron';
7
+ // import { UtilsOs } from 'tnp-core/src';
8
+ // //#endregion
9
+ // // If you import a module but never use any of the imported values other than as TypeScript types,
10
+ // // the resulting javascript file will look as if you never imported the module at all.
11
+ // @Injectable({
12
+ // providedIn: 'root',
13
+ // })
14
+ // export class TaonBaseElectronService {
15
+ // ipcRenderer!: typeof ipcRenderer;
16
+ // webFrame!: typeof webFrame;
17
+ // childProcess!: typeof childProcess;
18
+ // fs!: typeof fs;
19
+ // constructor() {
20
+ // // Conditional imports
21
+ // if (UtilsOs.isElectron) {
22
+ // this.ipcRenderer = (window as any).require('electron').ipcRenderer;
23
+ // this.webFrame = (window as any).require('electron').webFrame;
24
+ // this.fs = (window as any).require('fs');
25
+ // this.childProcess = (window as any).require('child_process');
26
+ // this.childProcess.exec('node -v', (error, stdout, stderr) => {
27
+ // if (error) {
28
+ // console.error(`error: ${error.message}`);
29
+ // return;
30
+ // }
31
+ // if (stderr) {
32
+ // console.error(`stderr: ${stderr}`);
33
+ // return;
34
+ // }
35
+ // console.log(`stdout:\n${stdout}`);
36
+ // });
37
+ // // Notes :
38
+ // // * A NodeJS's dependency imported with 'window.require' MUST BE present in `dependencies` of both `app/package.json`
39
+ // // and `package.json (root folder)` in order to make it work here in Electron's Renderer process (src folder)
40
+ // // because it will loaded at runtime by Electron.
41
+ // // * A NodeJS's dependency imported with TS module import (ex: import { Dropbox } from 'dropbox') CAN only be present
42
+ // // in `dependencies` of `package.json (root folder)` because it is loaded during build phase and does not need to be
43
+ // // in the final bundle. Reminder : only if not used in Electron's Main process (app folder)
44
+ // // If you want to use a NodeJS 3rd party deps in Renderer process,
45
+ // // ipcRenderer.invoke can serve many common use cases.
46
+ // // https://www.electronjs.org/docs/latest/api/ipc-renderer#ipcrendererinvokechannel-args
47
+ // }
48
+ // }
49
+ // }
@@ -1,32 +1,22 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __decorateClass = (decorators, target, key, kind) => {
4
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
- if (decorator = decorators[i])
7
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
- if (kind && result) __defProp(target, key, result);
9
- return result;
1
+ import { Entity } from 'taon-typeorm/lib-prod'; // @websql
2
+ import { TaonBaseClass } from './base-class';
3
+ //#region @websql
4
+ let TaonBaseEntity = class TaonBaseEntity extends TaonBaseClass {
5
+ /**
6
+ * simple check if relation is ok
7
+ */
8
+ relation(relationName) {
9
+ return relationName;
10
+ }
11
+ /**
12
+ * simple check if relation is ok
13
+ */
14
+ relations(relationNames) {
15
+ return relationNames;
16
+ }
10
17
  };
11
- import { Entity } from "taon-typeorm/lib-prod";
12
- import { TaonBaseClass } from "./base-class";
13
- let TaonBaseEntity = class extends TaonBaseClass {
14
- /**
15
- * simple check if relation is ok
16
- */
17
- relation(relationName) {
18
- return relationName;
19
- }
20
- /**
21
- * simple check if relation is ok
22
- */
23
- relations(relationNames) {
24
- return relationNames;
25
- }
26
- };
27
- TaonBaseEntity = __decorateClass([
28
- Entity()
18
+ TaonBaseEntity = __decorate([
19
+ Entity()
20
+ //#endregion
29
21
  ], TaonBaseEntity);
30
- export {
31
- TaonBaseEntity
32
- };
22
+ export { TaonBaseEntity };