@qoretechnologies/ts-toolkit 0.4.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 (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +74 -0
  3. package/dist/QorusAuthenticator.d.ts +181 -0
  4. package/dist/QorusAuthenticator.d.ts.map +1 -0
  5. package/dist/QorusAuthenticator.js +386 -0
  6. package/dist/QorusAuthenticator.js.map +1 -0
  7. package/dist/QorusConfigItems.d.ts +13 -0
  8. package/dist/QorusConfigItems.d.ts.map +1 -0
  9. package/dist/QorusConfigItems.js +41 -0
  10. package/dist/QorusConfigItems.js.map +1 -0
  11. package/dist/QorusDataProvider.d.ts +206 -0
  12. package/dist/QorusDataProvider.d.ts.map +1 -0
  13. package/dist/QorusDataProvider.js +262 -0
  14. package/dist/QorusDataProvider.js.map +1 -0
  15. package/dist/QorusOptions.d.ts +108 -0
  16. package/dist/QorusOptions.d.ts.map +1 -0
  17. package/dist/QorusOptions.js +181 -0
  18. package/dist/QorusOptions.js.map +1 -0
  19. package/dist/QorusRequest.d.ts +91 -0
  20. package/dist/QorusRequest.d.ts.map +1 -0
  21. package/dist/QorusRequest.js +103 -0
  22. package/dist/QorusRequest.js.map +1 -0
  23. package/dist/QorusValidator.d.ts +33 -0
  24. package/dist/QorusValidator.d.ts.map +1 -0
  25. package/dist/QorusValidator.js +385 -0
  26. package/dist/QorusValidator.js.map +1 -0
  27. package/dist/index.d.ts +21 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +43 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/managers/LocalStorage.d.ts +24 -0
  32. package/dist/managers/LocalStorage.d.ts.map +1 -0
  33. package/dist/managers/LocalStorage.js +46 -0
  34. package/dist/managers/LocalStorage.js.map +1 -0
  35. package/dist/managers/error/Error.d.ts +7 -0
  36. package/dist/managers/error/Error.d.ts.map +1 -0
  37. package/dist/managers/error/Error.js +16 -0
  38. package/dist/managers/error/Error.js.map +1 -0
  39. package/dist/managers/error/ErrorInternal.d.ts +6 -0
  40. package/dist/managers/error/ErrorInternal.d.ts.map +1 -0
  41. package/dist/managers/error/ErrorInternal.js +14 -0
  42. package/dist/managers/error/ErrorInternal.js.map +1 -0
  43. package/dist/managers/error/ErrorQorusRequest.d.ts +11 -0
  44. package/dist/managers/error/ErrorQorusRequest.d.ts.map +1 -0
  45. package/dist/managers/error/ErrorQorusRequest.js +22 -0
  46. package/dist/managers/error/ErrorQorusRequest.js.map +1 -0
  47. package/dist/managers/error/errorCodes.d.ts +8 -0
  48. package/dist/managers/error/errorCodes.d.ts.map +1 -0
  49. package/dist/managers/error/errorCodes.js +30 -0
  50. package/dist/managers/error/errorCodes.js.map +1 -0
  51. package/dist/managers/logger.d.ts +11 -0
  52. package/dist/managers/logger.d.ts.map +1 -0
  53. package/dist/managers/logger.js +22 -0
  54. package/dist/managers/logger.js.map +1 -0
  55. package/dist/utils/apiPaths.d.ts +63 -0
  56. package/dist/utils/apiPaths.d.ts.map +1 -0
  57. package/dist/utils/apiPaths.js +37 -0
  58. package/dist/utils/apiPaths.js.map +1 -0
  59. package/dist/utils/index.d.ts +3 -0
  60. package/dist/utils/index.d.ts.map +1 -0
  61. package/dist/utils/index.js +27 -0
  62. package/dist/utils/index.js.map +1 -0
  63. package/dist/utils/validation.d.ts +107 -0
  64. package/dist/utils/validation.d.ts.map +1 -0
  65. package/dist/utils/validation.js +108 -0
  66. package/dist/utils/validation.js.map +1 -0
  67. package/package.json +113 -0
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.QorusValidator = exports.versions = void 0;
7
+ const js_yaml_1 = __importDefault(require("js-yaml"));
8
+ const every_1 = __importDefault(require("lodash/every"));
9
+ const size_1 = __importDefault(require("lodash/size"));
10
+ const uniqWith_1 = __importDefault(require("lodash/uniqWith"));
11
+ const validation_1 = require("./utils/validation");
12
+ const cron_validator_1 = __importDefault(require("cron-validator"));
13
+ /*eslint-disable */
14
+ exports.versions = [1, 2, 3, 4, 5, 6, 'latest'];
15
+ /**
16
+ * QorusValidator is a helper class to verify the validity for Qorus types and their values
17
+ * - Verify if a value can be used for Qorus type
18
+ * @returns QorusValidator class object
19
+ * @Category QorusValidator
20
+ */
21
+ class QorusValidator {
22
+ /**
23
+ * Verifies if the type can be null or not
24
+ * @param type Type of the object
25
+ * @returns True if the the type can be null, False otherwise
26
+ */
27
+ nullType(type) {
28
+ if (type.startsWith('*')) {
29
+ type = type.substring(1);
30
+ return true;
31
+ }
32
+ return false;
33
+ }
34
+ /**
35
+ * Validate property for the provider-options for data-provider
36
+ * @param type type of value for the property
37
+ * @param value value for the property
38
+ * @param canBeNull if the value can be null
39
+ * @returns True if the value can be accepted for the type, False otherwise
40
+ */
41
+ validate(type, value, canBeNull) {
42
+ var _a;
43
+ if (!type) {
44
+ return false;
45
+ }
46
+ // Check if the type starts with a * to indicate it can be null
47
+ canBeNull = this.nullType(type);
48
+ // If the value can be null an is null
49
+ // immediately return true, no matter what type
50
+ if (canBeNull && value === null) {
51
+ return true;
52
+ }
53
+ // Get the actual type
54
+ // Check if there is a `<` in the type
55
+ if (type.includes('<')) {
56
+ // Extract internal type from the type
57
+ type = type.slice(0, type.indexOf('<'));
58
+ }
59
+ // Check if the value is a template string
60
+ if ((0, validation_1.isValueTemplate)(value)) {
61
+ // Check if the template has both the key and value
62
+ return !!(0, validation_1.getTemplateKey)(value) && !!(0, validation_1.getTemplateValue)(value);
63
+ }
64
+ // Check individual types
65
+ switch (type) {
66
+ case 'binary':
67
+ case 'string':
68
+ case 'mapper':
69
+ case 'workflow':
70
+ case 'service':
71
+ case 'job':
72
+ case 'connection':
73
+ case 'softstring':
74
+ case 'select-string':
75
+ case 'file-string':
76
+ case 'file-as-string':
77
+ case 'long-string':
78
+ case 'method-name': {
79
+ if (typeof value === 'undefined' || typeof value !== 'string' || value.length === 0) {
80
+ return false;
81
+ }
82
+ return true;
83
+ }
84
+ case 'array-of-pairs': {
85
+ let valid = true;
86
+ return valid;
87
+ }
88
+ case 'class-connectors': {
89
+ let valid = true;
90
+ // Check if every pair has name, input method and output method
91
+ // assigned properly
92
+ if (!Array.isArray(value) || !value[0])
93
+ return false;
94
+ value.forEach((val) => {
95
+ if (!(val.name && val.method)) {
96
+ valid = false;
97
+ }
98
+ });
99
+ // Get a list of unique values
100
+ const uniqueValues = (0, uniqWith_1.default)(value, (cur, prev) => cur.name === prev.name);
101
+ // Check if there are any duplicates
102
+ if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
103
+ valid = false;
104
+ }
105
+ return valid;
106
+ }
107
+ // Classes check
108
+ case 'class-array': {
109
+ // test-undone
110
+ let valid = true;
111
+ // Check if the fields are not empty
112
+ if (!Array.isArray(value) || !value[0])
113
+ return false;
114
+ if (!(value === null || value === void 0 ? void 0 : value.every((pair) => pair.name && pair.name !== ''))) {
115
+ valid = false;
116
+ }
117
+ // Get a list of unique values
118
+ const uniqueValues = (0, uniqWith_1.default)(value, (cur, prev) => `${cur.prefix}${cur.name}` === `${prev.prefix}${prev.name}`);
119
+ // Check if there are any duplicates
120
+ if ((0, size_1.default)(uniqueValues) !== (0, size_1.default)(value)) {
121
+ valid = false;
122
+ }
123
+ return valid;
124
+ }
125
+ case 'int':
126
+ case 'softint':
127
+ case 'number':
128
+ return !isNaN(value) && this.getTypeFromValue(value) === 'int';
129
+ case 'float':
130
+ return !isNaN(value) && (this.getTypeFromValue(value) === 'float' || this.getTypeFromValue(value) === 'int');
131
+ case 'select-array':
132
+ case 'array':
133
+ case 'file-tree':
134
+ // Check if there is atleast one value
135
+ // selected
136
+ return value && value.length !== 0;
137
+ case 'cron': // test undone
138
+ if (!value) {
139
+ return false;
140
+ }
141
+ // Check if the cron is valid
142
+ return cron_validator_1.default.isValidCron(value, { alias: true });
143
+ case 'date':
144
+ // Check if the date is valid
145
+ return value !== undefined && value !== null && value !== '' && new Date(value).toString() !== 'Invalid Date';
146
+ case 'hash':
147
+ case 'hash<auto>': {
148
+ // Get the parsed yaml
149
+ const parsedValue = value;
150
+ // If the value is not an object or empty
151
+ if (!parsedValue || typeof parsedValue !== 'object') {
152
+ return false;
153
+ }
154
+ return true;
155
+ }
156
+ case 'list':
157
+ case 'softlist':
158
+ case 'list<auto>': {
159
+ // Get the parsed yaml
160
+ // If the value is not an object or empty
161
+ if (value && typeof value === 'object')
162
+ return true;
163
+ else
164
+ return false;
165
+ }
166
+ case 'mapper-code':
167
+ if (!value) {
168
+ return false;
169
+ }
170
+ // Split the value
171
+ const [code, method] = value.split('::');
172
+ // Both fields need to be strings & filled
173
+ return this.validate('string', code) && this.validate('string', method);
174
+ case 'type-selector':
175
+ case 'data-provider':
176
+ case 'api-call':
177
+ case 'search-single':
178
+ case 'search':
179
+ case 'update':
180
+ case 'delete':
181
+ case 'create':
182
+ // Api call only supports requests / response
183
+ if (type === 'api-call' && !value.supports_request) {
184
+ return false;
185
+ }
186
+ if (value.use_args &&
187
+ value.args &&
188
+ ((_a = value.args) === null || _a === void 0 ? void 0 : _a.type) !== 'nothing' &&
189
+ !this.validate(value.args.type === 'hash' ? 'system-options' : value.args.type, value.args.value)) {
190
+ return false;
191
+ }
192
+ if ((type === 'search-single' || type === 'search') &&
193
+ ((0, size_1.default)(value.search_args) === 0 || !this.validate('system-options-with-operators', value.search_args))) {
194
+ return false;
195
+ }
196
+ if ((type === 'update' || type === 'create') &&
197
+ ((0, size_1.default)(value[`${type}_args`]) === 0 || !this.validate('system-options', value[`${type}_args`]))) {
198
+ return false;
199
+ }
200
+ if ((value === null || value === void 0 ? void 0 : value.type) === 'factory') {
201
+ if (value.optionsChanged) {
202
+ return false;
203
+ }
204
+ let options = true;
205
+ if (value.options) {
206
+ options = this.validate('system-options', value.options);
207
+ }
208
+ if (value.search_options) {
209
+ options = this.validate('system-options', value.search_options);
210
+ }
211
+ // Type path and name are required
212
+ return !!(value.type && value.name && options);
213
+ }
214
+ return !!(value.type && value.path && value.name);
215
+ case 'context-selector':
216
+ if (typeof value === 'string') {
217
+ const cont = value.split(':');
218
+ return this.validate('string', cont[0]) && this.validate('string', cont[1]);
219
+ }
220
+ return !!value.iface_kind && !!value.name;
221
+ case 'auto':
222
+ case 'any': {
223
+ // Parse the string as yaml
224
+ let yamlCorrect = true;
225
+ let parsedData;
226
+ // Parse the yaml
227
+ try {
228
+ parsedData = js_yaml_1.default.load(value);
229
+ }
230
+ catch (e) {
231
+ yamlCorrect = false;
232
+ }
233
+ if (!yamlCorrect) {
234
+ return false;
235
+ }
236
+ if (parsedData) {
237
+ return this.validate(this.getTypeFromValue(parsedData), value);
238
+ }
239
+ return false;
240
+ }
241
+ case 'processor': {
242
+ let valid = true;
243
+ if (!value['processor-input-type'] || !value['processor-output-type'] || !value) {
244
+ return false;
245
+ }
246
+ // Validate the input and output types
247
+ if (!this.validate('type-selector', value['processor-input-type'])) {
248
+ valid = false;
249
+ }
250
+ if (!this.validate('type-selector', value['processor-output-type'])) {
251
+ valid = false;
252
+ }
253
+ return valid;
254
+ }
255
+ case 'fsm-list': {
256
+ return (value.length !== 0 &&
257
+ (value === null || value === void 0 ? void 0 : value.every((val) => this.validate('string', val.name) === true)));
258
+ }
259
+ case 'api-manager': {
260
+ if (!value) {
261
+ return false;
262
+ }
263
+ let valid = true;
264
+ if (!this.validate('string', value.factory) ||
265
+ !this.validate('system-options', value['provider-options']) ||
266
+ !this.validate('api-endpoints', value.endpoints)) {
267
+ valid = false;
268
+ }
269
+ return valid;
270
+ }
271
+ case 'api-endpoints': {
272
+ if (!Array.isArray(value) || !(0, size_1.default)(value)) {
273
+ return false;
274
+ }
275
+ return value.every((endpoint) => this.validate('string', endpoint.value));
276
+ }
277
+ case 'options':
278
+ case 'pipeline-options':
279
+ case 'mapper-options':
280
+ case 'system-options': {
281
+ const isValid = (val) => {
282
+ if (!val || (0, size_1.default)(val) === 0) {
283
+ if (canBeNull) {
284
+ return true;
285
+ }
286
+ return false;
287
+ }
288
+ return (0, every_1.default)(val, (optionData) => typeof optionData !== 'object'
289
+ ? this.validate(this.getTypeFromValue(optionData), optionData)
290
+ : this.validate(optionData.type, optionData.value));
291
+ };
292
+ if (Array.isArray(value)) {
293
+ return value.every(isValid);
294
+ }
295
+ return isValid(value);
296
+ }
297
+ case 'system-options-with-operators': {
298
+ const isValidVal = (val) => {
299
+ if (!val || (0, size_1.default)(val) === 0) {
300
+ if (canBeNull) {
301
+ return true;
302
+ }
303
+ return false;
304
+ }
305
+ return (0, every_1.default)(val, (optionData) => {
306
+ let isValid = typeof optionData !== 'object'
307
+ ? this.validate(this.getTypeFromValue(optionData), optionData)
308
+ : this.validate(optionData.type, optionData.value);
309
+ if (!optionData.op ||
310
+ !(0, validation_1.fixOperatorValue)(optionData.op).every((operator) => this.validate('string', operator))) {
311
+ isValid = false;
312
+ }
313
+ return isValid;
314
+ });
315
+ };
316
+ if (Array.isArray(value)) {
317
+ return value.every(isValidVal);
318
+ }
319
+ return isValidVal(value);
320
+ }
321
+ case 'byte-size': {
322
+ let valid = true;
323
+ if (typeof value !== 'string')
324
+ return false;
325
+ const result = (0, validation_1.splitByteSize)(value);
326
+ if (!(result === null || result === void 0 ? void 0 : result[0]) || !(result === null || result === void 0 ? void 0 : result[1]))
327
+ return false;
328
+ const bytes = result[0];
329
+ const sizeN = result[1];
330
+ if (!this.validate('number', bytes)) {
331
+ valid = false;
332
+ }
333
+ if (!this.validate('string', sizeN)) {
334
+ valid = false;
335
+ }
336
+ return valid;
337
+ }
338
+ case 'url': {
339
+ return this.validate('string', (0, validation_1.getProtocol)(value)) && this.validate('string', (0, validation_1.getAddress)(value));
340
+ }
341
+ case 'version': {
342
+ return exports.versions.includes(value);
343
+ }
344
+ case 'nothing':
345
+ return false;
346
+ default:
347
+ return true;
348
+ }
349
+ }
350
+ /**
351
+ * Get QorusType from the value
352
+ * @param value Any accepted type value
353
+ * @returns QorusType string
354
+ */
355
+ getTypeFromValue(value) {
356
+ if (value === null) {
357
+ return 'null';
358
+ }
359
+ if (typeof value === 'boolean') {
360
+ return 'bool';
361
+ }
362
+ if (value === 0 || (Number(value) === value && value % 1 === 0)) {
363
+ return 'int';
364
+ }
365
+ if (value === 0 || value === 0.0 || (Number(value) === value && value % 1 !== 0)) {
366
+ return 'float';
367
+ }
368
+ if (Array.isArray(value)) {
369
+ return 'list';
370
+ }
371
+ if (new Date(value).toString() !== 'Invalid Date') {
372
+ return 'date';
373
+ }
374
+ if (value !== null && typeof value === 'object') {
375
+ return 'hash';
376
+ }
377
+ if (typeof value === 'string') {
378
+ return 'string';
379
+ }
380
+ return 'none';
381
+ }
382
+ }
383
+ exports.QorusValidator = QorusValidator;
384
+ exports.default = new QorusValidator();
385
+ //# sourceMappingURL=QorusValidator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QorusValidator.js","sourceRoot":"","sources":["../src/QorusValidator.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,yDAAiC;AACjC,uDAA+B;AAC/B,+DAAuC;AACvC,mDAY4B;AAE5B,oEAAkC;AAClC,mBAAmB;AAEN,QAAA,QAAQ,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAErD;;;;;GAKG;AACH,MAAa,cAAc;IACzB;;;;OAIG;IACK,QAAQ,CAAC,IAAY;QAC3B,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACxB,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YACzB,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,IAAyB,EAAE,KAAW,EAAE,SAAmB;;QAClE,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,KAAK,CAAC;SACd;QACD,+D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ED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACxB,OAAO,MAAM,CAAC;SACf;QAED,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,KAAK,cAAc,EAAE;YACjD,OAAO,MAAM,CAAC;SACf;QAED,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC/C,OAAO,MAAM,CAAC;SACf;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,QAAQ,CAAC;SACjB;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAlaD,wCAkaC;AAED,kBAAe,IAAI,cAAc,EAAE,CAAC"}
@@ -0,0 +1,21 @@
1
+ export * as Authenticator from './QorusAuthenticator';
2
+ export * as HttpRequest from './QorusRequest';
3
+ export * as DataProvider from './QorusDataProvider';
4
+ export * as QorusOptions from './QorusOptions';
5
+ export * as Validator from './QorusValidator';
6
+ export { default as QorusAuthenticator } from './QorusAuthenticator';
7
+ export { default as QorusRequest } from './QorusRequest';
8
+ export { default as QorusDataProvider } from './QorusDataProvider';
9
+ export { default as QorusValidator } from './QorusValidator';
10
+ export { TVersion, IApiPaths, IAuthenticatorApiPaths, IDataProviderApiPaths, IJobsApiPaths } from './utils/apiPaths';
11
+ export { TContext } from './QorusDataProvider';
12
+ export { IDefaultHeaders } from './QorusRequest';
13
+ /**
14
+ * A record of objects with string key and string value
15
+ */
16
+ export type TObjectWithStringKey = Record<string, string>;
17
+ /**
18
+ * A record of objects with string key and any kind of value
19
+ */
20
+ export type TObjectWithAnyValue = Record<string, any>;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.QorusValidator = exports.QorusDataProvider = exports.QorusRequest = exports.QorusAuthenticator = exports.Validator = exports.QorusOptions = exports.DataProvider = exports.HttpRequest = exports.Authenticator = void 0;
30
+ exports.Authenticator = __importStar(require("./QorusAuthenticator"));
31
+ exports.HttpRequest = __importStar(require("./QorusRequest"));
32
+ exports.DataProvider = __importStar(require("./QorusDataProvider"));
33
+ exports.QorusOptions = __importStar(require("./QorusOptions"));
34
+ exports.Validator = __importStar(require("./QorusValidator"));
35
+ var QorusAuthenticator_1 = require("./QorusAuthenticator");
36
+ Object.defineProperty(exports, "QorusAuthenticator", { enumerable: true, get: function () { return __importDefault(QorusAuthenticator_1).default; } });
37
+ var QorusRequest_1 = require("./QorusRequest");
38
+ Object.defineProperty(exports, "QorusRequest", { enumerable: true, get: function () { return __importDefault(QorusRequest_1).default; } });
39
+ var QorusDataProvider_1 = require("./QorusDataProvider");
40
+ Object.defineProperty(exports, "QorusDataProvider", { enumerable: true, get: function () { return __importDefault(QorusDataProvider_1).default; } });
41
+ var QorusValidator_1 = require("./QorusValidator");
42
+ Object.defineProperty(exports, "QorusValidator", { enumerable: true, get: function () { return __importDefault(QorusValidator_1).default; } });
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsD;AACtD,8DAA8C;AAC9C,oEAAoD;AACpD,+DAA+C;AAC/C,8DAA8C;AAE9C,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,yDAAmE;AAA1D,uIAAA,OAAO,OAAqB;AACrC,mDAA6D;AAApD,iIAAA,OAAO,OAAkB"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * A helper function to check if the running environment is node or client
3
+ *
4
+ * @returns 'node' or 'browser' based on the current environment
5
+ */
6
+ export declare const detectEnvironment: () => 'node' | 'browser' | 'unknown';
7
+ export interface IKeyValue {
8
+ key: string;
9
+ value: string;
10
+ }
11
+ /**
12
+ * A local storage helper to set key value pair in local storage
13
+ * works only on the client side(browser)
14
+ *
15
+ */
16
+ declare const setKeyValLocal: (keyValue: IKeyValue) => void;
17
+ /**
18
+ * A local storage helper to get key value pair in local storage
19
+ * works only on the client side(browser)
20
+ *
21
+ */
22
+ declare const getKeyValLocal: (key: string) => string | null;
23
+ export { setKeyValLocal, getKeyValLocal };
24
+ //# sourceMappingURL=LocalStorage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStorage.d.ts","sourceRoot":"","sources":["../../src/managers/LocalStorage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAAM,GAAG,SAAS,GAAG,SAMzD,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,QAAA,MAAM,cAAc,aAAc,SAAS,SAM1C,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,cAAc,QAAS,MAAM,kBAMlC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getKeyValLocal = exports.setKeyValLocal = exports.detectEnvironment = void 0;
4
+ /**
5
+ * A helper function to check if the running environment is node or client
6
+ *
7
+ * @returns 'node' or 'browser' based on the current environment
8
+ */
9
+ const detectEnvironment = () => {
10
+ if (typeof process !== 'undefined' && process.title === 'node') {
11
+ return 'node';
12
+ }
13
+ else if (typeof window != 'undefined') {
14
+ return 'browser';
15
+ }
16
+ else
17
+ return 'unknown';
18
+ };
19
+ exports.detectEnvironment = detectEnvironment;
20
+ /**
21
+ * A local storage helper to set key value pair in local storage
22
+ * works only on the client side(browser)
23
+ *
24
+ */
25
+ const setKeyValLocal = (keyValue) => {
26
+ const environment = (0, exports.detectEnvironment)();
27
+ const { key, value } = keyValue;
28
+ if (environment == 'browser') {
29
+ window.localStorage.setItem(key, value);
30
+ }
31
+ };
32
+ exports.setKeyValLocal = setKeyValLocal;
33
+ /**
34
+ * A local storage helper to get key value pair in local storage
35
+ * works only on the client side(browser)
36
+ *
37
+ */
38
+ const getKeyValLocal = (key) => {
39
+ const environment = (0, exports.detectEnvironment)();
40
+ if (environment == 'browser') {
41
+ return window.localStorage.getItem(key);
42
+ }
43
+ return null;
44
+ };
45
+ exports.getKeyValLocal = getKeyValLocal;
46
+ //# sourceMappingURL=LocalStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalStorage.js","sourceRoot":"","sources":["../../src/managers/LocalStorage.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,GAAmC,EAAE;IACpE,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM,EAAE;QAC9D,OAAO,MAAM,CAAC;KACf;SAAM,IAAI,OAAO,MAAM,IAAI,WAAW,EAAE;QACvC,OAAO,SAAS,CAAC;KAClB;;QAAM,OAAO,SAAS,CAAC;AAC1B,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B;AAOF;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,QAAmB,EAAE,EAAE;IAC7C,MAAM,WAAW,GAAG,IAAA,yBAAiB,GAAE,CAAC;IACxC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAChC,IAAI,WAAW,IAAI,SAAS,EAAE;QAC5B,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACzC;AACH,CAAC,CAAC;AAeO,wCAAc;AAbvB;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE;IACrC,MAAM,WAAW,GAAG,IAAA,yBAAiB,GAAE,CAAC;IACxC,IAAI,WAAW,IAAI,SAAS,EAAE;QAC5B,OAAO,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEuB,wCAAc"}
@@ -0,0 +1,7 @@
1
+ declare class BaseError extends Error {
2
+ statusCode?: number;
3
+ isOperational: boolean;
4
+ constructor(description: string, isOperational: any, name: any, statusCode: any);
5
+ }
6
+ export default BaseError;
7
+ //# sourceMappingURL=Error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Error.d.ts","sourceRoot":"","sources":["../../../src/managers/error/Error.ts"],"names":[],"mappings":"AAAA,cAAM,SAAU,SAAQ,KAAK;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;gBACX,WAAW,EAAE,MAAM,EAAE,aAAa,KAAA,EAAE,IAAI,KAAA,EAAE,UAAU,KAAA;CAUjE;AAED,eAAe,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class BaseError extends Error {
4
+ constructor(description, isOperational, name, statusCode) {
5
+ var _a;
6
+ super(description);
7
+ Object.setPrototypeOf(this, new.target.prototype);
8
+ this.name = name;
9
+ this.statusCode = statusCode;
10
+ this.isOperational = isOperational;
11
+ // This only works in a Node.js environment or via the V8 engine
12
+ (_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this);
13
+ }
14
+ }
15
+ exports.default = BaseError;
16
+ //# sourceMappingURL=Error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Error.js","sourceRoot":"","sources":["../../../src/managers/error/Error.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAU,SAAQ,KAAK;IAG3B,YAAY,WAAmB,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU;;QAC9D,KAAK,CAAC,WAAW,CAAC,CAAC;QAEnB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,gEAAgE;QAChE,MAAA,KAAK,CAAC,iBAAiB,sDAAG,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AAED,kBAAe,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ import BaseError from './Error';
2
+ declare class ErrorInternal extends BaseError {
3
+ constructor(description: string, name?: string | undefined, statusCode?: number | undefined, isOperational?: boolean);
4
+ }
5
+ export default ErrorInternal;
6
+ //# sourceMappingURL=ErrorInternal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorInternal.d.ts","sourceRoot":"","sources":["../../../src/managers/error/ErrorInternal.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,SAAS,CAAC;AAGhC,cAAM,aAAc,SAAQ,SAAS;gBAEjC,WAAW,EAAE,MAAM,EACnB,IAAI,qBAA2B,EAC/B,UAAU,qBAA2B,EACrC,aAAa,UAAO;CAIvB;AAED,eAAe,aAAa,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Error_1 = __importDefault(require("./Error"));
7
+ const errorCodes_1 = require("./errorCodes");
8
+ class ErrorInternal extends Error_1.default {
9
+ constructor(description, name = errorCodes_1.errorCodes.INTERNAL.name, statusCode = errorCodes_1.errorCodes.INTERNAL.code, isOperational = true) {
10
+ super(description, isOperational, name, statusCode);
11
+ }
12
+ }
13
+ exports.default = ErrorInternal;
14
+ //# sourceMappingURL=ErrorInternal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorInternal.js","sourceRoot":"","sources":["../../../src/managers/error/ErrorInternal.ts"],"names":[],"mappings":";;;;;AAAA,oDAAgC;AAChC,6CAA0C;AAE1C,MAAM,aAAc,SAAQ,eAAS;IACnC,YACE,WAAmB,EACnB,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,IAAI,EAC/B,UAAU,GAAG,uBAAU,CAAC,QAAQ,CAAC,IAAI,EACrC,aAAa,GAAG,IAAI;QAEpB,KAAK,CAAC,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;IACtD,CAAC;CACF;AAED,kBAAe,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ import BaseError from './Error';
2
+ declare class ErrorQorusRequest extends BaseError {
3
+ constructor(error: IErrorQorusRequestParams | string);
4
+ }
5
+ export interface IErrorQorusRequestParams {
6
+ desc: string;
7
+ err: string;
8
+ status: number;
9
+ }
10
+ export default ErrorQorusRequest;
11
+ //# sourceMappingURL=ErrorQorusRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorQorusRequest.d.ts","sourceRoot":"","sources":["../../../src/managers/error/ErrorQorusRequest.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,SAAS,CAAC;AAGhC,cAAM,iBAAkB,SAAQ,SAAS;gBAC3B,KAAK,EAAE,wBAAwB,GAAG,MAAM;CASrD;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAe,iBAAiB,CAAC"}