oneentry 1.0.142 → 1.0.144
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.
- package/configure.js +2 -2
- package/dist/admins/adminsApi.d.ts +50 -0
- package/dist/admins/adminsApi.js +65 -0
- package/dist/admins/adminsInterfaces.d.ts +98 -0
- package/dist/admins/adminsInterfaces.js +2 -0
- package/dist/admins/adminsSchemas.d.ts +30 -0
- package/dist/admins/adminsSchemas.js +27 -0
- package/dist/attribute-sets/attributeSetsApi.d.ts +63 -0
- package/dist/attribute-sets/attributeSetsApi.js +98 -0
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +185 -0
- package/dist/attribute-sets/attributeSetsInterfaces.js +2 -0
- package/dist/attribute-sets/attributeSetsSchemas.d.ts +90 -0
- package/dist/attribute-sets/attributeSetsSchemas.js +74 -0
- package/dist/auth-provider/authProviderApi.d.ts +249 -0
- package/dist/auth-provider/authProviderApi.js +354 -0
- package/dist/auth-provider/authProviderSchemas.d.ts +131 -0
- package/dist/auth-provider/authProviderSchemas.js +82 -0
- package/dist/auth-provider/authProvidersInterfaces.d.ts +412 -0
- package/dist/auth-provider/authProvidersInterfaces.js +2 -0
- package/dist/base/asyncModules.d.ts +80 -0
- package/dist/base/asyncModules.js +448 -0
- package/dist/base/result.d.ts +39 -0
- package/dist/base/result.js +154 -0
- package/dist/base/stateModule.d.ts +41 -0
- package/dist/base/stateModule.js +128 -0
- package/dist/base/syncModules.d.ts +286 -0
- package/dist/base/syncModules.js +716 -0
- package/dist/base/utils.d.ts +197 -0
- package/dist/base/utils.js +2 -0
- package/dist/base/validation.d.ts +118 -0
- package/dist/base/validation.js +132 -0
- package/dist/blocks/blocksApi.d.ts +88 -0
- package/dist/blocks/blocksApi.js +207 -0
- package/dist/blocks/blocksInterfaces.d.ts +179 -0
- package/dist/blocks/blocksInterfaces.js +2 -0
- package/dist/blocks/blocksSchemas.d.ts +195 -0
- package/dist/blocks/blocksSchemas.js +43 -0
- package/dist/discounts/discountsApi.d.ts +76 -0
- package/dist/discounts/discountsApi.js +116 -0
- package/dist/discounts/discountsInterfaces.d.ts +217 -0
- package/dist/discounts/discountsInterfaces.js +2 -0
- package/dist/events/eventsApi.d.ts +60 -0
- package/dist/events/eventsApi.js +97 -0
- package/dist/events/eventsInterfaces.d.ts +87 -0
- package/dist/events/eventsInterfaces.js +2 -0
- package/dist/file-uploading/fileUploadingApi.d.ts +88 -0
- package/dist/file-uploading/fileUploadingApi.js +129 -0
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +114 -0
- package/dist/file-uploading/fileUploadingInterfaces.js +2 -0
- package/dist/file-uploading/fileUploadingSchemas.d.ts +22 -0
- package/dist/file-uploading/fileUploadingSchemas.js +21 -0
- package/dist/forms/formsApi.d.ts +42 -0
- package/dist/forms/formsApi.js +57 -0
- package/dist/forms/formsInterfaces.d.ts +144 -0
- package/dist/forms/formsInterfaces.js +2 -0
- package/dist/forms/formsSchemas.d.ts +53 -0
- package/dist/forms/formsSchemas.js +34 -0
- package/dist/forms-data/formsDataApi.d.ts +106 -0
- package/dist/forms-data/formsDataApi.js +189 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +522 -0
- package/dist/forms-data/formsDataInterfaces.js +2 -0
- package/dist/forms-data/formsDataSchemas.d.ts +115 -0
- package/dist/forms-data/formsDataSchemas.js +86 -0
- package/dist/general-types/generalTypesApi.d.ts +28 -0
- package/dist/general-types/generalTypesApi.js +38 -0
- package/dist/general-types/generalTypesInterfaces.d.ts +29 -0
- package/dist/general-types/generalTypesInterfaces.js +2 -0
- package/dist/general-types/generalTypesSchemas.d.ts +52 -0
- package/dist/general-types/generalTypesSchemas.js +36 -0
- package/dist/index.d.ts +124 -0
- package/dist/index.js +103 -0
- package/dist/integration-collections/integrationCollectionsApi.d.ts +163 -0
- package/dist/integration-collections/integrationCollectionsApi.js +220 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +313 -0
- package/dist/integration-collections/integrationCollectionsInterfaces.js +2 -0
- package/dist/integration-collections/integrationCollectionsSchemas.d.ts +80 -0
- package/dist/integration-collections/integrationCollectionsSchemas.js +61 -0
- package/dist/locales/localesApi.d.ts +27 -0
- package/dist/locales/localesApi.js +37 -0
- package/dist/locales/localesInterfaces.d.ts +40 -0
- package/dist/locales/localesInterfaces.js +2 -0
- package/dist/locales/localesSchemas.d.ts +32 -0
- package/dist/locales/localesSchemas.js +26 -0
- package/dist/menus/menusApi.d.ts +29 -0
- package/dist/menus/menusApi.js +39 -0
- package/dist/menus/menusInterfaces.d.ts +87 -0
- package/dist/menus/menusInterfaces.js +3 -0
- package/dist/menus/menusSchemas.d.ts +16 -0
- package/dist/menus/menusSchemas.js +28 -0
- package/dist/orders/ordersApi.d.ts +175 -0
- package/dist/orders/ordersApi.js +247 -0
- package/dist/orders/ordersInterfaces.d.ts +593 -0
- package/dist/orders/ordersInterfaces.js +2 -0
- package/dist/orders/ordersSchemas.d.ts +120 -0
- package/dist/orders/ordersSchemas.js +101 -0
- package/dist/pages/pagesApi.d.ts +151 -0
- package/dist/pages/pagesApi.js +390 -0
- package/dist/pages/pagesInterfaces.d.ts +286 -0
- package/dist/pages/pagesInterfaces.js +2 -0
- package/dist/pages/pagesSchemas.d.ts +85 -0
- package/dist/pages/pagesSchemas.js +46 -0
- package/dist/payments/paymentsApi.d.ts +82 -0
- package/dist/payments/paymentsApi.js +121 -0
- package/dist/payments/paymentsInterfaces.d.ts +200 -0
- package/dist/payments/paymentsInterfaces.js +2 -0
- package/dist/payments/paymentsSchemas.d.ts +100 -0
- package/dist/payments/paymentsSchemas.js +65 -0
- package/dist/product-statuses/productStatusesApi.d.ts +47 -0
- package/dist/product-statuses/productStatusesApi.js +70 -0
- package/dist/product-statuses/productStatusesInterfaces.d.ts +62 -0
- package/dist/product-statuses/productStatusesInterfaces.js +2 -0
- package/dist/product-statuses/productStatusesSchemas.d.ts +34 -0
- package/dist/product-statuses/productStatusesSchemas.js +30 -0
- package/dist/products/productsApi.d.ts +366 -0
- package/dist/products/productsApi.js +458 -0
- package/dist/products/productsInterfaces.d.ts +593 -0
- package/dist/products/productsInterfaces.js +2 -0
- package/dist/products/productsSchemas.d.ts +200 -0
- package/dist/products/productsSchemas.js +98 -0
- package/dist/sitemap/sitemapApi.d.ts +35 -0
- package/dist/sitemap/sitemapApi.js +45 -0
- package/dist/sitemap/sitemapInterfaces.d.ts +40 -0
- package/dist/sitemap/sitemapInterfaces.js +2 -0
- package/dist/system/systemApi.d.ts +43 -0
- package/dist/system/systemApi.js +56 -0
- package/dist/system/systemInterfaces.d.ts +29 -0
- package/dist/system/systemInterfaces.js +2 -0
- package/dist/templates/templatesApi.d.ts +49 -0
- package/dist/templates/templatesApi.js +75 -0
- package/dist/templates/templatesInterfaces.d.ts +67 -0
- package/dist/templates/templatesInterfaces.js +2 -0
- package/dist/templates/templatesSchemas.d.ts +48 -0
- package/dist/templates/templatesSchemas.js +31 -0
- package/dist/templates-preview/templatesPreviewApi.d.ts +38 -0
- package/dist/templates-preview/templatesPreviewApi.js +53 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +119 -0
- package/dist/templates-preview/templatesPreviewInterfaces.js +2 -0
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +83 -0
- package/dist/templates-preview/templatesPreviewSchemas.js +48 -0
- package/dist/users/usersApi.d.ts +143 -0
- package/dist/users/usersApi.js +171 -0
- package/dist/users/usersInterfaces.d.ts +231 -0
- package/dist/users/usersInterfaces.js +2 -0
- package/dist/users/usersSchemas.d.ts +38 -0
- package/dist/users/usersSchemas.js +28 -0
- package/dist/web-socket/wsApi.d.ts +25 -0
- package/dist/web-socket/wsApi.js +45 -0
- package/dist/web-socket/wsInterfaces.d.ts +16 -0
- package/dist/web-socket/wsInterfaces.js +2 -0
- package/package.json +2 -80
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IFileUploading, IUploadingQuery, IUploadingReturn } from './fileUploadingInterfaces';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for working with file uploading
|
|
7
|
+
* @handle /api/content/files
|
|
8
|
+
* @class FileUploadingApi
|
|
9
|
+
* @augments AsyncModules
|
|
10
|
+
* @implements {IFileUploading}
|
|
11
|
+
* @description This class provides methods to upload and delete files in a cloud file storage, as well as retrieve files by parameters.
|
|
12
|
+
*/
|
|
13
|
+
export default class FileUploadingApi extends AsyncModules implements IFileUploading {
|
|
14
|
+
protected state: StateModule;
|
|
15
|
+
protected _url: string;
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a new instance of the FileUploadingApi class.
|
|
18
|
+
*/
|
|
19
|
+
constructor(state: StateModule);
|
|
20
|
+
/** FileUploadingApi class */
|
|
21
|
+
private _defaultQuery;
|
|
22
|
+
/**
|
|
23
|
+
* Upload file function.
|
|
24
|
+
* @handleName upload
|
|
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.
|
|
27
|
+
* @example
|
|
28
|
+
{
|
|
29
|
+
"type": "page",
|
|
30
|
+
"entity": "editor",
|
|
31
|
+
"id": 3787,
|
|
32
|
+
"width": 0,
|
|
33
|
+
"height": 0,
|
|
34
|
+
"compress": true,
|
|
35
|
+
"template": 1
|
|
36
|
+
}
|
|
37
|
+
* @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
|
|
38
|
+
* @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
39
|
+
* @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
40
|
+
* @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
|
|
41
|
+
* @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
|
|
42
|
+
* @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
|
|
43
|
+
* @param {string | number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
44
|
+
* @returns {Promise<IUploadingReturn[] | IError>} Uploads a file to an Amazon S3-compatible cloud file storage.
|
|
45
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
46
|
+
*/
|
|
47
|
+
upload(file: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturn[] | IError>;
|
|
48
|
+
/**
|
|
49
|
+
* Deletes a file from the cloud file storage.
|
|
50
|
+
* @handleName delete
|
|
51
|
+
* @param {string} filename - File name. Example: "file.png".
|
|
52
|
+
* @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
|
|
53
|
+
* @example
|
|
54
|
+
{
|
|
55
|
+
"type": "page",
|
|
56
|
+
"entity": "editor",
|
|
57
|
+
"id": 3787,
|
|
58
|
+
"template": 1
|
|
59
|
+
}
|
|
60
|
+
* @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
|
|
61
|
+
* @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
62
|
+
* @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
63
|
+
* @param {number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
64
|
+
* @returns {Promise<boolean | IError>} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
|
|
65
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
66
|
+
*/
|
|
67
|
+
delete(filename: string, fileQuery?: IUploadingQuery): Promise<boolean | 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>;
|
|
76
|
+
/**
|
|
77
|
+
* Get file by parameters.
|
|
78
|
+
* @handleName getFile
|
|
79
|
+
* @param {number} id - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
80
|
+
* @param {string} type - Type, determines the folder name in the storage. Example: "page".
|
|
81
|
+
* @param {string} entity - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
82
|
+
* @param {string} filename - Filename. Example: "file.png".
|
|
83
|
+
* @param {string} [template] - Preview template identifier. Example: 1.
|
|
84
|
+
* @returns {Promise<Response | IError>} Returns a promise that resolves to a Response object containing the file data or an error object if there was an issue.
|
|
85
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
86
|
+
*/
|
|
87
|
+
getFile(id: number, type: string, entity: string, filename: string, template?: string): Promise<Response | IError>;
|
|
88
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
+
// import { IFileEntity } from './fileUploadingInterfaces';
|
|
8
|
+
const fileUploadingSchemas_1 = require("./fileUploadingSchemas");
|
|
9
|
+
/**
|
|
10
|
+
* Controllers for working with file uploading
|
|
11
|
+
* @handle /api/content/files
|
|
12
|
+
* @class FileUploadingApi
|
|
13
|
+
* @augments AsyncModules
|
|
14
|
+
* @implements {IFileUploading}
|
|
15
|
+
* @description This class provides methods to upload and delete files in a cloud file storage, as well as retrieve files by parameters.
|
|
16
|
+
*/
|
|
17
|
+
class FileUploadingApi extends asyncModules_1.default {
|
|
18
|
+
/**
|
|
19
|
+
* Constructs a new instance of the FileUploadingApi class.
|
|
20
|
+
*/
|
|
21
|
+
constructor(state) {
|
|
22
|
+
super(state);
|
|
23
|
+
/** FileUploadingApi class */
|
|
24
|
+
this._defaultQuery = {
|
|
25
|
+
type: null,
|
|
26
|
+
entity: null,
|
|
27
|
+
id: null,
|
|
28
|
+
width: null,
|
|
29
|
+
height: null,
|
|
30
|
+
compress: null,
|
|
31
|
+
};
|
|
32
|
+
this._url = state.url + '/api/content/files';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Upload file function.
|
|
36
|
+
* @handleName upload
|
|
37
|
+
* @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
|
|
38
|
+
* @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
|
|
39
|
+
* @example
|
|
40
|
+
{
|
|
41
|
+
"type": "page",
|
|
42
|
+
"entity": "editor",
|
|
43
|
+
"id": 3787,
|
|
44
|
+
"width": 0,
|
|
45
|
+
"height": 0,
|
|
46
|
+
"compress": true,
|
|
47
|
+
"template": 1
|
|
48
|
+
}
|
|
49
|
+
* @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
|
|
50
|
+
* @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
51
|
+
* @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
52
|
+
* @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
|
|
53
|
+
* @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
|
|
54
|
+
* @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
|
|
55
|
+
* @param {string | number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
56
|
+
* @returns {Promise<IUploadingReturn[] | IError>} Uploads a file to an Amazon S3-compatible cloud file storage.
|
|
57
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
58
|
+
*/
|
|
59
|
+
async upload(file, fileQuery) {
|
|
60
|
+
const query = { ...this._defaultQuery, ...fileQuery };
|
|
61
|
+
const body = new FormData();
|
|
62
|
+
body.append('files', file);
|
|
63
|
+
const result = await this._fetchPost('?' + this._queryParamsToString(query), body);
|
|
64
|
+
// Validate response if validation is enabled
|
|
65
|
+
const validated = this._validateResponse(result, fileUploadingSchemas_1.UploadResponseSchema);
|
|
66
|
+
return validated;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Deletes a file from the cloud file storage.
|
|
70
|
+
* @handleName delete
|
|
71
|
+
* @param {string} filename - File name. Example: "file.png".
|
|
72
|
+
* @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
|
|
73
|
+
* @example
|
|
74
|
+
{
|
|
75
|
+
"type": "page",
|
|
76
|
+
"entity": "editor",
|
|
77
|
+
"id": 3787,
|
|
78
|
+
"template": 1
|
|
79
|
+
}
|
|
80
|
+
* @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
|
|
81
|
+
* @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
82
|
+
* @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
83
|
+
* @param {number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
84
|
+
* @returns {Promise<boolean | IError>} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
|
|
85
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
86
|
+
*/
|
|
87
|
+
async delete(filename, fileQuery) {
|
|
88
|
+
const query = { ...this._defaultQuery, ...fileQuery };
|
|
89
|
+
const result = await this._fetchDelete(`?filename=${filename}&` + this._queryParamsToString(query));
|
|
90
|
+
return result;
|
|
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
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get file by parameters.
|
|
108
|
+
* @handleName getFile
|
|
109
|
+
* @param {number} id - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
110
|
+
* @param {string} type - Type, determines the folder name in the storage. Example: "page".
|
|
111
|
+
* @param {string} entity - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
112
|
+
* @param {string} filename - Filename. Example: "file.png".
|
|
113
|
+
* @param {string} [template] - Preview template identifier. Example: 1.
|
|
114
|
+
* @returns {Promise<Response | IError>} Returns a promise that resolves to a Response object containing the file data or an error object if there was an issue.
|
|
115
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
116
|
+
*/
|
|
117
|
+
async getFile(id, type, entity, filename, template) {
|
|
118
|
+
// eslint-disable-next-line no-undef
|
|
119
|
+
const response = await fetch(this._getFullPath(`?id=${id}&type=${type}&entity=${entity}${`&filename=${filename}`}${template ? `&template=${template}` : ''}`), {
|
|
120
|
+
method: 'GET',
|
|
121
|
+
headers: {
|
|
122
|
+
'Content-Type': 'application/json',
|
|
123
|
+
'x-app-token': this.state.token,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
return response;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.default = FileUploadingApi;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for uploading, deleting, and retrieving files in the CMS.
|
|
4
|
+
* @interface IFileUploading
|
|
5
|
+
* @description This interface defines methods for uploading, deleting, and retrieving files in the CMS.
|
|
6
|
+
*/
|
|
7
|
+
interface IFileUploading {
|
|
8
|
+
/**
|
|
9
|
+
* Create a File object from a URL.
|
|
10
|
+
* @param {string} url - The URL to fetch the file from.
|
|
11
|
+
* @param {string} filename - The name to give the created file.
|
|
12
|
+
* @param {string} [mimeType] - Optional MIME type for the file.
|
|
13
|
+
* @returns {Promise<File>} A promise that resolves to a File object.
|
|
14
|
+
*/
|
|
15
|
+
createFileFromUrl(url: string, filename: string, mimeType?: string): Promise<File>;
|
|
16
|
+
/**
|
|
17
|
+
* Upload file function.
|
|
18
|
+
* @handleName upload
|
|
19
|
+
* @param {File | Blob} file - File to upload. Example: `new File(["content"], "file.png", {"type": "image/png"})`
|
|
20
|
+
* @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
|
|
21
|
+
* @example
|
|
22
|
+
{
|
|
23
|
+
"type": "page",
|
|
24
|
+
"entity": "editor",
|
|
25
|
+
"id": 3787,
|
|
26
|
+
"width": 0,
|
|
27
|
+
"height": 0,
|
|
28
|
+
"compress": true,
|
|
29
|
+
"template": 1
|
|
30
|
+
}
|
|
31
|
+
* @param {string} [fileQuery.type] - Type, determines the folder name in the storage. Example: "page".
|
|
32
|
+
* @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
33
|
+
* @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
34
|
+
* @param {number} [fileQuery.width] - Optional width parameter. Example: 0.
|
|
35
|
+
* @param {number} [fileQuery.height] - Optional height parameter. Example: 0.
|
|
36
|
+
* @param {boolean} [fileQuery.compress] - Optional flag of optimization (compression) for images. Example: true.
|
|
37
|
+
* @param {number} [fileQuery.template] - preview template identifier. Example: 1.
|
|
38
|
+
* @returns {IUploadingReturn[]} Uploads a file to an Amazon S3-compatible cloud file storage.
|
|
39
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
40
|
+
*/
|
|
41
|
+
upload(file: File | Blob, fileQuery?: IUploadingQuery): Promise<IUploadingReturn[] | IError>;
|
|
42
|
+
/**
|
|
43
|
+
* Deletes a file from the cloud file storage.
|
|
44
|
+
* @handleName delete
|
|
45
|
+
* @param {string} [filename] - File name. Example: "file.png".
|
|
46
|
+
* @param {IUploadingQuery} [fileQuery] - Optional set query parameters.
|
|
47
|
+
* @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
|
+
* @returns {boolean | IError} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
|
|
59
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
60
|
+
*/
|
|
61
|
+
delete(filename: string, fileQuery?: IUploadingQuery): Promise<boolean | IError>;
|
|
62
|
+
/**
|
|
63
|
+
* Get file by parameters.
|
|
64
|
+
* @handleName getFile
|
|
65
|
+
* @param {number} id - Object identifier, from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
66
|
+
* @param {string} type - Type, determines the folder name in the storage. Example: "page".
|
|
67
|
+
* @param {string} entity - Entity name, from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
68
|
+
* @param {string} filename - Filename. Example: "file.png".
|
|
69
|
+
* @param {string} [template] - Preview template identifier. Example: 1.
|
|
70
|
+
* @returns {Response | IError} Returns a promise that resolves to a Response object containing the file data or an error object if there was an issue.
|
|
71
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
72
|
+
*/
|
|
73
|
+
getFile(id: number, type: string, entity: string, filename: string, template?: string): Promise<Response | IError>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Represents a file entity that may contain a file object or a path as a string.
|
|
77
|
+
* @interface IFileEntity
|
|
78
|
+
* @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
|
+
* @description Represents a file entity that may contain a file object or a path as a string.
|
|
80
|
+
*/
|
|
81
|
+
interface IFileEntity {
|
|
82
|
+
file: File | string | null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Represents a query for uploading files, including type, entity, and optional parameters like width, height, and compression.
|
|
86
|
+
* @interface IUploadingQuery
|
|
87
|
+
* @property {string} type - Type, determines the folder name in the storage. Example: "page".
|
|
88
|
+
* @property {string} entity - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
|
|
89
|
+
* @property {number} id - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
|
|
90
|
+
* @property {number} [width] - Width parameter. Example: 0.
|
|
91
|
+
* @property {number} [height] - Height parameter. Example: 0.
|
|
92
|
+
* @property {boolean} [compress] - Flag of optimization (compression) for images. Example: true.
|
|
93
|
+
* @description Represents a query for uploading files, including type, entity, and optional parameters like width, height, and compression.
|
|
94
|
+
*/
|
|
95
|
+
interface IUploadingQuery {
|
|
96
|
+
type: string | null;
|
|
97
|
+
entity: string | null;
|
|
98
|
+
id: number | null;
|
|
99
|
+
[key: string]: string | number | boolean | null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Represents the return value of an uploading operation, including the filename, download link, and file size.
|
|
103
|
+
* @interface IUploadingReturn
|
|
104
|
+
* @property {string} filename - Filename with relative path. Example: "uploads/file.png".
|
|
105
|
+
* @property {string} downloadLink - Link for downloading the file. Example: "https://example.com/uploads/file.png".
|
|
106
|
+
* @property {number} size - Size of the file in bytes. Example: 1024.
|
|
107
|
+
* @description Represents the return value of an uploading operation, including the filename, download link, and file size.
|
|
108
|
+
*/
|
|
109
|
+
interface IUploadingReturn {
|
|
110
|
+
filename: string;
|
|
111
|
+
downloadLink: string;
|
|
112
|
+
size: number;
|
|
113
|
+
}
|
|
114
|
+
export type { IFileEntity, IFileUploading, IUploadingQuery, IUploadingReturn };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation schemas for FileUploading module
|
|
3
|
+
* @description Zod schemas for validating file uploading-related API responses
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Upload return schema
|
|
8
|
+
* Includes filename, downloadLink, and size
|
|
9
|
+
*/
|
|
10
|
+
export declare const UploadingReturnSchema: z.ZodObject<{
|
|
11
|
+
filename: z.ZodString;
|
|
12
|
+
downloadLink: z.ZodString;
|
|
13
|
+
size: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/**
|
|
16
|
+
* Upload response schema (array of upload results)
|
|
17
|
+
*/
|
|
18
|
+
export declare const UploadResponseSchema: z.ZodArray<z.ZodObject<{
|
|
19
|
+
filename: z.ZodString;
|
|
20
|
+
downloadLink: z.ZodString;
|
|
21
|
+
size: z.ZodNumber;
|
|
22
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadResponseSchema = exports.UploadingReturnSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Validation schemas for FileUploading module
|
|
6
|
+
* @description Zod schemas for validating file uploading-related API responses
|
|
7
|
+
*/
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/**
|
|
10
|
+
* Upload return schema
|
|
11
|
+
* Includes filename, downloadLink, and size
|
|
12
|
+
*/
|
|
13
|
+
exports.UploadingReturnSchema = zod_1.z.object({
|
|
14
|
+
filename: zod_1.z.string(),
|
|
15
|
+
downloadLink: zod_1.z.string(),
|
|
16
|
+
size: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Upload response schema (array of upload results)
|
|
20
|
+
*/
|
|
21
|
+
exports.UploadResponseSchema = zod_1.z.array(exports.UploadingReturnSchema);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IForms, IFormsEntity, IFormsResponse } from './formsInterfaces';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for forms objects
|
|
7
|
+
* @class FormsApi
|
|
8
|
+
* @augments AsyncModules
|
|
9
|
+
* @implements {IForms}
|
|
10
|
+
* @description This class provides methods to interact with forms, including retrieving all forms and getting a form by its marker.
|
|
11
|
+
*/
|
|
12
|
+
export default class FormsApi extends AsyncModules implements IForms {
|
|
13
|
+
protected state: StateModule;
|
|
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
|
+
*/
|
|
22
|
+
constructor(state: StateModule);
|
|
23
|
+
/**
|
|
24
|
+
* Get all forms.
|
|
25
|
+
* @handleName getAllForms
|
|
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 {Promise<IFormsResponse | IError>} Returns paginated object with array of FormEntity and total count.
|
|
30
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
31
|
+
*/
|
|
32
|
+
getAllForms(langCode?: string, offset?: number, limit?: number): Promise<IFormsResponse | IError>;
|
|
33
|
+
/**
|
|
34
|
+
* Get one form by form marker.
|
|
35
|
+
* @handleName getFormByMarker
|
|
36
|
+
* @param {string} marker - Marker of form. Example: "contact_form".
|
|
37
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
38
|
+
* @returns {Promise<IFormsEntity | IError>} Returns object of type FormEntity.
|
|
39
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
40
|
+
*/
|
|
41
|
+
getFormByMarker(marker: string, langCode?: string): Promise<IFormsEntity | IError>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const asyncModules_1 = __importDefault(require("../base/asyncModules"));
|
|
7
|
+
const formsSchemas_1 = require("./formsSchemas");
|
|
8
|
+
/**
|
|
9
|
+
* Controllers for forms objects
|
|
10
|
+
* @class FormsApi
|
|
11
|
+
* @augments AsyncModules
|
|
12
|
+
* @implements {IForms}
|
|
13
|
+
* @description This class provides methods to interact with forms, including retrieving all forms and getting a form by its marker.
|
|
14
|
+
*/
|
|
15
|
+
class FormsApi extends asyncModules_1.default {
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the FormsApi with the provided state module.
|
|
18
|
+
* @class
|
|
19
|
+
* @class FormsApi
|
|
20
|
+
* @param {StateModule} state - The state module containing configuration data.
|
|
21
|
+
* @description Constructor initializes the FormsApi with a given state.
|
|
22
|
+
*/
|
|
23
|
+
constructor(state) {
|
|
24
|
+
super(state);
|
|
25
|
+
this._url = state.url + '/api/content/forms';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get all forms.
|
|
29
|
+
* @handleName getAllForms
|
|
30
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
31
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
32
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
33
|
+
* @returns {Promise<IFormsResponse | IError>} Returns paginated object with array of FormEntity and total count.
|
|
34
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
35
|
+
*/
|
|
36
|
+
async getAllForms(langCode = this.state.lang, offset = 0, limit = 30) {
|
|
37
|
+
const result = await this._fetchGet(`?langCode=${langCode}&offset=${offset}&limit=${limit}`);
|
|
38
|
+
// Validate response if validation is enabled
|
|
39
|
+
const validated = this._validateResponse(result, formsSchemas_1.FormsResponseSchema);
|
|
40
|
+
return this._dataPostProcess(validated, langCode);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get one form by form marker.
|
|
44
|
+
* @handleName getFormByMarker
|
|
45
|
+
* @param {string} marker - Marker of form. Example: "contact_form".
|
|
46
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
47
|
+
* @returns {Promise<IFormsEntity | IError>} Returns object of type FormEntity.
|
|
48
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
49
|
+
*/
|
|
50
|
+
async getFormByMarker(marker, langCode = this.state.lang) {
|
|
51
|
+
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
52
|
+
// Validate response if validation is enabled
|
|
53
|
+
const validated = this._validateResponse(result, formsSchemas_1.FormEntitySchema);
|
|
54
|
+
return this._dataPostProcess(validated, langCode);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.default = FormsApi;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { IPosition } from '../admins/adminsInterfaces';
|
|
2
|
+
import type { IAttributes, IError, ILocalizeInfo } from '../base/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for retrieving forms in the system.
|
|
5
|
+
* @interface IForms
|
|
6
|
+
* @description This interface defines methods for retrieving forms in the system.
|
|
7
|
+
*/
|
|
8
|
+
interface IForms {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves all forms in the system.
|
|
11
|
+
* @handleName getAllForms
|
|
12
|
+
* @param {string} [langCode] - The language code for localization. Default: "en_US".
|
|
13
|
+
* @param {number} [offset] - Optional offset for pagination. Default: 0.
|
|
14
|
+
* @param {number} [limit] - Optional limit for pagination. Default: 30.
|
|
15
|
+
* @returns {IFormsEntity[]} A promise that resolves to an array of form entities or an error.
|
|
16
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
17
|
+
* @description This method retrieves all forms in the system.
|
|
18
|
+
*/
|
|
19
|
+
getAllForms(langCode?: string, offset?: number, limit?: number): Promise<IFormsResponse | IError>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves a form by its marker.
|
|
22
|
+
* @handleName getFormByMarker
|
|
23
|
+
* @param {string} marker - The marker identifying the form. Example: "contact_form".
|
|
24
|
+
* @param {string} [langCode] - The language code for localization. Default: "en_US".
|
|
25
|
+
* @returns {IFormsEntity} A promise that resolves to a form entity or an error.
|
|
26
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
27
|
+
* @description This method retrieves a form by its marker.
|
|
28
|
+
*/
|
|
29
|
+
getFormByMarker(marker: string, langCode?: string): Promise<IFormsEntity | IError>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Represents the structure of a form page.
|
|
33
|
+
* @interface IFromPages
|
|
34
|
+
* @property {number} id - The unique identifier of the form page. Example: 123.
|
|
35
|
+
* @property {number} pageId - The identifier of the page. Example: 12.
|
|
36
|
+
* @property {number} formId - The identifier of the form. Example: 321.
|
|
37
|
+
* @property {number} positionId - The identifier of the position. Example: 1.
|
|
38
|
+
* @property {IPosition} position - The position object.
|
|
39
|
+
* @example
|
|
40
|
+
{
|
|
41
|
+
"id": 1,
|
|
42
|
+
"position": 1,
|
|
43
|
+
"objectId": 2,
|
|
44
|
+
"objectType": "admin",
|
|
45
|
+
"isLocked": false,
|
|
46
|
+
"objectCategoryId": 1
|
|
47
|
+
}
|
|
48
|
+
* @description This interface defines the structure of a form page.
|
|
49
|
+
*/
|
|
50
|
+
interface IFromPages {
|
|
51
|
+
id: number;
|
|
52
|
+
pageId: number;
|
|
53
|
+
formId: number;
|
|
54
|
+
positionId: number;
|
|
55
|
+
position: IPosition;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Represents the structure of a form entity.
|
|
59
|
+
* @interface IFormsEntity
|
|
60
|
+
* @property {number} id - The identifier of the object. Example: 12345.
|
|
61
|
+
* @property {number | null} attributeSetId - The identifier of the attribute set being used, or null if not applicable. Example: 1234.
|
|
62
|
+
* @property {string | null} type - Form type. Example: "contact".
|
|
63
|
+
* @property {ILocalizeInfo} localizeInfos - The name of the form, taking into account localization.
|
|
64
|
+
* @example
|
|
65
|
+
{
|
|
66
|
+
"key": "value"
|
|
67
|
+
}
|
|
68
|
+
* @property {number} version - The version number of the object. Example: 1.
|
|
69
|
+
* @property {number} position - The position of the object. Example: 1.
|
|
70
|
+
* @property {string} identifier - The textual identifier for the record field. Example: "form_contact_us".
|
|
71
|
+
* @property {string} processingType - Type of form processing. Example: "async".
|
|
72
|
+
* @property {number | null} templateId - The identifier of the template used by the form, or null if no template is used. Example: 6789.
|
|
73
|
+
* @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.
|
|
74
|
+
* @example
|
|
75
|
+
{
|
|
76
|
+
"key": "value"
|
|
77
|
+
}
|
|
78
|
+
* @description This interface defines the structure of a form entity, including its identifiers, attributes, and processing data.
|
|
79
|
+
*/
|
|
80
|
+
interface IFormsEntity {
|
|
81
|
+
id: number;
|
|
82
|
+
attributeSetId: number | null;
|
|
83
|
+
type: 'order' | 'sing_in_up' | 'collection' | 'data' | 'rating' | null;
|
|
84
|
+
localizeInfos: ILocalizeInfo;
|
|
85
|
+
version: number;
|
|
86
|
+
position: number;
|
|
87
|
+
identifier: string;
|
|
88
|
+
processingType: string;
|
|
89
|
+
templateId: number | null;
|
|
90
|
+
attributes: IAttributes[] | Record<string, any>;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Represents the structure of a form configuration.
|
|
94
|
+
* @interface IFormConfig
|
|
95
|
+
* @property {number} id - The identifier of the form configuration. Example: 123.
|
|
96
|
+
* @property {string} [formIdentifier] - The form identifier (only in products/pages API). Example: "review".
|
|
97
|
+
* @property {string} moduleIdentifier - The identifier of the module associated with the form configuration. Example: "module_identifier".
|
|
98
|
+
* @property {boolean} isGlobal - Indicates whether the form configuration is global. Example: true.
|
|
99
|
+
* @property {boolean} isClosed - Indicates whether the form configuration is closed. Example: true.
|
|
100
|
+
* @property {boolean} [isModerate] - Indicates whether the form requires moderation (only in products/pages API). Example: false.
|
|
101
|
+
* @property {boolean} [viewOnlyUserData] - Indicates whether the form configuration allows viewing user data (used in forms API). Example: true.
|
|
102
|
+
* @property {boolean} [commentOnlyUserData] - Indicates whether the form configuration allows commenting on user data (used in forms API). Example: true.
|
|
103
|
+
* @property {boolean} [viewOnlyMyData] - Indicates whether the form configuration allows viewing my data (used in products/pages API). Example: false.
|
|
104
|
+
* @property {boolean} [commentOnlyMyData] - Indicates whether the form configuration allows commenting on my data (used in products/pages API). Example: false.
|
|
105
|
+
* @property {object[]} entityIdentifiers - An array of entity identifiers associated with the form configuration.
|
|
106
|
+
* @property {string} entityIdentifiers[].id - Entity identifier. Example: "catalog".
|
|
107
|
+
* @property {boolean} entityIdentifiers[].isNested - Indicates if entity is nested. Example: false.
|
|
108
|
+
* @property {string[]} [nestedEntityIdentifiers] - An array of nested entity identifier strings (only in products/pages API). Example: ["catalog"].
|
|
109
|
+
* @property {string[]} [exceptionIds] - An array of exception identifiers.
|
|
110
|
+
* @property {number} [formDataCount] - Total count of form data entries (only in products/pages API). Example: 306.
|
|
111
|
+
* @property {Record<string, number>} [entityFormDataCount] - Form data count per entity identifier (only in products/pages API). Example: {"catalog": 306}.
|
|
112
|
+
* @description This interface defines the structure of a form configuration, including its identifiers, module association, and entity identifiers. Different APIs return different field variants.
|
|
113
|
+
*/
|
|
114
|
+
interface IFormConfig {
|
|
115
|
+
id: number;
|
|
116
|
+
formIdentifier?: string;
|
|
117
|
+
moduleIdentifier: string;
|
|
118
|
+
isGlobal: boolean;
|
|
119
|
+
isClosed: boolean;
|
|
120
|
+
isModerate?: boolean;
|
|
121
|
+
viewOnlyUserData?: boolean;
|
|
122
|
+
commentOnlyUserData?: boolean;
|
|
123
|
+
viewOnlyMyData?: boolean;
|
|
124
|
+
commentOnlyMyData?: boolean;
|
|
125
|
+
entityIdentifiers: {
|
|
126
|
+
id: string;
|
|
127
|
+
isNested: boolean;
|
|
128
|
+
}[];
|
|
129
|
+
nestedEntityIdentifiers?: string[];
|
|
130
|
+
exceptionIds?: string[];
|
|
131
|
+
formDataCount?: number;
|
|
132
|
+
entityFormDataCount?: Record<string, number>;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Represents the paginated response structure for forms.
|
|
136
|
+
* @interface IFormsResponse
|
|
137
|
+
* @property {number} total - Total items count.
|
|
138
|
+
* @property {IFormsEntity[]} items - Array of form entities.
|
|
139
|
+
*/
|
|
140
|
+
interface IFormsResponse {
|
|
141
|
+
total: number;
|
|
142
|
+
items: IFormsEntity[];
|
|
143
|
+
}
|
|
144
|
+
export type { IFormConfig, IForms, IFormsEntity, IFormsResponse, IFromPages };
|