oneentry 1.0.65 → 1.0.67
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/README.md +304 -243
- package/dist/_cjs/admins/adminsApi.d.ts +1 -1
- package/dist/admins/adminsApi.d.ts +6 -4
- package/dist/admins/adminsApi.js +6 -6
- package/dist/attribute-sets/attributeSetsApi.d.ts +6 -4
- package/dist/attribute-sets/attributeSetsApi.js +7 -7
- package/dist/auth-provider/authProviderApi.d.ts +6 -4
- package/dist/auth-provider/authProviderApi.js +14 -10
- package/dist/auth-provider/authProvidersInterfaces.d.ts +2 -2
- package/dist/base/asyncModules.d.ts +16 -0
- package/dist/base/asyncModules.js +164 -0
- package/dist/base/modules.d.ts +14 -0
- package/dist/base/modules.js +173 -0
- package/dist/base/oneEntry.d.ts +0 -23
- package/dist/base/oneEntry.js +74 -236
- package/dist/base/stateModule.d.ts +10 -0
- package/dist/base/stateModule.js +13 -0
- package/dist/base/syncModules.d.ts +14 -0
- package/dist/base/syncModules.js +72 -0
- package/dist/blocks/blocksApi.d.ts +9 -6
- package/dist/blocks/blocksApi.js +17 -16
- package/dist/blocks/blocksInterfaces.d.ts +3 -2
- package/dist/events/eventsApi.d.ts +6 -4
- package/dist/events/eventsApi.js +5 -5
- package/dist/file-uploding/fileUploadingApi.d.ts +6 -4
- package/dist/file-uploding/fileUploadingApi.js +6 -6
- package/dist/forms/formsApi.d.ts +7 -5
- package/dist/forms/formsApi.js +8 -8
- package/dist/formsData/formsDataApi.d.ts +8 -6
- package/dist/formsData/formsDataApi.js +10 -10
- package/dist/general-types/typesApi.d.ts +6 -4
- package/dist/general-types/typesApi.js +5 -5
- package/dist/index.js +22 -20
- package/dist/locales/localesApi.d.ts +6 -4
- package/dist/locales/localesApi.js +5 -5
- package/dist/menus/menusApi.d.ts +7 -5
- package/dist/menus/menusApi.js +7 -7
- package/dist/orders/ordersApi.d.ts +6 -4
- package/dist/orders/ordersApi.js +10 -10
- package/dist/pages/pagesApi.d.ts +6 -4
- package/dist/pages/pagesApi.js +16 -19
- package/dist/payments/paymentsApi.d.ts +6 -10
- package/dist/payments/paymentsApi.js +5 -14
- package/dist/payments/paymentsInterfaces.d.ts +0 -2
- package/dist/product-statuses/productStatusesApi.d.ts +6 -4
- package/dist/product-statuses/productStatusesApi.js +8 -8
- package/dist/products/productsApi.d.ts +107 -52
- package/dist/products/productsApi.js +119 -65
- package/dist/products/productsInterfaces.d.ts +16 -8
- package/dist/system/systemApi.d.ts +6 -4
- package/dist/system/systemApi.js +5 -5
- package/dist/templates/templatesApi.d.ts +9 -6
- package/dist/templates/templatesApi.js +9 -9
- package/dist/templates/templatesInterfaces.d.ts +2 -1
- package/dist/templates-preview/templatesPreviewApi.d.ts +8 -6
- package/dist/templates-preview/templatesPreviewApi.js +10 -10
- package/dist/users/usersApi.d.ts +6 -4
- package/dist/users/usersApi.js +7 -7
- package/package.json +1 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AsyncModules from "../base/asyncModules";
|
|
2
2
|
import { ISystem } from "./systemInterfaces";
|
|
3
|
-
import
|
|
3
|
+
import StateModule from "../base/stateModule";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with system - system
|
|
6
6
|
*/
|
|
7
|
-
export default class SystemApi extends
|
|
8
|
-
|
|
7
|
+
export default class SystemApi extends AsyncModules implements ISystem {
|
|
8
|
+
protected state: StateModule;
|
|
9
|
+
protected _url: string;
|
|
10
|
+
constructor(state: StateModule);
|
|
9
11
|
test404(): Promise<any>;
|
|
10
12
|
test500(): Promise<any>;
|
|
11
13
|
}
|
package/dist/system/systemApi.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const asyncModules_1 = require("../base/asyncModules");
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with system - system
|
|
6
6
|
*/
|
|
7
|
-
class SystemApi extends
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
this._url
|
|
7
|
+
class SystemApi extends asyncModules_1.default {
|
|
8
|
+
constructor(state) {
|
|
9
|
+
super(state);
|
|
10
|
+
this._url = state.url + '/api/content/system';
|
|
11
11
|
}
|
|
12
12
|
async test404() {
|
|
13
13
|
const result = await this._fetchGet('/test404');
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AsyncModules from '../base/asyncModules';
|
|
2
2
|
import { ITemplatesApi, ITemplateEntity, ITemplateList } from './templatesInterfaces';
|
|
3
|
-
import
|
|
3
|
+
import StateModule from "../base/stateModule";
|
|
4
|
+
import { BlockType } from "../blocks/blocksInterfaces";
|
|
4
5
|
/**
|
|
5
6
|
* Controllers for working with template objects
|
|
6
7
|
*/
|
|
7
|
-
export default class TemplatesPreviewApi extends
|
|
8
|
-
|
|
8
|
+
export default class TemplatesPreviewApi extends AsyncModules implements ITemplatesApi {
|
|
9
|
+
protected state: StateModule;
|
|
10
|
+
protected _url: string;
|
|
11
|
+
constructor(state: StateModule);
|
|
9
12
|
/**
|
|
10
13
|
* Get all template objects grouped by types.
|
|
11
14
|
* @param {string} [langCode] - Optional parameter language code
|
|
@@ -16,12 +19,12 @@ export default class TemplatesPreviewApi extends OneEntry implements ITemplatesA
|
|
|
16
19
|
/**
|
|
17
20
|
* Get template objects by type.
|
|
18
21
|
*
|
|
19
|
-
* @param {
|
|
22
|
+
* @param {BlockType} type - Product marker
|
|
20
23
|
* @param {string} [langCode] - Optional parameter language code
|
|
21
24
|
*
|
|
22
25
|
* @returns Returns a TemplateEntity object
|
|
23
26
|
*/
|
|
24
|
-
getTemplateByType(type:
|
|
27
|
+
getTemplateByType(type: BlockType): Promise<Array<ITemplateEntity>>;
|
|
25
28
|
/**
|
|
26
29
|
* Get one template object by id.
|
|
27
30
|
*
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const asyncModules_1 = require("../base/asyncModules");
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with template objects
|
|
6
6
|
*/
|
|
7
|
-
class TemplatesPreviewApi extends
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
this._url
|
|
7
|
+
class TemplatesPreviewApi extends asyncModules_1.default {
|
|
8
|
+
constructor(state) {
|
|
9
|
+
super(state);
|
|
10
|
+
this._url = state.url + '/api/content/templates';
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Get all template objects grouped by types.
|
|
@@ -15,7 +15,7 @@ class TemplatesPreviewApi extends oneEntry_1.default {
|
|
|
15
15
|
*
|
|
16
16
|
* @returns Returns an object GroupedTemplatesObject, which contains an array of template objects TemplateEntity
|
|
17
17
|
*/
|
|
18
|
-
async getAllTemplates(langCode = this.
|
|
18
|
+
async getAllTemplates(langCode = this.state.lang) {
|
|
19
19
|
const response = await this._fetchGet('/all');
|
|
20
20
|
const result = {};
|
|
21
21
|
for (let item in response) {
|
|
@@ -26,14 +26,14 @@ class TemplatesPreviewApi extends oneEntry_1.default {
|
|
|
26
26
|
/**
|
|
27
27
|
* Get template objects by type.
|
|
28
28
|
*
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {BlockType} type - Product marker
|
|
30
30
|
* @param {string} [langCode] - Optional parameter language code
|
|
31
31
|
*
|
|
32
32
|
* @returns Returns a TemplateEntity object
|
|
33
33
|
*/
|
|
34
|
-
async getTemplateByType(type
|
|
34
|
+
async getTemplateByType(type) {
|
|
35
35
|
const result = await this._fetchGet(`?type=${type}`);
|
|
36
|
-
return
|
|
36
|
+
return result;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Get one template object by id.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IGeneralTypesEntity } from "../general-types/generalTypesInterfaces";
|
|
2
2
|
import { Types } from "../base/utils";
|
|
3
|
+
import { BlockType } from "../blocks/blocksInterfaces";
|
|
3
4
|
/**
|
|
4
5
|
* Represents an interface object of Templates Api.
|
|
5
6
|
*
|
|
@@ -9,7 +10,7 @@ import { Types } from "../base/utils";
|
|
|
9
10
|
*/
|
|
10
11
|
interface ITemplatesApi {
|
|
11
12
|
getAllTemplates(langCode: string): Promise<ITemplateList>;
|
|
12
|
-
getTemplateByType(type:
|
|
13
|
+
getTemplateByType(type: BlockType, langCode: string): Promise<Array<ITemplateEntity>>;
|
|
13
14
|
getTemplateById(id: string): Promise<ITemplateList>;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AsyncModules from "../base/asyncModules";
|
|
2
2
|
import { ITemplatesPreview, ITemplatesPreviewEntity } from "./templatesPreviewInterfaces";
|
|
3
|
-
import
|
|
3
|
+
import StateModule from "../base/stateModule";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with template objects for preview
|
|
6
6
|
*/
|
|
7
|
-
export default class TemplatePreviewsApi extends
|
|
8
|
-
|
|
7
|
+
export default class TemplatePreviewsApi extends AsyncModules implements ITemplatesPreview {
|
|
8
|
+
protected state: StateModule;
|
|
9
|
+
protected _url: string;
|
|
10
|
+
constructor(state: StateModule);
|
|
9
11
|
/**
|
|
10
12
|
* Get all template objects.
|
|
11
13
|
* @param {string} [langCode] - Optional parameter language code
|
|
@@ -16,7 +18,7 @@ export default class TemplatePreviewsApi extends OneEntry implements ITemplatesP
|
|
|
16
18
|
/**
|
|
17
19
|
* Get one template object by id.
|
|
18
20
|
*
|
|
19
|
-
* @param {number}
|
|
21
|
+
* @param {number} id - Product marker
|
|
20
22
|
* @param {string} [langCode] - Optional parameter language code
|
|
21
23
|
*
|
|
22
24
|
* @returns Returns a TemplatePreviewsEntity object
|
|
@@ -25,7 +27,7 @@ export default class TemplatePreviewsApi extends OneEntry implements ITemplatesP
|
|
|
25
27
|
/**
|
|
26
28
|
* Get one template object by marker.
|
|
27
29
|
*
|
|
28
|
-
* @param {string}
|
|
30
|
+
* @param {string} marker - Product marker
|
|
29
31
|
* @param {string} [langCode] - Optional parameter language code
|
|
30
32
|
*
|
|
31
33
|
* @returns Returns a TemplatePreviewsEntity object
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const asyncModules_1 = require("../base/asyncModules");
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with template objects for preview
|
|
6
6
|
*/
|
|
7
|
-
class TemplatePreviewsApi extends
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
this._url
|
|
7
|
+
class TemplatePreviewsApi extends asyncModules_1.default {
|
|
8
|
+
constructor(state) {
|
|
9
|
+
super(state);
|
|
10
|
+
this._url = state.url + '/api/content/template-previews';
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Get all template objects.
|
|
@@ -15,31 +15,31 @@ class TemplatePreviewsApi extends oneEntry_1.default {
|
|
|
15
15
|
*
|
|
16
16
|
* @returns Returns all TemplatePreviewsEntity template objects
|
|
17
17
|
*/
|
|
18
|
-
async getTemplatePreviews(langCode = this.
|
|
18
|
+
async getTemplatePreviews(langCode = this.state.lang) {
|
|
19
19
|
const result = await this._fetchGet('');
|
|
20
20
|
return this._normalizeData(result, langCode);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Get one template object by id.
|
|
24
24
|
*
|
|
25
|
-
* @param {number}
|
|
25
|
+
* @param {number} id - Product marker
|
|
26
26
|
* @param {string} [langCode] - Optional parameter language code
|
|
27
27
|
*
|
|
28
28
|
* @returns Returns a TemplatePreviewsEntity object
|
|
29
29
|
*/
|
|
30
|
-
async getTemplatePreviewById(id, langCode = this.
|
|
30
|
+
async getTemplatePreviewById(id, langCode = this.state.lang) {
|
|
31
31
|
const result = await this._fetchGet(`/${id}`);
|
|
32
32
|
return this._normalizeData(result, langCode);
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Get one template object by marker.
|
|
36
36
|
*
|
|
37
|
-
* @param {string}
|
|
37
|
+
* @param {string} marker - Product marker
|
|
38
38
|
* @param {string} [langCode] - Optional parameter language code
|
|
39
39
|
*
|
|
40
40
|
* @returns Returns a TemplatePreviewsEntity object
|
|
41
41
|
*/
|
|
42
|
-
async getTemplatePreviewByMarker(marker, langCode = this.
|
|
42
|
+
async getTemplatePreviewByMarker(marker, langCode = this.state.lang) {
|
|
43
43
|
const result = await this._fetchGet(`/marker/${marker}`);
|
|
44
44
|
return this._normalizeData(result, langCode);
|
|
45
45
|
}
|
package/dist/users/usersApi.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IConfig } from "../base/utils";
|
|
1
|
+
import AsyncModules from "../base/asyncModules";
|
|
3
2
|
import { IUserBody, IUserEntity, IUsers } from "./usersInterfaces";
|
|
3
|
+
import StateModule from "../base/stateModule";
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with users
|
|
6
6
|
*/
|
|
7
|
-
export default class UsersApi extends
|
|
8
|
-
|
|
7
|
+
export default class UsersApi extends AsyncModules implements IUsers {
|
|
8
|
+
protected state: StateModule;
|
|
9
|
+
protected _url: string;
|
|
10
|
+
constructor(state: StateModule);
|
|
9
11
|
/**
|
|
10
12
|
* Getting the data of an authorized user.
|
|
11
13
|
* @param {string} [langCode] Required parameter lang code.
|
package/dist/users/usersApi.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const asyncModules_1 = require("../base/asyncModules");
|
|
4
4
|
/**
|
|
5
5
|
* Controllers for working with users
|
|
6
6
|
*/
|
|
7
|
-
class UsersApi extends
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
this._url
|
|
7
|
+
class UsersApi extends asyncModules_1.default {
|
|
8
|
+
constructor(state) {
|
|
9
|
+
super(state);
|
|
10
|
+
this._url = state.url + '/api/content/users';
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* Getting the data of an authorized user.
|
|
14
14
|
* @param {string} [langCode] Required parameter lang code.
|
|
15
15
|
*/
|
|
16
|
-
async getUser(langCode = this.
|
|
16
|
+
async getUser(langCode = this.state.lang) {
|
|
17
17
|
const result = await this._fetchGet(`/me?langCode=${langCode}`);
|
|
18
18
|
return result;
|
|
19
19
|
}
|
|
@@ -43,7 +43,7 @@ class UsersApi extends oneEntry_1.default {
|
|
|
43
43
|
* }
|
|
44
44
|
* }
|
|
45
45
|
*/
|
|
46
|
-
async updateUser(data, langCode = this.
|
|
46
|
+
async updateUser(data, langCode = this.state.lang) {
|
|
47
47
|
const result = await this._fetchPut('', this._normalizePostBody(data));
|
|
48
48
|
return result;
|
|
49
49
|
}
|