@zajno/common 2.2.15 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/api/call.d.ts +30 -0
  2. package/api/call.d.ts.map +1 -0
  3. package/api/call.js +60 -0
  4. package/api/call.js.map +1 -0
  5. package/api/endpoint.d.ts +27 -0
  6. package/api/endpoint.d.ts.map +1 -0
  7. package/api/endpoint.js +55 -0
  8. package/api/endpoint.js.map +1 -0
  9. package/api/endpoint.types.d.ts +40 -0
  10. package/api/endpoint.types.d.ts.map +1 -0
  11. package/api/endpoint.types.js +11 -0
  12. package/api/endpoint.types.js.map +1 -0
  13. package/api/error.d.ts +18 -0
  14. package/api/error.d.ts.map +1 -0
  15. package/api/error.js +35 -0
  16. package/api/error.js.map +1 -0
  17. package/api/helpers.d.ts +9 -0
  18. package/api/helpers.d.ts.map +1 -0
  19. package/api/helpers.js +27 -0
  20. package/api/helpers.js.map +1 -0
  21. package/api/index.d.ts +9 -0
  22. package/api/index.d.ts.map +1 -0
  23. package/api/index.js +17 -0
  24. package/api/index.js.map +1 -0
  25. package/api/logging.d.ts +14 -0
  26. package/api/logging.d.ts.map +1 -0
  27. package/api/logging.js +28 -0
  28. package/api/logging.js.map +1 -0
  29. package/api/methods.d.ts +7 -0
  30. package/api/methods.d.ts.map +1 -0
  31. package/api/methods.js +11 -0
  32. package/api/methods.js.map +1 -0
  33. package/api/processor.d.ts +8 -0
  34. package/api/processor.d.ts.map +1 -0
  35. package/api/processor.js +51 -0
  36. package/api/processor.js.map +1 -0
  37. package/api/register.d.ts +8 -0
  38. package/api/register.d.ts.map +1 -0
  39. package/api/register.js +25 -0
  40. package/api/register.js.map +1 -0
  41. package/api/statusCodes.d.ts +17 -0
  42. package/api/statusCodes.d.ts.map +1 -0
  43. package/api/statusCodes.js +21 -0
  44. package/api/statusCodes.js.map +1 -0
  45. package/dates/datex.d.ts +2 -2
  46. package/dates/datex.d.ts.map +1 -1
  47. package/dates/datex.js +2 -4
  48. package/dates/datex.js.map +1 -1
  49. package/fields/update.js +2 -2
  50. package/fields/update.js.map +1 -1
  51. package/functions/throttle.d.ts.map +1 -1
  52. package/functions/throttle.js.map +1 -1
  53. package/logger/named.d.ts.map +1 -1
  54. package/logger/named.js +3 -3
  55. package/logger/named.js.map +1 -1
  56. package/math/arrays.d.ts +3 -3
  57. package/math/arrays.d.ts.map +1 -1
  58. package/math/arrays.js +1 -1
  59. package/math/arrays.js.map +1 -1
  60. package/math/object/math.d.ts.map +1 -1
  61. package/math/object/math.js +6 -3
  62. package/math/object/math.js.map +1 -1
  63. package/math/object/ops.d.ts +1 -1
  64. package/math/object/ops.d.ts.map +1 -1
  65. package/math/object/ops.js.map +1 -1
  66. package/observing/event.d.ts.map +1 -1
  67. package/observing/event.js +9 -1
  68. package/observing/event.js.map +1 -1
  69. package/package.json +1 -1
  70. package/storage/abstractions.d.ts +0 -1
  71. package/storage/abstractions.d.ts.map +1 -1
  72. package/storage/index.d.ts +2 -0
  73. package/storage/index.d.ts.map +1 -1
  74. package/storage/index.js +2 -0
  75. package/storage/index.js.map +1 -1
  76. package/storage/keyStorage.d.ts +12 -18
  77. package/storage/keyStorage.d.ts.map +1 -1
  78. package/storage/keyStorage.js +21 -23
  79. package/storage/keyStorage.js.map +1 -1
  80. package/storage/keyStorage.sync.d.ts +21 -0
  81. package/storage/keyStorage.sync.d.ts.map +1 -0
  82. package/storage/keyStorage.sync.js +40 -0
  83. package/storage/keyStorage.sync.js.map +1 -0
  84. package/structures/path/builder.d.ts +16 -0
  85. package/structures/path/builder.d.ts.map +1 -0
  86. package/structures/path/builder.js +128 -0
  87. package/structures/path/builder.js.map +1 -0
  88. package/structures/path/index.d.ts +3 -0
  89. package/structures/path/index.d.ts.map +1 -0
  90. package/structures/path/index.js +7 -0
  91. package/structures/path/index.js.map +1 -0
  92. package/structures/path/types.d.ts +53 -0
  93. package/structures/path/types.d.ts.map +1 -0
  94. package/{abstractions/controllers/IPluggableController.js → structures/path/types.js} +1 -1
  95. package/structures/path/types.js.map +1 -0
  96. package/structures/path/utils.d.ts +12 -0
  97. package/structures/path/utils.d.ts.map +1 -0
  98. package/structures/path/utils.js +54 -0
  99. package/structures/path/utils.js.map +1 -0
  100. package/structures/promiseExtended.d.ts +1 -1
  101. package/structures/promiseExtended.d.ts.map +1 -1
  102. package/structures/promiseExtended.js.map +1 -1
  103. package/structures/promiseProxy.d.ts.map +1 -1
  104. package/structures/promiseProxy.js +3 -2
  105. package/structures/promiseProxy.js.map +1 -1
  106. package/types/misc.d.ts +12 -3
  107. package/types/misc.d.ts.map +1 -1
  108. package/validation/throwers.js.map +1 -1
  109. package/abstractions/controllers/IPluggableController.d.ts +0 -5
  110. package/abstractions/controllers/IPluggableController.d.ts.map +0 -1
  111. package/abstractions/controllers/IPluggableController.js.map +0 -1
  112. package/async/arrays.extend.d.ts +0 -10
  113. package/async/arrays.extend.d.ts.map +0 -1
  114. package/async/arrays.extend.js +0 -8
  115. package/async/arrays.extend.js.map +0 -1
  116. package/controllers/PluggableController.d.ts +0 -13
  117. package/controllers/PluggableController.d.ts.map +0 -1
  118. package/controllers/PluggableController.js +0 -29
  119. package/controllers/PluggableController.js.map +0 -1
package/api/call.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { AnyObject } from '../types';
2
+ import { IEndpointInfo } from './endpoint';
3
+ import { EndpointMethods } from './methods';
4
+ import { LogTypes } from './logging';
5
+ type Extra<T> = {
6
+ headers?: IEndpointInfo.ExtractHeaders<T>;
7
+ log?: LogTypes<IEndpointInfo.ExtractIn<T>, IEndpointInfo.ExtractOut<T>>;
8
+ noLoader?: boolean;
9
+ };
10
+ export type RequestConfig<TIn> = {
11
+ method: EndpointMethods | string & Record<never, never>;
12
+ url: string;
13
+ data: TIn | null | undefined;
14
+ headers: AnyObject;
15
+ };
16
+ export type RequestConfigDetails<T extends IEndpointInfo = IEndpointInfo, TIn = IEndpointInfo.ExtractIn<T>> = RequestConfig<TIn> & {
17
+ _api: T;
18
+ _noLoader?: boolean;
19
+ _log?: LogTypes;
20
+ };
21
+ type CallerOptions = {
22
+ bodyValidation?: (api: IEndpointInfo, input: any) => Promise<void>;
23
+ request: <TIn, TOut>(config: RequestConfigDetails<IEndpointInfo, TIn>) => Promise<{
24
+ data: TOut;
25
+ }>;
26
+ };
27
+ export type EndpointCallArgs<T extends IEndpointInfo> = IEndpointInfo.ExtractIn<T> | IEndpointInfo.ExtractPath<T> | IEndpointInfo.ExtractQuery<T>;
28
+ export declare function buildApiCaller(options: CallerOptions): <T extends IEndpointInfo>(api: T, data: EndpointCallArgs<T>, extra?: Extra<T> | undefined) => Promise<IEndpointInfo.ExtractOut<T>>;
29
+ export {};
30
+ //# sourceMappingURL=call.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.d.ts","sourceRoot":"","sources":["../../src/api/call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,KAAK,KAAK,CAAC,CAAC,IAAI;IACZ,OAAO,CAAC,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAC1C,GAAG,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,GAAG,IAAI;IAC7B,MAAM,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxD,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,EAAE,GAAG,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,GAAG;IAC/H,IAAI,EAAE,CAAC,CAAC;IACR,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,oBAAoB,CAAC,aAAa,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;CACrG,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAElJ,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,sIAuEpD"}
package/api/call.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildApiCaller = void 0;
4
+ const register_1 = require("./register");
5
+ function buildApiCaller(options) {
6
+ const { bodyValidation, request } = options;
7
+ return async function callApi(api, data, extra) {
8
+ const { headers, log = 'res' } = extra || {};
9
+ const resultInput = data && { ...data };
10
+ const pathInputs = {};
11
+ let queryStr = '';
12
+ const pathKeys = api.pathBuilder.args;
13
+ if (resultInput && pathKeys?.length) {
14
+ for (const key of pathKeys) {
15
+ pathInputs[key] = resultInput[key];
16
+ delete resultInput[key];
17
+ }
18
+ }
19
+ const queryKeysExpected = api.queryKeys;
20
+ if (resultInput && queryKeysExpected?.length) {
21
+ const queryInputs = {};
22
+ let empty = true;
23
+ for (const key of queryKeysExpected) {
24
+ const v = resultInput[key];
25
+ if (v || v === 0) {
26
+ queryInputs[key] = v;
27
+ empty = false;
28
+ }
29
+ delete resultInput[key];
30
+ }
31
+ if (!empty) {
32
+ const params = new URLSearchParams(queryInputs);
33
+ queryStr = '?' + params.toString();
34
+ }
35
+ }
36
+ if (resultInput && bodyValidation) {
37
+ await bodyValidation(api, resultInput);
38
+ }
39
+ const sendingData = resultInput && Object.keys(resultInput).length > 0
40
+ ? resultInput
41
+ : undefined;
42
+ const method = api.method || 'GET';
43
+ const config = {
44
+ method,
45
+ url: api.pathBuilder.build(pathInputs) + queryStr,
46
+ data: register_1.PreProcessors.process(api, sendingData) || undefined,
47
+ headers: headers || {},
48
+ _api: api,
49
+ _noLoader: extra?.noLoader == null ? method === 'GET' : extra.noLoader,
50
+ _log: log,
51
+ };
52
+ if (api.isForm) {
53
+ config.headers['Content-Type'] = 'multipart/form-data';
54
+ }
55
+ const response = await request(config);
56
+ return register_1.PostProcessors.process(api, response.data);
57
+ };
58
+ }
59
+ exports.buildApiCaller = buildApiCaller;
60
+ //# sourceMappingURL=call.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"call.js","sourceRoot":"","sources":["../../src/api/call.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAgC3D,SAAgB,cAAc,CAAC,OAAsB;IAEjD,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAE5C,OAAO,KAAK,UAAU,OAAO,CACzB,GAAM,EACN,IAAyB,EACzB,KAAgB;QAKhB,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,KAAK,EAAE,GAAG,KAAK,IAAI,EAAE,CAAC;QAE7C,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,GAA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AAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC;YAClE,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,SAAS,CAAC;QAEhB,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,IAAI,KAAK,CAAC;QACnC,MAAM,MAAM,GAA4B;YACpC,MAAM;YACN,GAAG,EAAE,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,QAAQ;YACjD,IAAI,EAAE,wBAAa,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,IAAI,SAAS;YAC1D,OAAO,EAAE,OAAoB,IAAI,EAAE;YACnC,IAAI,EAAE,GAAG;YACT,SAAS,EAAE,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,MAAgB,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ;YAChF,IAAI,EAAE,GAAG;SACZ,CAAC;QAEF,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,GAAG,qBAAqB,CAAC;QAC3D,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAmB,CAAC;QACzD,OAAO,yBAAc,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC;AACN,CAAC;AAvED,wCAuEC"}
@@ -0,0 +1,27 @@
1
+ import { AnyObject } from '../types';
2
+ import { Path } from '../structures/path';
3
+ import { EndpointMethods } from './methods';
4
+ import { IEndpointInfo } from './endpoint.types';
5
+ export type { IEndpointInfo };
6
+ export declare class ApiEndpoint<TIn extends object | null, TOut, TPath extends readonly string[], TQuery extends object, TErrors, THeaders> implements IEndpointInfo, IEndpointInfo.IIn<TIn>, IEndpointInfo.IOut<TOut>, IEndpointInfo.IPath<TPath>, IEndpointInfo.IQuery<TQuery>, IEndpointInfo.IErrors<TErrors>, IEndpointInfo.IHeaders<THeaders> {
7
+ method: EndpointMethods;
8
+ path: Path.SwitchBuilder<TPath>;
9
+ isForm?: boolean;
10
+ displayName?: string;
11
+ in?: TIn;
12
+ out?: TOut;
13
+ queryKeys?: (string & keyof TQuery)[];
14
+ errors?: TErrors;
15
+ headers?: THeaders;
16
+ get pathBuilder(): Path.IBuilder;
17
+ static construct<TIn extends object | null, TOut>(method?: EndpointMethods, displayName?: string): ApiEndpoint<TIn, TOut, readonly [], object, any, AnyObject>;
18
+ static get<TOut>(displayName?: string): ApiEndpoint<null, TOut, readonly [], object, any, AnyObject>;
19
+ static post<TIn extends object | null, TOut = void>(displayName?: string): ApiEndpoint<TIn, TOut, readonly [], object, any, AnyObject>;
20
+ static delete<TOut>(displayName?: string): ApiEndpoint<null, TOut, readonly [], object, any, AnyObject>;
21
+ withPath<P extends Path.BaseInput[]>(...path: P): ApiEndpoint<TIn, TOut, Path.ExtractArgs<Path.CombineBuilders<P>>, TQuery, TErrors, THeaders>;
22
+ withQuery<TQ extends object>(...queryKeys: (string & keyof TQ)[]): ApiEndpoint<TIn, TOut, TPath, TQ, TErrors, THeaders>;
23
+ withErrors<TErr>(_errors?: TErr): ApiEndpoint<TIn, TOut, TPath, TQuery, TErr, THeaders>;
24
+ withHeaders<THeads>(_headersMarker?: THeads): ApiEndpoint<TIn, TOut, TPath, TQuery, TErrors, THeads>;
25
+ asForm(): this;
26
+ }
27
+ //# sourceMappingURL=endpoint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/api/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B,qBA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,SAAS,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;IAS9I,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC;IAMvH,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC;IAIvF,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC;IAIpG,MAAM;CAIhB"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiEndpoint = void 0;
4
+ const path_1 = require("../structures/path");
5
+ const methods_1 = require("./methods");
6
+ class ApiEndpoint {
7
+ method = methods_1.EndpointMethods.GET;
8
+ path = path_1.Path.Empty.as();
9
+ isForm;
10
+ displayName;
11
+ in;
12
+ out;
13
+ queryKeys;
14
+ errors;
15
+ headers;
16
+ get pathBuilder() { return this.path.as(); }
17
+ static construct(method = methods_1.EndpointMethods.GET, displayName) {
18
+ const res = new ApiEndpoint();
19
+ res.method = method;
20
+ res.displayName = displayName;
21
+ return res;
22
+ }
23
+ static get(displayName) {
24
+ return ApiEndpoint.construct(methods_1.EndpointMethods.GET, displayName);
25
+ }
26
+ static post(displayName) {
27
+ return ApiEndpoint.construct(methods_1.EndpointMethods.POST, displayName);
28
+ }
29
+ static delete(displayName) {
30
+ return ApiEndpoint.construct(methods_1.EndpointMethods.DELETE, displayName);
31
+ }
32
+ withPath(...path) {
33
+ const res = this;
34
+ const p = path_1.Path.construct(...path);
35
+ res.path = p;
36
+ return res;
37
+ }
38
+ withQuery(...queryKeys) {
39
+ const res = this;
40
+ res.queryKeys = queryKeys;
41
+ return res;
42
+ }
43
+ withErrors(_errors) {
44
+ return this;
45
+ }
46
+ withHeaders(_headersMarker) {
47
+ return this;
48
+ }
49
+ asForm() {
50
+ this.isForm = true;
51
+ return this;
52
+ }
53
+ }
54
+ exports.ApiEndpoint = ApiEndpoint;
55
+ //# sourceMappingURL=endpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/api/endpoint.ts"],"names":[],"mappings":";;;AACA,6CAA0C;AAC1C,uCAA4C;AAK5C,MAAa,WAAW;IAgBpB,MAAM,GAAoB,yBAAe,CAAC,GAAG,CAAC;IAC9C,IAAI,GAA8B,WAAI,CAAC,KAAK,CAAC,EAAE,EAA6B,CAAC;IAE7E,MAAM,CAAW;IACjB,WAAW,CAAU;IAErB,EAAE,CAAO;IACT,GAAG,CAAQ;IACX,SAAS,CAA6B;IAEtC,MAAM,CAAW;IACjB,OAAO,CAAY;IAEnB,IAAW,WAAW,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,EAAiB,CAAC,CAAC,CAAC;IAElE,MAAM,CAAC,SAAS,CAAkC,SAA0B,yBAAe,CAAC,GAAG,EAAE,WAAoB;QACjH,MAAM,GAAG,GAAG,IAAI,WAAW,EAAkD,CAAC;QAC9E,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC;QACpB,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC;QAC9B,OAAO,GAAG,CAAC;IACf,CAAC;IAED,MAAM,CAAC,GAAG,CAAO,WAAoB;QACjC,OAAO,WAAW,CAAC,SAAS,CAAa,yBAAe,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,IAAI,CAAyC,WAAoB;QACpE,OAAO,WAAW,CAAC,SAAS,CAAY,yBAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC/E,CAAC;IAED,MAAM,CAAC,MAAM,CAAO,WAAoB;QACpC,OAAO,WAAW,CAAC,SAAS,CAAa,yBAAe,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClF,CAAC;IAEM,QAAQ,CAA6B,GAAG,IAAO;QAGlD,MAAM,GAAG,GAAG,IAA0E,CAAC;QACvF,MAAM,CAAC,GAAG,WAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC;QAClC,GAAG,CAAC,IAAI,GAAG,CAAwC,CAAC;QACpD,OAAO,GAAG,CAAC;IACf,CAAC;IAEM,SAAS,CAAoB,GAAG,SAAgC;QACnE,MAAM,GAAG,GAAG,IAAuE,CAAC;QACpF,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;QAC1B,OAAO,GAAG,CAAC;IACf,CAAC;IAEM,UAAU,CAAO,OAAc;QAClC,OAAO,IAAwE,CAAC;IACpF,CAAC;IAEM,WAAW,CAAS,cAAuB;QAC9C,OAAO,IAAyE,CAAC;IACrF,CAAC;IAEM,MAAM;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AA7ED,kCA6EC"}
@@ -0,0 +1,40 @@
1
+ import { Path } from '../structures/path';
2
+ import { AnyObject, Coalesce, EmptyObjectNullable } from '../types/misc';
3
+ import { EndpointMethods } from './methods';
4
+ export interface IEndpointInfo {
5
+ readonly method: EndpointMethods;
6
+ readonly isForm?: boolean;
7
+ readonly pathBuilder: Path.IBuilder;
8
+ readonly displayName?: string;
9
+ readonly queryKeys?: string[];
10
+ }
11
+ export declare namespace IEndpointInfo {
12
+ export interface IIn<TIn extends object | null> {
13
+ readonly in?: TIn;
14
+ }
15
+ export class IOut<TOut> {
16
+ readonly out?: TOut;
17
+ }
18
+ export interface IPath<TPath extends readonly string[]> {
19
+ readonly path: Path.SwitchBuilder<TPath>;
20
+ }
21
+ export interface IQuery<TQuery extends object> {
22
+ readonly queryKeys?: (string & keyof TQuery)[];
23
+ }
24
+ export interface IErrors<TErrors> {
25
+ readonly errors?: TErrors;
26
+ }
27
+ export interface IHeaders<THeaders> {
28
+ readonly headers?: THeaders;
29
+ }
30
+ type Any = AnyObject;
31
+ type Empty = EmptyObjectNullable;
32
+ export type ExtractIn<T> = T extends IIn<infer TIn> ? Coalesce<TIn> : Empty;
33
+ export type ExtractPath<T> = T extends IPath<infer TPath extends string[]> ? (readonly [] extends TPath ? Empty : Path.ObjectBuilderArgs<TPath[number]>) : Empty;
34
+ export type ExtractQuery<T> = T extends IQuery<infer TQuery> ? TQuery : Empty;
35
+ export type ExtractOut<T> = T extends IOut<infer TOut> ? TOut : never;
36
+ export type ExtractErrors<T> = T extends IErrors<infer TErrors> ? TErrors : Any;
37
+ export type ExtractHeaders<T> = T extends IHeaders<infer THeaders> ? THeaders : Any;
38
+ export {};
39
+ }
40
+ //# sourceMappingURL=endpoint.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.types.d.ts","sourceRoot":"","sources":["../../src/api/endpoint.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC1B,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAE1B,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC;IAEpC,QAAQ,CAAC,WAAW,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C;IAEZ,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,MAAM,MAAM,CAAC,GACtD,MAAM,GACN,KAAK,CAAC;IAEZ,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM,IAAI,CAAC,GAChD,IAAI,GACJ,KAAK,CAAC;IAEZ,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,GAAG,CAAC;IAChF,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,QAAQ,CAAC,MAAM,QAAQ,CAAC,GAAG,QAAQ,GAAG,GAAG,CAAC;;CACvF"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IEndpointInfo = void 0;
4
+ var IEndpointInfo;
5
+ (function (IEndpointInfo) {
6
+ class IOut {
7
+ out;
8
+ }
9
+ IEndpointInfo.IOut = IOut;
10
+ })(IEndpointInfo || (exports.IEndpointInfo = IEndpointInfo = {}));
11
+ //# sourceMappingURL=endpoint.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"endpoint.types.js","sourceRoot":"","sources":["../../src/api/endpoint.types.ts"],"names":[],"mappings":";;;AAeA,IAAiB,aAAa,CA+C7B;AA/CD,WAAiB,aAAa;IAM1B,MAAa,IAAI;QACJ,GAAG,CAAQ;KACvB;IAFY,kBAAI,OAEhB,CAAA;AAuCL,CAAC,EA/CgB,aAAa,6BAAb,aAAa,QA+C7B"}
package/api/error.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ import { StatusCodes } from './statusCodes';
2
+ export type ApiErrorResponse<TCause = never, TErrors = number | string> = {
3
+ code?: TErrors;
4
+ message?: string;
5
+ } & ([TCause] extends [never] ? object : {
6
+ cause?: TCause;
7
+ });
8
+ export declare namespace ApiErrorResponse {
9
+ function create<TCause = never, TErrors = number | string>(code: TErrors, message?: string, cause?: TCause): ApiErrorResponse<TCause, TErrors>;
10
+ }
11
+ export declare class ApiError<TCause = unknown, TCodes extends number = StatusCodes, TErrors extends number | string = number | string> extends Error {
12
+ readonly status: TCodes;
13
+ readonly code: TErrors;
14
+ readonly cause?: TCause;
15
+ constructor(status: TCodes, code: TErrors, message: string, cause?: TCause);
16
+ static fromResponse<TCodes extends number = StatusCodes, TErrors extends number | string = number | string>(status: TCodes, responseData: unknown): ApiError<unknown, TCodes, 0> | ApiError<unknown, TCodes, TErrors>;
17
+ }
18
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/api/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,MAAM,gBAAgB,CAAC,MAAM,GAAG,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,IAAI;IACtE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE7D,yBAAiB,gBAAgB,CAAC;IAC9B,SAAgB,MAAM,CAAC,MAAM,GAAG,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAEpJ;CACJ;AAGD,qBAAa,QAAQ,CACjB,MAAM,GAAG,OAAO,EAChB,MAAM,SAAS,MAAM,GAAG,WAAW,EACnC,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CACnD,SAAQ,KAAK;aAKS,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,OAAO;IAJjC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;gBAGJ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,EAC7B,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM;WASJ,YAAY,CAAC,MAAM,SAAS,MAAM,GAAG,WAAW,EAAE,OAAO,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO;CAoB3J"}
package/api/error.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApiError = exports.ApiErrorResponse = void 0;
4
+ var ApiErrorResponse;
5
+ (function (ApiErrorResponse) {
6
+ function create(code, message, cause) {
7
+ return { code, message, cause };
8
+ }
9
+ ApiErrorResponse.create = create;
10
+ })(ApiErrorResponse || (exports.ApiErrorResponse = ApiErrorResponse = {}));
11
+ class ApiError extends Error {
12
+ status;
13
+ code;
14
+ cause;
15
+ constructor(status, code, message, cause) {
16
+ super(message, { cause });
17
+ this.status = status;
18
+ this.code = code;
19
+ this.cause = cause;
20
+ this.name = 'ApiError';
21
+ Object.setPrototypeOf(this, ApiError.prototype);
22
+ }
23
+ static fromResponse(status, responseData) {
24
+ const response = responseData;
25
+ if (!response || response.code == null) {
26
+ return new ApiError(status, 0, [
27
+ 'An unknown error has occurred. Please try again later.',
28
+ response?.message && `Message: ${response.message}`,
29
+ ].filter(Boolean).join('\n'));
30
+ }
31
+ return new ApiError(status, response.code, response.message || '<no message>', response.cause);
32
+ }
33
+ }
34
+ exports.ApiError = ApiError;
35
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/api/error.ts"],"names":[],"mappings":";;;AAOA,IAAiB,gBAAgB,CAIhC;AAJD,WAAiB,gBAAgB;IAC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
+ templateArgPrefix: string;
4
+ basePrefix: string;
5
+ };
6
+ export declare function setDefaults(settings: Partial<typeof DefaultSettings>): void;
7
+ export declare function getPath<T extends IEndpointInfo>(endpoint: T, pathArgs?: IEndpointInfo.ExtractPath<T>): string;
8
+ export declare function getFormattedDisplayName(endpoint: IEndpointInfo): string;
9
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/api/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,eAAe;;;CAG3B,CAAC;AAEF,wBAAgB,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,OAAO,eAAe,CAAC,QAEpE;AAED,wBAAgB,OAAO,CAAC,CAAC,SAAS,aAAa,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,UAKpG;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,aAAa,UAM9D"}
package/api/helpers.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFormattedDisplayName = exports.getPath = exports.setDefaults = exports.DefaultSettings = void 0;
4
+ exports.DefaultSettings = {
5
+ templateArgPrefix: ':',
6
+ basePrefix: '/',
7
+ };
8
+ function setDefaults(settings) {
9
+ Object.assign(exports.DefaultSettings, settings);
10
+ }
11
+ exports.setDefaults = setDefaults;
12
+ function getPath(endpoint, pathArgs) {
13
+ if (pathArgs) {
14
+ return endpoint.pathBuilder.build(pathArgs, { addStart: exports.DefaultSettings.basePrefix });
15
+ }
16
+ return endpoint.pathBuilder.template(exports.DefaultSettings.templateArgPrefix, { addStart: exports.DefaultSettings.basePrefix });
17
+ }
18
+ exports.getPath = getPath;
19
+ function getFormattedDisplayName(endpoint) {
20
+ const template = endpoint.pathBuilder.template(exports.DefaultSettings.templateArgPrefix, { addStart: exports.DefaultSettings.basePrefix });
21
+ const prefix = endpoint.displayName
22
+ ? `[${endpoint.displayName}] `
23
+ : '';
24
+ return prefix + template;
25
+ }
26
+ exports.getFormattedDisplayName = getFormattedDisplayName;
27
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/api/helpers.ts"],"names":[],"mappings":";;;AAGa,QAAA,eAAe,GAAG;IAC3B,iBAAiB,EAAE,GAAoC;IACvD,UAAU,EAAE,GAAG;CAClB,CAAC;AAEF,SAAgB,WAAW,CAAC,QAAyC;IACjE,MAAM,CAAC,MAAM,CAAC,uBAAe,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAFD,kCAEC;AAED,SAAgB,OAAO,CAA0B,QAAW,EAAE,QAAuC;IACjG,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,uBAAe,CAAC,UAAU,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,uBAAe,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,uBAAe,CAAC,UAAU,EAAE,CAAC,CAAC;AACtH,CAAC;AALD,0BAKC;AAED,SAAgB,uBAAuB,CAAC,QAAuB;IAC3D,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,uBAAe,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,uBAAe,CAAC,UAAU,EAAE,CAAC,CAAC;IAC5H,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW;QAC/B,CAAC,CAAC,IAAI,QAAQ,CAAC,WAAW,IAAI;QAC9B,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,MAAM,GAAG,QAAQ,CAAC;AAC7B,CAAC;AAND,0DAMC"}
package/api/index.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ export type { ProcessingFn } from './processor';
2
+ export { ApiEndpoint } from './endpoint';
3
+ export type * from './endpoint.types';
4
+ export { EndpointMethods } from './methods';
5
+ export * from './helpers';
6
+ export { buildApiCaller } from './call';
7
+ export { registerPostProcessor, registerPreProcessor } from './register';
8
+ export { LogTypes } from './logging';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,mBAAmB,kBAAkB,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,cAAc,WAAW,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
package/api/index.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogTypes = exports.registerPreProcessor = exports.registerPostProcessor = exports.buildApiCaller = exports.EndpointMethods = exports.ApiEndpoint = void 0;
4
+ const tslib_1 = require("tslib");
5
+ var endpoint_1 = require("./endpoint");
6
+ Object.defineProperty(exports, "ApiEndpoint", { enumerable: true, get: function () { return endpoint_1.ApiEndpoint; } });
7
+ var methods_1 = require("./methods");
8
+ Object.defineProperty(exports, "EndpointMethods", { enumerable: true, get: function () { return methods_1.EndpointMethods; } });
9
+ tslib_1.__exportStar(require("./helpers"), exports);
10
+ var call_1 = require("./call");
11
+ Object.defineProperty(exports, "buildApiCaller", { enumerable: true, get: function () { return call_1.buildApiCaller; } });
12
+ var register_1 = require("./register");
13
+ Object.defineProperty(exports, "registerPostProcessor", { enumerable: true, get: function () { return register_1.registerPostProcessor; } });
14
+ Object.defineProperty(exports, "registerPreProcessor", { enumerable: true, get: function () { return register_1.registerPreProcessor; } });
15
+ var logging_1 = require("./logging");
16
+ Object.defineProperty(exports, "LogTypes", { enumerable: true, get: function () { return logging_1.LogTypes; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;AAGA,uCAAyC;AAAhC,uGAAA,WAAW,OAAA;AAEpB,qCAA4C;AAAnC,0GAAA,eAAe,OAAA;AACxB,oDAA0B;AAE1B,+BAAwC;AAA/B,sGAAA,cAAc,OAAA;AACvB,uCAAyE;AAAhE,iHAAA,qBAAqB,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AACpD,qCAAqC;AAA5B,mGAAA,QAAQ,OAAA"}
@@ -0,0 +1,14 @@
1
+ import { Nullable } from 'vitest';
2
+ export type LogTypes<TIn = any, TOut = any> = boolean | 'full' | LogTypes.Dir | {
3
+ req?: boolean | LogTypes.LogFn<TIn>;
4
+ res?: boolean | LogTypes.LogFn<TOut>;
5
+ };
6
+ export declare namespace LogTypes {
7
+ type Dir = 'req' | 'res';
8
+ type LogFn<T = any> = (data: T) => void | string | any[];
9
+ function getIsEnabled<T = unknown>(type: Nullable<LogTypes>, dir: Dir): {
10
+ enabled: boolean;
11
+ formatter?: Nullable<(data: T) => unknown>;
12
+ };
13
+ }
14
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/api/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,MAAM,QAAQ,CAAC,GAAG,GAAG,GAAG,EAAE,IAAI,GAAG,GAAG,IAAI,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG,GAAG;IAC5E,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,GAAG,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;CACxC,CAAC;AAEF,yBAAiB,QAAQ,CAAC;IACtB,KAAY,GAAG,GAAG,KAAK,GAAG,KAAK,CAAC;IAChC,KAAY,KAAK,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC;IAEhE,SAAgB,YAAY,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,GAAG,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAA;KAAE,CAsB9I;CAEJ"}
package/api/logging.js ADDED
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LogTypes = void 0;
4
+ var LogTypes;
5
+ (function (LogTypes) {
6
+ function getIsEnabled(type, dir) {
7
+ if (type) {
8
+ if (type === true || type === 'full' || type === dir) {
9
+ return { enabled: true };
10
+ }
11
+ if (typeof type === 'object') {
12
+ const log = type[dir];
13
+ if (log === true) {
14
+ return { enabled: true };
15
+ }
16
+ if (typeof log === 'function') {
17
+ return {
18
+ enabled: true,
19
+ formatter: log,
20
+ };
21
+ }
22
+ }
23
+ }
24
+ return { enabled: false };
25
+ }
26
+ LogTypes.getIsEnabled = getIsEnabled;
27
+ })(LogTypes || (exports.LogTypes = LogTypes = {}));
28
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/api/logging.ts"],"names":[],"mappings":";;;AAOA,IAAiB,QAAQ,CA4BxB;AA5BD,WAAiB,QAAQ;IAIrB,SAAgB,YAAY,CAAc,IAAwB,EAAE,GAAQ;QACxE,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;gBACnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC7B,CAAC;YAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;oBACf,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gBAC7B,CAAC;gBAED,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;oBAC5B,OAAO;wBACH,OAAO,EAAE,IAAI;wBACb,SAAS,EAAE,GAAG;qBACjB,CAAC;gBACN,CAAC;YACL,CAAC;QACL,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;IAtBe,qBAAY,eAsB3B,CAAA;AAEL,CAAC,EA5BgB,QAAQ,wBAAR,QAAQ,QA4BxB"}
@@ -0,0 +1,7 @@
1
+ export declare enum EndpointMethods {
2
+ GET = "GET",
3
+ POST = "POST",
4
+ PUT = "PUT",
5
+ DELETE = "DELETE"
6
+ }
7
+ //# sourceMappingURL=methods.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["../../src/api/methods.ts"],"names":[],"mappings":"AACA,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;CACpB"}
package/api/methods.js ADDED
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EndpointMethods = void 0;
4
+ var EndpointMethods;
5
+ (function (EndpointMethods) {
6
+ EndpointMethods["GET"] = "GET";
7
+ EndpointMethods["POST"] = "POST";
8
+ EndpointMethods["PUT"] = "PUT";
9
+ EndpointMethods["DELETE"] = "DELETE";
10
+ })(EndpointMethods || (exports.EndpointMethods = EndpointMethods = {}));
11
+ //# sourceMappingURL=methods.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"methods.js","sourceRoot":"","sources":["../../src/api/methods.ts"],"names":[],"mappings":";;;AACA,IAAY,eAKX;AALD,WAAY,eAAe;IACvB,8BAAW,CAAA;IACX,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,oCAAiB,CAAA;AACrB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
@@ -0,0 +1,8 @@
1
+ export type ProcessingFn<T = unknown> = (input: T) => T;
2
+ export declare class ProcessorsRegistry<K> {
3
+ private readonly _map;
4
+ cleanup(): void;
5
+ register<P>(key: K, processor: ProcessingFn<P>, name?: string): () => void;
6
+ process<T>(key: K, input: T): T;
7
+ }
8
+ //# sourceMappingURL=processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/api/processor.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,CAAC;AAExD,qBAAa,kBAAkB,CAAC,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgC;IAE9C,OAAO;IAIP,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM;IAgB7D,OAAO,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;CAIzC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProcessorsRegistry = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const logger_1 = tslib_1.__importDefault(require("../logger"));
6
+ class ProcessorsRegistry {
7
+ _map = new Map();
8
+ cleanup() {
9
+ this._map.clear();
10
+ }
11
+ register(key, processor, name) {
12
+ const _name = name || processor.name;
13
+ const wrapper = (input) => {
14
+ try {
15
+ return processor(input);
16
+ }
17
+ catch (err) {
18
+ logger_1.default.error(`Processor error: ${_name}`, err);
19
+ return input;
20
+ }
21
+ };
22
+ const arr = getArr(this._map, key);
23
+ arr.push(wrapper);
24
+ return () => removeFromArr(arr, wrapper);
25
+ }
26
+ process(key, input) {
27
+ const arr = this._map.get(key);
28
+ return chainProcessors(arr, input);
29
+ }
30
+ }
31
+ exports.ProcessorsRegistry = ProcessorsRegistry;
32
+ function getArr(map, key) {
33
+ let arr = map.get(key);
34
+ if (!arr) {
35
+ arr = [];
36
+ map.set(key, arr);
37
+ }
38
+ return arr;
39
+ }
40
+ function removeFromArr(arr, item) {
41
+ const index = arr.indexOf(item);
42
+ if (index >= 0) {
43
+ arr.splice(index, 1);
44
+ }
45
+ }
46
+ function chainProcessors(chain, input) {
47
+ return chain?.length
48
+ ? chain.reduce((res, fn) => fn(res), input)
49
+ : input;
50
+ }
51
+ //# sourceMappingURL=processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/api/processor.ts"],"names":[],"mappings":";;;;AAAA,+DAA+B;AAI/B,MAAa,kBAAkB;IACV,IAAI,GAAG,IAAI,GAAG,EAAqB,CAAC;IAE9C,OAAO;QACV,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAEM,QAAQ,CAAI,GAAM,EAAE,SAA0B,EAAE,IAAa;QAChE,MAAM,KAAK,GAAG,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC;QACrC,MAAM,OAAO,GAAG,CAAC,KAAQ,EAAE,EAAE;YACzB,IAAI,CAAC;gBACD,OAAO,SAAS,CA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AAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC;QAC3C,CAAC,CAAC,KAAK,CAAC;AAChB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ProcessingFn, ProcessorsRegistry } from './processor';
2
+ import { IEndpointInfo } from './endpoint';
3
+ export declare const PreProcessors: ProcessorsRegistry<IEndpointInfo>;
4
+ export declare const PostProcessors: ProcessorsRegistry<IEndpointInfo>;
5
+ export declare function cleanupProcessors(): void;
6
+ export declare function registerPreProcessor<T extends IEndpointInfo>(api: T, processor: ProcessingFn<IEndpointInfo.ExtractIn<T>>, name?: string): () => void;
7
+ export declare function registerPostProcessor<T extends IEndpointInfo>(api: T, processor: ProcessingFn<IEndpointInfo.ExtractOut<T>>, name?: string): () => void;
8
+ //# sourceMappingURL=register.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/api/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAO,MAAM,aAAa,mCAA0C,CAAC;AACrE,eAAO,MAAM,cAAc,mCAA0C,CAAC;AAOtE,wBAAgB,iBAAiB,SAGhC;AAED,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,cAEvI;AAED,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,cAEzI"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerPostProcessor = exports.registerPreProcessor = exports.cleanupProcessors = exports.PostProcessors = exports.PreProcessors = void 0;
4
+ const processor_1 = require("./processor");
5
+ const helpers_1 = require("./helpers");
6
+ exports.PreProcessors = new processor_1.ProcessorsRegistry();
7
+ exports.PostProcessors = new processor_1.ProcessorsRegistry();
8
+ const formatEndpointName = (api, prefix, name) => {
9
+ const regName = name ? ` ||| ${name})` : '';
10
+ return `${(0, helpers_1.getFormattedDisplayName)(api)}${prefix}${regName}`;
11
+ };
12
+ function cleanupProcessors() {
13
+ exports.PreProcessors.cleanup();
14
+ exports.PostProcessors.cleanup();
15
+ }
16
+ exports.cleanupProcessors = cleanupProcessors;
17
+ function registerPreProcessor(api, processor, name) {
18
+ return exports.PreProcessors.register(api, processor, formatEndpointName(api, ' | <pre_proc>', name));
19
+ }
20
+ exports.registerPreProcessor = registerPreProcessor;
21
+ function registerPostProcessor(api, processor, name) {
22
+ return exports.PostProcessors.register(api, processor, formatEndpointName(api, ' | <post_proc>', name));
23
+ }
24
+ exports.registerPostProcessor = registerPostProcessor;
25
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../../src/api/register.ts"],"names":[],"mappings":";;;AAAA,2CAA+D;AAC/D,uCAAoD;AAGvC,QAAA,aAAa,GAAG,IAAI,8BAAkB,EAAiB,CAAC;AACxD,QAAA,cAAc,GAAG,IAAI,8BAAkB,EAAiB,CAAC;AAEtE,MAAM,kBAAkB,GAAG,CAAC,GAAkB,EAAE,MAAc,EAAE,IAAa,EAAE,EAAE;IAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5C,OAAO,GAAG,IAAA,iCAAuB,EAAC,GAAG,CAAC,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC;AAChE,CAAC,CAAC;AAEF,SAAgB,iBAAiB;IAC7B,qBAAa,CAAC,OAAO,EAAE,CAAC;IACxB,sBAAc,CAAC,OAAO,EAAE,CAAC;AAC7B,CAAC;AAHD,8CAGC;AAED,SAAgB,oBAAoB,CAA0B,GAAM,EAAE,SAAmD,EAAE,IAAa;IACpI,OAAO,qBAAa,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAE,kBAAkB,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC;AAClG,CAAC;AAFD,oDAEC;AAED,SAAgB,qBAAqB,CAA0B,GAAM,EAAE,SAAoD,EAAE,IAAa;IACtI,OAAO,sBAAc,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAE,kBAAkB,CAAC,GAAG,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC;AACpG,CAAC;AAFD,sDAEC"}