oneentry 1.0.126 → 1.0.127

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 (83) hide show
  1. package/README.md +0 -2
  2. package/configure.js +25 -18
  3. package/dist/admins/adminsApi.d.ts +30 -25
  4. package/dist/admins/adminsApi.js +30 -25
  5. package/dist/admins/adminsInterfaces.d.ts +45 -54
  6. package/dist/attribute-sets/attributeSetsApi.d.ts +26 -27
  7. package/dist/attribute-sets/attributeSetsApi.js +26 -27
  8. package/dist/attribute-sets/attributeSetsInterfaces.d.ts +101 -109
  9. package/dist/auth-provider/authProviderApi.d.ts +132 -158
  10. package/dist/auth-provider/authProviderApi.js +131 -157
  11. package/dist/auth-provider/authProvidersInterfaces.d.ts +241 -237
  12. package/dist/base/asyncModules.d.ts +23 -21
  13. package/dist/base/asyncModules.js +30 -25
  14. package/dist/base/result.d.ts +31 -0
  15. package/dist/base/result.js +32 -1
  16. package/dist/base/stateModule.d.ts +10 -0
  17. package/dist/base/stateModule.js +50 -2
  18. package/dist/base/syncModules.d.ts +41 -49
  19. package/dist/base/syncModules.js +49 -48
  20. package/dist/base/utils.d.ts +38 -7
  21. package/dist/blocks/blocksApi.d.ts +27 -36
  22. package/dist/blocks/blocksApi.js +27 -36
  23. package/dist/blocks/blocksInterfaces.d.ts +92 -97
  24. package/dist/config.d.ts +13 -0
  25. package/dist/config.js +30 -0
  26. package/dist/events/eventsApi.d.ts +16 -33
  27. package/dist/events/eventsApi.js +32 -46
  28. package/dist/events/eventsInterfaces.d.ts +42 -37
  29. package/dist/file-uploading/fileUploadingApi.d.ts +42 -47
  30. package/dist/file-uploading/fileUploadingApi.js +44 -47
  31. package/dist/file-uploading/fileUploadingInterfaces.d.ts +49 -60
  32. package/dist/forms/formsApi.d.ts +15 -14
  33. package/dist/forms/formsApi.js +15 -14
  34. package/dist/forms/formsInterfaces.d.ts +36 -40
  35. package/dist/forms-data/formsDataApi.d.ts +40 -44
  36. package/dist/forms-data/formsDataApi.js +42 -44
  37. package/dist/forms-data/formsDataInterfaces.d.ts +231 -231
  38. package/dist/general-types/generalTypesApi.d.ts +5 -5
  39. package/dist/general-types/generalTypesApi.js +5 -5
  40. package/dist/general-types/generalTypesInterfaces.d.ts +6 -9
  41. package/dist/index.d.ts +12 -13
  42. package/dist/index.js +12 -13
  43. package/dist/integration-collections/integrationCollectionsApi.d.ts +84 -98
  44. package/dist/integration-collections/integrationCollectionsApi.js +86 -102
  45. package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +177 -169
  46. package/dist/locales/localesApi.d.ts +7 -3
  47. package/dist/locales/localesApi.js +7 -3
  48. package/dist/locales/localesInterfaces.d.ts +14 -13
  49. package/dist/menus/menusApi.d.ts +9 -5
  50. package/dist/menus/menusApi.js +9 -5
  51. package/dist/menus/menusInterfaces.d.ts +43 -48
  52. package/dist/menus/menusInterfaces.js +1 -0
  53. package/dist/orders/ordersApi.d.ts +62 -70
  54. package/dist/orders/ordersApi.js +62 -71
  55. package/dist/orders/ordersInterfaces.d.ts +238 -203
  56. package/dist/pages/pagesApi.d.ts +67 -80
  57. package/dist/pages/pagesApi.js +71 -81
  58. package/dist/pages/pagesInterfaces.d.ts +164 -160
  59. package/dist/payments/paymentsApi.d.ts +24 -34
  60. package/dist/payments/paymentsApi.js +24 -38
  61. package/dist/payments/paymentsInterfaces.d.ts +82 -76
  62. package/dist/product-statuses/productStatusesApi.d.ts +13 -13
  63. package/dist/product-statuses/productStatusesApi.js +13 -13
  64. package/dist/product-statuses/productStatusesInterfaces.d.ts +29 -27
  65. package/dist/products/productsApi.d.ts +246 -267
  66. package/dist/products/productsApi.js +247 -267
  67. package/dist/products/productsInterfaces.d.ts +333 -339
  68. package/dist/system/systemApi.d.ts +19 -21
  69. package/dist/system/systemApi.js +20 -21
  70. package/dist/system/systemInterfaces.d.ts +14 -3
  71. package/dist/templates/templatesApi.d.ts +13 -16
  72. package/dist/templates/templatesApi.js +13 -16
  73. package/dist/templates/templatesInterfaces.d.ts +30 -29
  74. package/dist/templates-preview/templatesPreviewApi.d.ts +10 -11
  75. package/dist/templates-preview/templatesPreviewApi.js +10 -11
  76. package/dist/templates-preview/templatesPreviewInterfaces.d.ts +61 -64
  77. package/dist/users/usersApi.d.ts +36 -43
  78. package/dist/users/usersApi.js +36 -43
  79. package/dist/users/usersInterfaces.d.ts +92 -96
  80. package/dist/web-socket/wsApi.d.ts +5 -3
  81. package/dist/web-socket/wsApi.js +6 -3
  82. package/dist/web-socket/wsInterfaces.d.ts +7 -2
  83. package/package.json +16 -12
@@ -4,80 +4,75 @@ import type { IError } from '../base/utils';
4
4
  import type { IFileUploading, IUploadingQuery, IUploadingReturn } from './fileUploadingInterfaces';
5
5
  /**
6
6
  * Controllers for working with file uploading
7
- *
8
7
  * @handle /api/content/files
9
8
  * @class FileUploadingApi
10
- * @extends AsyncModules
9
+ * @augments AsyncModules
11
10
  * @implements {IFileUploading}
12
- *
13
11
  * @description This class provides methods to upload and delete files in a cloud file storage, as well as retrieve files by parameters.
14
12
  */
15
13
  export default class FileUploadingApi extends AsyncModules implements IFileUploading {
16
14
  protected state: StateModule;
17
15
  protected _url: string;
16
+ /**
17
+ *
18
+ */
18
19
  constructor(state: StateModule);
19
20
  private _defaultQuery;
20
21
  /**
21
22
  * Upload file function.
22
- *
23
23
  * @handleName upload
24
- *
25
- * @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
26
- * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
27
- {
28
- "type": "page",
29
- "entity": "editor",
30
- "id": 3787,
31
- "width": 0,
32
- "height": 0,
33
- "compress": true,
34
- "template": 1
35
- }
36
- * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
37
- * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
38
- * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
39
- * @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
40
- * @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
41
- * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
42
- * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
43
- * @return {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
24
+ * @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
25
+ * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
26
+ {
27
+ "type": "page",
28
+ "entity": "editor",
29
+ "id": 3787,
30
+ "width": 0,
31
+ "height": 0,
32
+ "compress": true,
33
+ "template": 1
34
+ }
35
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
36
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
37
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
38
+ * @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
39
+ * @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
40
+ * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
41
+ * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
42
+ * @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
44
43
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
45
44
  * @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.
46
45
  */
47
46
  upload(file: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturn[] | IError>;
48
47
  /**
49
48
  * Deletes a file from the cloud file storage.
50
- *
51
49
  * @handleName delete
52
- *
53
- * @param {string} [filename] - File name. Example: "file.png".
54
- * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
55
- {
56
- "type": "page",
57
- "entity": "editor",
58
- "id": 3787,
59
- "template": 1
60
- }
61
- * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
62
- * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
63
- * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
64
- * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
65
- * @return {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
50
+ * @param {string} [filename] - File name. Example: "file.png".
51
+ * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
52
+ {
53
+ "type": "page",
54
+ "entity": "editor",
55
+ "id": 3787,
56
+ "template": 1
57
+ }
58
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
59
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
60
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
61
+ * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
62
+ * @returns {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
66
63
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
67
64
  * @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.
68
65
  */
69
66
  delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
70
67
  /**
71
68
  * Get file by parameters.
72
- *
73
69
  * @handleName getFile
74
- *
75
- * @param {number} [id] - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
76
- * @param {string} [type] - Type, determines the folder name in the storage. Example: "page".
77
- * @param {string} [entity] - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
78
- * @param {string} [filename] - Filename. Example: "file.png".
79
- * @param {string} [template] - Preview template identifier. Example: 1.
80
- * @return {any} Returns a promise that resolves to a Blob object containing the file data or an error object if there was an issue.
70
+ * @param {number} [id] - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
71
+ * @param {string} [type] - Type, determines the folder name in the storage. Example: "page".
72
+ * @param {string} [entity] - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
73
+ * @param {string} [filename] - Filename. Example: "file.png".
74
+ * @param {string} [template] - Preview template identifier. Example: 1.
75
+ * @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
76
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
82
77
  * @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.
83
78
  */
@@ -3,19 +3,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ /* eslint-disable jsdoc/reject-any-type */
6
7
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
8
  // import { IFileEntity } from './fileUploadingInterfaces';
8
9
  /**
9
10
  * Controllers for working with file uploading
10
- *
11
11
  * @handle /api/content/files
12
12
  * @class FileUploadingApi
13
- * @extends AsyncModules
13
+ * @augments AsyncModules
14
14
  * @implements {IFileUploading}
15
- *
16
15
  * @description This class provides methods to upload and delete files in a cloud file storage, as well as retrieve files by parameters.
17
16
  */
18
17
  class FileUploadingApi extends asyncModules_1.default {
18
+ /**
19
+ *
20
+ */
19
21
  constructor(state) {
20
22
  super(state);
21
23
  this._defaultQuery = {
@@ -30,28 +32,26 @@ class FileUploadingApi extends asyncModules_1.default {
30
32
  }
31
33
  /**
32
34
  * Upload file function.
33
- *
34
35
  * @handleName upload
35
- *
36
- * @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
37
- * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
38
- {
39
- "type": "page",
40
- "entity": "editor",
41
- "id": 3787,
42
- "width": 0,
43
- "height": 0,
44
- "compress": true,
45
- "template": 1
46
- }
47
- * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
48
- * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
49
- * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
50
- * @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
51
- * @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
52
- * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
53
- * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
54
- * @return {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
36
+ * @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
37
+ * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
38
+ {
39
+ "type": "page",
40
+ "entity": "editor",
41
+ "id": 3787,
42
+ "width": 0,
43
+ "height": 0,
44
+ "compress": true,
45
+ "template": 1
46
+ }
47
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
48
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
49
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
50
+ * @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
51
+ * @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
52
+ * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
53
+ * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
54
+ * @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
55
55
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
56
56
  * @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.
57
57
  */
@@ -64,22 +64,20 @@ class FileUploadingApi extends asyncModules_1.default {
64
64
  }
65
65
  /**
66
66
  * Deletes a file from the cloud file storage.
67
- *
68
67
  * @handleName delete
69
- *
70
- * @param {string} [filename] - File name. Example: "file.png".
71
- * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
72
- {
73
- "type": "page",
74
- "entity": "editor",
75
- "id": 3787,
76
- "template": 1
77
- }
78
- * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
79
- * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
80
- * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
81
- * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
82
- * @return {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
68
+ * @param {string} [filename] - File name. Example: "file.png".
69
+ * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
70
+ {
71
+ "type": "page",
72
+ "entity": "editor",
73
+ "id": 3787,
74
+ "template": 1
75
+ }
76
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
77
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
78
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
79
+ * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
80
+ * @returns {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
83
81
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
84
82
  * @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.
85
83
  */
@@ -90,19 +88,18 @@ class FileUploadingApi extends asyncModules_1.default {
90
88
  }
91
89
  /**
92
90
  * Get file by parameters.
93
- *
94
91
  * @handleName getFile
95
- *
96
- * @param {number} [id] - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
97
- * @param {string} [type] - Type, determines the folder name in the storage. Example: "page".
98
- * @param {string} [entity] - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
99
- * @param {string} [filename] - Filename. Example: "file.png".
100
- * @param {string} [template] - Preview template identifier. Example: 1.
101
- * @return {any} Returns a promise that resolves to a Blob object containing the file data or an error object if there was an issue.
92
+ * @param {number} [id] - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
93
+ * @param {string} [type] - Type, determines the folder name in the storage. Example: "page".
94
+ * @param {string} [entity] - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
95
+ * @param {string} [filename] - Filename. Example: "file.png".
96
+ * @param {string} [template] - Preview template identifier. Example: 1.
97
+ * @returns {any} Returns a promise that resolves to a Blob object containing the file data or an error object if there was an issue.
102
98
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
103
99
  * @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.
104
100
  */
105
101
  async getFile(id, type, entity, filename, template) {
102
+ // eslint-disable-next-line no-undef
106
103
  const response = await fetch(this._getFullPath(`?id=${id}&type=${type}&entity=${entity}${`&filename=${filename}`}${template ? `&template=${template}` : ''}`), {
107
104
  method: 'GET',
108
105
  headers: {
@@ -1,82 +1,75 @@
1
1
  import type { IError } from '../base/utils';
2
2
  /**
3
3
  * Interface for uploading, deleting, and retrieving files in the CMS.
4
- *
5
4
  * @interface IFileUploading
6
- *
7
- * @property {function} upload - Upload file from CMS.
8
- * @property {function} delete - Delete file from CMS.
9
- * @property {function} getFile - Get file by parameters.
5
+ * @property {Function} upload - Upload file from CMS.
6
+ * @property {Function} delete - Delete file from CMS.
7
+ * @property {Function} getFile - Get file by parameters.
10
8
  * @description This interface defines methods for uploading, deleting, and retrieving files in the CMS.
11
9
  */
12
10
  interface IFileUploading {
13
11
  /**
14
12
  * Upload file function.
15
- *
16
13
  * @handleName upload
17
- *
18
- * @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
19
- * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
20
- {
21
- "type": "page",
22
- "entity": "editor",
23
- "id": 3787,
24
- "width": 0,
25
- "height": 0,
26
- "compress": true,
27
- "template": 1
28
- }
29
- * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
30
- * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
31
- * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
32
- * @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
33
- * @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
34
- * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
35
- * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
36
- * @return {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
14
+ * @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
15
+ * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
16
+ {
17
+ "type": "page",
18
+ "entity": "editor",
19
+ "id": 3787,
20
+ "width": 0,
21
+ "height": 0,
22
+ "compress": true,
23
+ "template": 1
24
+ }
25
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
26
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
27
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
28
+ * @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
29
+ * @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
30
+ * @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
31
+ * @param {any} [fileQuery.template] - preview template identifier. Example: 1.
32
+ * @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
37
33
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
38
34
  * @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.
39
35
  */
40
36
  upload(file: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturn[] | IError>;
41
37
  /**
42
38
  * Deletes a file from the cloud file storage.
43
- *
44
39
  * @handleName delete
45
- *
46
- * @param {string} [filename] - File name. Example: "file.png".
47
- * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
48
- {
49
- "type": "page",
50
- "entity": "editor",
51
- "id": 3787,
52
- "template": 1
53
- }
54
- * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
55
- * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
56
- * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
57
- * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
58
- * @return {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
40
+ * @param {string} [filename] - File name. Example: "file.png".
41
+ * @param {IUploadingQuery} [fileQuery] - Optional set query parameters. Example:
42
+ {
43
+ "type": "page",
44
+ "entity": "editor",
45
+ "id": 3787,
46
+ "template": 1
47
+ }
48
+ * @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
49
+ * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
50
+ * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
51
+ * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
52
+ * @returns {any} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
59
53
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
60
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.
61
55
  */
62
56
  delete(filename: string, fileQuery?: IUploadingQuery): Promise<any | IError>;
63
57
  /**
64
58
  * Retrieves a file by its parameters.
65
- *
66
- * @param {number} id - The ID of the file entity. Example: 3787.
67
- * @param {string} type - The type of the file. Example: "page".
68
- * @param {string} entity - The entity associated with the file. Example: "editor".
69
- * @param {string} [filename] - Optional filename to retrieve. Example: "file.png".
70
- * @return {Blob} A promise that resolves to a Blob object or an error.
59
+ * @handleName getFile
60
+ * @param {number} id - The ID of the file entity. Example: 3787.
61
+ * @param {string} type - The type of the file. Example: "page".
62
+ * @param {string} entity - The entity associated with the file. Example: "editor".
63
+ * @param {string} [filename] - Optional filename to retrieve. Example: "file.png".
64
+ * @returns {Blob} A promise that resolves to a Blob object or an error.
71
65
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
66
+ * @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.
72
67
  */
73
68
  getFile(id: number, type: string, entity: string, filename?: string): Promise<any | IError>;
74
69
  }
75
70
  /**
76
71
  * Represents a file entity with a file object or string path.
77
- *
78
72
  * @interface IFileEntity
79
- *
80
73
  * @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".
81
74
  * @description Represents a file entity that may contain a file object or a path as a string.
82
75
  */
@@ -85,14 +78,12 @@ interface IFileEntity {
85
78
  }
86
79
  /**
87
80
  * Represents a query for uploading files, including type, entity, and optional parameters like width, height, and compression.
88
- *
89
81
  * @interface IUploadingQuery
90
- *
91
- * @property {string} type - Type, determines the folder name in the storage. Example: "page".
92
- * @property {string} entity - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
93
- * @property {number} id - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
94
- * @property {number} [width] - Width parameter. Example: 0.
95
- * @property {number} [height] - Height parameter. Example: 0.
82
+ * @property {string} type - Type, determines the folder name in the storage. Example: "page".
83
+ * @property {string} entity - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
84
+ * @property {number} id - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
85
+ * @property {number} [width] - Width parameter. Example: 0.
86
+ * @property {number} [height] - Height parameter. Example: 0.
96
87
  * @property {boolean} [compress] - Flag of optimization (compression) for images. Example: true.
97
88
  * @description Represents a query for uploading files, including type, entity, and optional parameters like width, height, and compression.
98
89
  */
@@ -104,12 +95,10 @@ interface IUploadingQuery {
104
95
  }
105
96
  /**
106
97
  * Represents the return value of an uploading operation, including the filename, download link, and file size.
107
- *
108
98
  * @interface IUploadingReturn
109
- *
110
- * @property {string} filename - Filename with relative path. Example: "uploads/file.png".
99
+ * @property {string} filename - Filename with relative path. Example: "uploads/file.png".
111
100
  * @property {string} downloadLink - Link for downloading the file. Example: "https://example.com/uploads/file.png".
112
- * @property {number} size - Size of the file in bytes. Example: 1024.
101
+ * @property {number} size - Size of the file in bytes. Example: 1024.
113
102
  * @description Represents the return value of an uploading operation, including the filename, download link, and file size.
114
103
  */
115
104
  interface IUploadingReturn {
@@ -4,38 +4,39 @@ import type { IError } from '../base/utils';
4
4
  import type { IForms, IFormsEntity } from './formsInterfaces';
5
5
  /**
6
6
  * Controllers for forms objects
7
- *
8
7
  * @class FormsApi
9
- * @extends AsyncModules
8
+ * @augments AsyncModules
10
9
  * @implements {IForms}
11
- *
12
10
  * @description This class provides methods to interact with forms, including retrieving all forms and getting a form by its marker.
13
11
  */
14
12
  export default class FormsApi extends AsyncModules implements IForms {
15
13
  protected state: StateModule;
16
14
  protected _url: string;
15
+ /**
16
+ * Initializes the FormsApi with the provided state module.
17
+ * @class
18
+ * @class FormsApi
19
+ * @param {StateModule} state - The state module containing configuration data.
20
+ * @description Constructor initializes the FormsApi with a given state.
21
+ */
17
22
  constructor(state: StateModule);
18
23
  /**
19
24
  * Get all forms.
20
- *
21
25
  * @handleName getAllForms
22
- *
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
- * @return {IFormsEntity[]} Returns array for all objects of type FormEntity.
26
+ * @param {string} [langCode] - Language code. Default: "en_US".
27
+ * @param {number} [offset] - Parameter for pagination. Default: 0.
28
+ * @param {number} [limit] - Parameter for pagination. Default: 30.
29
+ * @returns {IFormsEntity[]} Returns array for all objects of type FormEntity.
27
30
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
28
31
  * @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.
29
32
  */
30
33
  getAllForms(langCode?: string, offset?: number, limit?: number): Promise<IFormsEntity[] | IError>;
31
34
  /**
32
35
  * Get one form by form marker.
33
- *
34
36
  * @handleName getFormByMarker
35
- *
36
- * @param {string} marker - Marker of form. Example: "contact_form".
37
- * @param {string} [langCode] - Language code. Default: "en_US".
38
- * @return {IFormsEntity} Returns object of type FormEntity.
37
+ * @param {string} marker - Marker of form. Example: "contact_form".
38
+ * @param {string} [langCode] - Language code. Default: "en_US".
39
+ * @returns {IFormsEntity} Returns object of type FormEntity.
39
40
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
40
41
  * @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.
41
42
  */
@@ -6,27 +6,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const asyncModules_1 = __importDefault(require("../base/asyncModules"));
7
7
  /**
8
8
  * Controllers for forms objects
9
- *
10
9
  * @class FormsApi
11
- * @extends AsyncModules
10
+ * @augments AsyncModules
12
11
  * @implements {IForms}
13
- *
14
12
  * @description This class provides methods to interact with forms, including retrieving all forms and getting a form by its marker.
15
13
  */
16
14
  class FormsApi extends asyncModules_1.default {
15
+ /**
16
+ * Initializes the FormsApi with the provided state module.
17
+ * @class
18
+ * @class FormsApi
19
+ * @param {StateModule} state - The state module containing configuration data.
20
+ * @description Constructor initializes the FormsApi with a given state.
21
+ */
17
22
  constructor(state) {
18
23
  super(state);
19
24
  this._url = state.url + '/api/content/forms';
20
25
  }
21
26
  /**
22
27
  * Get all forms.
23
- *
24
28
  * @handleName getAllForms
25
- *
26
- * @param {string} [langCode] - Language code. Default: "en_US".
27
- * @param {number} [offset] - Parameter for pagination. Default: 0.
28
- * @param {number} [limit] - Parameter for pagination. Default: 30.
29
- * @return {IFormsEntity[]} Returns array for all objects of type FormEntity.
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 {IFormsEntity[]} Returns array for all objects of type FormEntity.
30
33
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
31
34
  * @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.
32
35
  */
@@ -36,12 +39,10 @@ class FormsApi extends asyncModules_1.default {
36
39
  }
37
40
  /**
38
41
  * Get one form by form marker.
39
- *
40
42
  * @handleName getFormByMarker
41
- *
42
- * @param {string} marker - Marker of form. Example: "contact_form".
43
- * @param {string} [langCode] - Language code. Default: "en_US".
44
- * @return {IFormsEntity} Returns object of type FormEntity.
43
+ * @param {string} marker - Marker of form. Example: "contact_form".
44
+ * @param {string} [langCode] - Language code. Default: "en_US".
45
+ * @returns {IFormsEntity} Returns object of type FormEntity.
45
46
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
46
47
  * @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.
47
48
  */