oneentry 1.0.159 → 1.0.161
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 +2 -0
- package/changelog.md +56 -1
- package/dist/admins/adminsApi.d.ts +15 -1
- package/dist/admins/adminsApi.js +29 -0
- package/dist/admins/adminsInterfaces.d.ts +37 -1
- package/dist/base/lazySchema.d.ts +15 -0
- package/dist/base/lazySchema.js +20 -0
- package/dist/discounts/discountsApi.d.ts +14 -1
- package/dist/discounts/discountsApi.js +21 -0
- package/dist/discounts/discountsInterfaces.d.ts +27 -1
- package/dist/filters/filtersInterfaces.d.ts +2 -2
- package/dist/filters/filtersSchemas.d.ts +1 -1
- package/dist/filters/filtersSchemas.js +4 -1
- package/dist/forms-data/formsDataApi.d.ts +14 -1
- package/dist/forms-data/formsDataApi.js +21 -0
- package/dist/forms-data/formsDataInterfaces.d.ts +74 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -0
- package/dist/orders/ordersApi.d.ts +15 -1
- package/dist/orders/ordersApi.js +22 -0
- package/dist/orders/ordersInterfaces.d.ts +27 -1
- package/dist/pages/pagesApi.d.ts +14 -1
- package/dist/pages/pagesApi.js +21 -0
- package/dist/pages/pagesInterfaces.d.ts +38 -1
- package/dist/payments/paymentsInterfaces.d.ts +2 -2
- package/dist/products/productsInterfaces.d.ts +1 -1
- package/dist/search/searchApi.d.ts +35 -0
- package/dist/search/searchApi.js +86 -0
- package/dist/search/searchInterfaces.d.ts +94 -0
- package/dist/search/searchInterfaces.js +2 -0
- package/dist/search/searchSchemas.d.ts +73 -0
- package/dist/search/searchSchemas.js +44 -0
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +0 -2
- package/dist/templates-preview/templatesPreviewSchemas.js +0 -1
- package/dist/types.d.ts +35 -0
- package/dist/types.js +2 -0
- package/dist/users/usersApi.d.ts +15 -1
- package/dist/users/usersApi.js +22 -0
- package/dist/users/usersInterfaces.d.ts +39 -1
- package/dist/web-socket/lazySocket.d.ts +18 -0
- package/dist/web-socket/lazySocket.js +70 -0
- package/esm/admins/adminsApi.d.ts +66 -0
- package/esm/admins/adminsApi.js +90 -0
- package/esm/admins/adminsInterfaces.d.ts +137 -0
- package/esm/admins/adminsInterfaces.js +1 -0
- package/esm/admins/adminsSchemas.d.ts +48 -0
- package/esm/admins/adminsSchemas.js +31 -0
- package/esm/attribute-sets/attributeSetsApi.d.ts +67 -0
- package/esm/attribute-sets/attributeSetsApi.js +97 -0
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +285 -0
- package/esm/attribute-sets/attributeSetsInterfaces.js +1 -0
- package/esm/attribute-sets/attributeSetsSchemas.d.ts +84 -0
- package/esm/attribute-sets/attributeSetsSchemas.js +66 -0
- package/esm/auth-provider/authProviderApi.d.ts +262 -0
- package/esm/auth-provider/authProviderApi.js +362 -0
- package/esm/auth-provider/authProviderSchemas.d.ts +124 -0
- package/esm/auth-provider/authProviderSchemas.js +92 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +430 -0
- package/esm/auth-provider/authProvidersInterfaces.js +1 -0
- package/esm/base/asyncModules.d.ts +123 -0
- package/esm/base/asyncModules.js +382 -0
- package/esm/base/lazySchema.d.ts +15 -0
- package/esm/base/lazySchema.js +17 -0
- package/esm/base/stateModule.d.ts +35 -0
- package/esm/base/stateModule.js +51 -0
- package/esm/base/syncModules.d.ts +245 -0
- package/esm/base/syncModules.js +555 -0
- package/esm/base/timeIntervals.d.ts +95 -0
- package/esm/base/timeIntervals.js +317 -0
- package/esm/base/utils.d.ts +354 -0
- package/esm/base/utils.js +1 -0
- package/esm/base/validation.d.ts +98 -0
- package/esm/base/validation.js +118 -0
- package/esm/blocks/blocksApi.d.ts +252 -0
- package/esm/blocks/blocksApi.js +394 -0
- package/esm/blocks/blocksInterfaces.d.ts +361 -0
- package/esm/blocks/blocksInterfaces.js +1 -0
- package/esm/blocks/blocksSchemas.d.ts +213 -0
- package/esm/blocks/blocksSchemas.js +40 -0
- package/esm/discounts/discountsApi.d.ts +94 -0
- package/esm/discounts/discountsApi.js +136 -0
- package/esm/discounts/discountsInterfaces.d.ts +293 -0
- package/esm/discounts/discountsInterfaces.js +1 -0
- package/esm/events/eventsApi.d.ts +108 -0
- package/esm/events/eventsApi.js +141 -0
- package/esm/events/eventsInterfaces.d.ts +176 -0
- package/esm/events/eventsInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingApi.d.ts +91 -0
- package/esm/file-uploading/fileUploadingApi.js +127 -0
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +116 -0
- package/esm/file-uploading/fileUploadingInterfaces.js +1 -0
- package/esm/file-uploading/fileUploadingSchemas.d.ts +24 -0
- package/esm/file-uploading/fileUploadingSchemas.js +19 -0
- package/esm/filters/filtersApi.d.ts +32 -0
- package/esm/filters/filtersApi.js +36 -0
- package/esm/filters/filtersInterfaces.d.ts +56 -0
- package/esm/filters/filtersInterfaces.js +1 -0
- package/esm/filters/filtersSchemas.d.ts +32 -0
- package/esm/filters/filtersSchemas.js +29 -0
- package/esm/forms/formsApi.d.ts +44 -0
- package/esm/forms/formsApi.js +54 -0
- package/esm/forms/formsInterfaces.d.ts +237 -0
- package/esm/forms/formsInterfaces.js +1 -0
- package/esm/forms/formsSchemas.d.ts +56 -0
- package/esm/forms/formsSchemas.js +32 -0
- package/esm/forms-data/formsDataApi.d.ts +124 -0
- package/esm/forms-data/formsDataApi.js +210 -0
- package/esm/forms-data/formsDataInterfaces.d.ts +670 -0
- package/esm/forms-data/formsDataInterfaces.js +1 -0
- package/esm/forms-data/formsDataSchemas.d.ts +107 -0
- package/esm/forms-data/formsDataSchemas.js +83 -0
- package/esm/general-types/generalTypesApi.d.ts +29 -0
- package/esm/general-types/generalTypesApi.js +34 -0
- package/esm/general-types/generalTypesInterfaces.d.ts +29 -0
- package/esm/general-types/generalTypesInterfaces.js +1 -0
- package/esm/general-types/generalTypesSchemas.d.ts +68 -0
- package/esm/general-types/generalTypesSchemas.js +42 -0
- package/esm/index.d.ts +143 -0
- package/esm/index.js +124 -0
- package/esm/integration-collections/integrationCollectionsApi.d.ts +172 -0
- package/esm/integration-collections/integrationCollectionsApi.js +224 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +317 -0
- package/esm/integration-collections/integrationCollectionsInterfaces.js +1 -0
- package/esm/integration-collections/integrationCollectionsSchemas.d.ts +84 -0
- package/esm/integration-collections/integrationCollectionsSchemas.js +60 -0
- package/esm/locales/localesApi.d.ts +28 -0
- package/esm/locales/localesApi.js +33 -0
- package/esm/locales/localesInterfaces.d.ts +40 -0
- package/esm/locales/localesInterfaces.js +1 -0
- package/esm/locales/localesSchemas.d.ts +32 -0
- package/esm/locales/localesSchemas.js +23 -0
- package/esm/menus/menusApi.d.ts +30 -0
- package/esm/menus/menusApi.js +35 -0
- package/esm/menus/menusInterfaces.d.ts +87 -0
- package/esm/menus/menusInterfaces.js +2 -0
- package/esm/menus/menusSchemas.d.ts +16 -0
- package/esm/menus/menusSchemas.js +25 -0
- package/esm/orders/ordersApi.d.ts +213 -0
- package/esm/orders/ordersApi.js +288 -0
- package/esm/orders/ordersInterfaces.d.ts +763 -0
- package/esm/orders/ordersInterfaces.js +1 -0
- package/esm/orders/ordersSchemas.d.ts +312 -0
- package/esm/orders/ordersSchemas.js +171 -0
- package/esm/package.json +4 -0
- package/esm/pages/pagesApi.d.ts +173 -0
- package/esm/pages/pagesApi.js +414 -0
- package/esm/pages/pagesInterfaces.d.ts +344 -0
- package/esm/pages/pagesInterfaces.js +1 -0
- package/esm/pages/pagesSchemas.d.ts +121 -0
- package/esm/pages/pagesSchemas.js +60 -0
- package/esm/payments/paymentsApi.d.ts +88 -0
- package/esm/payments/paymentsApi.js +122 -0
- package/esm/payments/paymentsInterfaces.d.ts +189 -0
- package/esm/payments/paymentsInterfaces.js +1 -0
- package/esm/payments/paymentsSchemas.d.ts +94 -0
- package/esm/payments/paymentsSchemas.js +53 -0
- package/esm/product-statuses/productStatusesApi.d.ts +50 -0
- package/esm/product-statuses/productStatusesApi.js +68 -0
- package/esm/product-statuses/productStatusesInterfaces.d.ts +62 -0
- package/esm/product-statuses/productStatusesInterfaces.js +1 -0
- package/esm/product-statuses/productStatusesSchemas.d.ts +34 -0
- package/esm/product-statuses/productStatusesSchemas.js +27 -0
- package/esm/products/productsApi.d.ts +366 -0
- package/esm/products/productsApi.js +468 -0
- package/esm/products/productsInterfaces.d.ts +723 -0
- package/esm/products/productsInterfaces.js +1 -0
- package/esm/products/productsSchemas.d.ts +234 -0
- package/esm/products/productsSchemas.js +121 -0
- package/esm/search/searchApi.d.ts +35 -0
- package/esm/search/searchApi.js +47 -0
- package/esm/search/searchInterfaces.d.ts +94 -0
- package/esm/search/searchInterfaces.js +1 -0
- package/esm/search/searchSchemas.d.ts +73 -0
- package/esm/search/searchSchemas.js +41 -0
- package/esm/sitemap/sitemapApi.d.ts +37 -0
- package/esm/sitemap/sitemapApi.js +41 -0
- package/esm/sitemap/sitemapInterfaces.d.ts +51 -0
- package/esm/sitemap/sitemapInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsApi.d.ts +74 -0
- package/esm/subscriptions/subscriptionsApi.js +90 -0
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +111 -0
- package/esm/subscriptions/subscriptionsInterfaces.js +1 -0
- package/esm/subscriptions/subscriptionsSchemas.d.ts +46 -0
- package/esm/subscriptions/subscriptionsSchemas.js +38 -0
- package/esm/system/systemApi.d.ts +46 -0
- package/esm/system/systemApi.js +53 -0
- package/esm/system/systemInterfaces.d.ts +29 -0
- package/esm/system/systemInterfaces.js +1 -0
- package/esm/templates/templatesApi.d.ts +53 -0
- package/esm/templates/templatesApi.js +78 -0
- package/esm/templates/templatesInterfaces.d.ts +68 -0
- package/esm/templates/templatesInterfaces.js +1 -0
- package/esm/templates/templatesSchemas.d.ts +48 -0
- package/esm/templates/templatesSchemas.js +28 -0
- package/esm/templates-preview/templatesPreviewApi.d.ts +40 -0
- package/esm/templates-preview/templatesPreviewApi.js +50 -0
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +129 -0
- package/esm/templates-preview/templatesPreviewInterfaces.js +1 -0
- package/esm/templates-preview/templatesPreviewSchemas.d.ts +79 -0
- package/esm/templates-preview/templatesPreviewSchemas.js +43 -0
- package/esm/types.d.ts +35 -0
- package/esm/types.js +1 -0
- package/esm/user-activity/userActivityApi.d.ts +31 -0
- package/esm/user-activity/userActivityApi.js +37 -0
- package/esm/user-activity/userActivityInterfaces.d.ts +42 -0
- package/esm/user-activity/userActivityInterfaces.js +1 -0
- package/esm/users/usersApi.d.ts +249 -0
- package/esm/users/usersApi.js +312 -0
- package/esm/users/usersInterfaces.d.ts +419 -0
- package/esm/users/usersInterfaces.js +1 -0
- package/esm/users/usersSchemas.d.ts +72 -0
- package/esm/users/usersSchemas.js +55 -0
- package/esm/web-socket/lazySocket.d.ts +18 -0
- package/esm/web-socket/lazySocket.js +67 -0
- package/esm/web-socket/wsApi.d.ts +27 -0
- package/esm/web-socket/wsApi.js +43 -0
- package/esm/web-socket/wsInterfaces.d.ts +16 -0
- package/esm/web-socket/wsInterfaces.js +1 -0
- package/package.json +47 -2
- package/types.d.ts +1 -0
- package/types.js +1 -0
package/esm/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules.js';
|
|
2
|
+
import type StateModule from '../base/stateModule.js';
|
|
3
|
+
import type { IError } from '../base/utils.js';
|
|
4
|
+
import type { ITrackActivity, IUserActivityApi } from './userActivityInterfaces.js';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for working with user activity.
|
|
7
|
+
* @handle /api/content/user-activity
|
|
8
|
+
* @class UserActivityApi
|
|
9
|
+
* @augments AsyncModules
|
|
10
|
+
* @implements {IUserActivityApi}
|
|
11
|
+
* @description This class provides methods to track user/guest activity events.
|
|
12
|
+
*/
|
|
13
|
+
export default class UserActivityApi extends AsyncModules implements IUserActivityApi {
|
|
14
|
+
protected state: StateModule;
|
|
15
|
+
protected _url: string;
|
|
16
|
+
/**
|
|
17
|
+
* Constructor for UserActivityApi class.
|
|
18
|
+
* @param {StateModule} state - The state module.
|
|
19
|
+
*/
|
|
20
|
+
constructor(state: StateModule);
|
|
21
|
+
/**
|
|
22
|
+
* Track a user or guest activity event.
|
|
23
|
+
* @handleName trackUserActivity
|
|
24
|
+
* @param {ITrackActivity} body - Activity event body. Example: `{ type: "product_view", productId: 12345 }`.
|
|
25
|
+
* @returns {Promise<boolean | IError>} Returns true if the event was recorded, or an error object if there was an issue.
|
|
26
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
27
|
+
* @description Records an activity event for the current authorized user or guest.
|
|
28
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/user-activity/trackUserActivity trackUserActivity} documentation.
|
|
29
|
+
*/
|
|
30
|
+
trackUserActivity(body: ITrackActivity): Promise<boolean | IError>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules.js';
|
|
2
|
+
/**
|
|
3
|
+
* Controllers for working with user activity.
|
|
4
|
+
* @handle /api/content/user-activity
|
|
5
|
+
* @class UserActivityApi
|
|
6
|
+
* @augments AsyncModules
|
|
7
|
+
* @implements {IUserActivityApi}
|
|
8
|
+
* @description This class provides methods to track user/guest activity events.
|
|
9
|
+
*/
|
|
10
|
+
export default class UserActivityApi extends AsyncModules {
|
|
11
|
+
/**
|
|
12
|
+
* Constructor for UserActivityApi class.
|
|
13
|
+
* @param {StateModule} state - The state module.
|
|
14
|
+
*/
|
|
15
|
+
constructor(state) {
|
|
16
|
+
super(state);
|
|
17
|
+
this._url = state.url + '/api/content/user-activity';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Track a user or guest activity event.
|
|
21
|
+
* @handleName trackUserActivity
|
|
22
|
+
* @param {ITrackActivity} body - Activity event body. Example: `{ type: "product_view", productId: 12345 }`.
|
|
23
|
+
* @returns {Promise<boolean | IError>} Returns true if the event was recorded, or an error object if there was an issue.
|
|
24
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
25
|
+
* @description Records an activity event for the current authorized user or guest.
|
|
26
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/user-activity/trackUserActivity trackUserActivity} documentation.
|
|
27
|
+
*/
|
|
28
|
+
async trackUserActivity(body) {
|
|
29
|
+
try {
|
|
30
|
+
await this._fetchPost(`/track`, body);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IError } from '../base/utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for the UserActivity API module.
|
|
4
|
+
* @interface IUserActivityApi
|
|
5
|
+
* @description This interface defines methods for tracking user/guest activity events.
|
|
6
|
+
*/
|
|
7
|
+
interface IUserActivityApi {
|
|
8
|
+
/**
|
|
9
|
+
* Track a user or guest activity event.
|
|
10
|
+
* @handleName trackUserActivity
|
|
11
|
+
* @param {ITrackActivity} body - Activity event body. Example: `{ type: "product_view", productId: 12345 }`.
|
|
12
|
+
* @returns {Promise<boolean | IError>} Returns true if the event was recorded, or an error object if there was an issue.
|
|
13
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
14
|
+
* @description Records an activity event for the current authorized user or guest.
|
|
15
|
+
*/
|
|
16
|
+
trackUserActivity(body: ITrackActivity): Promise<boolean | IError>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* User activity event type.
|
|
20
|
+
* @description Type of the tracked user activity event.
|
|
21
|
+
*/
|
|
22
|
+
type TUserActivityType = 'product_view' | 'page_view' | 'category_view' | 'search' | 'product_add_to_cart' | 'product_remove_from_cart' | 'product_add_to_wishlist' | 'product_remove_from_wishlist' | 'product_purchase' | 'product_rating';
|
|
23
|
+
/**
|
|
24
|
+
* Body for tracking a user activity event.
|
|
25
|
+
* @interface ITrackActivity
|
|
26
|
+
* @property {TUserActivityType} type - Activity event type. Example: "product_view".
|
|
27
|
+
* @property {number} [productId] - Product identifier. Example: 12345.
|
|
28
|
+
* @property {number} [pageId] - Page identifier (for page_view, category_view). Example: 7.
|
|
29
|
+
* @property {number} [categoryId] - Legacy category identifier. Example: 67.
|
|
30
|
+
* @property {string} [query] - Search query (for type=search). Example: "iphone case".
|
|
31
|
+
* @property {Record<string, unknown>} [meta] - Arbitrary meta information (source block, A/B variant, scroll-depth).
|
|
32
|
+
* @description Body for tracking a user activity event.
|
|
33
|
+
*/
|
|
34
|
+
interface ITrackActivity {
|
|
35
|
+
type: TUserActivityType;
|
|
36
|
+
productId?: number;
|
|
37
|
+
pageId?: number;
|
|
38
|
+
categoryId?: number;
|
|
39
|
+
query?: string;
|
|
40
|
+
meta?: Record<string, unknown>;
|
|
41
|
+
}
|
|
42
|
+
export type { ITrackActivity, IUserActivityApi, TUserActivityType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import AsyncModules from '../base/asyncModules.js';
|
|
2
|
+
import type StateModule from '../base/stateModule.js';
|
|
3
|
+
import type { IError } from '../base/utils.js';
|
|
4
|
+
import type { ICartAddItem, ICartResponse, ICartSet, IUserBody, IUserEntity, IUsersApi, IUsersResponse, IUsersVectorSearch, IWishlistAddItem, IWishlistResponse, IWishlistSet } from './usersInterfaces.js';
|
|
5
|
+
/**
|
|
6
|
+
* Controllers for working with users
|
|
7
|
+
* @handle /api/content/users
|
|
8
|
+
* @description This module provides various methods to manage users, including creating, retrieving, updating, and deleting user data. It requires proper authorization to access these endpoints.
|
|
9
|
+
*/
|
|
10
|
+
export default class UsersApi extends AsyncModules implements IUsersApi {
|
|
11
|
+
protected state: StateModule;
|
|
12
|
+
protected _url: string;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor for UsersApi class.
|
|
15
|
+
* @param {StateModule} state - The state module containing necessary information for API calls.
|
|
16
|
+
* @description Initializes the UsersApi class with the provided state module.
|
|
17
|
+
*/
|
|
18
|
+
constructor(state: StateModule);
|
|
19
|
+
/**
|
|
20
|
+
* Getting the data of an authorized user.
|
|
21
|
+
* @handleName getUser
|
|
22
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
23
|
+
* @returns {Promise<IUserEntity | IError>} Returns a promise that resolves to the user entity object if successful; otherwise, returns an error object.
|
|
24
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
25
|
+
* @description This method requires user authorization.
|
|
26
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
27
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/getUser getUser} documentation.
|
|
28
|
+
*/
|
|
29
|
+
getUser(langCode?: string): Promise<IUserEntity | IError>;
|
|
30
|
+
/**
|
|
31
|
+
* Updating a single user object.
|
|
32
|
+
* @handleName updateUser
|
|
33
|
+
* @param {IUserBody} body - Request body.
|
|
34
|
+
* @example
|
|
35
|
+
{
|
|
36
|
+
"formIdentifier": "reg",
|
|
37
|
+
"authData": [
|
|
38
|
+
{
|
|
39
|
+
"marker": "email_reg",
|
|
40
|
+
"value": "your-email@oneentery.cloud"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"marker": "password_reg",
|
|
44
|
+
"value": "12345"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"formData": [
|
|
48
|
+
{
|
|
49
|
+
"marker": "last_name",
|
|
50
|
+
"type": "string",
|
|
51
|
+
"value": "Username"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"notificationData": {
|
|
55
|
+
"email": "example@oneentry.cloud",
|
|
56
|
+
"phonePush": ["+99999999999"],
|
|
57
|
+
"phoneSMS": "+99999999999"
|
|
58
|
+
},
|
|
59
|
+
"state": {}
|
|
60
|
+
}
|
|
61
|
+
* @param {string} body.formIdentifier - Identifies the registration form being used. Example: "reg_form".
|
|
62
|
+
* @param {string} body.authData - Contains authentication credentials for the user. Example:
|
|
63
|
+
* @example
|
|
64
|
+
[
|
|
65
|
+
{
|
|
66
|
+
"marker": "email_reg",
|
|
67
|
+
"value": "example@oneentry.cloud"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"marker": "password_reg",
|
|
71
|
+
"value": "password"
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
* @param {string} body.authData[].marker - Identifies the field being used. Example: "email_reg".
|
|
75
|
+
* @param {string} body.authData[].value - Contains the value of the field. Example: "example@oneentry.cloud".
|
|
76
|
+
* @param {string} body.formData - Contains additional data for the user.
|
|
77
|
+
* @example
|
|
78
|
+
[
|
|
79
|
+
{
|
|
80
|
+
"marker": "last_name",
|
|
81
|
+
"type": "string",
|
|
82
|
+
"value": "Username"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
* @param {string} body.formData[].marker - The marker of the field. Example: "last_name".
|
|
86
|
+
* @param {string} body.formData[].type - The type of the field. Example: "string".
|
|
87
|
+
* @param {string} body.formData[].value - The value of the field. Example: "Username".
|
|
88
|
+
* @param {string} body.notificationData - The notification data.
|
|
89
|
+
* @example
|
|
90
|
+
{
|
|
91
|
+
"email": "example@oneentry.cloud",
|
|
92
|
+
"phonePush": ["+99999999999"],
|
|
93
|
+
"phoneSMS": "+99999999999"
|
|
94
|
+
}
|
|
95
|
+
* @param {string} body.notificationData.email - The email address of the user. Example: "example@oneentry.cloud".
|
|
96
|
+
* @param {string} body.notificationData.phonePush - An array of phone numbers for push notifications. Example: ["+99999999999"].
|
|
97
|
+
* @param {string} body.notificationData.phoneSMS - The phone number for SMS notifications. Example: "+99999999999".
|
|
98
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
99
|
+
* @returns {Promise<boolean | IError>} Returns `true` if the user object was successfully updated; otherwise, returns an error object.
|
|
100
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
101
|
+
* @description This method updates the user's data. This method requires user authorization.
|
|
102
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
103
|
+
* @see For more information about {@link https://doc.oneentry.cloud/docs/forms/create-form registration forms}, see the documentation in the {@link https://doc.oneentry.cloud/docs/forms/create-form forms configuration section}.
|
|
104
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/updateUser updateUser} documentation.
|
|
105
|
+
*/
|
|
106
|
+
updateUser(body: IUserBody, langCode?: string): Promise<boolean | IError>;
|
|
107
|
+
/**
|
|
108
|
+
* Archiving one user object (marked for deletion).
|
|
109
|
+
* @handleName archiveUser
|
|
110
|
+
* @returns {Promise<boolean | IError>} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
111
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
112
|
+
* @description This method archives a user object (marks it for deletion). This method requires user authorization.
|
|
113
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/auth-provider/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
114
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/archiveUser archiveUser} documentation.
|
|
115
|
+
*/
|
|
116
|
+
archiveUser(): Promise<boolean | IError>;
|
|
117
|
+
/**
|
|
118
|
+
* Delete a single user.
|
|
119
|
+
* @handleName deleteUser
|
|
120
|
+
* @returns {Promise<boolean | IError>} Returns `true` if the user was successfully deleted; otherwise, returns an error object.
|
|
121
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
122
|
+
* @description This method deletes the user from the system. This method requires user authorization.
|
|
123
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
124
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/deleteUser deleteUser} documentation.
|
|
125
|
+
*/
|
|
126
|
+
deleteUser(): Promise<boolean | IError>;
|
|
127
|
+
/**
|
|
128
|
+
* Adds an FCM (Firebase Cloud Messaging) token for sending push notifications.
|
|
129
|
+
* @handleName addFCMToken
|
|
130
|
+
* @param {string} token - The cloud messaging token to be added. This token is used to identify the user's device for push notifications. Example: "fcm_token_1234567890abcdefg".
|
|
131
|
+
* @returns {Promise<boolean | IError>} Returns `true` if the token was successfully added; otherwise, returns an error object.
|
|
132
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
133
|
+
* @description This method adds an FCM token for sending push notifications. This method requires user authorization.
|
|
134
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
135
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/addFCMToken addFCMToken} documentation.
|
|
136
|
+
*/
|
|
137
|
+
addFCMToken(token: string): Promise<boolean | IError>;
|
|
138
|
+
/**
|
|
139
|
+
* Deletes an FCM (Firebase Cloud Messaging) token.
|
|
140
|
+
* @handleName deleteFCMToken
|
|
141
|
+
* @param {string} token - The cloud messaging token to be deleted. This token is used to identify the user's device for push notifications and will be removed. Example: "fcm_token_1234567890abcdefg".
|
|
142
|
+
* @returns {Promise<boolean | IError>} Returns `true` if the token was successfully deleted; otherwise, returns an error object.
|
|
143
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
144
|
+
* @description This method deletes an existing FCM token. This method requires user authorization.
|
|
145
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
146
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/deleteFCMToken deleteFCMToken} documentation.
|
|
147
|
+
*/
|
|
148
|
+
deleteFCMToken(token: string): Promise<boolean | IError>;
|
|
149
|
+
/**
|
|
150
|
+
* Get the current user's or guest's cart.
|
|
151
|
+
* @handleName getCart
|
|
152
|
+
* @returns {Promise<ICartResponse | IError>} Returns the cart with its items and total.
|
|
153
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
154
|
+
* @description This method requires user authorization (or a guest context).
|
|
155
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
156
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/getCart getCart} documentation.
|
|
157
|
+
*/
|
|
158
|
+
getCart(): Promise<ICartResponse | IError>;
|
|
159
|
+
/**
|
|
160
|
+
* Replace the current user's or guest's cart.
|
|
161
|
+
* @handleName setCart
|
|
162
|
+
* @param {ICartSet} body - New cart contents. Example: `{ items: [{ productId: 1, qty: 2 }] }`.
|
|
163
|
+
* @returns {Promise<ICartResponse | IError>} Returns the updated cart.
|
|
164
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
165
|
+
* @description This method requires user authorization (or a guest context).
|
|
166
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
167
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/setCart setCart} documentation.
|
|
168
|
+
*/
|
|
169
|
+
setCart(body: ICartSet): Promise<ICartResponse | IError>;
|
|
170
|
+
/**
|
|
171
|
+
* Add an item to the cart (or update qty of an existing one).
|
|
172
|
+
* @handleName addCartItem
|
|
173
|
+
* @param {ICartAddItem} body - Item to add. Example: `{ productId: 1, qty: 2 }`.
|
|
174
|
+
* @returns {Promise<ICartResponse | IError>} Returns the updated cart.
|
|
175
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
176
|
+
* @description This method requires user authorization (or a guest context).
|
|
177
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
178
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/addCartItem addCartItem} documentation.
|
|
179
|
+
*/
|
|
180
|
+
addCartItem(body: ICartAddItem): Promise<ICartResponse | IError>;
|
|
181
|
+
/**
|
|
182
|
+
* Remove an item from the cart.
|
|
183
|
+
* @handleName removeCartItem
|
|
184
|
+
* @param {number} productId - Product identifier. Example: 12345.
|
|
185
|
+
* @returns {Promise<ICartResponse | IError>} Returns the updated cart.
|
|
186
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
187
|
+
* @description This method requires user authorization (or a guest context).
|
|
188
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
189
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/removeCartItem removeCartItem} documentation.
|
|
190
|
+
*/
|
|
191
|
+
removeCartItem(productId: number): Promise<ICartResponse | IError>;
|
|
192
|
+
/**
|
|
193
|
+
* Get the current user's or guest's wishlist.
|
|
194
|
+
* @handleName getWishlist
|
|
195
|
+
* @returns {Promise<IWishlistResponse | IError>} Returns the wishlist with its items and total.
|
|
196
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
197
|
+
* @description This method requires user authorization (or a guest context).
|
|
198
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
199
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/getWishlist getWishlist} documentation.
|
|
200
|
+
*/
|
|
201
|
+
getWishlist(): Promise<IWishlistResponse | IError>;
|
|
202
|
+
/**
|
|
203
|
+
* Replace the current user's or guest's wishlist.
|
|
204
|
+
* @handleName setWishlist
|
|
205
|
+
* @param {IWishlistSet} body - New wishlist contents. Example: `{ items: [{ productId: 1 }] }`.
|
|
206
|
+
* @returns {Promise<IWishlistResponse | IError>} Returns the updated wishlist.
|
|
207
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
208
|
+
* @description This method requires user authorization (or a guest context).
|
|
209
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
210
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/setWishlist setWishlist} documentation.
|
|
211
|
+
*/
|
|
212
|
+
setWishlist(body: IWishlistSet): Promise<IWishlistResponse | IError>;
|
|
213
|
+
/**
|
|
214
|
+
* Add an item to the wishlist.
|
|
215
|
+
* @handleName addWishlistItem
|
|
216
|
+
* @param {IWishlistAddItem} body - Item to add. Example: `{ productId: 1 }`.
|
|
217
|
+
* @returns {Promise<IWishlistResponse | IError>} Returns the updated wishlist.
|
|
218
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
219
|
+
* @description This method requires user authorization (or a guest context).
|
|
220
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
221
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/addWishlistItem addWishlistItem} documentation.
|
|
222
|
+
*/
|
|
223
|
+
addWishlistItem(body: IWishlistAddItem): Promise<IWishlistResponse | IError>;
|
|
224
|
+
/**
|
|
225
|
+
* Remove an item from the wishlist.
|
|
226
|
+
* @handleName removeWishlistItem
|
|
227
|
+
* @param {number} productId - Product identifier. Example: 12345.
|
|
228
|
+
* @returns {Promise<IWishlistResponse | IError>} Returns the updated wishlist.
|
|
229
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
230
|
+
* @description This method requires user authorization (or a guest context).
|
|
231
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
232
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/removeWishlistItem removeWishlistItem} documentation.
|
|
233
|
+
*/
|
|
234
|
+
removeWishlistItem(productId: number): Promise<IWishlistResponse | IError>;
|
|
235
|
+
/**
|
|
236
|
+
* Semantic (vector) search for users.
|
|
237
|
+
* @handleName getUsersByVectorSearch
|
|
238
|
+
* @param {IUsersVectorSearch} body - Vector search body. Example: `{ queryText: "john" }`.
|
|
239
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
240
|
+
* @param {number} [offset] - Parameter for pagination. Default: 0.
|
|
241
|
+
* @param {number} [limit] - Parameter for pagination. Default: 30.
|
|
242
|
+
* @returns {Promise<IUsersResponse | IError>} Returns an object with an array of found users and total count.
|
|
243
|
+
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
244
|
+
* @description This method performs a semantic (vector) search for users. It requires user authorization.
|
|
245
|
+
* @see For more information about configuring the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider authorization module}, see the documentation in the {@link https://js-sdk.oneentry.cloud/docs/category/authprovider configuration settings section of the SDK}.
|
|
246
|
+
* @see {@link https://js-sdk.oneentry.cloud/docs/users/getUsersByVectorSearch getUsersByVectorSearch} documentation.
|
|
247
|
+
*/
|
|
248
|
+
getUsersByVectorSearch(body: IUsersVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IUsersResponse | IError>;
|
|
249
|
+
}
|