@buildery/ts-api-kit 5.2.6 → 6.1.0

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 (123) hide show
  1. package/dist/Api.d.ts +103 -90
  2. package/dist/Api.js +17 -12
  3. package/dist/Api.js.map +1 -1
  4. package/dist/ApiConfigs.d.ts +7 -6
  5. package/dist/ApiConfigs.js +1 -0
  6. package/dist/ApiConfigs.js.map +1 -1
  7. package/dist/compose/useSingleton.d.ts +1 -1
  8. package/dist/compose/useSingleton.js +1 -2
  9. package/dist/compose/useSingleton.js.map +1 -1
  10. package/dist/constants.d.ts +3 -0
  11. package/dist/constants.js +31 -0
  12. package/dist/constants.js.map +1 -0
  13. package/dist/features/api/AbstractApi.d.ts +4 -4
  14. package/dist/features/api/AbstractApi.js +6 -6
  15. package/dist/features/api/AbstractApi.js.map +1 -1
  16. package/dist/features/auth/services/AuthAxiosService.js +6 -3
  17. package/dist/features/auth/services/AuthAxiosService.js.map +1 -1
  18. package/dist/features/auth/services/AuthService.d.ts +0 -1
  19. package/dist/features/auth/services/AuthService.js +0 -4
  20. package/dist/features/auth/services/AuthService.js.map +1 -1
  21. package/dist/features/callout/Callout.d.ts +22 -0
  22. package/dist/features/callout/Callout.js +66 -0
  23. package/dist/features/callout/Callout.js.map +1 -0
  24. package/dist/features/callout/CalloutMiddlewareService.d.ts +5 -0
  25. package/dist/features/callout/CalloutMiddlewareService.js +17 -0
  26. package/dist/features/callout/CalloutMiddlewareService.js.map +1 -0
  27. package/dist/features/callout/CalloutMiddlewares.d.ts +4 -0
  28. package/dist/features/callout/CalloutMiddlewares.js +15 -0
  29. package/dist/features/callout/CalloutMiddlewares.js.map +1 -0
  30. package/dist/features/callout/Calloutable.d.ts +3 -0
  31. package/dist/features/callout/Calloutable.js +20 -0
  32. package/dist/features/callout/Calloutable.js.map +1 -0
  33. package/dist/features/callout/index.d.ts +4 -1
  34. package/dist/features/callout/index.js +4 -1
  35. package/dist/features/callout/index.js.map +1 -1
  36. package/dist/features/callout/types.d.ts +21 -0
  37. package/dist/features/callout/types.js +3 -0
  38. package/dist/features/callout/types.js.map +1 -0
  39. package/dist/features/crud/operations/abstract/AbstractCRUDApi.d.ts +2 -2
  40. package/dist/features/crud/operations/abstract/AbstractCRUDApi.js +2 -2
  41. package/dist/features/crud/operations/abstract/AbstractCRUDApi.js.map +1 -1
  42. package/dist/features/crud/operations/operations/Create.js +5 -5
  43. package/dist/features/crud/operations/operations/Create.js.map +1 -1
  44. package/dist/features/crud/operations/operations/CreateBulk.js +4 -5
  45. package/dist/features/crud/operations/operations/CreateBulk.js.map +1 -1
  46. package/dist/features/crud/operations/operations/DeleteByFilters.js +2 -2
  47. package/dist/features/crud/operations/operations/DeleteByFilters.js.map +1 -1
  48. package/dist/features/crud/operations/operations/DeleteById.js +2 -2
  49. package/dist/features/crud/operations/operations/DeleteById.js.map +1 -1
  50. package/dist/features/crud/operations/operations/DeleteByIds.js +2 -2
  51. package/dist/features/crud/operations/operations/DeleteByIds.js.map +1 -1
  52. package/dist/features/crud/operations/operations/GetAll.js +2 -2
  53. package/dist/features/crud/operations/operations/GetAll.js.map +1 -1
  54. package/dist/features/crud/operations/operations/GetByFilters.js +2 -2
  55. package/dist/features/crud/operations/operations/GetByFilters.js.map +1 -1
  56. package/dist/features/crud/operations/operations/GetById.js +2 -2
  57. package/dist/features/crud/operations/operations/GetById.js.map +1 -1
  58. package/dist/features/crud/operations/operations/GetByIds.js +2 -2
  59. package/dist/features/crud/operations/operations/GetByIds.js.map +1 -1
  60. package/dist/features/crud/operations/operations/Update.js +2 -2
  61. package/dist/features/crud/operations/operations/Update.js.map +1 -1
  62. package/dist/features/crud/operations/operations/UpdateBulk.js +2 -2
  63. package/dist/features/crud/operations/operations/UpdateBulk.js.map +1 -1
  64. package/dist/features/crud/operations/operations/Upsert.js +2 -2
  65. package/dist/features/crud/operations/operations/Upsert.js.map +1 -1
  66. package/dist/features/crud/operations/operations/UpsertBulk.js +2 -2
  67. package/dist/features/crud/operations/operations/UpsertBulk.js.map +1 -1
  68. package/dist/features/crud/sync/compose/useCrudSync.js +1 -2
  69. package/dist/features/crud/sync/compose/useCrudSync.js.map +1 -1
  70. package/dist/features/crud/sync/constants/CrudSyncAction.js +1 -1
  71. package/dist/features/crud/sync/constants/CrudSyncAction.js.map +1 -1
  72. package/dist/features/crud/sync/middlewares/PushCrudEvent.js.map +1 -1
  73. package/dist/features/crud/sync/sync/abstract/AbstractCrudSync.js.map +1 -1
  74. package/dist/index.d.ts +10 -0
  75. package/dist/index.js +10 -0
  76. package/dist/index.js.map +1 -1
  77. package/dist/micro/auth/AuthApi.d.ts +6 -6
  78. package/dist/micro/auth/AuthApi.js +11 -10
  79. package/dist/micro/auth/AuthApi.js.map +1 -1
  80. package/dist/micro/auth/WorkspaceApi.js +6 -4
  81. package/dist/micro/auth/WorkspaceApi.js.map +1 -1
  82. package/dist/micro/auth/types/InitWorkspace.d.ts +1 -2
  83. package/dist/micro/query/FieldApi.d.ts +4 -4
  84. package/dist/micro/query/FieldApi.js +9 -8
  85. package/dist/micro/query/FieldApi.js.map +1 -1
  86. package/dist/micro/query/SObjectApi.d.ts +1 -1
  87. package/dist/micro/query/SObjectApi.js +2 -2
  88. package/dist/micro/query/SObjectApi.js.map +1 -1
  89. package/dist/micro/query/types/FieldType.js +1 -1
  90. package/dist/micro/query/types/FieldType.js.map +1 -1
  91. package/dist/micro/query/types/SObject.d.ts +1 -3
  92. package/dist/micro/query/types/SObjectField.d.ts +1 -2
  93. package/dist/micro/security/PermissionApi.d.ts +2 -2
  94. package/dist/micro/security/PermissionApi.js +6 -6
  95. package/dist/micro/security/PermissionApi.js.map +1 -1
  96. package/dist/micro/security/PermissionCategoryApi.js +2 -2
  97. package/dist/micro/security/PermissionCategoryApi.js.map +1 -1
  98. package/dist/micro/security/PermissionSetApi.d.ts +2 -2
  99. package/dist/micro/security/PermissionSetApi.js +3 -3
  100. package/dist/micro/security/PermissionSetApi.js.map +1 -1
  101. package/dist/micro/security/TeamApi.d.ts +2 -2
  102. package/dist/micro/security/TeamApi.js +3 -3
  103. package/dist/micro/security/TeamApi.js.map +1 -1
  104. package/dist/micro/workspace/ModuleApi.d.ts +3 -3
  105. package/dist/micro/workspace/ModuleApi.js +4 -4
  106. package/dist/micro/workspace/ModuleApi.js.map +1 -1
  107. package/dist/micro/workspace/types/EUserStatus.js +1 -1
  108. package/dist/micro/workspace/types/EUserStatus.js.map +1 -1
  109. package/dist/services/ResponseService.d.ts +9 -0
  110. package/dist/services/ResponseService.js +28 -0
  111. package/dist/services/ResponseService.js.map +1 -0
  112. package/dist/services/UrlService.d.ts +4 -0
  113. package/dist/services/UrlService.js +15 -0
  114. package/dist/services/UrlService.js.map +1 -0
  115. package/dist/services/index.d.ts +1 -0
  116. package/dist/services/index.js +1 -0
  117. package/dist/services/index.js.map +1 -1
  118. package/dist/tsconfig.build.tsbuildinfo +1 -1
  119. package/dist/types/HasCallouts.d.ts +1 -1
  120. package/dist/types.d.ts +61 -0
  121. package/dist/types.js +18 -0
  122. package/dist/types.js.map +1 -0
  123. package/package.json +6 -5
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Callout = void 0;
4
+ const axios_1 = require("axios");
5
+ class Callout {
6
+ get getState() { return this._state; }
7
+ get isLoading() { return this._state.isLoading; }
8
+ get getMessage() { return this._state.message; }
9
+ get getConfigFunction() { return this._configFunction; }
10
+ constructor(configFunction, axiosInstance = null) {
11
+ this._axiosInstance = axios_1.default;
12
+ this._state = { isLoading: false, message: null };
13
+ this._middlewares = [];
14
+ this._message = 'Loading...';
15
+ this._configFunction = configFunction;
16
+ this._axiosInstance = axiosInstance !== null && axiosInstance !== void 0 ? axiosInstance : this._getAxiosInstance();
17
+ }
18
+ setMessage(message) {
19
+ this._message = message;
20
+ return this;
21
+ }
22
+ async invoke(...params) {
23
+ this._invokeStart();
24
+ let response;
25
+ let error;
26
+ const config = await this._configFunction(...params);
27
+ try {
28
+ response = await this._axiosInstance(config);
29
+ }
30
+ catch (e) {
31
+ response = e === null || e === void 0 ? void 0 : e.response;
32
+ error = e;
33
+ }
34
+ await this._invokeMiddlewares(response, params, error);
35
+ this._invokeEnd();
36
+ return response;
37
+ }
38
+ addMiddleware(...middleware) {
39
+ this._middlewares.push(...middleware);
40
+ }
41
+ removeMiddleware(middleware) {
42
+ const index = this._middlewares.findIndex(m => m === middleware);
43
+ if (index === -1)
44
+ return;
45
+ this._middlewares.splice(index, 1);
46
+ }
47
+ _getAxiosInstance() {
48
+ return axios_1.default.create();
49
+ }
50
+ _invokeStart() {
51
+ this._state.isLoading = true;
52
+ this._state.message = this._message;
53
+ }
54
+ _invokeEnd() {
55
+ this._state.isLoading = false;
56
+ this._state.message = null;
57
+ }
58
+ async _invokeMiddlewares(response, params, error) {
59
+ let chain = {};
60
+ for (const middleware of this._middlewares) {
61
+ chain = await middleware({ response, error, params, chain, callout: this });
62
+ }
63
+ }
64
+ }
65
+ exports.Callout = Callout;
66
+ //# sourceMappingURL=Callout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Callout.js","sourceRoot":"","sources":["../../../src/features/callout/Callout.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ import { AxiosResponse } from "axios";
2
+ import { CalloutMiddlewareConditions } from "./types";
3
+ export declare class CalloutMiddlewareService {
4
+ static isMeetConditions(response: AxiosResponse, conditions: CalloutMiddlewareConditions): boolean;
5
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CalloutMiddlewareService = void 0;
4
+ const services_1 = require("../../services");
5
+ class CalloutMiddlewareService {
6
+ static isMeetConditions(response, conditions) {
7
+ if (!conditions)
8
+ return true;
9
+ const isHTTPIncludeMeet = !conditions.forHTTPCodes || services_1.ResponseService.isInHttpCodeRange(response, conditions.forHTTPCodes);
10
+ const isHTTPExcludeMeet = !conditions.excludeHTTPCodes || !services_1.ResponseService.isInHttpCodeRange(response, conditions.excludeHTTPCodes);
11
+ const isServerIncludeMeet = !conditions.forServerCodes || services_1.ResponseService.isInServerCodeRange(response, conditions.forServerCodes);
12
+ const isServerExcludeMeet = !conditions.excludeServerCodes || !services_1.ResponseService.isInServerCodeRange(response, conditions.excludeServerCodes);
13
+ return isHTTPIncludeMeet && isHTTPExcludeMeet && isServerIncludeMeet && isServerExcludeMeet;
14
+ }
15
+ }
16
+ exports.CalloutMiddlewareService = CalloutMiddlewareService;
17
+ //# sourceMappingURL=CalloutMiddlewareService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalloutMiddlewareService.js","sourceRoot":"","sources":["../../../src/features/callout/CalloutMiddlewareService.ts"],"names":[],"mappings":";;;AAEA,6CAA+C;AAE/C,MAAa,wBAAwB;IACjC,MAAM,CAAC,gBAAgB,CAAC,QAAuB,EAAE,UAAuC;QACpF,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,MAAM,iBAAiB,GAAG,CAAC,UAAU,CAAC,YAAY,IAAI,0BAAe,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;QAC3H,MAAM,iBAAiB,GAAG,CAAC,UAAU,CAAC,gBAAgB,IAAI,CAAC,0BAAe,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,gBAAgB,CAAC,CAAC;QAEpI,MAAM,mBAAmB,GAAG,CAAC,UAAU,CAAC,cAAc,IAAI,0BAAe,CAAC,mBAAmB,CAAC,QAAQ,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;QACnI,MAAM,mBAAmB,GAAG,CAAC,UAAU,CAAC,kBAAkB,IAAI,CAAC,0BAAe,CAAC,mBAAmB,CAAC,QAAQ,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC;QAE5I,OAAO,iBAAiB,IAAI,iBAAiB,IAAI,mBAAmB,IAAI,mBAAmB,CAAC;IAChG,CAAC;CAEJ;AAbD,4DAaC"}
@@ -0,0 +1,4 @@
1
+ import { CalloutMiddleware, CalloutMiddlewareConditions } from "./types";
2
+ export declare class CalloutMiddlewares {
3
+ static throwException: (message?: string, conditions?: CalloutMiddlewareConditions) => CalloutMiddleware<any, any>;
4
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CalloutMiddlewares = void 0;
4
+ const CalloutMiddlewareService_1 = require("./CalloutMiddlewareService");
5
+ class CalloutMiddlewares {
6
+ }
7
+ exports.CalloutMiddlewares = CalloutMiddlewares;
8
+ CalloutMiddlewares.throwException = (message, conditions) => ({ callout, response, error }) => {
9
+ if (!CalloutMiddlewareService_1.CalloutMiddlewareService.isMeetConditions(response, conditions))
10
+ return;
11
+ callout.getState.isLoading = false;
12
+ callout.getState.message = undefined;
13
+ throw new Error(message !== null && message !== void 0 ? message : `${error === null || error === void 0 ? void 0 : error.name}: ${error === null || error === void 0 ? void 0 : error.message}`);
14
+ };
15
+ //# sourceMappingURL=CalloutMiddlewares.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CalloutMiddlewares.js","sourceRoot":"","sources":["../../../src/features/callout/CalloutMiddlewares.ts"],"names":[],"mappings":";;;AACA,yEAAoE;AAEpE,MAAa,kBAAkB;;AAA/B,gDASC;AARU,iCAAc,GAAG,CAAC,OAAgB,EAAE,UAAwC,EAA+B,EAAE,CAAC,CAAC,EAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAC,EAAE,EAAE;IAChJ,IAAI,CAAC,mDAAwB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC;QAAE,OAAO;IAE7E,OAAO,CAAC,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC;IACnC,OAAO,CAAC,QAAQ,CAAC,OAAO,GAAG,SAAS,CAAC;IAErC,MAAM,IAAI,KAAK,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,KAAK,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,EAAE,CAAC,CAAC;AACpE,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { ApiCalloutMiddleware } from "./types";
2
+ import type { AbstractCRUDApi } from "../crud";
3
+ export declare const Calloutable: (...apiMiddlewares: Array<ApiCalloutMiddleware<AbstractCRUDApi>>) => (target: any, method: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Calloutable = void 0;
4
+ const auth_1 = require("../auth");
5
+ const Callout_1 = require("./Callout");
6
+ const Calloutable = (...apiMiddlewares) => (target, method, descriptor) => {
7
+ target[`${method}Callout`] = function () {
8
+ const callout = new Callout_1.Callout(descriptor.value.bind(this), auth_1.AuthAxiosService.getAxiosInstance());
9
+ apiMiddlewares === null || apiMiddlewares === void 0 ? void 0 : apiMiddlewares.map(apiMiddleware => {
10
+ const calloutMiddleware = apiMiddleware === null || apiMiddleware === void 0 ? void 0 : apiMiddleware(this);
11
+ if (!calloutMiddleware)
12
+ return;
13
+ callout.addMiddleware(calloutMiddleware);
14
+ });
15
+ return callout;
16
+ };
17
+ return descriptor;
18
+ };
19
+ exports.Calloutable = Calloutable;
20
+ //# sourceMappingURL=Calloutable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calloutable.js","sourceRoot":"","sources":["../../../src/features/callout/Calloutable.ts"],"names":[],"mappings":";;;AACA,kCAAyC;AAEzC,uCAAkC;AAE3B,MAAM,WAAW,GAAG,CAAC,GAAG,cAA4D,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,MAAc,EAAE,UAA8B,EAAE,EAAE;IAC9J,MAAM,CAAC,GAAG,MAAM,SAAS,CAAC,GAAG;QAE3B,MAAM,OAAO,GAAG,IAAI,iBAAO,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,uBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAE9F,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,GAAG,CAAC,aAAa,CAAC,EAAE;YAClC,MAAM,iBAAiB,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAG,IAAI,CAAC,CAAC;YAEhD,IAAI,CAAC,iBAAiB;gBAAE,OAAO;YAE/B,OAAO,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC,CAAA;AAjBY,QAAA,WAAW,eAiBvB"}
@@ -1,2 +1,5 @@
1
1
  export * from './types';
2
- export * from './decorators';
2
+ export * from './Callout';
3
+ export * from './Calloutable';
4
+ export * from './CalloutMiddlewareService';
5
+ export * from './CalloutMiddlewares';
@@ -15,5 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types"), exports);
18
- __exportStar(require("./decorators"), exports);
18
+ __exportStar(require("./Callout"), exports);
19
+ __exportStar(require("./Calloutable"), exports);
20
+ __exportStar(require("./CalloutMiddlewareService"), exports);
21
+ __exportStar(require("./CalloutMiddlewares"), exports);
19
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/callout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/features/callout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,gDAA8B;AAC9B,6DAA2C;AAC3C,uDAAqC"}
@@ -0,0 +1,21 @@
1
+ import { AxiosError, AxiosResponse } from "axios";
2
+ import { Callout } from "./Callout";
3
+ export type ApiCalloutMiddleware<T> = (apiInstance: T) => CalloutMiddleware<any, any>;
4
+ export type CalloutMiddleware<P extends Array<any>, T> = (params: CalloutMiddlewareParams<P, T>) => any;
5
+ export type CalloutMiddlewareParams<Params extends any[], ResponseType> = {
6
+ response?: AxiosResponse;
7
+ error?: AxiosError;
8
+ params?: Array<any>;
9
+ chain: any;
10
+ callout: Callout<Params, ResponseType>;
11
+ };
12
+ export type CalloutState = {
13
+ isLoading: boolean | undefined;
14
+ message: string | undefined;
15
+ };
16
+ export type CalloutMiddlewareConditions = {
17
+ forHTTPCodes?: Array<number>;
18
+ excludeHTTPCodes?: Array<number>;
19
+ forServerCodes?: Array<string>;
20
+ excludeServerCodes?: Array<string>;
21
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/features/callout/types.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import { AbstractApi } from "../../../api";
2
- import { ApiConfigs } from "../../../../ApiConfigs";
2
+ import { MicroserviceName } from "../../../../types";
3
3
  export declare abstract class AbstractCRUDApi extends AbstractApi {
4
4
  readonly objectName: string;
5
- constructor(apiUrl: keyof typeof ApiConfigs.api, objectName: string);
5
+ constructor(microName: MicroserviceName, objectName: string);
6
6
  }
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AbstractCRUDApi = void 0;
4
4
  const api_1 = require("../../../api");
5
5
  class AbstractCRUDApi extends api_1.AbstractApi {
6
- constructor(apiUrl, objectName) {
7
- super(apiUrl);
6
+ constructor(microName, objectName) {
7
+ super(microName);
8
8
  if (!objectName) {
9
9
  throw new AbstractCRUDApiError('Object name is not defined');
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractCRUDApi.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/abstract/AbstractCRUDApi.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AAGzC,MAAsB,eAAgB,SAAQ,iBAAW;IAIvD,YAAmB,MAAmC,EAAE,UAAkB;QACxE,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,oBAAoB,CAAC,4BAA4B,CAAC,CAAC;SAC9D;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CAEF;AAdD,0CAcC;AAED,MAAM,oBAAqB,SAAQ,KAAK;CAAG"}
1
+ {"version":3,"file":"AbstractCRUDApi.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/abstract/AbstractCRUDApi.ts"],"names":[],"mappings":";;;AAAA,sCAAyC;AAGzC,MAAsB,eAAgB,SAAQ,iBAAW;IAIvD,YAAmB,SAA2B,EAAE,UAAkB;QAChE,KAAK,CAAC,SAAS,CAAC,CAAC;QAEjB,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,oBAAoB,CAAC,4BAA4B,CAAC,CAAC;QAC/D,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CAEF;AAdD,0CAcC;AAED,MAAM,oBAAqB,SAAQ,KAAK;CAAG"}
@@ -11,13 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Create = void 0;
13
13
  const abstract_1 = require("../abstract");
14
- const callout_1 = require("../../../callout");
15
14
  const sync_1 = require("../../sync");
16
- const middlewares_1 = require("../../sync/middlewares");
15
+ const sync_2 = require("../../sync");
16
+ const callout_1 = require("../../../callout");
17
17
  class Create extends abstract_1.AbstractCRUDApi {
18
18
  create(entity) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}`,
22
22
  method: 'POST',
23
23
  data: entity
@@ -25,11 +25,11 @@ class Create extends abstract_1.AbstractCRUDApi {
25
25
  }
26
26
  ;
27
27
  }
28
+ exports.Create = Create;
28
29
  __decorate([
29
- (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.Create)),
30
+ (0, callout_1.Calloutable)((0, sync_2.PushCrudEvent)(sync_1.CrudSyncAction.Create)),
30
31
  __metadata("design:type", Function),
31
32
  __metadata("design:paramtypes", [Object]),
32
33
  __metadata("design:returntype", Object)
33
34
  ], Create.prototype, "create", null);
34
- exports.Create = Create;
35
35
  //# sourceMappingURL=Create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAU,SAAQ,0BAAe;IAGrC,MAAM,CAAC,MAAS;QACrB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;oCAQjD;AAVH,wBAYC"}
1
+ {"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,qCAA0C;AAC1C,qCAAyC;AACzC,8CAA6C;AAE7C,MAAa,MAAU,SAAQ,0BAAe;IAGrC,MAAM,CAAC,MAAS;QACrB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,wBAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,oBAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;oCAQjD"}
@@ -11,13 +11,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CreateBulk = void 0;
13
13
  const abstract_1 = require("../abstract");
14
- const callout_1 = require("../../../callout");
15
14
  const sync_1 = require("../../sync");
16
- const middlewares_1 = require("../../sync/middlewares");
15
+ const callout_1 = require("../../../callout");
17
16
  class CreateBulk extends abstract_1.AbstractCRUDApi {
18
17
  createBulk(entities) {
19
18
  return {
20
- baseURL: this.serverName,
19
+ baseURL: this.serverUrl,
21
20
  url: `/${this.objectName}/bulk`,
22
21
  method: 'POST',
23
22
  data: entities
@@ -25,11 +24,11 @@ class CreateBulk extends abstract_1.AbstractCRUDApi {
25
24
  }
26
25
  ;
27
26
  }
27
+ exports.CreateBulk = CreateBulk;
28
28
  __decorate([
29
- (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.CreateBulk)),
29
+ (0, callout_1.Calloutable)((0, sync_1.PushCrudEvent)(sync_1.CrudSyncAction.CreateBulk)),
30
30
  __metadata("design:type", Function),
31
31
  __metadata("design:paramtypes", [Array]),
32
32
  __metadata("design:returntype", Object)
33
33
  ], CreateBulk.prototype, "createBulk", null);
34
- exports.CreateBulk = CreateBulk;
35
34
  //# sourceMappingURL=CreateBulk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CreateBulk.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/CreateBulk.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0CAA4C;AAC5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,UAAc,SAAQ,0BAAe;IAGzC,UAAU,CAAC,QAAkB;QAClC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,OAAO;YAC/B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,QAAQ;SACf,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,UAAU,CAAC,CAAC;;qCAC1B,KAAK;;4CAOhC;AAVH,gCAYC"}
1
+ {"version":3,"file":"CreateBulk.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/CreateBulk.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,0CAA4C;AAC5C,qCAAyD;AACzD,8CAA6C;AAE7C,MAAa,UAAc,SAAQ,0BAAe;IAGzC,UAAU,CAAC,QAAkB;QAClC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,OAAO;YAC/B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,QAAQ;SACf,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,gCAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,oBAAa,EAAC,qBAAc,CAAC,UAAU,CAAC,CAAC;;qCAC1B,KAAK;;4CAOhC"}
@@ -16,18 +16,18 @@ const index_3 = require("../abstract/index");
16
16
  class DeleteByFilters extends index_3.AbstractCRUDApi {
17
17
  deleteByFilters(filter) {
18
18
  return {
19
- baseURL: this.serverName,
19
+ baseURL: this.serverUrl,
20
20
  url: `/${this.objectName}/delete`,
21
21
  method: 'POST',
22
22
  data: { filter }
23
23
  };
24
24
  }
25
25
  }
26
+ exports.DeleteByFilters = DeleteByFilters;
26
27
  __decorate([
27
28
  (0, index_1.Calloutable)((0, index_2.PushCrudEvent)(index_2.CrudSyncAction.DeleteBulk)),
28
29
  __metadata("design:type", Function),
29
30
  __metadata("design:paramtypes", [Object]),
30
31
  __metadata("design:returntype", Object)
31
32
  ], DeleteByFilters.prototype, "deleteByFilters", null);
32
- exports.DeleteByFilters = DeleteByFilters;
33
33
  //# sourceMappingURL=DeleteByFilters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteByFilters.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/DeleteByFilters.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kDAAmD;AACnD,4CAA+D;AAC/D,6CAAkD;AAElD,MAAa,eAAmB,SAAQ,uBAAe;IAG9C,eAAe,CAAC,MAAiB;QACtC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,SAAS;YACjC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAC,MAAM,EAAC;SACf,CAAA;IACH,CAAC;CAEF;AAVC;IAAC,IAAA,mBAAW,EAAC,IAAA,qBAAa,EAAC,sBAAc,CAAC,UAAU,CAAC,CAAC;;;;sDAQrD;AAVH,0CAYC"}
1
+ {"version":3,"file":"DeleteByFilters.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/DeleteByFilters.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kDAAmD;AACnD,4CAA+D;AAC/D,6CAAkD;AAElD,MAAa,eAAmB,SAAQ,uBAAe;IAG9C,eAAe,CAAC,MAAiB;QACtC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,SAAS;YACjC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,EAAC,MAAM,EAAC;SACf,CAAA;IACH,CAAC;CAEF;AAZD,0CAYC;AATQ;IADN,IAAA,mBAAW,EAAC,IAAA,qBAAa,EAAC,sBAAc,CAAC,UAAU,CAAC,CAAC;;;;sDAQrD"}
@@ -17,18 +17,18 @@ const sync_2 = require("../../sync");
17
17
  class DeleteById extends abstract_1.AbstractCRUDApi {
18
18
  deleteById(entityId) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}/${entityId}`,
22
22
  method: 'DELETE'
23
23
  };
24
24
  }
25
25
  ;
26
26
  }
27
+ exports.DeleteById = DeleteById;
27
28
  __decorate([
28
29
  (0, callout_1.Calloutable)((0, sync_2.PushCrudEvent)(sync_1.CrudSyncAction.Delete)),
29
30
  __metadata("design:type", Function),
30
31
  __metadata("design:paramtypes", [String]),
31
32
  __metadata("design:returntype", Object)
32
33
  ], DeleteById.prototype, "deleteById", null);
33
- exports.DeleteById = DeleteById;
34
34
  //# sourceMappingURL=DeleteById.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteById.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/DeleteById.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,qCAAyC;AAEzC,MAAa,UAAW,SAAQ,0BAAe;IAGtC,UAAU,CAAC,QAAgB;QAChC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,IAAI,QAAQ,EAAE;YACtC,MAAM,EAAE,QAAQ;SACjB,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AATC;IAAC,IAAA,qBAAW,EAAC,IAAA,oBAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;4CAOjD;AATH,gCAWC"}
1
+ {"version":3,"file":"DeleteById.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/DeleteById.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,qCAAyC;AAEzC,MAAa,UAAW,SAAQ,0BAAe;IAGtC,UAAU,CAAC,QAAgB;QAChC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,IAAI,QAAQ,EAAE;YACtC,MAAM,EAAE,QAAQ;SACjB,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAXD,gCAWC;AARQ;IADN,IAAA,qBAAW,EAAC,IAAA,oBAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;4CAOjD"}
@@ -17,18 +17,18 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class DeleteByIds extends abstract_1.AbstractCRUDApi {
18
18
  deleteByIds(entityIds) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}/bulk/${entityIds === null || entityIds === void 0 ? void 0 : entityIds.join(',')}`,
22
22
  method: 'DELETE'
23
23
  };
24
24
  }
25
25
  ;
26
26
  }
27
+ exports.DeleteByIds = DeleteByIds;
27
28
  __decorate([
28
29
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.DeleteBulk)),
29
30
  __metadata("design:type", Function),
30
31
  __metadata("design:paramtypes", [Array]),
31
32
  __metadata("design:returntype", Object)
32
33
  ], DeleteByIds.prototype, "deleteByIds", null);
33
- exports.DeleteByIds = DeleteByIds;
34
34
  //# sourceMappingURL=DeleteByIds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DeleteByIds.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/DeleteByIds.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,WAAY,SAAQ,0BAAe;IAGvC,WAAW,CAAC,SAAwB;QACzC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,SAAS,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,CAAC,GAAG,CAAC,EAAE;YACvD,MAAM,EAAE,QAAQ;SACjB,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AATC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,UAAU,CAAC,CAAC;;qCACxB,KAAK;;8CAMlC;AATH,kCAWC"}
1
+ {"version":3,"file":"DeleteByIds.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/DeleteByIds.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,WAAY,SAAQ,0BAAe;IAGvC,WAAW,CAAC,SAAwB;QACzC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,SAAS,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,CAAC,GAAG,CAAC,EAAE;YACvD,MAAM,EAAE,QAAQ;SACjB,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAXD,kCAWC;AARQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,UAAU,CAAC,CAAC;;qCACxB,KAAK;;8CAMlC"}
@@ -17,18 +17,18 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class GetAll extends abstract_1.AbstractCRUDApi {
18
18
  getAll() {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}`,
22
22
  method: 'GET'
23
23
  };
24
24
  }
25
25
  ;
26
26
  }
27
+ exports.GetAll = GetAll;
27
28
  __decorate([
28
29
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.QueryBulk)),
29
30
  __metadata("design:type", Function),
30
31
  __metadata("design:paramtypes", []),
31
32
  __metadata("design:returntype", Object)
32
33
  ], GetAll.prototype, "getAll", null);
33
- exports.GetAll = GetAll;
34
34
  //# sourceMappingURL=GetAll.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GetAll.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetAll.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAO,SAAQ,0BAAe;IAGlC,MAAM;QACX,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,KAAK;SACd,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AATC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,SAAS,CAAC,CAAC;;;;oCAOpD;AATH,wBAWC"}
1
+ {"version":3,"file":"GetAll.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetAll.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAO,SAAQ,0BAAe;IAGlC,MAAM;QACX,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,KAAK;SACd,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAXD,wBAWC;AARQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,SAAS,CAAC,CAAC;;;;oCAOpD"}
@@ -17,7 +17,7 @@ const sync_2 = require("../../sync");
17
17
  class GetByFilters extends abstract_1.AbstractCRUDApi {
18
18
  getByFilters(query) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}/query`,
22
22
  method: 'POST',
23
23
  data: query
@@ -25,11 +25,11 @@ class GetByFilters extends abstract_1.AbstractCRUDApi {
25
25
  }
26
26
  ;
27
27
  }
28
+ exports.GetByFilters = GetByFilters;
28
29
  __decorate([
29
30
  (0, callout_1.Calloutable)((0, sync_2.PushCrudEvent)(sync_1.CrudSyncAction.QueryBulk)),
30
31
  __metadata("design:type", Function),
31
32
  __metadata("design:paramtypes", [Object]),
32
33
  __metadata("design:returntype", Object)
33
34
  ], GetByFilters.prototype, "getByFilters", null);
34
- exports.GetByFilters = GetByFilters;
35
35
  //# sourceMappingURL=GetByFilters.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GetByFilters.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetByFilters.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,qCAAyC;AAGzC,MAAa,YAAgB,SAAQ,0BAAe;IAG3C,YAAY,CAAC,KAA0B;QAC5C,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,QAAQ;YAChC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;SACZ,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,oBAAa,EAAC,qBAAc,CAAC,SAAS,CAAC,CAAC;;;;gDAQpD;AAVH,oCAYC"}
1
+ {"version":3,"file":"GetByFilters.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetByFilters.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,qCAAyC;AAGzC,MAAa,YAAgB,SAAQ,0BAAe;IAG3C,YAAY,CAAC,KAA0B;QAC5C,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,QAAQ;YAChC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;SACZ,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,oCAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,oBAAa,EAAC,qBAAc,CAAC,SAAS,CAAC,CAAC;;;;gDAQpD"}
@@ -17,18 +17,18 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class GetById extends abstract_1.AbstractCRUDApi {
18
18
  getById(entityId) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}/${entityId}`,
22
22
  method: 'GET',
23
23
  };
24
24
  }
25
25
  ;
26
26
  }
27
+ exports.GetById = GetById;
27
28
  __decorate([
28
29
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.Query)),
29
30
  __metadata("design:type", Function),
30
31
  __metadata("design:paramtypes", [String]),
31
32
  __metadata("design:returntype", Object)
32
33
  ], GetById.prototype, "getById", null);
33
- exports.GetById = GetById;
34
34
  //# sourceMappingURL=GetById.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GetById.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetById.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,OAAQ,SAAQ,0BAAe;IAGnC,OAAO,CAAC,QAAgB;QAC7B,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,IAAI,QAAQ,EAAE;YACtC,MAAM,EAAE,KAAK;SACd,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AATC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,KAAK,CAAC,CAAC;;;;sCAOhD;AATH,0BAWC"}
1
+ {"version":3,"file":"GetById.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetById.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,OAAQ,SAAQ,0BAAe;IAGnC,OAAO,CAAC,QAAgB;QAC7B,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,IAAI,QAAQ,EAAE;YACtC,MAAM,EAAE,KAAK;SACd,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAXD,0BAWC;AARQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,KAAK,CAAC,CAAC;;;;sCAOhD"}
@@ -17,7 +17,7 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class GetByIds extends abstract_1.AbstractCRUDApi {
18
18
  getByIds(entityIds) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}/ids`,
22
22
  method: 'POST',
23
23
  data: entityIds
@@ -25,11 +25,11 @@ class GetByIds extends abstract_1.AbstractCRUDApi {
25
25
  }
26
26
  ;
27
27
  }
28
+ exports.GetByIds = GetByIds;
28
29
  __decorate([
29
30
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.QueryBulk)),
30
31
  __metadata("design:type", Function),
31
32
  __metadata("design:paramtypes", [Array]),
32
33
  __metadata("design:returntype", Object)
33
34
  ], GetByIds.prototype, "getByIds", null);
34
- exports.GetByIds = GetByIds;
35
35
  //# sourceMappingURL=GetByIds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GetByIds.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetByIds.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,QAAS,SAAQ,0BAAe;IAGpC,QAAQ,CAAC,SAAwB;QACtC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,MAAM;YAC9B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;SAChB,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,SAAS,CAAC,CAAC;;qCAC1B,KAAK;;wCAO/B;AAVH,4BAYC"}
1
+ {"version":3,"file":"GetByIds.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/GetByIds.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,QAAS,SAAQ,0BAAe;IAGpC,QAAQ,CAAC,SAAwB;QACtC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,MAAM;YAC9B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,SAAS;SAChB,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,4BAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,SAAS,CAAC,CAAC;;qCAC1B,KAAK;;wCAO/B"}
@@ -17,7 +17,7 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class Update extends abstract_1.AbstractCRUDApi {
18
18
  update(entity) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}`,
22
22
  method: 'PATCH',
23
23
  data: entity
@@ -25,11 +25,11 @@ class Update extends abstract_1.AbstractCRUDApi {
25
25
  }
26
26
  ;
27
27
  }
28
+ exports.Update = Update;
28
29
  __decorate([
29
30
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.Update)),
30
31
  __metadata("design:type", Function),
31
32
  __metadata("design:paramtypes", [Object]),
32
33
  __metadata("design:returntype", Object)
33
34
  ], Update.prototype, "update", null);
34
- exports.Update = Update;
35
35
  //# sourceMappingURL=Update.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/Update.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAU,SAAQ,0BAAe;IAGrC,MAAM,CAAC,MAAS;QACrB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;oCAQjD;AAVH,wBAYC"}
1
+ {"version":3,"file":"Update.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/Update.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAU,SAAQ,0BAAe;IAGrC,MAAM,CAAC,MAAS;QACrB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,wBAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;oCAQjD"}
@@ -17,7 +17,7 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class UpdateBulk extends abstract_1.AbstractCRUDApi {
18
18
  updateBulk(entities) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}/bulk`,
22
22
  method: 'PATCH',
23
23
  data: entities
@@ -25,11 +25,11 @@ class UpdateBulk extends abstract_1.AbstractCRUDApi {
25
25
  }
26
26
  ;
27
27
  }
28
+ exports.UpdateBulk = UpdateBulk;
28
29
  __decorate([
29
30
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.UpdateBulk)),
30
31
  __metadata("design:type", Function),
31
32
  __metadata("design:paramtypes", [Array]),
32
33
  __metadata("design:returntype", Object)
33
34
  ], UpdateBulk.prototype, "updateBulk", null);
34
- exports.UpdateBulk = UpdateBulk;
35
35
  //# sourceMappingURL=UpdateBulk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateBulk.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/UpdateBulk.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,UAAc,SAAQ,0BAAe;IAGzC,UAAU,CAAC,QAAkB;QAClC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,OAAO;YAC/B,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,QAAQ;SACf,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,UAAU,CAAC,CAAC;;qCAC1B,KAAK;;4CAOhC;AAVH,gCAYC"}
1
+ {"version":3,"file":"UpdateBulk.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/UpdateBulk.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,UAAc,SAAQ,0BAAe;IAGzC,UAAU,CAAC,QAAkB;QAClC,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,OAAO;YAC/B,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,QAAQ;SACf,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,gCAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,UAAU,CAAC,CAAC;;qCAC1B,KAAK;;4CAOhC"}
@@ -17,7 +17,7 @@ const middlewares_1 = require("../../sync/middlewares");
17
17
  class Upsert extends abstract_1.AbstractCRUDApi {
18
18
  upsert(entity) {
19
19
  return {
20
- baseURL: this.serverName,
20
+ baseURL: this.serverUrl,
21
21
  url: `/${this.objectName}`,
22
22
  method: 'PUT',
23
23
  data: entity
@@ -25,11 +25,11 @@ class Upsert extends abstract_1.AbstractCRUDApi {
25
25
  }
26
26
  ;
27
27
  }
28
+ exports.Upsert = Upsert;
28
29
  __decorate([
29
30
  (0, callout_1.Calloutable)((0, middlewares_1.PushCrudEvent)(sync_1.CrudSyncAction.Upsert)),
30
31
  __metadata("design:type", Function),
31
32
  __metadata("design:paramtypes", [Object]),
32
33
  __metadata("design:returntype", Object)
33
34
  ], Upsert.prototype, "upsert", null);
34
- exports.Upsert = Upsert;
35
35
  //# sourceMappingURL=Upsert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Upsert.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/Upsert.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAU,SAAQ,0BAAe;IAGrC,MAAM,CAAC,MAAS;QACrB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,UAAU;YACxB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAVC;IAAC,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;oCAQjD;AAVH,wBAYC"}
1
+ {"version":3,"file":"Upsert.js","sourceRoot":"","sources":["../../../../../src/features/crud/operations/operations/Upsert.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4C;AAE5C,8CAA6C;AAC7C,qCAA0C;AAC1C,wDAAqD;AAErD,MAAa,MAAU,SAAQ,0BAAe;IAGrC,MAAM,CAAC,MAAS;QACrB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,SAAS;YACvB,GAAG,EAAE,IAAI,IAAI,CAAC,UAAU,EAAE;YAC1B,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,MAAM;SACb,CAAA;IACH,CAAC;IAAA,CAAC;CAEH;AAZD,wBAYC;AATQ;IADN,IAAA,qBAAW,EAAC,IAAA,2BAAa,EAAC,qBAAc,CAAC,MAAM,CAAC,CAAC;;;;oCAQjD"}