oneentry 1.0.149 → 1.0.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +8 -0
  2. package/changelog.md +453 -0
  3. package/dist/base/asyncModules.js +13 -0
  4. package/dist/base/stateModule.d.ts +1 -0
  5. package/dist/base/stateModule.js +3 -0
  6. package/dist/base/syncModules.d.ts +30 -1
  7. package/dist/base/syncModules.js +102 -30
  8. package/dist/base/utils.d.ts +4 -1
  9. package/dist/blocks/blocksApi.d.ts +124 -3
  10. package/dist/blocks/blocksApi.js +169 -4
  11. package/dist/blocks/blocksInterfaces.d.ts +177 -4
  12. package/dist/blocks/blocksSchemas.d.ts +4 -0
  13. package/dist/events/eventsApi.d.ts +42 -1
  14. package/dist/events/eventsApi.js +67 -0
  15. package/dist/events/eventsInterfaces.d.ts +79 -1
  16. package/dist/file-uploading/fileUploadingInterfaces.d.ts +2 -0
  17. package/dist/file-uploading/fileUploadingSchemas.d.ts +2 -0
  18. package/dist/file-uploading/fileUploadingSchemas.js +1 -0
  19. package/dist/filters/filtersApi.d.ts +31 -0
  20. package/dist/filters/filtersApi.js +40 -0
  21. package/dist/filters/filtersInterfaces.d.ts +56 -0
  22. package/dist/filters/filtersInterfaces.js +2 -0
  23. package/dist/filters/filtersSchemas.d.ts +32 -0
  24. package/dist/filters/filtersSchemas.js +29 -0
  25. package/dist/forms-data/formsDataInterfaces.d.ts +2 -2
  26. package/dist/forms-data/formsDataSchemas.d.ts +1 -1
  27. package/dist/forms-data/formsDataSchemas.js +1 -1
  28. package/dist/general-types/generalTypesSchemas.d.ts +16 -0
  29. package/dist/general-types/generalTypesSchemas.js +10 -1
  30. package/dist/index.d.ts +13 -0
  31. package/dist/index.js +10 -0
  32. package/dist/orders/ordersInterfaces.d.ts +51 -3
  33. package/dist/orders/ordersSchemas.d.ts +127 -31
  34. package/dist/orders/ordersSchemas.js +53 -30
  35. package/dist/pages/pagesInterfaces.d.ts +14 -8
  36. package/dist/pages/pagesSchemas.d.ts +24 -9
  37. package/dist/pages/pagesSchemas.js +4 -3
  38. package/dist/products/productsApi.d.ts +19 -1
  39. package/dist/products/productsApi.js +42 -8
  40. package/dist/products/productsInterfaces.d.ts +35 -6
  41. package/dist/products/productsSchemas.d.ts +4 -0
  42. package/dist/products/productsSchemas.js +1 -0
  43. package/dist/subscriptions/subscriptionsApi.d.ts +69 -0
  44. package/dist/subscriptions/subscriptionsApi.js +102 -0
  45. package/dist/subscriptions/subscriptionsInterfaces.d.ts +90 -0
  46. package/dist/subscriptions/subscriptionsInterfaces.js +2 -0
  47. package/dist/subscriptions/subscriptionsSchemas.d.ts +20 -0
  48. package/dist/subscriptions/subscriptionsSchemas.js +23 -0
  49. package/dist/user-activity/userActivityApi.d.ts +30 -0
  50. package/dist/user-activity/userActivityApi.js +42 -0
  51. package/dist/user-activity/userActivityInterfaces.d.ts +42 -0
  52. package/dist/user-activity/userActivityInterfaces.js +2 -0
  53. package/dist/users/usersApi.d.ts +79 -1
  54. package/dist/users/usersApi.js +110 -0
  55. package/dist/users/usersInterfaces.d.ts +155 -1
  56. package/dist/users/usersSchemas.d.ts +40 -0
  57. package/dist/users/usersSchemas.js +34 -1
  58. package/package.json +3 -2
@@ -132,6 +132,84 @@ interface IUsersApi {
132
132
  * @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}.
133
133
  */
134
134
  deleteFCMToken(token: string): Promise<boolean | IError>;
135
+ /**
136
+ * Get the current user's or guest's cart.
137
+ * @handleName getCart
138
+ * @returns {Promise<ICartResponse | IError>} A promise resolving to the cart with its items and total, or an error.
139
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
140
+ * @description This method requires user authorization (or a guest context).
141
+ * @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}.
142
+ */
143
+ getCart(): Promise<ICartResponse | IError>;
144
+ /**
145
+ * Replace the current user's or guest's cart.
146
+ * @handleName setCart
147
+ * @param {ICartSet} body - New cart contents. Example: `{ items: [{ productId: 1, qty: 2 }] }`.
148
+ * @returns {Promise<ICartResponse | IError>} A promise resolving to the updated cart, or an error.
149
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
150
+ * @description This method requires user authorization (or a guest context).
151
+ * @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}.
152
+ */
153
+ setCart(body: ICartSet): Promise<ICartResponse | IError>;
154
+ /**
155
+ * Add an item to the cart (or update qty of an existing one).
156
+ * @handleName addCartItem
157
+ * @param {ICartAddItem} body - Item to add. Example: `{ productId: 1, qty: 2 }`.
158
+ * @returns {Promise<ICartResponse | IError>} A promise resolving to the updated cart, or an error.
159
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
160
+ * @description This method requires user authorization (or a guest context).
161
+ * @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}.
162
+ */
163
+ addCartItem(body: ICartAddItem): Promise<ICartResponse | IError>;
164
+ /**
165
+ * Remove an item from the cart.
166
+ * @handleName removeCartItem
167
+ * @param {number} productId - Product identifier. Example: 12345.
168
+ * @returns {Promise<ICartResponse | IError>} A promise resolving to the updated cart, or an error.
169
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
170
+ * @description This method requires user authorization (or a guest context).
171
+ * @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}.
172
+ */
173
+ removeCartItem(productId: number): Promise<ICartResponse | IError>;
174
+ /**
175
+ * Get the current user's or guest's wishlist.
176
+ * @handleName getWishlist
177
+ * @returns {Promise<IWishlistResponse | IError>} A promise resolving to the wishlist with its items and total, or an error.
178
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
179
+ * @description This method requires user authorization (or a guest context).
180
+ * @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}.
181
+ */
182
+ getWishlist(): Promise<IWishlistResponse | IError>;
183
+ /**
184
+ * Replace the current user's or guest's wishlist.
185
+ * @handleName setWishlist
186
+ * @param {IWishlistSet} body - New wishlist contents. Example: `{ items: [{ productId: 1 }] }`.
187
+ * @returns {Promise<IWishlistResponse | IError>} A promise resolving to the updated wishlist, or an error.
188
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
189
+ * @description This method requires user authorization (or a guest context).
190
+ * @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}.
191
+ */
192
+ setWishlist(body: IWishlistSet): Promise<IWishlistResponse | IError>;
193
+ /**
194
+ * Add an item to the wishlist.
195
+ * @handleName addWishlistItem
196
+ * @param {IWishlistAddItem} body - Item to add. Example: `{ productId: 1 }`.
197
+ * @returns {Promise<IWishlistResponse | IError>} A promise resolving to the updated wishlist, or an error.
198
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
199
+ * @description This method requires user authorization (or a guest context).
200
+ * @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}.
201
+ */
202
+ addWishlistItem(body: IWishlistAddItem): Promise<IWishlistResponse | IError>;
203
+ /**
204
+ * Remove an item from the wishlist.
205
+ * @handleName removeWishlistItem
206
+ * @param {number} productId - Product identifier. Example: 12345.
207
+ * @returns {Promise<IWishlistResponse | IError>} A promise resolving to the updated wishlist, or an error.
208
+ * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
209
+ * @description This method requires user authorization (or a guest context).
210
+ * @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}.
211
+ */
212
+ removeWishlistItem(productId: number): Promise<IWishlistResponse | IError>;
135
213
  }
136
214
  /**
137
215
  * @interface IUserEntity
@@ -224,4 +302,80 @@ interface IUserBody {
224
302
  notificationData?: INotificationData;
225
303
  state?: Record<string, unknown>;
226
304
  }
227
- export type { IUserBody, IUserEntity, IUsersApi };
305
+ /**
306
+ * @interface ICartItem
307
+ * @property {number} productId - Product identifier. Example: 1.
308
+ * @property {number} qty - Quantity of the product in the cart. Example: 2.
309
+ * @property {string} [addedAt] - ISO date when the item was added. Example: "2026-05-30T10:00:00.000Z".
310
+ * @description A single cart item.
311
+ */
312
+ interface ICartItem {
313
+ productId: number;
314
+ qty: number;
315
+ addedAt?: string;
316
+ }
317
+ /**
318
+ * @interface ICartResponse
319
+ * @property {ICartItem[]} items - Cart items.
320
+ * @property {number} total - Total number of items in the cart. Example: 3.
321
+ * @description The user's or guest's cart.
322
+ */
323
+ interface ICartResponse {
324
+ items: ICartItem[];
325
+ total: number;
326
+ }
327
+ /**
328
+ * @interface ICartSet
329
+ * @property {ICartItem[]} items - New cart items. Example: `[{ productId: 1, qty: 2 }]`.
330
+ * @description Body for replacing the whole cart.
331
+ */
332
+ interface ICartSet {
333
+ items: ICartItem[];
334
+ }
335
+ /**
336
+ * @interface ICartAddItem
337
+ * @property {number} productId - Product identifier. Example: 1.
338
+ * @property {number} qty - Quantity to add. Example: 2.
339
+ * @description Body for adding a single item to the cart.
340
+ */
341
+ interface ICartAddItem {
342
+ productId: number;
343
+ qty: number;
344
+ }
345
+ /**
346
+ * @interface IWishlistItem
347
+ * @property {number} productId - Product identifier. Example: 1.
348
+ * @property {string} [addedAt] - ISO date when the item was added. Example: "2026-05-30T10:00:00.000Z".
349
+ * @description A single wishlist item.
350
+ */
351
+ interface IWishlistItem {
352
+ productId: number;
353
+ addedAt?: string;
354
+ }
355
+ /**
356
+ * @interface IWishlistResponse
357
+ * @property {IWishlistItem[]} items - Wishlist items.
358
+ * @property {number} total - Total number of items in the wishlist. Example: 3.
359
+ * @description The user's or guest's wishlist.
360
+ */
361
+ interface IWishlistResponse {
362
+ items: IWishlistItem[];
363
+ total: number;
364
+ }
365
+ /**
366
+ * @interface IWishlistSet
367
+ * @property {IWishlistItem[]} items - New wishlist items. Example: `[{ productId: 1 }]`.
368
+ * @description Body for replacing the whole wishlist.
369
+ */
370
+ interface IWishlistSet {
371
+ items: IWishlistItem[];
372
+ }
373
+ /**
374
+ * @interface IWishlistAddItem
375
+ * @property {number} productId - Product identifier. Example: 1.
376
+ * @description Body for adding a single item to the wishlist.
377
+ */
378
+ interface IWishlistAddItem {
379
+ productId: number;
380
+ }
381
+ export type { ICartAddItem, ICartItem, ICartResponse, ICartSet, IUserBody, IUserEntity, IUsersApi, IWishlistAddItem, IWishlistItem, IWishlistResponse, IWishlistSet, };
@@ -30,3 +30,43 @@ export declare const DeleteUserResponseSchema: z.ZodObject<{
30
30
  success: z.ZodBoolean;
31
31
  message: z.ZodOptional<z.ZodString>;
32
32
  }, z.core.$strip>;
33
+ /**
34
+ * Cart item schema
35
+ * @description Schema for a single cart item
36
+ */
37
+ export declare const CartItemSchema: z.ZodObject<{
38
+ productId: z.ZodNumber;
39
+ qty: z.ZodNumber;
40
+ addedAt: z.ZodOptional<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ /**
43
+ * Cart response schema
44
+ * @description Schema for the user's or guest's cart
45
+ */
46
+ export declare const CartResponseSchema: z.ZodObject<{
47
+ items: z.ZodArray<z.ZodObject<{
48
+ productId: z.ZodNumber;
49
+ qty: z.ZodNumber;
50
+ addedAt: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>>;
52
+ total: z.ZodNumber;
53
+ }, z.core.$strip>;
54
+ /**
55
+ * Wishlist item schema
56
+ * @description Schema for a single wishlist item
57
+ */
58
+ export declare const WishlistItemSchema: z.ZodObject<{
59
+ productId: z.ZodNumber;
60
+ addedAt: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>;
62
+ /**
63
+ * Wishlist response schema
64
+ * @description Schema for the user's or guest's wishlist
65
+ */
66
+ export declare const WishlistResponseSchema: z.ZodObject<{
67
+ items: z.ZodArray<z.ZodObject<{
68
+ productId: z.ZodNumber;
69
+ addedAt: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>;
71
+ total: z.ZodNumber;
72
+ }, z.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DeleteUserResponseSchema = exports.UpdateUserResponseSchema = exports.UserResponseSchema = void 0;
3
+ exports.WishlistResponseSchema = exports.WishlistItemSchema = exports.CartResponseSchema = exports.CartItemSchema = exports.DeleteUserResponseSchema = exports.UpdateUserResponseSchema = exports.UserResponseSchema = void 0;
4
4
  /**
5
5
  * Validation schemas for Users module
6
6
  * @description Zod schemas for validating users-related API responses
@@ -23,3 +23,36 @@ exports.DeleteUserResponseSchema = zod_1.z.object({
23
23
  success: zod_1.z.boolean(),
24
24
  message: zod_1.z.string().optional(),
25
25
  });
26
+ /**
27
+ * Cart item schema
28
+ * @description Schema for a single cart item
29
+ */
30
+ exports.CartItemSchema = zod_1.z.object({
31
+ productId: zod_1.z.number(),
32
+ qty: zod_1.z.number(),
33
+ addedAt: zod_1.z.string().optional(),
34
+ });
35
+ /**
36
+ * Cart response schema
37
+ * @description Schema for the user's or guest's cart
38
+ */
39
+ exports.CartResponseSchema = zod_1.z.object({
40
+ items: zod_1.z.array(exports.CartItemSchema),
41
+ total: zod_1.z.number(),
42
+ });
43
+ /**
44
+ * Wishlist item schema
45
+ * @description Schema for a single wishlist item
46
+ */
47
+ exports.WishlistItemSchema = zod_1.z.object({
48
+ productId: zod_1.z.number(),
49
+ addedAt: zod_1.z.string().optional(),
50
+ });
51
+ /**
52
+ * Wishlist response schema
53
+ * @description Schema for the user's or guest's wishlist
54
+ */
55
+ exports.WishlistResponseSchema = zod_1.z.object({
56
+ items: zod_1.z.array(exports.WishlistItemSchema),
57
+ total: zod_1.z.number(),
58
+ });
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "oneentry",
3
- "version": "1.0.149",
3
+ "version": "1.0.151",
4
4
  "description": "OneEntry NPM package",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
8
- "/dist"
8
+ "/dist",
9
+ "/changelog.md"
9
10
  ],
10
11
  "bin": {
11
12
  "oneentry": "./configure.js"