oneentry 1.0.140 → 1.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admins/adminsApi.d.ts +50 -0
- package/dist/admins/adminsApi.js +65 -0
- package/dist/admins/adminsInterfaces.d.ts +99 -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 +187 -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 +351 -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 +425 -0
- package/dist/auth-provider/authProvidersInterfaces.js +2 -0
- package/dist/base/asyncModules.d.ts +80 -0
- package/dist/base/asyncModules.js +440 -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 +149 -0
- package/dist/base/syncModules.js +549 -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 +76 -0
- package/dist/blocks/blocksApi.js +188 -0
- package/dist/blocks/blocksInterfaces.d.ts +173 -0
- package/dist/blocks/blocksInterfaces.js +2 -0
- package/dist/blocks/blocksSchemas.d.ts +187 -0
- package/dist/blocks/blocksSchemas.js +43 -0
- package/dist/discounts/discountsApi.d.ts +56 -0
- package/dist/discounts/discountsApi.js +82 -0
- package/dist/discounts/discountsInterfaces.d.ts +145 -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 +132 -0
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +117 -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 +132 -0
- package/dist/forms/formsInterfaces.js +2 -0
- package/dist/forms/formsSchemas.d.ts +50 -0
- package/dist/forms/formsSchemas.js +31 -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 +525 -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 +30 -0
- package/dist/general-types/generalTypesInterfaces.js +2 -0
- package/dist/general-types/generalTypesSchemas.d.ts +50 -0
- package/dist/general-types/generalTypesSchemas.js +35 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +103 -0
- package/dist/integration-collections/integrationCollectionsApi.d.ts +173 -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 +41 -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 +88 -0
- package/dist/menus/menusInterfaces.js +4 -0
- package/dist/menus/menusSchemas.d.ts +16 -0
- package/dist/menus/menusSchemas.js +28 -0
- package/dist/orders/ordersApi.d.ts +149 -0
- package/dist/orders/ordersApi.js +203 -0
- package/dist/orders/ordersInterfaces.d.ts +527 -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 +292 -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 +206 -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 +66 -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 +365 -0
- package/dist/products/productsApi.js +459 -0
- package/dist/products/productsInterfaces.d.ts +586 -0
- package/dist/products/productsInterfaces.js +2 -0
- package/dist/products/productsSchemas.d.ts +192 -0
- package/dist/products/productsSchemas.js +96 -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 +58 -0
- package/dist/system/systemInterfaces.d.ts +31 -0
- package/dist/system/systemInterfaces.js +5 -0
- package/dist/templates/templatesApi.d.ts +49 -0
- package/dist/templates/templatesApi.js +75 -0
- package/dist/templates/templatesInterfaces.d.ts +70 -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 +121 -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 +173 -0
- package/dist/users/usersInterfaces.d.ts +235 -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 +17 -0
- package/dist/web-socket/wsInterfaces.js +2 -0
- package/package.json +3 -81
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateFormsDataSchema = exports.PostFormResponseSchema = exports.FormsByMarkerDataResponseSchema = exports.FormByMarkerDataEntitySchema = exports.FormDataTypeSchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Validation schemas for FormsData module
|
|
6
|
+
* @description Zod schemas for validating forms data-related API responses
|
|
7
|
+
*/
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/**
|
|
10
|
+
* Form data type schema (flexible structure)
|
|
11
|
+
*/
|
|
12
|
+
exports.FormDataTypeSchema = zod_1.z.union([
|
|
13
|
+
zod_1.z.object({
|
|
14
|
+
marker: zod_1.z.string(),
|
|
15
|
+
type: zod_1.z.string(),
|
|
16
|
+
value: zod_1.z.any(),
|
|
17
|
+
}),
|
|
18
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
19
|
+
]);
|
|
20
|
+
/**
|
|
21
|
+
* Form by marker data entity schema
|
|
22
|
+
*/
|
|
23
|
+
exports.FormByMarkerDataEntitySchema = zod_1.z.object({
|
|
24
|
+
id: zod_1.z.number(),
|
|
25
|
+
parentId: zod_1.z.number().nullish(),
|
|
26
|
+
formIdentifier: zod_1.z.string(),
|
|
27
|
+
depth: zod_1.z.number().optional(),
|
|
28
|
+
ip: zod_1.z.string().nullish(),
|
|
29
|
+
fingerprint: zod_1.z.string().nullish(),
|
|
30
|
+
status: zod_1.z.string().nullish(),
|
|
31
|
+
userIdentifier: zod_1.z.string().nullish(),
|
|
32
|
+
formData: zod_1.z.union([
|
|
33
|
+
zod_1.z.array(exports.FormDataTypeSchema),
|
|
34
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.array(exports.FormDataTypeSchema)),
|
|
35
|
+
]),
|
|
36
|
+
attributeSetIdentifier: zod_1.z.string().nullish(),
|
|
37
|
+
time: zod_1.z.union([zod_1.z.date(), zod_1.z.string()]),
|
|
38
|
+
entityIdentifier: zod_1.z.string().optional(),
|
|
39
|
+
isUserAdmin: zod_1.z.boolean().optional(),
|
|
40
|
+
formModuleConfigId: zod_1.z.number().optional(),
|
|
41
|
+
moduleIdentifier: zod_1.z.string().optional(),
|
|
42
|
+
entityId: zod_1.z.number().optional(),
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Forms by marker data response schema
|
|
46
|
+
*/
|
|
47
|
+
exports.FormsByMarkerDataResponseSchema = zod_1.z.object({
|
|
48
|
+
items: zod_1.z.array(exports.FormByMarkerDataEntitySchema),
|
|
49
|
+
total: zod_1.z.number(),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Post form response schema
|
|
53
|
+
*/
|
|
54
|
+
exports.PostFormResponseSchema = zod_1.z.object({
|
|
55
|
+
actionMessage: zod_1.z.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.any())]),
|
|
56
|
+
formData: zod_1.z.object({
|
|
57
|
+
id: zod_1.z.number(),
|
|
58
|
+
formIdentifier: zod_1.z.string(),
|
|
59
|
+
time: zod_1.z.string(),
|
|
60
|
+
entityIdentifier: zod_1.z.string(),
|
|
61
|
+
fingerprint: zod_1.z.string(),
|
|
62
|
+
isUserAdmin: zod_1.z.boolean(),
|
|
63
|
+
formModuleId: zod_1.z.number(),
|
|
64
|
+
userIdentifier: zod_1.z.any(),
|
|
65
|
+
parentId: zod_1.z.any(),
|
|
66
|
+
formData: zod_1.z.union([
|
|
67
|
+
zod_1.z.array(exports.FormDataTypeSchema),
|
|
68
|
+
zod_1.z.record(zod_1.z.string(), zod_1.z.any()),
|
|
69
|
+
]),
|
|
70
|
+
}),
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Update forms data response schema
|
|
74
|
+
*/
|
|
75
|
+
exports.UpdateFormsDataSchema = zod_1.z.object({
|
|
76
|
+
id: zod_1.z.number(),
|
|
77
|
+
formIdentifier: zod_1.z.string(),
|
|
78
|
+
time: zod_1.z.string(),
|
|
79
|
+
formData: zod_1.z.array(exports.FormDataTypeSchema),
|
|
80
|
+
userIdentifier: zod_1.z.string(),
|
|
81
|
+
entityIdentifier: zod_1.z.string(),
|
|
82
|
+
parentId: zod_1.z.number().nullable(),
|
|
83
|
+
fingerprint: zod_1.z.string().nullable(),
|
|
84
|
+
isUserAdmin: zod_1.z.boolean(),
|
|
85
|
+
formModuleId: zod_1.z.number(),
|
|
86
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { IGeneralTypes, IGeneralTypesEntity } from './generalTypesInterfaces';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for working with types
|
|
7
|
+
* @handle /api/content/general-types
|
|
8
|
+
* @class GeneralTypesApi
|
|
9
|
+
* @augments AsyncModules
|
|
10
|
+
* @implements {IGeneralTypes}
|
|
11
|
+
* @description This class provides methods to interact with general types, including retrieving all types.
|
|
12
|
+
*/
|
|
13
|
+
export default class GeneralTypesApi extends AsyncModules implements IGeneralTypes {
|
|
14
|
+
protected state: StateModule;
|
|
15
|
+
protected _url: string;
|
|
16
|
+
/**
|
|
17
|
+
* Constructor for the GeneralTypesApi class.
|
|
18
|
+
*/
|
|
19
|
+
constructor(state: StateModule);
|
|
20
|
+
/**
|
|
21
|
+
* Get all types.
|
|
22
|
+
* @handleName getAllTypes
|
|
23
|
+
* @returns {Promise<IGeneralTypesEntity[] | IError>} Returns an array of general types or an error object if there was an issue.
|
|
24
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
25
|
+
* @description This method retrieves all general types available in the system.
|
|
26
|
+
*/
|
|
27
|
+
getAllTypes(): Promise<IGeneralTypesEntity[] | IError>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 generalTypesSchemas_1 = require("./generalTypesSchemas");
|
|
8
|
+
/**
|
|
9
|
+
* Controllers for working with types
|
|
10
|
+
* @handle /api/content/general-types
|
|
11
|
+
* @class GeneralTypesApi
|
|
12
|
+
* @augments AsyncModules
|
|
13
|
+
* @implements {IGeneralTypes}
|
|
14
|
+
* @description This class provides methods to interact with general types, including retrieving all types.
|
|
15
|
+
*/
|
|
16
|
+
class GeneralTypesApi extends asyncModules_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Constructor for the GeneralTypesApi class.
|
|
19
|
+
*/
|
|
20
|
+
constructor(state) {
|
|
21
|
+
super(state);
|
|
22
|
+
this._url = state.url + '/api/content/general-types';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get all types.
|
|
26
|
+
* @handleName getAllTypes
|
|
27
|
+
* @returns {Promise<IGeneralTypesEntity[] | IError>} Returns an array of general types or an error object if there was an issue.
|
|
28
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
29
|
+
* @description This method retrieves all general types available in the system.
|
|
30
|
+
*/
|
|
31
|
+
async getAllTypes() {
|
|
32
|
+
const result = await this._fetchGet('');
|
|
33
|
+
// Validate response if validation is enabled
|
|
34
|
+
const validated = this._validateResponse(result, generalTypesSchemas_1.GeneralTypesResponseSchema);
|
|
35
|
+
return validated;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.default = GeneralTypesApi;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { IError } from '../base/utils';
|
|
2
|
+
import type { BlockType } from '../blocks/blocksInterfaces';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for retrieving all general types in the system.
|
|
5
|
+
* @interface IGeneralTypes
|
|
6
|
+
* @property {Function} getAllTypes - Get all types.
|
|
7
|
+
* @description This interface defines a method for retrieving all general types in the system.
|
|
8
|
+
*/
|
|
9
|
+
interface IGeneralTypes {
|
|
10
|
+
/**
|
|
11
|
+
* Get all types.
|
|
12
|
+
* @handleName getAllTypes
|
|
13
|
+
* @returns {IGeneralTypesEntity[]} Returns an array of general types or an error object if there was an issue.
|
|
14
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
15
|
+
* @description This method gets all types.
|
|
16
|
+
*/
|
|
17
|
+
getAllTypes(): Promise<IGeneralTypesEntity[] | IError>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a general type entity.
|
|
21
|
+
* @interface IGeneralTypesEntity
|
|
22
|
+
* @property {number} id - Type id. Example: 1.
|
|
23
|
+
* @property {Types} type - Types enum. Example: "product", "category", "etc".
|
|
24
|
+
* @description Represents a general type entity with an identifier and a type.
|
|
25
|
+
*/
|
|
26
|
+
interface IGeneralTypesEntity {
|
|
27
|
+
id: number;
|
|
28
|
+
type: BlockType;
|
|
29
|
+
}
|
|
30
|
+
export type { IGeneralTypes, IGeneralTypesEntity };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation schemas for GeneralTypes module
|
|
3
|
+
* @description Zod schemas for validating general types-related API responses
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* General type entity schema
|
|
8
|
+
* Includes all fields returned by the API
|
|
9
|
+
*/
|
|
10
|
+
export declare const GeneralTypeEntitySchema: z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
type: z.ZodEnum<{
|
|
13
|
+
none: "none";
|
|
14
|
+
product: "product";
|
|
15
|
+
order: "order";
|
|
16
|
+
form: "form";
|
|
17
|
+
error_page: "error_page";
|
|
18
|
+
catalog_page: "catalog_page";
|
|
19
|
+
product_preview: "product_preview";
|
|
20
|
+
similar_products_block: "similar_products_block";
|
|
21
|
+
product_block: "product_block";
|
|
22
|
+
common_page: "common_page";
|
|
23
|
+
common_block: "common_block";
|
|
24
|
+
service: "service";
|
|
25
|
+
external_page: "external_page";
|
|
26
|
+
discount: "discount";
|
|
27
|
+
}>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
/**
|
|
30
|
+
* General types response schema (array of general types)
|
|
31
|
+
*/
|
|
32
|
+
export declare const GeneralTypesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
33
|
+
id: z.ZodNumber;
|
|
34
|
+
type: z.ZodEnum<{
|
|
35
|
+
none: "none";
|
|
36
|
+
product: "product";
|
|
37
|
+
order: "order";
|
|
38
|
+
form: "form";
|
|
39
|
+
error_page: "error_page";
|
|
40
|
+
catalog_page: "catalog_page";
|
|
41
|
+
product_preview: "product_preview";
|
|
42
|
+
similar_products_block: "similar_products_block";
|
|
43
|
+
product_block: "product_block";
|
|
44
|
+
common_page: "common_page";
|
|
45
|
+
common_block: "common_block";
|
|
46
|
+
service: "service";
|
|
47
|
+
external_page: "external_page";
|
|
48
|
+
discount: "discount";
|
|
49
|
+
}>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GeneralTypesResponseSchema = exports.GeneralTypeEntitySchema = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Validation schemas for GeneralTypes module
|
|
6
|
+
* @description Zod schemas for validating general types-related API responses
|
|
7
|
+
*/
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/**
|
|
10
|
+
* General type entity schema
|
|
11
|
+
* Includes all fields returned by the API
|
|
12
|
+
*/
|
|
13
|
+
exports.GeneralTypeEntitySchema = zod_1.z.object({
|
|
14
|
+
id: zod_1.z.number(),
|
|
15
|
+
type: zod_1.z.enum([
|
|
16
|
+
'product',
|
|
17
|
+
'error_page',
|
|
18
|
+
'catalog_page',
|
|
19
|
+
'product_preview',
|
|
20
|
+
'similar_products_block',
|
|
21
|
+
'product_block',
|
|
22
|
+
'form',
|
|
23
|
+
'common_page',
|
|
24
|
+
'common_block',
|
|
25
|
+
'order',
|
|
26
|
+
'service',
|
|
27
|
+
'external_page',
|
|
28
|
+
'discount',
|
|
29
|
+
'none',
|
|
30
|
+
]),
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* General types response schema (array of general types)
|
|
34
|
+
*/
|
|
35
|
+
exports.GeneralTypesResponseSchema = zod_1.z.array(exports.GeneralTypeEntitySchema);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OneEntry SDK
|
|
3
|
+
*/
|
|
4
|
+
import AdminsApi from './admins/adminsApi';
|
|
5
|
+
import AttributesSetsApi from './attribute-sets/attributeSetsApi';
|
|
6
|
+
import AuthProviderApi from './auth-provider/authProviderApi';
|
|
7
|
+
import type { IConfig } from './base/utils';
|
|
8
|
+
import BlocksApi from './blocks/blocksApi';
|
|
9
|
+
import DiscountsApi from './discounts/discountsApi';
|
|
10
|
+
import EventsApi from './events/eventsApi';
|
|
11
|
+
import FileUploadingApi from './file-uploading/fileUploadingApi';
|
|
12
|
+
import FormsApi from './forms/formsApi';
|
|
13
|
+
import FormsDataApi from './forms-data/formsDataApi';
|
|
14
|
+
import GeneralTypesApi from './general-types/generalTypesApi';
|
|
15
|
+
import IntegrationCollectionsApi from './integration-collections/integrationCollectionsApi';
|
|
16
|
+
import LocalesApi from './locales/localesApi';
|
|
17
|
+
import MenusApi from './menus/menusApi';
|
|
18
|
+
import OrdersApi from './orders/ordersApi';
|
|
19
|
+
import PagesApi from './pages/pagesApi';
|
|
20
|
+
import PaymentsApi from './payments/paymentsApi';
|
|
21
|
+
import ProductStatusesApi from './product-statuses/productStatusesApi';
|
|
22
|
+
import ProductsApi from './products/productsApi';
|
|
23
|
+
import SitemapApi from './sitemap/sitemapApi';
|
|
24
|
+
import SystemApi from './system/systemApi';
|
|
25
|
+
import TemplatesApi from './templates/templatesApi';
|
|
26
|
+
import TemplatePreviewsApi from './templates-preview/templatesPreviewApi';
|
|
27
|
+
import UsersApi from './users/usersApi';
|
|
28
|
+
import WsApi from './web-socket/wsApi';
|
|
29
|
+
/**
|
|
30
|
+
* IDefineApi interface
|
|
31
|
+
* @interface IDefineApi
|
|
32
|
+
* @property {AdminsApi} Admins - Admins API module.
|
|
33
|
+
* @property {AttributesSetsApi} AttributesSets - Attribute sets API module.
|
|
34
|
+
* @property {AuthProviderApi} AuthProvider - Auth provider API module.
|
|
35
|
+
* @property {BlocksApi} Blocks - Blocks API module.
|
|
36
|
+
* @property {EventsApi} Events - Events API module.
|
|
37
|
+
* @property {DiscountsApi} Discounts - Discounts API module.
|
|
38
|
+
* @property {FileUploadingApi} FileUploading - File uploading API module.
|
|
39
|
+
* @property {FormsApi} Forms - Forms API module.
|
|
40
|
+
* @property {FormsDataApi} FormData - Form data API module.
|
|
41
|
+
* @property {GeneralTypesApi} GeneralTypes - General types API module.
|
|
42
|
+
* @property {IntegrationCollectionsApi} IntegrationCollections - Integration collections API module.
|
|
43
|
+
* @property {LocalesApi} Locales - Locales API module.
|
|
44
|
+
* @property {MenusApi} Menus - Menus API module.
|
|
45
|
+
* @property {OrdersApi} Orders - Orders API module.
|
|
46
|
+
* @property {PageApi} Pages - Pages API module.
|
|
47
|
+
* @property {PaymentsApi} Payments - Payments API module.
|
|
48
|
+
* @property {ProductsApi} Products - Products API module.
|
|
49
|
+
* @property {ProductStatusesApi} ProductStatuses - Product statuses API module.
|
|
50
|
+
* @property {SitemapApi} Sitemap - Sitemap API module.
|
|
51
|
+
* @property {SystemApi} System - System API module.
|
|
52
|
+
* @property {TemplatesApi} Templates - Templates API module.
|
|
53
|
+
* @property {TemplatePreviewsApi} TemplatePreviews - Template previews API module.
|
|
54
|
+
* @property {UsersApi} Users - Users API module.
|
|
55
|
+
* @property {WsApi} WS - WebSocket API module.
|
|
56
|
+
*/
|
|
57
|
+
interface IDefineApi {
|
|
58
|
+
Admins: AdminsApi;
|
|
59
|
+
AttributesSets: AttributesSetsApi;
|
|
60
|
+
AuthProvider: AuthProviderApi;
|
|
61
|
+
Blocks: BlocksApi;
|
|
62
|
+
Events: EventsApi;
|
|
63
|
+
Discounts: DiscountsApi;
|
|
64
|
+
FileUploading: FileUploadingApi;
|
|
65
|
+
Forms: FormsApi;
|
|
66
|
+
FormData: FormsDataApi;
|
|
67
|
+
GeneralTypes: GeneralTypesApi;
|
|
68
|
+
IntegrationCollections: IntegrationCollectionsApi;
|
|
69
|
+
Locales: LocalesApi;
|
|
70
|
+
Menus: MenusApi;
|
|
71
|
+
Orders: OrdersApi;
|
|
72
|
+
Pages: PagesApi;
|
|
73
|
+
Payments: PaymentsApi;
|
|
74
|
+
Products: ProductsApi;
|
|
75
|
+
ProductStatuses: ProductStatusesApi;
|
|
76
|
+
Sitemap: SitemapApi;
|
|
77
|
+
System: SystemApi;
|
|
78
|
+
Templates: TemplatesApi;
|
|
79
|
+
TemplatePreviews: TemplatePreviewsApi;
|
|
80
|
+
Users: UsersApi;
|
|
81
|
+
WS: WsApi;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Define API.
|
|
85
|
+
* @function defineOneEntry
|
|
86
|
+
* @param {string} url - URl of your project.
|
|
87
|
+
* @param {IConfig} config - Custom configuration settings
|
|
88
|
+
* @param {string} [config.token] - Optional token parameter
|
|
89
|
+
* @param {string} [config.langCode] - Optional langCode parameter
|
|
90
|
+
* @param {boolean} [config.traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set this parameter to "false" to save traffic and decide for yourself what data you need.
|
|
91
|
+
* @param {string} [config.auth] - An object with authorization settings.
|
|
92
|
+
* @param {boolean} [config.auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal.
|
|
93
|
+
* @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
|
|
94
|
+
* @param {string} [config.auth.providerMarker] - The marker of the authorization provider.
|
|
95
|
+
* @param {string} [config.auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated.
|
|
96
|
+
* @returns {IDefineApi} List of methods set.
|
|
97
|
+
* @description Define API.
|
|
98
|
+
*/
|
|
99
|
+
export declare function defineOneEntry(url: string, config: IConfig): IDefineApi;
|
|
100
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.defineOneEntry = defineOneEntry;
|
|
7
|
+
/**
|
|
8
|
+
* OneEntry SDK
|
|
9
|
+
*/
|
|
10
|
+
const adminsApi_1 = __importDefault(require("./admins/adminsApi"));
|
|
11
|
+
const attributeSetsApi_1 = __importDefault(require("./attribute-sets/attributeSetsApi"));
|
|
12
|
+
const authProviderApi_1 = __importDefault(require("./auth-provider/authProviderApi"));
|
|
13
|
+
const stateModule_1 = __importDefault(require("./base/stateModule"));
|
|
14
|
+
const blocksApi_1 = __importDefault(require("./blocks/blocksApi"));
|
|
15
|
+
const discountsApi_1 = __importDefault(require("./discounts/discountsApi"));
|
|
16
|
+
const eventsApi_1 = __importDefault(require("./events/eventsApi"));
|
|
17
|
+
const fileUploadingApi_1 = __importDefault(require("./file-uploading/fileUploadingApi"));
|
|
18
|
+
const formsApi_1 = __importDefault(require("./forms/formsApi"));
|
|
19
|
+
const formsDataApi_1 = __importDefault(require("./forms-data/formsDataApi"));
|
|
20
|
+
const generalTypesApi_1 = __importDefault(require("./general-types/generalTypesApi"));
|
|
21
|
+
const integrationCollectionsApi_1 = __importDefault(require("./integration-collections/integrationCollectionsApi"));
|
|
22
|
+
const localesApi_1 = __importDefault(require("./locales/localesApi"));
|
|
23
|
+
const menusApi_1 = __importDefault(require("./menus/menusApi"));
|
|
24
|
+
const ordersApi_1 = __importDefault(require("./orders/ordersApi"));
|
|
25
|
+
const pagesApi_1 = __importDefault(require("./pages/pagesApi"));
|
|
26
|
+
const paymentsApi_1 = __importDefault(require("./payments/paymentsApi"));
|
|
27
|
+
const productStatusesApi_1 = __importDefault(require("./product-statuses/productStatusesApi"));
|
|
28
|
+
const productsApi_1 = __importDefault(require("./products/productsApi"));
|
|
29
|
+
const sitemapApi_1 = __importDefault(require("./sitemap/sitemapApi"));
|
|
30
|
+
const systemApi_1 = __importDefault(require("./system/systemApi"));
|
|
31
|
+
const templatesApi_1 = __importDefault(require("./templates/templatesApi"));
|
|
32
|
+
const templatesPreviewApi_1 = __importDefault(require("./templates-preview/templatesPreviewApi"));
|
|
33
|
+
const usersApi_1 = __importDefault(require("./users/usersApi"));
|
|
34
|
+
const wsApi_1 = __importDefault(require("./web-socket/wsApi"));
|
|
35
|
+
/**
|
|
36
|
+
* Define API.
|
|
37
|
+
* @function defineOneEntry
|
|
38
|
+
* @param {string} url - URl of your project.
|
|
39
|
+
* @param {IConfig} config - Custom configuration settings
|
|
40
|
+
* @param {string} [config.token] - Optional token parameter
|
|
41
|
+
* @param {string} [config.langCode] - Optional langCode parameter
|
|
42
|
+
* @param {boolean} [config.traficLimit] - Some methods use multiple queries to make it easier to work with the API. Set this parameter to "false" to save traffic and decide for yourself what data you need.
|
|
43
|
+
* @param {string} [config.auth] - An object with authorization settings.
|
|
44
|
+
* @param {boolean} [config.auth.customAuth] - Set this flag to true if you want to configure the authorization process yourself. Set the flag to false, or do not pass it at all to have automatic authorization and token renewal.
|
|
45
|
+
* @param {string} [config.auth.refreshToken] - Transfer the refresh token here, for example from the local storage, to resume the user's session. Otherwise, the user will need to log in every time a new session is created.
|
|
46
|
+
* @param {string} [config.auth.providerMarker] - The marker of the authorization provider.
|
|
47
|
+
* @param {string} [config.auth.saveFunction] - If you want to store the token between sessions, for example in local storage, create a custom function that takes refreshToken as a parameter and executes the necessary instructions. This function will be called every time the tokens are updated.
|
|
48
|
+
* @returns {IDefineApi} List of methods set.
|
|
49
|
+
* @description Define API.
|
|
50
|
+
*/
|
|
51
|
+
function defineOneEntry(url, config) {
|
|
52
|
+
const stateModule = new stateModule_1.default(url.endsWith('/') ? url.slice(0, -1) : url, config);
|
|
53
|
+
const Admins = new adminsApi_1.default(stateModule);
|
|
54
|
+
const AttributesSets = new attributeSetsApi_1.default(stateModule);
|
|
55
|
+
const AuthProvider = new authProviderApi_1.default(stateModule);
|
|
56
|
+
const Blocks = new blocksApi_1.default(stateModule);
|
|
57
|
+
const Discounts = new discountsApi_1.default(stateModule);
|
|
58
|
+
const Events = new eventsApi_1.default(stateModule);
|
|
59
|
+
const FileUploading = new fileUploadingApi_1.default(stateModule);
|
|
60
|
+
const Forms = new formsApi_1.default(stateModule);
|
|
61
|
+
const FormData = new formsDataApi_1.default(stateModule);
|
|
62
|
+
const GeneralTypes = new generalTypesApi_1.default(stateModule);
|
|
63
|
+
const IntegrationCollections = new integrationCollectionsApi_1.default(stateModule);
|
|
64
|
+
const Locales = new localesApi_1.default(stateModule);
|
|
65
|
+
const Menus = new menusApi_1.default(stateModule);
|
|
66
|
+
const Orders = new ordersApi_1.default(stateModule);
|
|
67
|
+
const Pages = new pagesApi_1.default(stateModule);
|
|
68
|
+
const Payments = new paymentsApi_1.default(stateModule);
|
|
69
|
+
const Products = new productsApi_1.default(stateModule);
|
|
70
|
+
const ProductStatuses = new productStatusesApi_1.default(stateModule);
|
|
71
|
+
const Sitemap = new sitemapApi_1.default(stateModule);
|
|
72
|
+
const System = new systemApi_1.default(stateModule);
|
|
73
|
+
const Templates = new templatesApi_1.default(stateModule);
|
|
74
|
+
const TemplatePreviews = new templatesPreviewApi_1.default(stateModule);
|
|
75
|
+
const Users = new usersApi_1.default(stateModule);
|
|
76
|
+
const WS = new wsApi_1.default(stateModule);
|
|
77
|
+
return {
|
|
78
|
+
Admins,
|
|
79
|
+
AttributesSets,
|
|
80
|
+
AuthProvider,
|
|
81
|
+
Blocks,
|
|
82
|
+
Discounts,
|
|
83
|
+
Events,
|
|
84
|
+
FileUploading,
|
|
85
|
+
Forms,
|
|
86
|
+
FormData,
|
|
87
|
+
GeneralTypes,
|
|
88
|
+
IntegrationCollections,
|
|
89
|
+
Locales,
|
|
90
|
+
Menus,
|
|
91
|
+
Orders,
|
|
92
|
+
Pages,
|
|
93
|
+
Payments,
|
|
94
|
+
Products,
|
|
95
|
+
ProductStatuses,
|
|
96
|
+
Sitemap,
|
|
97
|
+
System,
|
|
98
|
+
Templates,
|
|
99
|
+
TemplatePreviews,
|
|
100
|
+
Users,
|
|
101
|
+
WS,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
|
+
import type StateModule from '../base/stateModule';
|
|
3
|
+
import type { IError } from '../base/utils';
|
|
4
|
+
import type { ICollectionEntity, ICollectionFormObject, ICollectionIsValid, ICollectionRow, ICollectionRowsResponce, ICollectionsApi } from './integrationCollectionsInterfaces';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for working with attributes.
|
|
7
|
+
* @handle /api/content/integration-collections
|
|
8
|
+
* @class IntegrationCollectionsApi
|
|
9
|
+
* @augments AsyncModules
|
|
10
|
+
* @implements {ICollectionsApi}
|
|
11
|
+
* @description This class provides methods to interact with integration collections, including retrieving all collections, getting a single collection by ID, and managing collection rows.
|
|
12
|
+
*/
|
|
13
|
+
export default class IntegrationCollectionsApi extends AsyncModules implements ICollectionsApi {
|
|
14
|
+
protected state: StateModule;
|
|
15
|
+
protected _url: string;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
constructor(state: StateModule);
|
|
20
|
+
private _defaultQuery;
|
|
21
|
+
/**
|
|
22
|
+
* Get all collections.
|
|
23
|
+
* @handleName getICollections
|
|
24
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
+
* @param {object} [userQuery] - Optional set query parameters.
|
|
26
|
+
* @example
|
|
27
|
+
{
|
|
28
|
+
"limit": 0,
|
|
29
|
+
"offset": 30,
|
|
30
|
+
"entityType": "orders",
|
|
31
|
+
"entityId": 1
|
|
32
|
+
}
|
|
33
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
34
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
35
|
+
* @param {string} [userQuery.entityType] - Entity type. Example: "orders".
|
|
36
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
37
|
+
* @returns {Promise<ICollectionEntity[] | IError>} Returns an array of ICollection objects or an error object if there was an issue.
|
|
38
|
+
*/
|
|
39
|
+
getICollections(langCode?: string, userQuery?: {
|
|
40
|
+
limit: number;
|
|
41
|
+
offset: number;
|
|
42
|
+
entityType: string;
|
|
43
|
+
entityId: number;
|
|
44
|
+
}): Promise<ICollectionEntity[] | IError>;
|
|
45
|
+
/**
|
|
46
|
+
* Get a single collection object by id.
|
|
47
|
+
* @handleName getICollectionById
|
|
48
|
+
* @param {number} id - Collection id. Example: 1.
|
|
49
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
50
|
+
* @returns {Promise<ICollectionEntity | IError>} Returns an ICollection object or an error object if there was an issue.
|
|
51
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
52
|
+
*/
|
|
53
|
+
getICollectionById(id: number, langCode?: string): Promise<ICollectionEntity | IError>;
|
|
54
|
+
/**
|
|
55
|
+
* Get all records belonging to the collection by collection id.
|
|
56
|
+
* @handleName getICollectionRowsById
|
|
57
|
+
* @param {number} id - Collection id. Example: 1.
|
|
58
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
59
|
+
* @param {any} [userQuery] - Optional set query parameters.
|
|
60
|
+
* @example
|
|
61
|
+
{
|
|
62
|
+
"limit": 0,
|
|
63
|
+
"offset": 30,
|
|
64
|
+
"entityType": "orders",
|
|
65
|
+
"entityId": 1
|
|
66
|
+
}
|
|
67
|
+
* @param {number} [userQuery.limit] - Optional parameter for pagination. Default: 0.
|
|
68
|
+
* @param {number} [userQuery.offset] - Optional parameter for pagination. Default: 30.
|
|
69
|
+
* @param {number} [userQuery.entityType] - Entity type. Example: "orders".
|
|
70
|
+
* @param {number} [userQuery.entityId] - Entity identifier. Example: 1.
|
|
71
|
+
* @returns {Promise<ICollectionRowsResponce | IError>} Returns object ItemsWithTotal, where items is an array of requested objects.
|
|
72
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
73
|
+
* @description Get all records belonging to the collection by collection id.
|
|
74
|
+
*/
|
|
75
|
+
getICollectionRowsById(id: number, langCode?: string, userQuery?: {
|
|
76
|
+
limit: number;
|
|
77
|
+
offset: number;
|
|
78
|
+
entityType: string;
|
|
79
|
+
entityId: number;
|
|
80
|
+
}): Promise<ICollectionRowsResponce | IError>;
|
|
81
|
+
/**
|
|
82
|
+
* Check for the existence of a text identifier (marker).
|
|
83
|
+
* @handleName validateICollectionMarker
|
|
84
|
+
* @param {string} marker - Collection marker. Example: "collection1".
|
|
85
|
+
* @returns {Promise<ICollectionIsValid | IError>} Returns an object with a boolean property `valid` indicating whether the marker is valid or not.
|
|
86
|
+
* @example
|
|
87
|
+
{
|
|
88
|
+
"valid": true
|
|
89
|
+
}
|
|
90
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
91
|
+
* @description Check for the existence of a text identifier (marker).
|
|
92
|
+
*/
|
|
93
|
+
validateICollectionMarker(marker: string): Promise<ICollectionIsValid | IError>;
|
|
94
|
+
/**
|
|
95
|
+
* Getting all records from the collection.
|
|
96
|
+
* @handleName getICollectionRowsByMarker
|
|
97
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
98
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
99
|
+
* @returns {Promise<ICollectionRowsResponce | IError>} Returns CollectionRowEntity object.
|
|
100
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
101
|
+
*/
|
|
102
|
+
getICollectionRowsByMarker(marker: string, langCode?: string): Promise<ICollectionRowsResponce | IError>;
|
|
103
|
+
/**
|
|
104
|
+
* Getting one record from the collection.
|
|
105
|
+
* @handleName getICollectionRowByMarkerAndId
|
|
106
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
107
|
+
* @param {number} id - Collection record identifier. Example: 1.
|
|
108
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
109
|
+
* @returns {Promise<ICollectionRow | IError>} Returns CollectionRowEntity object.
|
|
110
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
111
|
+
*/
|
|
112
|
+
getICollectionRowByMarkerAndId(marker: string, id: number, langCode?: string): Promise<ICollectionRow | IError>;
|
|
113
|
+
/**
|
|
114
|
+
* Create a record in the collection.
|
|
115
|
+
* @handleName createICollectionRow
|
|
116
|
+
* @param {string} marker - Collection text identifier. Example: "collection1".
|
|
117
|
+
* @param {ICollectionFormObject} body - Object for creating a record.
|
|
118
|
+
* @example
|
|
119
|
+
{
|
|
120
|
+
"formIdentifier": "collection-form",
|
|
121
|
+
"formData": [
|
|
122
|
+
{
|
|
123
|
+
"marker": "collection_marker",
|
|
124
|
+
"type": "string",
|
|
125
|
+
"value": "Collection marker"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
130
|
+
* @returns {Promise<ICollectionRow | IError>} Returns object of type ICollectionRow.
|
|
131
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
132
|
+
* @description Create a record in the collection.
|
|
133
|
+
*/
|
|
134
|
+
createICollectionRow(marker: string, body: ICollectionFormObject, langCode?: string): Promise<ICollectionRow | IError>;
|
|
135
|
+
/**
|
|
136
|
+
* Edit a record in the collection.
|
|
137
|
+
* @handleName updateICollectionRow
|
|
138
|
+
* @param {string} marker - Text identifier of the collection. Example: "collection1".
|
|
139
|
+
* @param {number} id - Row identifier in the collection. Example: 12.
|
|
140
|
+
* @param {object} body - Object for updating a record in the collection.
|
|
141
|
+
* @example
|
|
142
|
+
{
|
|
143
|
+
"formIdentifier": "collection-form",
|
|
144
|
+
"formData": [
|
|
145
|
+
{
|
|
146
|
+
"marker": "collection_marker",
|
|
147
|
+
"type": "string",
|
|
148
|
+
"value": "Collection marker"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
* @param {string} body.formIdentifier - Textual identifier of the form. Example: "collection-form".
|
|
153
|
+
* @param {any} body.formData - Object with the form data.
|
|
154
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
155
|
+
* @returns {Promise<ICollectionRow | IError>} Returns object of type ICollectionRow.
|
|
156
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
157
|
+
* @description Edit a record in the collection.
|
|
158
|
+
*/
|
|
159
|
+
updateICollectionRow(marker: string, id: number, body: {
|
|
160
|
+
formIdentifier: string;
|
|
161
|
+
formData: any;
|
|
162
|
+
}, langCode?: string): Promise<ICollectionRow | IError>;
|
|
163
|
+
/**
|
|
164
|
+
* Deletion of collection record object
|
|
165
|
+
* @handleName deleteICollectionRowByMarkerAndId
|
|
166
|
+
* @param {string} marker - text identifier of the collection Example: "collection1".
|
|
167
|
+
* @param {number} id - record identifier in the collection Example: 12.
|
|
168
|
+
* @returns {Promise<boolean | IError>} Returns true (in case of successful deletion) or false (in case of unsuccessful deletion) (permission "collections.row.delete" required for access)
|
|
169
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
170
|
+
* @description Deletion of collection record object
|
|
171
|
+
*/
|
|
172
|
+
deleteICollectionRowByMarkerAndId(marker: string, id: number): Promise<boolean | IError>;
|
|
173
|
+
}
|