oneentry 1.0.140 → 1.0.141

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 (149) hide show
  1. package/dist/admins/adminsApi.d.ts +50 -0
  2. package/dist/admins/adminsApi.js +65 -0
  3. package/dist/admins/adminsInterfaces.d.ts +99 -0
  4. package/dist/admins/adminsInterfaces.js +2 -0
  5. package/dist/admins/adminsSchemas.d.ts +30 -0
  6. package/dist/admins/adminsSchemas.js +27 -0
  7. package/dist/attribute-sets/attributeSetsApi.d.ts +63 -0
  8. package/dist/attribute-sets/attributeSetsApi.js +98 -0
  9. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +187 -0
  10. package/dist/attribute-sets/attributeSetsInterfaces.js +2 -0
  11. package/dist/attribute-sets/attributeSetsSchemas.d.ts +90 -0
  12. package/dist/attribute-sets/attributeSetsSchemas.js +74 -0
  13. package/dist/auth-provider/authProviderApi.d.ts +249 -0
  14. package/dist/auth-provider/authProviderApi.js +351 -0
  15. package/dist/auth-provider/authProviderSchemas.d.ts +131 -0
  16. package/dist/auth-provider/authProviderSchemas.js +82 -0
  17. package/dist/auth-provider/authProvidersInterfaces.d.ts +425 -0
  18. package/dist/auth-provider/authProvidersInterfaces.js +2 -0
  19. package/dist/base/asyncModules.d.ts +80 -0
  20. package/dist/base/asyncModules.js +440 -0
  21. package/dist/base/result.d.ts +39 -0
  22. package/dist/base/result.js +154 -0
  23. package/dist/base/stateModule.d.ts +41 -0
  24. package/dist/base/stateModule.js +128 -0
  25. package/dist/base/syncModules.d.ts +149 -0
  26. package/dist/base/syncModules.js +549 -0
  27. package/dist/base/utils.d.ts +197 -0
  28. package/dist/base/utils.js +2 -0
  29. package/dist/base/validation.d.ts +118 -0
  30. package/dist/base/validation.js +132 -0
  31. package/dist/blocks/blocksApi.d.ts +76 -0
  32. package/dist/blocks/blocksApi.js +188 -0
  33. package/dist/blocks/blocksInterfaces.d.ts +173 -0
  34. package/dist/blocks/blocksInterfaces.js +2 -0
  35. package/dist/blocks/blocksSchemas.d.ts +187 -0
  36. package/dist/blocks/blocksSchemas.js +43 -0
  37. package/dist/discounts/discountsApi.d.ts +56 -0
  38. package/dist/discounts/discountsApi.js +82 -0
  39. package/dist/discounts/discountsInterfaces.d.ts +145 -0
  40. package/dist/discounts/discountsInterfaces.js +2 -0
  41. package/dist/events/eventsApi.d.ts +60 -0
  42. package/dist/events/eventsApi.js +97 -0
  43. package/dist/events/eventsInterfaces.d.ts +87 -0
  44. package/dist/events/eventsInterfaces.js +2 -0
  45. package/dist/file-uploading/fileUploadingApi.d.ts +88 -0
  46. package/dist/file-uploading/fileUploadingApi.js +132 -0
  47. package/dist/file-uploading/fileUploadingInterfaces.d.ts +117 -0
  48. package/dist/file-uploading/fileUploadingInterfaces.js +2 -0
  49. package/dist/file-uploading/fileUploadingSchemas.d.ts +22 -0
  50. package/dist/file-uploading/fileUploadingSchemas.js +21 -0
  51. package/dist/forms/formsApi.d.ts +42 -0
  52. package/dist/forms/formsApi.js +57 -0
  53. package/dist/forms/formsInterfaces.d.ts +132 -0
  54. package/dist/forms/formsInterfaces.js +2 -0
  55. package/dist/forms/formsSchemas.d.ts +50 -0
  56. package/dist/forms/formsSchemas.js +31 -0
  57. package/dist/forms-data/formsDataApi.d.ts +106 -0
  58. package/dist/forms-data/formsDataApi.js +189 -0
  59. package/dist/forms-data/formsDataInterfaces.d.ts +525 -0
  60. package/dist/forms-data/formsDataInterfaces.js +2 -0
  61. package/dist/forms-data/formsDataSchemas.d.ts +115 -0
  62. package/dist/forms-data/formsDataSchemas.js +86 -0
  63. package/dist/general-types/generalTypesApi.d.ts +28 -0
  64. package/dist/general-types/generalTypesApi.js +38 -0
  65. package/dist/general-types/generalTypesInterfaces.d.ts +30 -0
  66. package/dist/general-types/generalTypesInterfaces.js +2 -0
  67. package/dist/general-types/generalTypesSchemas.d.ts +50 -0
  68. package/dist/general-types/generalTypesSchemas.js +35 -0
  69. package/dist/index.d.ts +100 -0
  70. package/dist/index.js +103 -0
  71. package/dist/integration-collections/integrationCollectionsApi.d.ts +173 -0
  72. package/dist/integration-collections/integrationCollectionsApi.js +220 -0
  73. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +313 -0
  74. package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
  75. package/dist/integration-collections/integrationCollectionsSchemas.d.ts +80 -0
  76. package/dist/integration-collections/integrationCollectionsSchemas.js +61 -0
  77. package/dist/locales/localesApi.d.ts +27 -0
  78. package/dist/locales/localesApi.js +37 -0
  79. package/dist/locales/localesInterfaces.d.ts +41 -0
  80. package/dist/locales/localesInterfaces.js +2 -0
  81. package/dist/locales/localesSchemas.d.ts +32 -0
  82. package/dist/locales/localesSchemas.js +26 -0
  83. package/dist/menus/menusApi.d.ts +29 -0
  84. package/dist/menus/menusApi.js +39 -0
  85. package/dist/menus/menusInterfaces.d.ts +88 -0
  86. package/dist/menus/menusInterfaces.js +4 -0
  87. package/dist/menus/menusSchemas.d.ts +16 -0
  88. package/dist/menus/menusSchemas.js +28 -0
  89. package/dist/orders/ordersApi.d.ts +149 -0
  90. package/dist/orders/ordersApi.js +203 -0
  91. package/dist/orders/ordersInterfaces.d.ts +527 -0
  92. package/dist/orders/ordersInterfaces.js +2 -0
  93. package/dist/orders/ordersSchemas.d.ts +120 -0
  94. package/dist/orders/ordersSchemas.js +101 -0
  95. package/dist/pages/pagesApi.d.ts +151 -0
  96. package/dist/pages/pagesApi.js +390 -0
  97. package/dist/pages/pagesInterfaces.d.ts +292 -0
  98. package/dist/pages/pagesInterfaces.js +2 -0
  99. package/dist/pages/pagesSchemas.d.ts +85 -0
  100. package/dist/pages/pagesSchemas.js +46 -0
  101. package/dist/payments/paymentsApi.d.ts +82 -0
  102. package/dist/payments/paymentsApi.js +121 -0
  103. package/dist/payments/paymentsInterfaces.d.ts +206 -0
  104. package/dist/payments/paymentsInterfaces.js +2 -0
  105. package/dist/payments/paymentsSchemas.d.ts +100 -0
  106. package/dist/payments/paymentsSchemas.js +65 -0
  107. package/dist/product-statuses/productStatusesApi.d.ts +47 -0
  108. package/dist/product-statuses/productStatusesApi.js +70 -0
  109. package/dist/product-statuses/productStatusesInterfaces.d.ts +66 -0
  110. package/dist/product-statuses/productStatusesInterfaces.js +2 -0
  111. package/dist/product-statuses/productStatusesSchemas.d.ts +34 -0
  112. package/dist/product-statuses/productStatusesSchemas.js +30 -0
  113. package/dist/products/productsApi.d.ts +365 -0
  114. package/dist/products/productsApi.js +459 -0
  115. package/dist/products/productsInterfaces.d.ts +586 -0
  116. package/dist/products/productsInterfaces.js +2 -0
  117. package/dist/products/productsSchemas.d.ts +192 -0
  118. package/dist/products/productsSchemas.js +96 -0
  119. package/dist/sitemap/sitemapApi.d.ts +35 -0
  120. package/dist/sitemap/sitemapApi.js +45 -0
  121. package/dist/sitemap/sitemapInterfaces.d.ts +40 -0
  122. package/dist/sitemap/sitemapInterfaces.js +2 -0
  123. package/dist/system/systemApi.d.ts +43 -0
  124. package/dist/system/systemApi.js +58 -0
  125. package/dist/system/systemInterfaces.d.ts +31 -0
  126. package/dist/system/systemInterfaces.js +5 -0
  127. package/dist/templates/templatesApi.d.ts +49 -0
  128. package/dist/templates/templatesApi.js +75 -0
  129. package/dist/templates/templatesInterfaces.d.ts +70 -0
  130. package/dist/templates/templatesInterfaces.js +2 -0
  131. package/dist/templates/templatesSchemas.d.ts +48 -0
  132. package/dist/templates/templatesSchemas.js +31 -0
  133. package/dist/templates-preview/templatesPreviewApi.d.ts +38 -0
  134. package/dist/templates-preview/templatesPreviewApi.js +53 -0
  135. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +121 -0
  136. package/dist/templates-preview/templatesPreviewInterfaces.js +2 -0
  137. package/dist/templates-preview/templatesPreviewSchemas.d.ts +83 -0
  138. package/dist/templates-preview/templatesPreviewSchemas.js +48 -0
  139. package/dist/users/usersApi.d.ts +143 -0
  140. package/dist/users/usersApi.js +173 -0
  141. package/dist/users/usersInterfaces.d.ts +235 -0
  142. package/dist/users/usersInterfaces.js +2 -0
  143. package/dist/users/usersSchemas.d.ts +38 -0
  144. package/dist/users/usersSchemas.js +28 -0
  145. package/dist/web-socket/wsApi.d.ts +25 -0
  146. package/dist/web-socket/wsApi.js +45 -0
  147. package/dist/web-socket/wsInterfaces.d.ts +17 -0
  148. package/dist/web-socket/wsInterfaces.js +2 -0
  149. package/package.json +3 -81
@@ -0,0 +1,128 @@
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ /**
37
+ * State module for managing application state and configuration.
38
+ * @description State module for managing application state and configuration.
39
+ */
40
+ class StateModule {
41
+ /**
42
+ * Constructor for StateModule
43
+ * @param {string} url - Base URL for API requests.
44
+ * @param {IConfig} config - Configuration object.
45
+ * @description Constructor for StateModule.
46
+ */
47
+ constructor(url, config) {
48
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
49
+ this.url = url;
50
+ this.lang = (_a = config.langCode) !== null && _a !== void 0 ? _a : 'en_US';
51
+ this.token = config.token;
52
+ this.traficLimit = config.traficLimit || false;
53
+ this.validationEnabled = (_c = (_b = config.validation) === null || _b === void 0 ? void 0 : _b.enabled) !== null && _c !== void 0 ? _c : false;
54
+ this.validationStrictMode = (_e = (_d = config.validation) === null || _d === void 0 ? void 0 : _d.strictMode) !== null && _e !== void 0 ? _e : false;
55
+ this.validationLogErrors = (_g = (_f = config.validation) === null || _f === void 0 ? void 0 : _f.logErrors) !== null && _g !== void 0 ? _g : true;
56
+ this.rawData = (_h = config.rawData) !== null && _h !== void 0 ? _h : false;
57
+ this.refreshToken = (_k = (_j = config.auth) === null || _j === void 0 ? void 0 : _j.refreshToken) !== null && _k !== void 0 ? _k : undefined;
58
+ this.providerMarker = (_m = (_l = config.auth) === null || _l === void 0 ? void 0 : _l.providerMarker) !== null && _m !== void 0 ? _m : 'email';
59
+ this.customAuth = (_p = (_o = config.auth) === null || _o === void 0 ? void 0 : _o.customAuth) !== null && _p !== void 0 ? _p : false;
60
+ this.errorsFunctions = {
61
+ '400': undefined,
62
+ '401': undefined,
63
+ '403': undefined,
64
+ '404': undefined,
65
+ '429': undefined,
66
+ '500': undefined,
67
+ '502': undefined,
68
+ '503': undefined,
69
+ '504': undefined,
70
+ };
71
+ this.saveFunction = (_r = (_q = config.auth) === null || _q === void 0 ? void 0 : _q.saveFunction) !== null && _r !== void 0 ? _r : null;
72
+ if (config.errors) {
73
+ this.isShell = (_s = config.errors.isShell) !== null && _s !== void 0 ? _s : true;
74
+ if (config.errors.customErrors) {
75
+ this.errorsFunctions['400'] =
76
+ (_t = config.errors.customErrors['400']) !== null && _t !== void 0 ? _t : undefined;
77
+ this.errorsFunctions['401'] =
78
+ (_u = config.errors.customErrors['401']) !== null && _u !== void 0 ? _u : undefined;
79
+ this.errorsFunctions['403'] =
80
+ (_v = config.errors.customErrors['403']) !== null && _v !== void 0 ? _v : undefined;
81
+ this.errorsFunctions['404'] =
82
+ (_w = config.errors.customErrors['404']) !== null && _w !== void 0 ? _w : undefined;
83
+ this.errorsFunctions['429'] =
84
+ (_x = config.errors.customErrors['429']) !== null && _x !== void 0 ? _x : undefined;
85
+ this.errorsFunctions['500'] =
86
+ (_y = config.errors.customErrors['500']) !== null && _y !== void 0 ? _y : undefined;
87
+ this.errorsFunctions['502'] =
88
+ (_z = config.errors.customErrors['502']) !== null && _z !== void 0 ? _z : undefined;
89
+ this.errorsFunctions['503'] =
90
+ (_0 = config.errors.customErrors['503']) !== null && _0 !== void 0 ? _0 : undefined;
91
+ this.errorsFunctions['504'] =
92
+ (_1 = config.errors.customErrors['504']) !== null && _1 !== void 0 ? _1 : undefined;
93
+ }
94
+ }
95
+ else {
96
+ this.isShell = false;
97
+ }
98
+ try {
99
+ if (typeof process === 'object' &&
100
+ +process.versions.node.split('.')[0] < 18) {
101
+ try {
102
+ this._NO_FETCH = true;
103
+ // Dynamically import https for older Node.js versions
104
+ Promise.resolve().then(() => __importStar(require('https'))).then((https) => {
105
+ this._https = https;
106
+ })
107
+ .catch(() => {
108
+ this._https = null;
109
+ });
110
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
111
+ }
112
+ catch (e) {
113
+ this._https = null;
114
+ }
115
+ }
116
+ else {
117
+ this._NO_FETCH = false;
118
+ this._https = null;
119
+ }
120
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
+ }
122
+ catch (e) {
123
+ this._NO_FETCH = false;
124
+ this._https = null;
125
+ }
126
+ }
127
+ }
128
+ exports.default = StateModule;
@@ -0,0 +1,149 @@
1
+ import type { IUploadingQuery } from '../file-uploading/fileUploadingInterfaces';
2
+ import type { IProductsQuery } from '../products/productsInterfaces';
3
+ import type StateModule from './stateModule';
4
+ /**
5
+ * Abstract class representing synchronization modules.
6
+ */
7
+ export default abstract class SyncModules {
8
+ /** Protected properties for state and URL */
9
+ protected state: StateModule;
10
+ protected _url: string;
11
+ private readonly _nodeDeviceId;
12
+ /**
13
+ * Constructor to initialize state and URL.
14
+ * @param {StateModule} state - StateModule instance.
15
+ */
16
+ protected constructor(state: StateModule);
17
+ /**
18
+ * Constructs the full URL path by appending the given path to the base URL.
19
+ * @param {string} path - The path to append to the base URL.
20
+ * @returns {string} The full URL as a string.
21
+ */
22
+ protected _getFullPath(path: string): string;
23
+ /**
24
+ * Converts query parameters into a query string.
25
+ * @param {IProductsQuery | IUploadingQuery | any} query - The query object containing key-value pairs.
26
+ * @returns {string} A string representation of the query parameters.
27
+ */
28
+ protected _queryParamsToString(query: IProductsQuery | IUploadingQuery | any): string;
29
+ /**
30
+ * Normalizes data based on language code.
31
+ * @param {any} data - The data to normalize.
32
+ * @param {string} langCode - The language code for normalization.
33
+ * @returns {any} Normalized data.
34
+ */
35
+ protected _normalizeData(data: any, langCode?: string): any;
36
+ /**
37
+ * Normalizes the body of a POST request.
38
+ * @param {any} body - The body to normalize.
39
+ * @param {string} [langCode] - The language code for normalization.
40
+ * @returns {any} Normalized body.
41
+ */
42
+ protected _normalizePostBody(body: any, langCode?: string): any;
43
+ /**
44
+ * Clears arrays within the data structure.
45
+ * @param {Record<string, any>} data - The data to clear.
46
+ * @returns {any} Cleared data.
47
+ */
48
+ protected _clearArray(data: Record<string, any>): any;
49
+ /**
50
+ * Sorts attributes by their positions.
51
+ * @param {any} data - The data containing attributes.
52
+ * @returns {any} Sorted attributes.
53
+ */
54
+ protected _sortAttributes: (data: any) => any;
55
+ /**
56
+ * Adds a specified number of days to a date.
57
+ * @param {Date} date - The initial date.
58
+ * @param {number} days - The number of days to add.
59
+ * @returns {any} The new date with added days.
60
+ */
61
+ protected _addDays(date: Date, days: number): any;
62
+ /**
63
+ * Common logic for processing schedule dates (weekly, monthly, or both).
64
+ * @param {Date} date - The date for which to process intervals.
65
+ * @param {object} config - Configuration for schedule repetition.
66
+ * @param {boolean} config.inEveryWeek - Whether to repeat weekly.
67
+ * @param {boolean} config.inEveryMonth - Whether to repeat monthly.
68
+ * @param {Function} processDate - Callback function to process each date.
69
+ */
70
+ protected _processScheduleDates(date: Date, config: {
71
+ inEveryWeek: boolean;
72
+ inEveryMonth: boolean;
73
+ }, processDate: (currentDate: Date) => void): void;
74
+ /**
75
+ * Generates intervals for a specific date based on a schedule.
76
+ * @param {Date} date - The date for which to generate intervals.
77
+ * @param {object} schedule - The schedule defining the intervals.
78
+ * @param {boolean} schedule.inEveryWeek - The number of weeks between intervals.
79
+ * @param {any[]} schedule.times - The times for each interval.
80
+ * @param {boolean} schedule.inEveryMonth - The month intervals for each interval.
81
+ * @param {Set<Array<string>>} utcIntervals - A set to store unique intervals.
82
+ */
83
+ protected _generateIntervalsForDate(date: Date, schedule: {
84
+ inEveryWeek: boolean;
85
+ times: any[];
86
+ inEveryMonth: boolean;
87
+ }, utcIntervals: Set<Array<string>>): void;
88
+ /**
89
+ * Adds time intervals to schedules.
90
+ * @param {any[]} schedules - The schedules to process.
91
+ * @returns {any} Schedules with added time intervals.
92
+ */
93
+ _addTimeIntervalsToSchedules(schedules: any[]): any;
94
+ /**
95
+ * Generates intervals for a specific date for form schedules.
96
+ * @param {Date} date - The date for which to generate intervals.
97
+ * @param {object} interval - The interval configuration.
98
+ * @param {boolean} interval.inEveryWeek - Indicates whether the schedule is weekly.
99
+ * @param {boolean} interval.inEveryMonth - Indicates whether the schedule is monthly.
100
+ * @param {any[]} timeIntervals - The time intervals to process.
101
+ * @param {Set<Array<string>>} utcIntervals - A set to store unique intervals.
102
+ */
103
+ protected _generateIntervalsForFormDate(date: Date, interval: {
104
+ inEveryWeek: boolean;
105
+ inEveryMonth: boolean;
106
+ }, timeIntervals: any[], utcIntervals: Set<Array<string>>): void;
107
+ /**
108
+ * Adds time intervals to form schedules (different structure).
109
+ * @param {any[]} intervals - The intervals to process.
110
+ * @returns {any} Intervals with added time intervals.
111
+ */
112
+ _addTimeIntervalsToFormSchedules(intervals: any[]): any;
113
+ /**
114
+ * Transforms additionalFields from array to object keyed by marker.
115
+ * Skipped when rawData is enabled in config.
116
+ * @param {any} attr - The attribute object that may contain additionalFields.
117
+ */
118
+ private _normalizeAdditionalFields;
119
+ /**
120
+ * Normalizes attributes within the data.
121
+ * @param {any} data - The data to normalize.
122
+ * @returns {any} Normalized attributes.
123
+ */
124
+ protected _normalizeAttr(data: any): any;
125
+ /**
126
+ * Processes data after fetching or receiving it.
127
+ * @param {any} data - The data to process.
128
+ * @param {any} [langCode] - The language code for processing.
129
+ * @returns {any} Processed data.
130
+ */
131
+ protected _dataPostProcess(data: any, langCode?: string): any;
132
+ /**
133
+ * Sets the access token in the state.
134
+ * @param {string} accessToken - The access token to set.
135
+ * @returns {any} The instance of SyncModules for chaining.
136
+ */
137
+ setAccessToken(accessToken: string): any;
138
+ /**
139
+ * Sets the refresh token in the state.
140
+ * @param {string} refreshToken - The refresh token to set.
141
+ * @returns {any} The instance of SyncModules for chaining.
142
+ */
143
+ setRefreshToken(refreshToken: string): any;
144
+ /**
145
+ * Get deviceMetadata
146
+ * @returns {string} - Returns an object containing device metadata.
147
+ */
148
+ protected _getDeviceMetadata(): string;
149
+ }