oneentry 1.0.131 → 1.0.133

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.
@@ -71,7 +71,7 @@ class AttributesSetsApi extends asyncModules_1.default {
71
71
  */
72
72
  async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
73
73
  const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
74
- return result;
74
+ return this._dataPostProcess(result, langCode);
75
75
  }
76
76
  /**
77
77
  * Getting a single object from a set of attributes by marker.
@@ -102,6 +102,7 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
102
102
  interface IAttributesSetsEntity {
103
103
  type: AttributeType;
104
104
  value?: any;
105
+ initialValue: any;
105
106
  marker: string;
106
107
  position: number;
107
108
  listTitles?: IListTitle[] | Record<string, any>;
@@ -374,8 +374,16 @@ interface IAuthEntity {
374
374
  * Interface representing an authentication provider entity.
375
375
  * @interface IAuthProvidersEntity
376
376
  * @property {number} id - The unique identifier of the auth provider entity. Example: 194.
377
- * @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider. Example: {"key": "value"}.
378
- * @property {IAuthProvidersEntityConfig} config - Configuration settings for the auth provider, stored as a key-value pair object. Example: { "key": "value" }
377
+ * @property {ILocalizeInfo} localizeInfos - Localized information for the auth provider.
378
+ * @example
379
+ {
380
+ "key": "value"
381
+ }
382
+ * @property {IAuthProvidersEntityConfig} config - Configuration settings for the auth provider, stored as a key-value pair object.
383
+ * @example
384
+ {
385
+ "key": "value"
386
+ }
379
387
  * @property {number} version - The version number of the auth provider entity. Example: 1.
380
388
  * @property {string} identifier - A unique string that identifies the auth provider. Example: "email".
381
389
  * @property {string} type - The type of the auth provider (e.g., 'email', 'google', etc.). Example: "email".
@@ -400,12 +408,12 @@ interface IAuthProvidersEntity {
400
408
  /**
401
409
  * Interface representing an authentication provider config.
402
410
  * @interface IAuthProvidersEntityConfig
403
- * @property {string} accessTokenTtlSec - Access token time to live in seconds.
404
- * @property {string} refreshTokenTtlMc - Refresh token time to live in milliseconds.
405
- * @property {string} tokenSecretKey - Token secret key.
406
- * @property {string} deleteNoneActiveUsersAfterDays - Delete none active users after days.
407
- * @property {string} systemCodeTlsSec - System code time to live in seconds.
408
- * @property {string} systemCodeLength - System code length.
411
+ * @property {string} accessTokenTtlSec - Access token time to live in seconds. Example: "3600".
412
+ * @property {string} refreshTokenTtlMc - Refresh token time to live in milliseconds. Example: "86400000".
413
+ * @property {string} tokenSecretKey - Token secret key. Example: "secret_key".
414
+ * @property {string} deleteNoneActiveUsersAfterDays - Delete none active users after days. Example: "30".
415
+ * @property {string} systemCodeTlsSec - System code time to live in seconds. Example: "86400".
416
+ * @property {string} systemCodeLength - System code length. Example: "6".
409
417
  */
410
418
  interface IAuthProvidersEntityConfig {
411
419
  accessTokenTtlSec: string;
@@ -270,7 +270,8 @@ class SyncModules {
270
270
  const d = data.attributeValues[attr];
271
271
  // normalize numbers
272
272
  if (d.type === 'integer' || d.type === 'float') {
273
- d.value = Number(d.value);
273
+ const numValue = Number(d.value);
274
+ d.value = isNaN(numValue) ? null : numValue;
274
275
  }
275
276
  // add timeIntervals
276
277
  if (data.attributeValues[attr].type === 'timeInterval') {
@@ -290,10 +291,12 @@ class SyncModules {
290
291
  // for forms attributes
291
292
  if ('attributes' in data) {
292
293
  const d = data.attributes;
294
+ // console.log('Schedules:: ', JSON.stringify(d));
293
295
  for (const attr in d) {
294
296
  // Normalize numbers
295
297
  if (d[attr].type === 'integer' || d[attr].type === 'float') {
296
- d[attr].value = Number(d[attr].value);
298
+ const numValue = Number(d[attr].value);
299
+ d[attr].value = isNaN(numValue) ? null : numValue;
297
300
  }
298
301
  // Add time intervals
299
302
  if (d[attr].type === 'timeInterval') {
@@ -309,8 +312,9 @@ class SyncModules {
309
312
  }
310
313
  // !!! For single attribute
311
314
  if ('attributes' in data) {
312
- //
315
+ // console.log('Schedules:: ', JSON.stringify(data));
313
316
  }
317
+ // console.log('Schedules:: ', JSON.stringify(data));
314
318
  return data;
315
319
  }
316
320
  /**
@@ -50,7 +50,8 @@ interface IBlocks {
50
50
  * Represents a response from the blocks API.
51
51
  * @interface IBlocksResponse
52
52
  * @property {number} total - Total number of found records. Example: 100.
53
- * @property {IBlockEntity[]} items - Array of block entities. Example:
53
+ * @property {IBlockEntity[]} items - Array of block entities.
54
+ * @example
54
55
  [
55
56
  {
56
57
  "attributeValues": [],
@@ -89,7 +90,8 @@ interface IBlocksResponse {
89
90
  /**
90
91
  * Represents a block entity with various attributes and properties.
91
92
  * @interface IBlockEntity
92
- * @property {AttributeType} attributeValues - Type of attributes used in the block. Example:
93
+ * @property {AttributeType} attributeValues - Type of attributes used in the block.
94
+ * @example
93
95
  {
94
96
  "block-text": {
95
97
  "type": "string",
@@ -101,7 +103,11 @@ interface IBlocksResponse {
101
103
  }
102
104
  }
103
105
  * @property {number} id - Unique identifier of the block. Example: 1234.
104
- * @property {ILocalizeInfo} localizeInfos - Localization information for the block. Example: {"key": "value"}
106
+ * @property {ILocalizeInfo} localizeInfos - Localization information for the block.
107
+ * @example
108
+ {
109
+ "key": "value"
110
+ }
105
111
  * @property {number} version - Version of the block entity. Example: 1.
106
112
  * @property {string} identifier - Unique string identifier for the block. Example: "block1".
107
113
  * @property {string} type - Type of the block, such as 'product', 'error_page', etc. Example: "product".
@@ -109,22 +115,24 @@ interface IBlocksResponse {
109
115
  * @property {boolean} isVisible - Indicates whether the block is visible. Example: true.
110
116
  * @property {number} [countElementsPerRow] - Number of elements displayed per row in the block, if applicable. Example: 3.
111
117
  * @property {number} [quantity] - Quantity of items in the block, if applicable. Example: 5.
112
- * @property {IProductsResponse} [similarProducts] - Response containing similar products associated with the block. Example:
113
- {
114
- "total": 10,
115
- "items": []
116
- }
117
- * @property {IProductsEntity[]} [products] - Array of product entities associated with the block. Example:
118
- [
118
+ * @property {IProductsResponse} [similarProducts] - Response containing similar products associated with the block.
119
+ * @example
119
120
  {
120
- "id": 1,
121
- "name": "Product 1"
122
- },
123
- {
124
- "id": 2,
125
- "name": "Product 2"
121
+ "total": 10,
122
+ "items": []
126
123
  }
127
- ]
124
+ * @property {IProductsEntity[]} [products] - Array of product entities associated with the block.
125
+ * @example
126
+ [
127
+ {
128
+ "id": 1,
129
+ "name": "Product 1"
130
+ },
131
+ {
132
+ "id": 2,
133
+ "name": "Product 2"
134
+ }
135
+ ]
128
136
  * @description Represents a block entity with various attributes and properties.
129
137
  */
130
138
  interface IBlockEntity {
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const projectUrl = "https://js-sdk-tests.oneentry.cloud/";
1
+ export declare const projectUrl = "https://js-sdk-tests.oneentry.cloud";
2
2
  export declare const projectToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiTlBNIiwic2VyaWFsTnVtYmVyIjozLCJpYXQiOjE3NDA1OTE0MzgsImV4cCI6MTc3MjEyNzQzMX0.MWbtBoXh-MqGTWgmiMTZSkfN8N-WYv3Cv2kSPhRpFlk";
3
3
  /**
4
4
  * authData
package/dist/config.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.authData2 = exports.authData = exports.projectToken = exports.projectUrl = void 0;
4
4
  // export const projectUrl = 'https://stage.oneentry.cloud';
5
5
  // export const projectToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiTlBNIiwic2VyaWFsTnVtYmVyIjozLCJpYXQiOjE3NDA1OTE0MzgsImV4cCI6MTc3MjEyNzQzMX0.MWbtBoXh-MqGTWgmiMTZSkfN8N-WYv3Cv2kSPhRpFlk';
6
- exports.projectUrl = 'https://js-sdk-tests.oneentry.cloud/';
6
+ exports.projectUrl = 'https://js-sdk-tests.oneentry.cloud';
7
7
  exports.projectToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiTlBNIiwic2VyaWFsTnVtYmVyIjozLCJpYXQiOjE3NDA1OTE0MzgsImV4cCI6MTc3MjEyNzQzMX0.MWbtBoXh-MqGTWgmiMTZSkfN8N-WYv3Cv2kSPhRpFlk';
8
8
  /**
9
9
  * authData
@@ -43,8 +43,6 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
43
43
  * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
44
44
  * @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
45
45
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
46
- * @description This method requires user authorization.
47
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
48
46
  */
49
47
  upload(file: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturn[] | IError>;
50
48
  /**
@@ -65,10 +63,16 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
65
63
  * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
66
64
  * @returns {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
67
65
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
68
- * @description This method requires user authorization.
69
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
70
66
  */
71
67
  delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
68
+ /**
69
+ * Create a File object from a URL.
70
+ * @param {string} url - The URL to fetch the file from.
71
+ * @param {string} filename - The name to give the created file.
72
+ * @param {string} [mimeType] - Optional MIME type for the file.
73
+ * @returns {Promise<File>} A promise that resolves to a File object.
74
+ */
75
+ createFileFromUrl(url: string, filename: string, mimeType?: string): Promise<File>;
72
76
  /**
73
77
  * Get file by parameters.
74
78
  * @handleName getFile
@@ -79,8 +83,6 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
79
83
  * @param {string} [template] - Preview template identifier. Example: 1.
80
84
  * @returns {any} Returns a promise that resolves to a Blob object containing the file data or an error object if there was an issue.
81
85
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
82
- * @description This method requires user authorization.
83
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
84
86
  */
85
87
  getFile(id: number, type: string, entity: string, filename: string, template?: string): Promise<any | IError>;
86
88
  }
@@ -4,6 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  /* eslint-disable jsdoc/reject-any-type */
7
+ /* eslint-disable @typescript-eslint/no-explicit-any */
8
+ /// <reference lib="dom" />
7
9
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
8
10
  // import { IFileEntity } from './fileUploadingInterfaces';
9
11
  /**
@@ -55,8 +57,6 @@ class FileUploadingApi extends asyncModules_1.default {
55
57
  * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
56
58
  * @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
57
59
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
- * @description This method requires user authorization.
59
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
60
60
  */
61
61
  async upload(file, fileQuery) {
62
62
  const query = { ...this._defaultQuery, ...fileQuery };
@@ -83,14 +83,26 @@ class FileUploadingApi extends asyncModules_1.default {
83
83
  * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
84
84
  * @returns {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
85
85
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
86
- * @description This method requires user authorization.
87
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
88
86
  */
89
87
  async delete(filename, fileQuery) {
90
88
  const query = { ...this._defaultQuery, ...fileQuery };
91
89
  const result = await this._fetchDelete(`?filename=${filename}&` + this._queryParamsToString(query));
92
90
  return result;
93
91
  }
92
+ /**
93
+ * Create a File object from a URL.
94
+ * @param {string} url - The URL to fetch the file from.
95
+ * @param {string} filename - The name to give the created file.
96
+ * @param {string} [mimeType] - Optional MIME type for the file.
97
+ * @returns {Promise<File>} A promise that resolves to a File object.
98
+ */
99
+ async createFileFromUrl(url, filename, mimeType) {
100
+ // eslint-disable-next-line no-undef
101
+ const response = await fetch(url);
102
+ const blob = await response.blob();
103
+ const file = new File([blob], filename, { type: mimeType || blob.type });
104
+ return file;
105
+ }
94
106
  /**
95
107
  * Get file by parameters.
96
108
  * @handleName getFile
@@ -101,8 +113,6 @@ class FileUploadingApi extends asyncModules_1.default {
101
113
  * @param {string} [template] - Preview template identifier. Example: 1.
102
114
  * @returns {any} Returns a promise that resolves to a Blob object containing the file data or an error object if there was an issue.
103
115
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
104
- * @description This method requires user authorization.
105
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
106
116
  */
107
117
  async getFile(id, type, entity, filename, template) {
108
118
  // eslint-disable-next-line no-undef
@@ -8,6 +8,14 @@ import type { IError } from '../base/utils';
8
8
  * @description This interface defines methods for uploading, deleting, and retrieving files in the CMS.
9
9
  */
10
10
  interface IFileUploading {
11
+ /**
12
+ * Create a File object from a URL.
13
+ * @param {string} url - The URL to fetch the file from.
14
+ * @param {string} filename - The name to give the created file.
15
+ * @param {string} [mimeType] - Optional MIME type for the file.
16
+ * @returns {Promise<File>} A promise that resolves to a File object.
17
+ */
18
+ createFileFromUrl(url: string, filename: string, mimeType?: string): Promise<File>;
11
19
  /**
12
20
  * Upload file function.
13
21
  * @handleName upload
@@ -32,8 +40,6 @@ interface IFileUploading {
32
40
  * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
33
41
  * @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
34
42
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
35
- * @description This method requires user authorization.
36
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
37
43
  */
38
44
  upload(file: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturn[] | IError>;
39
45
  /**
@@ -54,26 +60,23 @@ interface IFileUploading {
54
60
  * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
55
61
  * @returns {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
56
62
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
57
- * @description This method requires user authorization.
58
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
59
63
  */
60
64
  delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
61
65
  /**
62
- * Retrieves a file by its parameters.
66
+ * Get file by parameters.
63
67
  * @handleName getFile
64
- * @param {number} id - The ID of the file entity. Example: 3787.
65
- * @param {string} type - The type of the file. Example: "page".
66
- * @param {string} entity - The entity associated with the file. Example: "editor".
67
- * @param {string} [filename] - Optional filename to retrieve. Example: "file.png".
68
- * @returns {Blob} A promise that resolves to a Blob object or an error.
68
+ * @param {number} id - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
69
+ * @param {string} type - Type, determines the folder name in the storage. Example: "page".
70
+ * @param {string} entity - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
71
+ * @param {string} filename - Filename. Example: "file.png".
72
+ * @param {string} [template] - Preview template identifier. Example: 1.
73
+ * @returns {any} Returns a promise that resolves to a Blob object containing the file data or an error object if there was an issue.
69
74
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
70
- * @description This method requires user authorization.
71
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
72
75
  */
73
- getFile(id: number, type: string, entity: string, filename?: string): Promise<any | IError>;
76
+ getFile(id: number, type: string, entity: string, filename: string, template?: string): Promise<any | IError>;
74
77
  }
75
78
  /**
76
- * Represents a file entity with a file object or string path.
79
+ * Represents a file entity that may contain a file object or a path as a string.
77
80
  * @interface IFileEntity
78
81
  * @property {File | string | null} file - File object or string representing the file path. Example: new File(["content"], "file.png", { "type": "image/png" }) or "/path/to/file.png".
79
82
  * @description Represents a file entity that may contain a file object or a path as a string.
@@ -28,8 +28,6 @@ export default class FormsApi extends AsyncModules implements IForms {
28
28
  * @param {number} [limit] - Parameter for pagination. Default: 30.
29
29
  * @returns {IFormsEntity[]} Returns array for all objects of type FormEntity.
30
30
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
31
- * @description This method requires user authorization.
32
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
33
31
  */
34
32
  getAllForms(langCode?: string, offset?: number, limit?: number): Promise<IFormsEntity[] | IError>;
35
33
  /**
@@ -39,8 +37,6 @@ export default class FormsApi extends AsyncModules implements IForms {
39
37
  * @param {string} [langCode] - Language code. Default: "en_US".
40
38
  * @returns {IFormsEntity} Returns object of type FormEntity.
41
39
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
42
- * @description This method requires user authorization.
43
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
44
40
  */
45
41
  getFormByMarker(marker: string, langCode?: string): Promise<IFormsEntity | IError>;
46
42
  }
@@ -31,8 +31,6 @@ class FormsApi extends asyncModules_1.default {
31
31
  * @param {number} [limit] - Parameter for pagination. Default: 30.
32
32
  * @returns {IFormsEntity[]} Returns array for all objects of type FormEntity.
33
33
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
34
- * @description This method requires user authorization.
35
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
36
34
  */
37
35
  async getAllForms(langCode = this.state.lang, offset = 0, limit = 30) {
38
36
  const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
@@ -45,8 +43,6 @@ class FormsApi extends asyncModules_1.default {
45
43
  * @param {string} [langCode] - Language code. Default: "en_US".
46
44
  * @returns {IFormsEntity} Returns object of type FormEntity.
47
45
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
48
- * @description This method requires user authorization.
49
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
50
46
  */
51
47
  async getFormByMarker(marker, langCode = this.state.lang) {
52
48
  const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
@@ -62,13 +62,21 @@ interface IFromPages {
62
62
  * @property {number} id - The identifier of the object. Example: 12345.
63
63
  * @property {number | null} attributeSetId - The identifier of the attribute set being used, or null if not applicable. Example: 1234.
64
64
  * @property {string | null} type - Form type. Example: "contact".
65
- * @property {ILocalizeInfo} localizeInfos - The name of the form, taking into account localization. Example: {"key": "value"}.
65
+ * @property {ILocalizeInfo} localizeInfos - The name of the form, taking into account localization.
66
+ * @example
67
+ {
68
+ "key": "value"
69
+ }
66
70
  * @property {number} version - The version number of the object. Example: 1.
67
71
  * @property {number} position - The position of the object. Example: 1.
68
72
  * @property {string} identifier - The textual identifier for the record field. Example: "form_contact_us".
69
73
  * @property {string} processingType - Type of form processing. Example: "async".
70
74
  * @property {number | null} templateId - The identifier of the template used by the form, or null if no template is used. Example: 6789.
71
- * @property {IAttributes[] | Record<string, any>} attributes - The attributes of the form, which can be an array of attribute objects or a record of key-value pairs. Example: {"key": "value"}.
75
+ * @property {IAttributes[] | Record<string, any>} attributes - The attributes of the form, which can be an array of attribute objects or a record of key-value pairs.
76
+ * @example
77
+ {
78
+ "key": "value"
79
+ }
72
80
  * @description This interface defines the structure of a form entity, including its identifiers, attributes, and processing data.
73
81
  */
74
82
  interface IFormsEntity {
@@ -1,7 +1,7 @@
1
1
  import AsyncModules from '../base/asyncModules';
2
2
  import type StateModule from '../base/stateModule';
3
3
  import type { IError } from '../base/utils';
4
- import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IFormsDataEntity, IPostFormResponse } from './formsDataInterfaces';
4
+ import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IPostFormResponse } from './formsDataInterfaces';
5
5
  /**
6
6
  * Controllers for working with form data
7
7
  * @handle /api/content/form-data
@@ -17,18 +17,6 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
17
17
  * Constructor for FormsDataApi class.
18
18
  */
19
19
  constructor(state: StateModule);
20
- /**
21
- * Get all forms data.
22
- * @handleName getFormsData
23
- * @param {string} [langCode] - Language code. Default: "en_US".
24
- * @param {number} [offset] - Parameter for pagination. Default: 0.
25
- * @param {number} [limit] - Parameter for pagination. Default: 30.
26
- * @returns {IFormsDataEntity} Returns an object containing all forms data or an error object if there was an issue.
27
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
28
- * @description This method requires user authorization.
29
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
30
- */
31
- getFormsData(langCode?: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
32
20
  /**
33
21
  * Creating an object of data save information by form
34
22
  * @handleName postFormsData
@@ -68,8 +56,6 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
68
56
  * @param {string} [langCode] - Language code. Default: "en_US".
69
57
  * @returns {IPostFormResponse} Returns an object containing the created form data entry and message.
70
58
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
71
- * @description This method requires user authorization.
72
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
73
59
  */
74
60
  postFormsData(body: IBodyPostFormData, langCode?: string): Promise<IPostFormResponse | IError>;
75
61
  /**
@@ -92,8 +78,6 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
92
78
  * @param {number} [limit] - Parameter for pagination. Default: 30.
93
79
  * @returns {IFormsByMarkerDataEntity} Returns an object containing the form data or an error object if there was an issue.
94
80
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
95
- * @description This method requires user authorization.
96
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
97
81
  */
98
82
  getFormsDataByMarker(marker: string, formModuleConfigId: number, body?: object, isNested?: number, langCode?: string, offset?: number, limit?: number): Promise<IFormsByMarkerDataEntity | IError>;
99
83
  }
@@ -23,21 +23,6 @@ class FormsDataApi extends asyncModules_1.default {
23
23
  super(state);
24
24
  this._url = state.url + '/api/content/form-data';
25
25
  }
26
- /**
27
- * Get all forms data.
28
- * @handleName getFormsData
29
- * @param {string} [langCode] - Language code. Default: "en_US".
30
- * @param {number} [offset] - Parameter for pagination. Default: 0.
31
- * @param {number} [limit] - Parameter for pagination. Default: 30.
32
- * @returns {IFormsDataEntity} Returns an object containing all forms data or an error object if there was an issue.
33
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
34
- * @description This method requires user authorization.
35
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
36
- */
37
- async getFormsData(langCode = this.state.lang, offset = 0, limit = 30) {
38
- const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
39
- return this._dataPostProcess(result, langCode);
40
- }
41
26
  /**
42
27
  * Creating an object of data save information by form
43
28
  * @handleName postFormsData
@@ -77,8 +62,6 @@ class FormsDataApi extends asyncModules_1.default {
77
62
  * @param {string} [langCode] - Language code. Default: "en_US".
78
63
  * @returns {IPostFormResponse} Returns an object containing the created form data entry and message.
79
64
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
80
- * @description This method requires user authorization.
81
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
82
65
  */
83
66
  async postFormsData(body, langCode = this.state.lang) {
84
67
  const formData = {};
@@ -124,6 +107,10 @@ class FormsDataApi extends asyncModules_1.default {
124
107
  }
125
108
  // Remove the 'fileQuery' property from the object after processing
126
109
  delete fd.fileQuery;
110
+ // Remove the 'contentType' property from the file object because it is not needed and not valid
111
+ fd.value.map((file) => {
112
+ delete file.contentType;
113
+ });
127
114
  }
128
115
  // Return the processed form data element
129
116
  return fd;
@@ -153,8 +140,6 @@ class FormsDataApi extends asyncModules_1.default {
153
140
  * @param {number} [limit] - Parameter for pagination. Default: 30.
154
141
  * @returns {IFormsByMarkerDataEntity} Returns an object containing the form data or an error object if there was an issue.
155
142
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
156
- * @description This method requires user authorization.
157
- * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
158
143
  */
159
144
  async getFormsDataByMarker(marker, formModuleConfigId, body = {}, isNested = 1, langCode = this.state.lang, offset = 0, limit = 30) {
160
145
  const result = await this._fetchPost(`/marker/${marker}?formModuleConfigId=${formModuleConfigId}&isNested=${isNested}&langCode=${langCode}&offset=${offset}&limit=${limit}`, body);
@@ -9,17 +9,6 @@ import type { IUploadingQuery } from '../file-uploading/fileUploadingInterfaces'
9
9
  * @description This interface defines methods for retrieving and posting form data in the system.
10
10
  */
11
11
  interface IFormsData {
12
- /**
13
- * Retrieves all forms data.
14
- * @handleName getFormsData
15
- * @param {string} langCode - The language code for localization. Default: "en_US".
16
- * @param {number} [offset] - Optional offset for pagination. Default: 0.
17
- * @param {number} [limit] - Optional limit for pagination. Default: 30.
18
- * @returns {IFormsDataEntity} A promise that resolves to a collection of form data entities or an error.
19
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
20
- * @description This method retrieves all forms data.
21
- */
22
- getFormsData(langCode: string, offset?: number, limit?: number): Promise<IFormsDataEntity | IError>;
23
12
  /**
24
13
  * Creating an object of data save information by form
25
14
  * @handleName postFormsData
@@ -33,17 +22,17 @@ interface IFormsData {
33
22
  "status": "sent",
34
23
  "formData": [
35
24
  {
36
- "marker": "name",
37
- "type": "string",
38
- "value": "Test"
25
+ "marker": "name",
26
+ "type": "string",
27
+ "value": "Test"
39
28
  }
40
29
  ]
41
30
  }
42
31
  * @param {string} body.formIdentifier - The identifier for the form. Example: "form".
43
32
  * @param {number} body.formModuleConfigId - The ID of the form module configuration. Example: 2.
44
33
  * @param {string} body.moduleEntityIdentifier - The identifier of the module entity. Example: "form".
45
- * @param {string | null} [body.replayTo] - The email address to which the reply should be sent.
46
- * @param {string | null} [body.status] - The status of the form submission.
34
+ * @param {string | null} [body.replayTo] - The email address to which the reply should be sent. Example: null.
35
+ * @param {string | null} [body.status] - The status of the form submission. Example: "sent".
47
36
  * @param {FormDataType[]} body.formData - Form data.
48
37
  * @example
49
38
  [
@@ -53,9 +42,9 @@ interface IFormsData {
53
42
  "value": "Jack"
54
43
  }
55
44
  ]
56
- * @param {string} body.formData.marker - The marker identifying the form field. Example: "name".
57
- * @param {string} body.formData.type - The type of the form field. Example: "string".
58
- * @param {string} body.formData.value - The value of the form field. Example: "Jack".
45
+ * @param {string} body.formData[].marker - The marker identifying the form field. Example: "name".
46
+ * @param {string} body.formData[].type - The type of the form field. Example: "string".
47
+ * @param {string} body.formData[].value - The value of the form field. Example: "Jack".
59
48
  * @param {string} [langCode] - Language code. Default: "en_US".
60
49
  * @returns {IPostFormResponse} Returns an object containing the created form data entry and message.
61
50
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
@@ -127,8 +116,8 @@ interface IFormDataEntity {
127
116
  "actionMessage": "Action message string"
128
117
  }
129
118
  ]
130
- * @description This interface defines the structure of a collection of form data entities, including a total count and an array of items.
131
119
  * @property {number} total - Total number of found records. Example: 100.
120
+ * @description This interface defines the structure of a collection of form data entities, including a total count and an array of items.
132
121
  */
133
122
  interface IFormsDataEntity {
134
123
  items: IFormDataEntity[];
@@ -213,7 +202,6 @@ interface IFormsByMarkerDataEntity {
213
202
  /**
214
203
  * Represents the structure of the response after posting form data.
215
204
  * @interface IPostFormResponse
216
- * @property {string} actionMessage - Action message for the form data. Example: "Form submitted successfully".
217
205
  * @property {object} formData - Form data.
218
206
  * @example
219
207
  {
@@ -250,6 +238,7 @@ interface IFormsByMarkerDataEntity {
250
238
  "value": "Jack"
251
239
  }
252
240
  ]
241
+ * @property {string} actionMessage - Action message for the form data. Example: "Form submitted successfully".
253
242
  */
254
243
  interface IPostFormResponse {
255
244
  actionMessage: string;
@@ -35,8 +35,6 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
35
35
  * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
36
36
  * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
37
37
  * @returns {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
38
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
39
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
40
38
  */
41
39
  getICollections(langCode?: string, userQuery?: {
42
40
  limit: number;
@@ -51,7 +49,6 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
51
49
  * @param {string} [langCode] - Language code. Default: "en_US".
52
50
  * @returns {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
53
51
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
54
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
55
52
  */
56
53
  getICollectionById(id: number, langCode?: string): Promise<ICollectionEntity | IError>;
57
54
  /**
@@ -101,7 +98,6 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
101
98
  * @param {string} [langCode] - Language code. Default: "en_US".
102
99
  * @returns {ICollectionRowsResponce} Returns CollectionRowEntity object.
103
100
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
104
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
105
101
  */
106
102
  getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
107
103
  /**
@@ -112,7 +108,6 @@ export default class IntegrationCollectionsApi extends AsyncModules implements I
112
108
  * @param {string} [langCode] - Language code. Default: "en_US".
113
109
  * @returns {ICollectionRow} Returns CollectionRowEntity object.
114
110
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
115
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
116
111
  */
117
112
  getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<ICollectionRow | IError>;
118
113
  /**
@@ -44,8 +44,6 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
44
44
  * @param {string} [userQuery.entityType] - Entity type. Example: "orders".
45
45
  * @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
46
46
  * @returns {ICollectionEntity[]} Returns an array of ICollection objects or an error object if there was an issue.
47
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
48
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
49
47
  */
50
48
  async getICollections(langCode = this.state.lang, userQuery) {
51
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -60,7 +58,6 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
60
58
  * @param {string} [langCode] - Language code. Default: "en_US".
61
59
  * @returns {ICollectionEntity} Returns an ICollection object or an error object if there was an issue.
62
60
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
63
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
64
61
  */
65
62
  async getICollectionById(id, langCode = this.state.lang) {
66
63
  const result = await this._fetchGet(`/${id}?` + this._queryParamsToString({ langCode }));
@@ -119,7 +116,6 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
119
116
  * @param {string} [langCode] - Language code. Default: "en_US".
120
117
  * @returns {ICollectionRowsResponce} Returns CollectionRowEntity object.
121
118
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
122
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
123
119
  */
124
120
  async getICollectionRowsByMarker(marker, langCode = this.state.lang) {
125
121
  const result = await this._fetchGet(`/marker/${marker}/rows?langCode=${langCode}`);
@@ -133,7 +129,6 @@ class IntegrationCollectionsApi extends asyncModules_1.default {
133
129
  * @param {string} [langCode] - Language code. Default: "en_US".
134
130
  * @returns {ICollectionRow} Returns CollectionRowEntity object.
135
131
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
136
- * @description This method requires user authorization. For more information about configuring the authorization module, see the documentation in the configuration settings section of the SDK.
137
132
  */
138
133
  async getICollectionRowByMarkerAndId(marker, id, langCode = this.state.lang) {
139
134
  const result = await this._fetchGet(`/marker/${marker}/rows/${id}?langCode=${langCode}`);
@@ -60,7 +60,11 @@ interface IMenusPages {
60
60
  * @interface IMenusEntity
61
61
  * @property {number} id - The unique identifier of the menu. Example: 1.
62
62
  * @property {string} identifier - The menu identifier. Example: "main_menu".
63
- * @property {ILocalizeInfo} localizeInfos - Contains localization information. Example: {"title": "menu"}.
63
+ * @property {ILocalizeInfo} localizeInfos - Contains localization information.
64
+ * @example
65
+ {
66
+ "title": "menu"
67
+ }
64
68
  * @property {IMenusPages[]} pages - Array of menu pages.
65
69
  * @example
66
70
  [
@@ -232,21 +232,13 @@ interface IOrderProductData {
232
232
  /**
233
233
  * Interface representing product data in an order.
234
234
  * @interface IOrderProductsData
235
- * @property {number} id - Product identifier. Example: 1.
236
- * @property {any} previewImage - Product preview image.
237
- * @property {number} price - Product price. Example: 10.
235
+ * @property {number} productId - Product identifier. Example: 1.
238
236
  * @property {number} quantity - Quantity of the product. Example: 2.
239
- * @property {string} sku - Product SKU. Example: "sku_1".
240
- * @property {string} title - Product title. Example: "Product 1".
241
237
  * @description Represents a product data in an order.
242
238
  */
243
239
  interface IOrderProductsData {
244
- id: number;
245
- previewImage: any;
246
- price: number;
240
+ productId: number;
247
241
  quantity: number;
248
- sku: string;
249
- title: string;
250
242
  }
251
243
  /**
252
244
  * Interface representing an order storage object.
@@ -317,7 +309,8 @@ interface IBaseOrdersEntityResponse {
317
309
  * Interface representing an order storage object.
318
310
  * @interface IOrdersEntity
319
311
  * @property {number} id - Object identifier. Example: 1.
320
- * @property {ILocalizeInfo} localizeInfos - Name considering localization. Example:
312
+ * @property {ILocalizeInfo} localizeInfos - Name considering localization.
313
+ * @example
321
314
  {
322
315
  "title": "Cash"
323
316
  }
@@ -325,7 +318,13 @@ interface IBaseOrdersEntityResponse {
325
318
  * @property {string} identifier - Textual identifier for the record field. Example: "order_storage_1".
326
319
  * @property {string} formIdentifier - Textual identifier for the form used by the order storage. Example: "bar-orders-form".
327
320
  * @property {number | null} generalTypeId - Type identifier. Example: 1.
328
- * @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage. Example: [{ "identifier": "payment-1" }].
321
+ * @property {IPaymentAccountIdentifiers[]} paymentAccountIdentifiers - Array of textual identifiers of payment accounts used by the order storage.
322
+ * @example
323
+ [
324
+ {
325
+ "identifier": "payment-1"
326
+ }
327
+ ]
329
328
  * @description Represents an order storage object.
330
329
  */
331
330
  interface IOrdersEntity {
@@ -109,7 +109,14 @@ interface IPageConfig {
109
109
  * @property {string} identifier - The textual identifier for the record field. Example: "catalog".
110
110
  * @property {number} attributeSetId - The identifier of the attribute set being used. Example: 0.
111
111
  * @property {string} processingType - Type of form processing. Example: "email".
112
- * @property {ILocalizeInfo} localizeInfos - The name of the page, taking into account localization. Example:
112
+ * @property {ILocalizeInfo} localizeInfos - The name of the page, taking into account localization.
113
+ * @example
114
+ {
115
+ "title": "Blog",
116
+ "menuTitle": "Blog",
117
+ "htmlContent": "",
118
+ "plainContent": ""
119
+ }
113
120
  * @property {object} processingData - Form data. Example: {}.
114
121
  * @property {number} position - The position of the object. Example: 0.
115
122
  * @property {IAttributes[]} attributes - Array of attribute values from the used attribute set for displaying the form (taking into account the specified language).
@@ -157,7 +164,14 @@ interface IPositionForm {
157
164
  * @interface IPositionBlock
158
165
  * @property {number} id - The identifier of the object. Example: 1.
159
166
  * @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "block".
160
- * @property {ILocalizeInfo} localizeInfos - The name of the page, taking into account localization. Example:
167
+ * @property {ILocalizeInfo} localizeInfos - The name of the page, taking into account localization.
168
+ * @example
169
+ {
170
+ "title": "Blog",
171
+ "menuTitle": "Blog",
172
+ "htmlContent": "",
173
+ "plainContent": ""
174
+ }
161
175
  * @property {number} version - The version number of the object. Example: 0.
162
176
  * @property {number} position - The position of the object. Example: 1.
163
177
  * @property {string} identifier - The textual identifier for the record field. Example: "product_block".
@@ -177,9 +191,6 @@ interface IPositionForm {
177
191
  }
178
192
  * @property {number} [countElementsPerRow] - Number of elements displayed per row in the block, if applicable. Example: 3.
179
193
  * @property {number} [quantity] - Quantity pages in block. Example: 1.
180
- {
181
- "title": "Product Block"
182
- }
183
194
  * @description This interface defines the structure of a position block entity, including its identifiers, attributes, and visibility.
184
195
  */
185
196
  interface IPositionBlock {
@@ -203,7 +214,8 @@ interface IPositionBlock {
203
214
  * @property {number | null} parentId - The id of the parent page, if it contains null, then it is the top-level page. Example: 10.
204
215
  * @property {string} pageUrl - Unique page Url. Example: "blog".
205
216
  * @property {number} depth - Page nesting depth relative to parentId. Example: 10.
206
- * @property {ILocalizeInfo} localizeInfos - The name of the page, taking into account localization. Example:
217
+ * @property {ILocalizeInfo} localizeInfos - The name of the page, taking into account localization.
218
+ * @example
207
219
  {
208
220
  "title": "Blog",
209
221
  "menuTitle": "Blog",
@@ -225,7 +237,7 @@ interface IPositionBlock {
225
237
  }
226
238
  }
227
239
  * @property {boolean} isSync - Indication of page indexing. Example: true.
228
- * @property {any} [template] - Template object. Example:
240
+ * @property {any} [template] - Template object. Example: {}.
229
241
  * @property {number} [position] - Item number (for sorting). Example: 2.
230
242
  * @property {any} [config] - Output settings for catalog pages.
231
243
  * @example
@@ -379,9 +379,9 @@ interface IFilterParams {
379
379
  /**
380
380
  * @interface IProductsEntity
381
381
  * @property {number} id - The unique identifier. Example: 12345.
382
- * @property {ILocalizeInfo} localizeInfos - The name of the products, taking into account localization. Example:
382
+ * @property {ILocalizeInfo} localizeInfos - The name of the products, taking into account localization. Example: {}.
383
383
  * @property {string | null} statusIdentifier - Product page status identifiers (may be null). Example: "in_stock".
384
- * @property {any} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example:
384
+ * @property {any} statusLocalizeInfos - JSON description of the item status object, taking into account the language. Example: {}.
385
385
  * @property {string | null} attributeSetIdentifier - Set of attributes id. Example: "set_12345".
386
386
  * @property {number} position - Item number (for sorting). Example: 1.
387
387
  * @property {string | null} [templateIdentifier] - User id of the linked template. Example: "template_12345".
@@ -395,23 +395,36 @@ interface IFilterParams {
395
395
  }
396
396
  * @property {string | null} sku - Product SKU (Stock Keeping Unit), may be null. Example: "SKU_12345".
397
397
  * @property {boolean} isSync - Indication of page indexing. Example: true.
398
- * @property {AttributeType} attributeValues - Array of attribute values from the index, represented. Example:
398
+ * @property {AttributeType} attributeValues - Array of attribute values from the index, represented.
399
+ * @example
399
400
  [
400
401
  {
401
402
  "id": "color",
402
403
  "value": "red"
403
404
  }
404
405
  ]
405
- * @property {string[]} categories - Product categories. Example: [1, 2, 3]
406
+ * @property {string[]} categories - Product categories.
407
+ * @example
408
+ [
409
+ 1,
410
+ 2,
411
+ 3
412
+ ]
406
413
  * @property {boolean} isVisible - A sign of page visibility. Example: true.
407
- * @property {any[]} [productPages] - Array of product pages or a single product page object. Example:
408
- * @property {string[]} [blocks] - Array of block identifiers. Example:
414
+ * @property {any} [productPages] - Array of product pages or a single product page object. Example: [].
415
+ * @property {string[]} [blocks] - Array of block identifiers.
416
+ * @example
409
417
  [
410
418
  "block_12345",
411
419
  "block_67890"
412
420
  ]
413
421
  * @property {boolean} isPositionLocked - Sorting position lock indicator (optional). Example: false.
414
- * @property {number[]} relatedIds - Ids of related product pages. Example: [12345, 67890].
422
+ * @property {number[]} relatedIds - Ids of related product pages.
423
+ * @example
424
+ [
425
+ 12345,
426
+ 67890
427
+ ]
415
428
  * @description This interface defines the structure of a product entity, including its identifiers, attributes, and related information.
416
429
  */
417
430
  interface IProductsEntity {
@@ -35,15 +35,21 @@ export default class UsersApi extends AsyncModules implements IUsers {
35
35
  "formIdentifier": "reg",
36
36
  "authData": [
37
37
  {
38
- "marker": "password",
39
- "value": "12345"
38
+ "marker": "email_reg",
39
+ "value": "your-email@oneentery.cloud"
40
+ },
41
+ {
42
+ "marker": "password_reg",
43
+ "value": "12345"
44
+ }
45
+ ],
46
+ "formData": [
47
+ {
48
+ "marker": "last_name",
49
+ "type": "string",
50
+ "value": "Username"
40
51
  }
41
52
  ],
42
- "formData": {
43
- "marker": "last_name",
44
- "type": "string",
45
- "value": "Username"
46
- },
47
53
  "notificationData": {
48
54
  "email": "example@oneentry.cloud",
49
55
  "phonePush": ["+99999999999"],
@@ -51,11 +57,49 @@ export default class UsersApi extends AsyncModules implements IUsers {
51
57
  },
52
58
  "state": {}
53
59
  }
60
+ * @param {string} body.formIdentifier - Identifies the registration form being used. Example: "reg_form".
61
+ * @param {string} body.authData - Contains authentication credentials for the user. Example:
62
+ * @example
63
+ [
64
+ {
65
+ "marker": "email_reg",
66
+ "value": "example@oneentry.cloud"
67
+ },
68
+ {
69
+ "marker": "password_reg",
70
+ "value": "password"
71
+ }
72
+ ]
73
+ * @param {string} body.authData[index].marker - Identifies the field being used. Example: "email_reg".
74
+ * @param {string} body.authData[index].value - Contains the value of the field. Example: "example@oneentry.cloud".
75
+ * @param {string} body.formData - Contains additional data for the user.
76
+ * @example
77
+ [
78
+ {
79
+ "marker": "last_name",
80
+ "type": "string",
81
+ "value": "Username"
82
+ }
83
+ ]
84
+ * @param {string} body.formData[index].marker - The marker of the field. Example: "last_name".
85
+ * @param {string} body.formData[index].type - The type of the field. Example: "string".
86
+ * @param {string} body.formData[index].value - The value of the field. Example: "Username".
87
+ * @param {string} body.notificationData - The notification data.
88
+ * @example
89
+ {
90
+ "email": "example@oneentry.cloud",
91
+ "phonePush": ["+99999999999"],
92
+ "phoneSMS": "+99999999999"
93
+ }
94
+ * @param {string} body.notificationData.email - The email address of the user. Example: "example@oneentry.cloud".
95
+ * @param {string} body.notificationData.phonePush - An array of phone numbers for push notifications. Example: ["+99999999999"].
96
+ * @param {string} body.notificationData.phoneSMS - The phone number for SMS notifications. Example: "+99999999999".
54
97
  * @param {string} [langCode] - Language code. Default: "en_US".
55
98
  * @returns {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
56
99
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
57
100
  * @description This method updates the user's data. This method requires user authorization.
58
101
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
102
+ * @see For more information about {@link https://doc.oneentry.cloud/docs/forms/create-form registration forms}, see the documentation in the {@link https://doc.oneentry.cloud/docs/forms/create-form forms configuration section}.
59
103
  */
60
104
  updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
61
105
  /**
@@ -41,15 +41,21 @@ class UsersApi extends asyncModules_1.default {
41
41
  "formIdentifier": "reg",
42
42
  "authData": [
43
43
  {
44
- "marker": "password",
45
- "value": "12345"
44
+ "marker": "email_reg",
45
+ "value": "your-email@oneentery.cloud"
46
+ },
47
+ {
48
+ "marker": "password_reg",
49
+ "value": "12345"
50
+ }
51
+ ],
52
+ "formData": [
53
+ {
54
+ "marker": "last_name",
55
+ "type": "string",
56
+ "value": "Username"
46
57
  }
47
58
  ],
48
- "formData": {
49
- "marker": "last_name",
50
- "type": "string",
51
- "value": "Username"
52
- },
53
59
  "notificationData": {
54
60
  "email": "example@oneentry.cloud",
55
61
  "phonePush": ["+99999999999"],
@@ -57,11 +63,49 @@ class UsersApi extends asyncModules_1.default {
57
63
  },
58
64
  "state": {}
59
65
  }
66
+ * @param {string} body.formIdentifier - Identifies the registration form being used. Example: "reg_form".
67
+ * @param {string} body.authData - Contains authentication credentials for the user. Example:
68
+ * @example
69
+ [
70
+ {
71
+ "marker": "email_reg",
72
+ "value": "example@oneentry.cloud"
73
+ },
74
+ {
75
+ "marker": "password_reg",
76
+ "value": "password"
77
+ }
78
+ ]
79
+ * @param {string} body.authData[index].marker - Identifies the field being used. Example: "email_reg".
80
+ * @param {string} body.authData[index].value - Contains the value of the field. Example: "example@oneentry.cloud".
81
+ * @param {string} body.formData - Contains additional data for the user.
82
+ * @example
83
+ [
84
+ {
85
+ "marker": "last_name",
86
+ "type": "string",
87
+ "value": "Username"
88
+ }
89
+ ]
90
+ * @param {string} body.formData[index].marker - The marker of the field. Example: "last_name".
91
+ * @param {string} body.formData[index].type - The type of the field. Example: "string".
92
+ * @param {string} body.formData[index].value - The value of the field. Example: "Username".
93
+ * @param {string} body.notificationData - The notification data.
94
+ * @example
95
+ {
96
+ "email": "example@oneentry.cloud",
97
+ "phonePush": ["+99999999999"],
98
+ "phoneSMS": "+99999999999"
99
+ }
100
+ * @param {string} body.notificationData.email - The email address of the user. Example: "example@oneentry.cloud".
101
+ * @param {string} body.notificationData.phonePush - An array of phone numbers for push notifications. Example: ["+99999999999"].
102
+ * @param {string} body.notificationData.phoneSMS - The phone number for SMS notifications. Example: "+99999999999".
60
103
  * @param {string} [langCode] - Language code. Default: "en_US".
61
104
  * @returns {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
62
105
  * @throws {IError} If there is an error during the fetch operation, it will return an error object.
63
106
  * @description This method updates the user's data. This method requires user authorization.
64
107
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
108
+ * @see For more information about {@link https://doc.oneentry.cloud/docs/forms/create-form registration forms}, see the documentation in the {@link https://doc.oneentry.cloud/docs/forms/create-form forms configuration section}.
65
109
  */
66
110
  async updateUser(body, langCode = this.state.lang) {
67
111
  if (!('langCode' in body))
@@ -25,23 +25,29 @@ interface IUsers {
25
25
  */
26
26
  getUser(langCode?: string): Promise<IUserEntity | IError>;
27
27
  /**
28
- * Updates the user's data.
28
+ * Updating a single user object.
29
29
  * @handleName updateUser
30
- * @param {IUserBody} data - The new data for the user.
30
+ * @param {IUserBody} body - Request body.
31
31
  * @example
32
32
  {
33
33
  "formIdentifier": "reg",
34
34
  "authData": [
35
35
  {
36
- "marker": "password",
37
- "value": "12345"
36
+ "marker": "email_reg",
37
+ "value": "your-email@oneentery.cloud"
38
+ },
39
+ {
40
+ "marker": "password_reg",
41
+ "value": "12345"
42
+ }
43
+ ],
44
+ "formData": [
45
+ {
46
+ "marker": "last_name",
47
+ "type": "string",
48
+ "value": "Username"
38
49
  }
39
50
  ],
40
- "formData": {
41
- "marker": "last_name",
42
- "type": "string",
43
- "value": "Username"
44
- },
45
51
  "notificationData": {
46
52
  "email": "example@oneentry.cloud",
47
53
  "phonePush": ["+99999999999"],
@@ -49,13 +55,51 @@ interface IUsers {
49
55
  },
50
56
  "state": {}
51
57
  }
52
- * @param {string} [langCode] - Optional language code for localization. Default: "en_US".
53
- * @returns {boolean} A promise resolving to true if successful, or an error.
54
- * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
58
+ * @param {string} body.formIdentifier - Identifies the registration form being used. Example: "reg_form".
59
+ * @param {string} body.authData - Contains authentication credentials for the user. Example:
60
+ * @example
61
+ [
62
+ {
63
+ "marker": "email_reg",
64
+ "value": "example@oneentry.cloud"
65
+ },
66
+ {
67
+ "marker": "password_reg",
68
+ "value": "password"
69
+ }
70
+ ]
71
+ * @param {string} body.authData[index].marker - Identifies the field being used. Example: "email_reg".
72
+ * @param {string} body.authData[index].value - Contains the value of the field. Example: "example@oneentry.cloud".
73
+ * @param {string} body.formData - Contains additional data for the user.
74
+ * @example
75
+ [
76
+ {
77
+ "marker": "last_name",
78
+ "type": "string",
79
+ "value": "Username"
80
+ }
81
+ ]
82
+ * @param {string} body.formData[index].marker - The marker of the field. Example: "last_name".
83
+ * @param {string} body.formData[index].type - The type of the field. Example: "string".
84
+ * @param {string} body.formData[index].value - The value of the field. Example: "Username".
85
+ * @param {string} body.notificationData - The notification data.
86
+ * @example
87
+ {
88
+ "email": "example@oneentry.cloud",
89
+ "phonePush": ["+99999999999"],
90
+ "phoneSMS": "+99999999999"
91
+ }
92
+ * @param {string} body.notificationData.email - The email address of the user. Example: "example@oneentry.cloud".
93
+ * @param {string} body.notificationData.phonePush - An array of phone numbers for push notifications. Example: ["+99999999999"].
94
+ * @param {string} body.notificationData.phoneSMS - The phone number for SMS notifications. Example: "+99999999999".
95
+ * @param {string} [langCode] - Language code. Default: "en_US".
96
+ * @returns {boolean} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
97
+ * @throws {IError} If there is an error during the fetch operation, it will return an error object.
55
98
  * @description This method updates the user's data. This method requires user authorization.
56
99
  * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
100
+ * @see For more information about {@link https://doc.oneentry.cloud/docs/forms/create-form registration forms}, see the documentation in the {@link https://doc.oneentry.cloud/docs/forms/create-form forms configuration section}.
57
101
  */
58
- updateUser(data: IUserBody, langCode?: string): Promise<boolean | IError>;
102
+ updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
59
103
  /**
60
104
  * Archiving one user object (marked for deletion).
61
105
  * @handleName archiveUser
@@ -110,8 +154,17 @@ interface IUsers {
110
154
  }
111
155
  ]
112
156
  * @property {string} formIdentifier - Text identifier of the form. Example: "form_12345".
113
- * @property {any[]} groups - Array of user groups. Example: ["group_1", "group_2"].
114
- * @property {any} state - Object containing additional user state information. Example: {"key": "value"}
157
+ * @property {any[]} groups - Array of user groups.
158
+ * @example
159
+ [
160
+ "group_1",
161
+ "group_2"
162
+ ]
163
+ * @property {any} state - Object containing additional user state information.
164
+ * @example
165
+ {
166
+ "key": "value"
167
+ }
115
168
  * @description Represents a user entity with various properties, including identifiers, form data, and user groups.
116
169
  */
117
170
  interface IUserEntity {
@@ -158,7 +211,11 @@ interface IUserEntity {
158
211
  "phonePush": ["+99999999999"],
159
212
  "phoneSMS": "+99999999999"
160
213
  }
161
- * @property {any} [state] - Object containing additional state information. Example: {"key": "value"}
214
+ * @property {any} [state] - Object containing additional state information.
215
+ * @example
216
+ {
217
+ "key": "value"
218
+ }
162
219
  * @description Represents the body of a user request, including form identifiers, authentication data, form data, notification data, and state information.
163
220
  */
164
221
  interface IUserBody {
@@ -6,10 +6,11 @@ import type { Socket } from 'socket.io-client';
6
6
  */
7
7
  interface IWS {
8
8
  /**
9
- * WebSocket Connection.
9
+ * Creates an instance of an object Socket.io with a connection.
10
10
  * @handleName connect
11
11
  * @returns {Socket} Returns a Socket instance.
12
- * @description This method establishes a WebSocket connection.
12
+ * @description Creates an instance of an object Socket.io with a connection. This method requires user authorization.
13
+ * @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
13
14
  */
14
15
  connect(): Socket;
15
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.131",
3
+ "version": "1.0.133",
4
4
  "description": "OneEntry NPM package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",