oneentry 1.0.170 → 1.0.172

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 (72) hide show
  1. package/changelog.md +40 -0
  2. package/dist/admins/adminsApi.d.ts +3 -3
  3. package/dist/admins/adminsApi.js +1 -1
  4. package/dist/admins/adminsInterfaces.d.ts +3 -3
  5. package/dist/base/asyncModules.d.ts +6 -1
  6. package/dist/base/asyncModules.js +9 -1
  7. package/dist/base/utils.d.ts +11 -1
  8. package/dist/blocks/blocksApi.d.ts +1 -1
  9. package/dist/blocks/blocksApi.js +1 -1
  10. package/dist/blocks/blocksInterfaces.d.ts +4 -2
  11. package/dist/discounts/discountsApi.d.ts +3 -3
  12. package/dist/discounts/discountsApi.js +1 -1
  13. package/dist/discounts/discountsInterfaces.d.ts +3 -3
  14. package/dist/events/eventsApi.d.ts +1 -1
  15. package/dist/events/eventsApi.js +1 -2
  16. package/dist/file-uploading/fileUploadingApi.d.ts +1 -1
  17. package/dist/file-uploading/fileUploadingApi.js +4 -3
  18. package/dist/file-uploading/fileUploadingInterfaces.d.ts +1 -1
  19. package/dist/forms-data/formsDataApi.d.ts +28 -4
  20. package/dist/forms-data/formsDataApi.js +66 -15
  21. package/dist/forms-data/formsDataInterfaces.d.ts +13 -9
  22. package/dist/general-types/generalTypesSchemas.d.ts +0 -2
  23. package/dist/general-types/generalTypesSchemas.js +0 -1
  24. package/dist/orders/ordersApi.d.ts +16 -3
  25. package/dist/orders/ordersApi.js +25 -15
  26. package/dist/orders/ordersInterfaces.d.ts +3 -3
  27. package/dist/pages/pagesApi.d.ts +4 -4
  28. package/dist/pages/pagesApi.js +9 -13
  29. package/dist/pages/pagesInterfaces.d.ts +3 -3
  30. package/dist/products/productsApi.d.ts +7 -6
  31. package/dist/products/productsApi.js +6 -3
  32. package/dist/products/productsInterfaces.d.ts +14 -9
  33. package/dist/user-activity/userActivityApi.js +4 -7
  34. package/dist/users/usersApi.d.ts +3 -3
  35. package/dist/users/usersApi.js +1 -1
  36. package/dist/users/usersInterfaces.d.ts +3 -3
  37. package/esm/admins/adminsApi.d.ts +3 -3
  38. package/esm/admins/adminsApi.js +1 -1
  39. package/esm/admins/adminsInterfaces.d.ts +3 -3
  40. package/esm/base/asyncModules.d.ts +6 -1
  41. package/esm/base/asyncModules.js +9 -1
  42. package/esm/base/utils.d.ts +11 -1
  43. package/esm/blocks/blocksApi.d.ts +1 -1
  44. package/esm/blocks/blocksApi.js +1 -1
  45. package/esm/blocks/blocksInterfaces.d.ts +4 -2
  46. package/esm/discounts/discountsApi.d.ts +3 -3
  47. package/esm/discounts/discountsApi.js +1 -1
  48. package/esm/discounts/discountsInterfaces.d.ts +3 -3
  49. package/esm/events/eventsApi.d.ts +1 -1
  50. package/esm/events/eventsApi.js +1 -2
  51. package/esm/file-uploading/fileUploadingApi.d.ts +1 -1
  52. package/esm/file-uploading/fileUploadingApi.js +4 -3
  53. package/esm/file-uploading/fileUploadingInterfaces.d.ts +1 -1
  54. package/esm/forms-data/formsDataApi.d.ts +28 -4
  55. package/esm/forms-data/formsDataApi.js +66 -15
  56. package/esm/forms-data/formsDataInterfaces.d.ts +13 -9
  57. package/esm/general-types/generalTypesSchemas.d.ts +0 -2
  58. package/esm/general-types/generalTypesSchemas.js +0 -1
  59. package/esm/orders/ordersApi.d.ts +16 -3
  60. package/esm/orders/ordersApi.js +25 -15
  61. package/esm/orders/ordersInterfaces.d.ts +3 -3
  62. package/esm/pages/pagesApi.d.ts +4 -4
  63. package/esm/pages/pagesApi.js +9 -13
  64. package/esm/pages/pagesInterfaces.d.ts +3 -3
  65. package/esm/products/productsApi.d.ts +7 -6
  66. package/esm/products/productsApi.js +6 -3
  67. package/esm/products/productsInterfaces.d.ts +14 -9
  68. package/esm/user-activity/userActivityApi.js +4 -7
  69. package/esm/users/usersApi.d.ts +3 -3
  70. package/esm/users/usersApi.js +1 -1
  71. package/esm/users/usersInterfaces.d.ts +3 -3
  72. package/package.json +2 -2
@@ -439,6 +439,16 @@ interface IHttpOptions {
439
439
  headers: IHttpHeaders;
440
440
  body?: string | FormData | Blob;
441
441
  }
442
+ /**
443
+ * Response of a semantic (vector) search: the module's own list container plus `indexReady`.
444
+ * @typedef {object} IVectorSearchResponse
445
+ * @template T
446
+ * @property {boolean} indexReady - `false` when no vectors are built yet for this entity and language: the query was not embedded, and empty `items` do not mean "nothing matched". `true` — an honest search result.
447
+ * @description Every `…/vector/search` endpoint answers with `indexReady` next to its list (CMS-1074).
448
+ */
449
+ type IVectorSearchResponse<T> = T & {
450
+ indexReady: boolean;
451
+ };
442
452
  /**
443
453
  * LangType
444
454
  */
@@ -447,4 +457,4 @@ type LangType = string | Array<string>;
447
457
  * LocalizeType
448
458
  */
449
459
  type LocalizeType = ILocalizeInfo;
450
- export type { IAttributeFile, IAttributeLocalizeInfo, IAttributes, IAttributeValue, IAttributeValues, IConfig, IError, IFileAttributeValue, IHttpHeaders, IHttpOptions, IListAttributeValue, ILocalizeInfo, INumberAttributeValue, IRating, IStringAttributeValue, ITimeIntervalAttributeValue, ITimeIntervalEntitySchedule, ITimeIntervalGroup, ITimeIntervalPoint, ITimeIntervalRange, ITimeIntervalSchedule, ITimeIntervalWindow, ITypedAttributeValue, LangType, LocalizeType, TimeIntervalPair, };
460
+ export type { IAttributeFile, IAttributeLocalizeInfo, IAttributes, IAttributeValue, IAttributeValues, IConfig, IError, IFileAttributeValue, IHttpHeaders, IHttpOptions, IListAttributeValue, ILocalizeInfo, INumberAttributeValue, IRating, IStringAttributeValue, ITimeIntervalAttributeValue, ITimeIntervalEntitySchedule, ITimeIntervalGroup, ITimeIntervalPoint, ITimeIntervalRange, ITimeIntervalSchedule, ITimeIntervalWindow, ITypedAttributeValue, IVectorSearchResponse, LangType, LocalizeType, TimeIntervalPair, };
@@ -21,7 +21,7 @@ export default class BlocksApi extends AsyncModules implements IBlocks {
21
21
  /**
22
22
  * Get blocks by parameters.
23
23
  * @handleName getBlocks
24
- * @param {BlockType} [type] - Optional block type to filter by. Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". When omitted, blocks of all types are returned. Example: 'product'.
24
+ * @param {BlockType} [type] - Optional block type to filter by. Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "frequently_ordered_block" | "trending_block" | "recently_viewed_block" | "repeat_purchase_block" | "slider_block" | "personal_recommendations_block" | "cart_complement_block" | "cart_similar_block" | "wishlist_similar_block" | "form" | "common_page" | "common_block" | "order" | "service" | "external_page" | "discount" (see BlockType). When omitted, blocks of all types are returned. Example: 'product'.
25
25
  * @param {string} [langCode] - Language code. Default: "en_US".
26
26
  * @param {number} [offset] - Parameter for pagination. Default: 0.
27
27
  * @param {number} [limit] - Parameter for pagination. Default: 30.
@@ -22,7 +22,7 @@ export default class BlocksApi extends AsyncModules {
22
22
  /**
23
23
  * Get blocks by parameters.
24
24
  * @handleName getBlocks
25
- * @param {BlockType} [type] - Optional block type to filter by. Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "form" | "common_page" | "common_block" | "order" | "service" | "none". When omitted, blocks of all types are returned. Example: 'product'.
25
+ * @param {BlockType} [type] - Optional block type to filter by. Available values: "product" | "error_page" | "catalog_page" | "product_preview" | "similar_products_block" | "product_block" | "frequently_ordered_block" | "trending_block" | "recently_viewed_block" | "repeat_purchase_block" | "slider_block" | "personal_recommendations_block" | "cart_complement_block" | "cart_similar_block" | "wishlist_similar_block" | "form" | "common_page" | "common_block" | "order" | "service" | "external_page" | "discount" (see BlockType). When omitted, blocks of all types are returned. Example: 'product'.
26
26
  * @param {string} [langCode] - Language code. Default: "en_US".
27
27
  * @param {number} [offset] - Parameter for pagination. Default: 0.
28
28
  * @param {number} [limit] - Parameter for pagination. Default: 30.
@@ -309,9 +309,11 @@ interface ISearchBlock {
309
309
  /**
310
310
  * BlockType
311
311
  * @type {BlockType}
312
- * @description This type defines the possible values for block types used in the system.
312
+ * @description This type defines the possible values for block types used in the system: the types `GET /api/content/general-types` returns.
313
+ * `'none'` was dropped — the platform has no such type and a filter by it answers `400 type must be a valid enum value` (CMS-1062).
314
+ * `'service'` is the platform's own name for the type, but the `type` filter of getBlocks and getTemplateByType currently refuses it with the same `400`; that is a platform defect (CMS-1073).
313
315
  */
314
- type BlockType = 'product' | 'error_page' | 'catalog_page' | 'product_preview' | 'similar_products_block' | 'product_block' | 'frequently_ordered_block' | 'trending_block' | 'recently_viewed_block' | 'repeat_purchase_block' | 'slider_block' | 'personal_recommendations_block' | 'cart_complement_block' | 'cart_similar_block' | 'wishlist_similar_block' | 'form' | 'common_page' | 'common_block' | 'order' | 'service' | 'external_page' | 'discount' | 'none';
316
+ type BlockType = 'product' | 'error_page' | 'catalog_page' | 'product_preview' | 'similar_products_block' | 'product_block' | 'frequently_ordered_block' | 'trending_block' | 'recently_viewed_block' | 'repeat_purchase_block' | 'slider_block' | 'personal_recommendations_block' | 'cart_complement_block' | 'cart_similar_block' | 'wishlist_similar_block' | 'form' | 'common_page' | 'common_block' | 'order' | 'service' | 'external_page' | 'discount';
315
317
  /**
316
318
  * Lookup body for block product endpoints by explicit productIds.
317
319
  * @interface IBlockProductsLookup
@@ -1,6 +1,6 @@
1
1
  import AsyncModules from '../base/asyncModules.js';
2
2
  import type StateModule from '../base/stateModule.js';
3
- import type { IError } from '../base/utils.js';
3
+ import type { IError, IVectorSearchResponse } from '../base/utils.js';
4
4
  import type { IBonusBalanceEntity, IBonusHistoryResponse, IBonusTransactionType, ICouponValidationResult, IDiscountsApi, IDiscountsEntity, IDiscountsResponse, IDiscountsVectorSearch, IDiscountType } from './discountsInterfaces.js';
5
5
  /**
6
6
  * Controllers for working with events
@@ -85,10 +85,10 @@ export default class DiscountsApi extends AsyncModules implements IDiscountsApi
85
85
  * @param {string} [langCode] - Language code. Default: "en_US".
86
86
  * @param {number} [offset] - Parameter for pagination. Default: 0.
87
87
  * @param {number} [limit] - Parameter for pagination. Default: 30.
88
- * @returns {Promise<IDiscountsResponse | IError>} Returns an object with an array of found discounts and total count.
88
+ * @returns {Promise<IVectorSearchResponse<IDiscountsResponse> | IError>} Returns an object with an array of found discounts and total count.
89
89
  * @throws {IError} When isShell=false and an error occurs during the fetch
90
90
  * @description This method performs a semantic (vector) search for discounts.
91
91
  * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getDiscountsByVectorSearch getDiscountsByVectorSearch} documentation.
92
92
  */
93
- getDiscountsByVectorSearch(body: IDiscountsVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IDiscountsResponse | IError>;
93
+ getDiscountsByVectorSearch(body: IDiscountsVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IDiscountsResponse> | IError>;
94
94
  }
@@ -119,7 +119,7 @@ export default class DiscountsApi extends AsyncModules {
119
119
  * @param {string} [langCode] - Language code. Default: "en_US".
120
120
  * @param {number} [offset] - Parameter for pagination. Default: 0.
121
121
  * @param {number} [limit] - Parameter for pagination. Default: 30.
122
- * @returns {Promise<IDiscountsResponse | IError>} Returns an object with an array of found discounts and total count.
122
+ * @returns {Promise<IVectorSearchResponse<IDiscountsResponse> | IError>} Returns an object with an array of found discounts and total count.
123
123
  * @throws {IError} When isShell=false and an error occurs during the fetch
124
124
  * @description This method performs a semantic (vector) search for discounts.
125
125
  * @see {@link https://js-sdk.oneentry.cloud/docs/discounts/getDiscountsByVectorSearch getDiscountsByVectorSearch} documentation.
@@ -1,4 +1,4 @@
1
- import type { IAttributeValues, IError, ILocalizeInfo } from '../base/utils.js';
1
+ import type { IAttributeValues, IError, ILocalizeInfo, IVectorSearchResponse } from '../base/utils.js';
2
2
  /**
3
3
  * Discount type.
4
4
  */
@@ -66,10 +66,10 @@ interface IDiscountsApi {
66
66
  * @param {string} [langCode] - Language code. Default: "en_US".
67
67
  * @param {number} [offset] - Parameter for pagination. Default: 0.
68
68
  * @param {number} [limit] - Parameter for pagination. Default: 30.
69
- * @returns {Promise<IDiscountsResponse | IError>} Returns an object with an array of found discounts and total count.
69
+ * @returns {Promise<IVectorSearchResponse<IDiscountsResponse> | IError>} Returns an object with an array of found discounts and total count.
70
70
  * @throws {IError} When isShell=false and an error occurs during the fetch
71
71
  */
72
- getDiscountsByVectorSearch(body: IDiscountsVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IDiscountsResponse | IError>;
72
+ getDiscountsByVectorSearch(body: IDiscountsVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IDiscountsResponse> | IError>;
73
73
  }
74
74
  /**
75
75
  * Body for semantic (vector) discount search.
@@ -53,7 +53,7 @@ export default class EventsApi extends AsyncModules implements IEvents {
53
53
  * @param {string} marker - The marker of the event to unsubscribe from. Example: "product_price_change".
54
54
  * @param {number} productId - The ID of the product to unsubscribe from. Example: 12345.
55
55
  * @param {string} [langCode] - Language code. Default: "en_US".
56
- * @returns {Promise<any | IError>} - Returns a promise that resolves to the result of the unsubscription operation or an error object if there was an issue.
56
+ * @returns {Promise<boolean | IError>} - Returns true if the unsubscription succeeded, or an error object if there was an issue.
57
57
  * @throws {IError} When isShell=false and an error occurs during the fetch
58
58
  * @description This method requires user authorization.
59
59
  * @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}.
@@ -1,4 +1,3 @@
1
- /* eslint-disable jsdoc/reject-any-type */
2
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  import AsyncModules from '../base/asyncModules.js';
4
3
  /**
@@ -66,7 +65,7 @@ export default class EventsApi extends AsyncModules {
66
65
  * @param {string} marker - The marker of the event to unsubscribe from. Example: "product_price_change".
67
66
  * @param {number} productId - The ID of the product to unsubscribe from. Example: 12345.
68
67
  * @param {string} [langCode] - Language code. Default: "en_US".
69
- * @returns {Promise<any | IError>} - Returns a promise that resolves to the result of the unsubscription operation or an error object if there was an issue.
68
+ * @returns {Promise<boolean | IError>} - Returns true if the unsubscription succeeded, or an error object if there was an issue.
70
69
  * @throws {IError} When isShell=false and an error occurs during the fetch
71
70
  * @description This method requires user authorization.
72
71
  * @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}.
@@ -62,7 +62,7 @@ export default class FileUploadingApi extends AsyncModules implements IFileUploa
62
62
  * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
63
63
  * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
64
64
  * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
65
- * @returns {Promise<boolean | IError>} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
65
+ * @returns {Promise<boolean | IError>} Returns a promise that resolves to true when the file was deleted or an error object if there was an issue.
66
66
  * @throws {IError} When isShell=false and an error occurs during the fetch
67
67
  * @see {@link https://js-sdk.oneentry.cloud/docs/file-uploading/delete delete} documentation.
68
68
  */
@@ -78,14 +78,15 @@ export default class FileUploadingApi extends AsyncModules {
78
78
  * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
79
79
  * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
80
80
  * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
81
- * @returns {Promise<boolean | IError>} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
81
+ * @returns {Promise<boolean | IError>} Returns a promise that resolves to true when the file was deleted or an error object if there was an issue.
82
82
  * @throws {IError} When isShell=false and an error occurs during the fetch
83
83
  * @see {@link https://js-sdk.oneentry.cloud/docs/file-uploading/delete delete} documentation.
84
84
  */
85
85
  async delete(filename, fileQuery) {
86
86
  const query = { ...this._defaultQuery, ...fileQuery };
87
- const result = await this._fetchDelete(`?filename=${filename}&` + this._queryParamsToString(query));
88
- return result;
87
+ // The endpoint answers 200 with an empty body, which _parseJson reads as `{}`;
88
+ // _fetchBoolean turns that into the declared `true` (CMS-1072)
89
+ return this._fetchBoolean(() => this._fetchDelete(`?filename=${filename}&` + this._queryParamsToString(query)));
89
90
  }
90
91
  /**
91
92
  * Public search across the content of files attached to records.
@@ -55,7 +55,7 @@ interface IFileUploading {
55
55
  * @param {string} [fileQuery.entity] - Entity name from which the file is uploaded, determines the folder name in the storage. Example: "editor".
56
56
  * @param {number} [fileQuery.id] - Identifier of the object from which the file is uploaded, determines the folder name in the storage. Example: 3787.
57
57
  * @param {number} [fileQuery.template] - preview template identifier. Example: 1.
58
- * @returns {boolean | IError} Returns a promise that resolves to the result of the deletion operation or an error object if there was an issue.
58
+ * @returns {boolean | IError} Returns a promise that resolves to true when the file was deleted or an error object if there was an issue.
59
59
  * @throws {IError} - If there is an error during the fetch operation, it will return an error object.
60
60
  */
61
61
  delete(filename: string, fileQuery?: IUploadingQuery): Promise<boolean | IError>;
@@ -1,6 +1,6 @@
1
1
  import AsyncModules from '../base/asyncModules.js';
2
2
  import type StateModule from '../base/stateModule.js';
3
- import type { IError } from '../base/utils.js';
3
+ import type { IError, IVectorSearchResponse } from '../base/utils.js';
4
4
  import type { IBodyPostFormData, IFormsByMarkerDataEntity, IFormsData, IFormsDataFilter, IFormsDataSearchResponse, IFormsDataVectorSearch, IPostFormResponse, IUpdateFormsData } from './formsDataInterfaces.js';
5
5
  /**
6
6
  * Controllers for working with form data
@@ -56,10 +56,34 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
56
56
  * @param {string} [langCode] - Language code. Default: "en_US".
57
57
  * @returns {Promise<IPostFormResponse | IError>} Returns an object containing the created form data entry and message.
58
58
  * @throws {IError} When isShell=false and an error occurs during the fetch
59
- * @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects. Passing a `File`/`FileList` as the value is also supported — the SDK uploads it first, then strips `contentType` from the resulting value.
59
+ * @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects.
60
+ *
61
+ * A file value may be a `File`/`Blob` (a `FileList` too), which the SDK uploads first; the descriptor `FileUploading.upload` returns for a file **already in storage**, which the SDK passes through untouched; or a hand-built {@link IFileValue} / {@link IImageValue}. The three may be mixed in one array. `contentType` is stripped from all of them, and a value of none of these shapes is sent as it came — the endpoint then names the field it cannot read, instead of the SDK throwing before the request.
62
+ *
63
+ * The endpoint wants file values in an **array**: a lone descriptor or `IFileValue` answers `400 formData's marker '<marker>' value must be an array`, while a lone `File`/`Blob` works because the upload result is already one.
60
64
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/postFormsData postFormsData} documentation.
61
65
  */
62
66
  postFormsData(body: IBodyPostFormData, langCode?: string): Promise<IPostFormResponse | IError>;
67
+ /**
68
+ * Tells a file the SDK still has to upload from one already in storage.
69
+ * @param {unknown} value - One value of a `file` / `image` / `groupOfImages` field.
70
+ * @returns {boolean} True when the value is a `File` or a `Blob`, which has to be uploaded first.
71
+ * @description Only a `File` or a `Blob` is uploaded. Anything else — above all the
72
+ * descriptor `FileUploading.upload` returns for a file already in storage — is sent
73
+ * as it came: re-uploading it would send the descriptor as the file itself.
74
+ */
75
+ private _isUploadable;
76
+ /**
77
+ * Removes `contentType` from a file value, which the endpoint does not accept.
78
+ * @param {T} value - Value of a `file` / `image` / `groupOfImages` field, after the uploads.
79
+ * @returns {T} The value without `contentType`; entries that carried it are copies, the caller's objects are not modified.
80
+ * @description `FileUploading.upload` returns `contentType` and form data rejects it,
81
+ * so it is stripped from an array of values and from a lone value object alike. A value
82
+ * of any other shape is returned untouched and the endpoint names the field it cannot
83
+ * read — instead of the library dying on `value.map is not a function` before the
84
+ * request is made (CMS-990).
85
+ */
86
+ private _stripContentType;
63
87
  /**
64
88
  * Drops the date bounds the endpoint refuses to parse.
65
89
  *
@@ -142,10 +166,10 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
142
166
  * @param {string} [langCode] - Language code. Default: "en_US".
143
167
  * @param {number} [offset] - Parameter for pagination. Default: 0.
144
168
  * @param {number} [limit] - Parameter for pagination. Default: 30.
145
- * @returns {Promise<IFormsDataSearchResponse | IError>} Returns an object with an array of found form data records and total count.
169
+ * @returns {Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>} Returns an object with an array of found form data records and total count.
146
170
  * @throws {IError} When isShell=false and an error occurs during the fetch
147
171
  * @description This method performs a semantic (vector) search for form data.
148
172
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/getFormsDataByVectorSearch getFormsDataByVectorSearch} documentation.
149
173
  */
150
- getFormsDataByVectorSearch(body: IFormsDataVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IFormsDataSearchResponse | IError>;
174
+ getFormsDataByVectorSearch(body: IFormsDataVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>;
151
175
  }
@@ -58,7 +58,11 @@ export default class FormsDataApi extends AsyncModules {
58
58
  * @param {string} [langCode] - Language code. Default: "en_US".
59
59
  * @returns {Promise<IPostFormResponse | IError>} Returns an object containing the created form data entry and message.
60
60
  * @throws {IError} When isShell=false and an error occurs during the fetch
61
- * @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects. Passing a `File`/`FileList` as the value is also supported — the SDK uploads it first, then strips `contentType` from the resulting value.
61
+ * @description Field values are typed per field type by {@link FormDataType}. For attached files see {@link IImageValue} (`image`, `groupOfImages`) and {@link IFileValue} (`file`) — the shape the endpoint expects, which is **not** what `FileUploading.upload` returns: that object carries `contentType`, which form data rejects.
62
+ *
63
+ * A file value may be a `File`/`Blob` (a `FileList` too), which the SDK uploads first; the descriptor `FileUploading.upload` returns for a file **already in storage**, which the SDK passes through untouched; or a hand-built {@link IFileValue} / {@link IImageValue}. The three may be mixed in one array. `contentType` is stripped from all of them, and a value of none of these shapes is sent as it came — the endpoint then names the field it cannot read, instead of the SDK throwing before the request.
64
+ *
65
+ * The endpoint wants file values in an **array**: a lone descriptor or `IFileValue` answers `400 formData's marker '<marker>' value must be an array`, while a lone `File`/`Blob` works because the upload result is already one.
62
66
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/postFormsData postFormsData} documentation.
63
67
  */
64
68
  async postFormsData(body, langCode = this.state.lang) {
@@ -75,9 +79,12 @@ export default class FormsDataApi extends AsyncModules {
75
79
  // Create an instance of FileUploadingApi with the current state
76
80
  const fileUploader = new FileUploadingApi(this.state);
77
81
  // Process each element in formData[langCode] asynchronously
78
- formData[langCode] = await Promise.all(formData[langCode].map(async (fd) => {
82
+ formData[langCode] = await Promise.all(formData[langCode].map(async (field) => {
79
83
  // Check if the type is one of the specified types
80
- if (['file', 'image', 'groupOfImages'].includes(fd.type)) {
84
+ if (['file', 'image', 'groupOfImages'].includes(field.type)) {
85
+ // Work on a copy: the caller's field keeps its File and its fileQuery,
86
+ // so a reused body sends the same form again (CMS-1071)
87
+ const fd = { ...field };
81
88
  // If fileQuery does not exist, we create it and assign it to an object with the following properties:
82
89
  if (!fd.fileQuery) {
83
90
  const fileQuery = {
@@ -94,34 +101,78 @@ export default class FormsDataApi extends AsyncModules {
94
101
  const filesArray = typeof FileList !== 'undefined' && fd.value instanceof FileList
95
102
  ? Array.from(fd.value)
96
103
  : fd.value;
97
- // If filesArray is an array, upload each file asynchronously
104
+ // If filesArray is an array, upload the files it holds asynchronously
98
105
  if (Array.isArray(filesArray)) {
99
- const uploadPromises = filesArray.map((file) => fileUploader.upload(file, fd.fileQuery).catch((e) => e));
106
+ const uploadPromises = filesArray.map((file) =>
107
+ // An entry that is already in storage is passed through: a
108
+ // second upload would send the descriptor itself as the file
109
+ // and the endpoint answers `value[0].filename is required`.
110
+ this._isUploadable(file)
111
+ ? fileUploader.upload(file, fd.fileQuery).catch((e) => e)
112
+ : file);
100
113
  fd.value = (await Promise.all(uploadPromises)).flat();
101
114
  }
102
115
  // If fd.value is a single File or Blob, upload it
103
- else if (fd.value instanceof File || fd.value instanceof Blob) {
116
+ else if (this._isUploadable(fd.value)) {
104
117
  fd.value = await fileUploader
105
118
  .upload(fd.value, fd.fileQuery)
106
119
  .catch((e) => e); // Catch any errors during upload
107
120
  }
108
121
  // Remove the 'fileQuery' property from the object after processing
109
122
  delete fd.fileQuery;
110
- // Remove the 'contentType' property from the file object because it is not needed and not valid
111
- fd.value.map((file) => {
112
- delete file.contentType;
113
- });
123
+ // Remove the 'contentType' property from the file object because it is not needed and not valid
124
+ fd.value = this._stripContentType(fd.value);
125
+ return fd;
114
126
  }
115
- // Return the processed form data element
116
- return fd;
127
+ // Return the form data element untouched
128
+ return field;
117
129
  }));
118
130
  }
119
- body.formData = formData;
120
- const result = await this._fetchPost(``, body);
131
+ // The wrapped formData goes into a new body: written back into the caller's
132
+ // object, a second call with it wrapped the wrapper and answered `400` (CMS-1071)
133
+ const result = await this._fetchPost(``, { ...body, formData });
121
134
  // Validate response if validation is enabled
122
135
  const validated = await this._validateResponse(result, schema('PostFormResponseSchema'));
123
136
  return this._normalizeData(validated);
124
137
  }
138
+ /**
139
+ * Tells a file the SDK still has to upload from one already in storage.
140
+ * @param {unknown} value - One value of a `file` / `image` / `groupOfImages` field.
141
+ * @returns {boolean} True when the value is a `File` or a `Blob`, which has to be uploaded first.
142
+ * @description Only a `File` or a `Blob` is uploaded. Anything else — above all the
143
+ * descriptor `FileUploading.upload` returns for a file already in storage — is sent
144
+ * as it came: re-uploading it would send the descriptor as the file itself.
145
+ */
146
+ _isUploadable(value) {
147
+ return ((typeof File !== 'undefined' && value instanceof File) ||
148
+ (typeof Blob !== 'undefined' && value instanceof Blob));
149
+ }
150
+ /**
151
+ * Removes `contentType` from a file value, which the endpoint does not accept.
152
+ * @param {T} value - Value of a `file` / `image` / `groupOfImages` field, after the uploads.
153
+ * @returns {T} The value without `contentType`; entries that carried it are copies, the caller's objects are not modified.
154
+ * @description `FileUploading.upload` returns `contentType` and form data rejects it,
155
+ * so it is stripped from an array of values and from a lone value object alike. A value
156
+ * of any other shape is returned untouched and the endpoint names the field it cannot
157
+ * read — instead of the library dying on `value.map is not a function` before the
158
+ * request is made (CMS-990).
159
+ */
160
+ _stripContentType(value) {
161
+ // An entry carrying `contentType` is copied without it rather than edited:
162
+ // a descriptor passed through untouched belongs to the caller (CMS-1071)
163
+ const strip = (item) => {
164
+ if (item &&
165
+ typeof item === 'object' &&
166
+ !Array.isArray(item) &&
167
+ 'contentType' in item) {
168
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
169
+ const { contentType, ...rest } = item;
170
+ return rest;
171
+ }
172
+ return item;
173
+ };
174
+ return (Array.isArray(value) ? value.map(strip) : strip(value));
175
+ }
125
176
  /**
126
177
  * Drops the date bounds the endpoint refuses to parse.
127
178
  *
@@ -227,7 +278,7 @@ export default class FormsDataApi extends AsyncModules {
227
278
  * @param {string} [langCode] - Language code. Default: "en_US".
228
279
  * @param {number} [offset] - Parameter for pagination. Default: 0.
229
280
  * @param {number} [limit] - Parameter for pagination. Default: 30.
230
- * @returns {Promise<IFormsDataSearchResponse | IError>} Returns an object with an array of found form data records and total count.
281
+ * @returns {Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>} Returns an object with an array of found form data records and total count.
231
282
  * @throws {IError} When isShell=false and an error occurs during the fetch
232
283
  * @description This method performs a semantic (vector) search for form data.
233
284
  * @see {@link https://js-sdk.oneentry.cloud/docs/forms-data/getFormsDataByVectorSearch getFormsDataByVectorSearch} documentation.
@@ -1,5 +1,5 @@
1
- import type { IError } from '../base/utils.js';
2
- import type { IUploadingQuery } from '../file-uploading/fileUploadingInterfaces.js';
1
+ import type { IError, IVectorSearchResponse } from '../base/utils.js';
2
+ import type { IUploadingQuery, IUploadingReturn } from '../file-uploading/fileUploadingInterfaces.js';
3
3
  /**
4
4
  * Interface for retrieving and posting form data in the system.
5
5
  * @interface IFormsData
@@ -77,10 +77,10 @@ interface IFormsData {
77
77
  * @param {string} [langCode] - Language code. Default: "en_US".
78
78
  * @param {number} [offset] - Parameter for pagination. Default: 0.
79
79
  * @param {number} [limit] - Parameter for pagination. Default: 30.
80
- * @returns {Promise<IFormsDataSearchResponse | IError>} Returns an object with an array of found form data records and total count.
80
+ * @returns {Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>} Returns an object with an array of found form data records and total count.
81
81
  * @throws {IError} When isShell=false and an error occurs during the fetch
82
82
  */
83
- getFormsDataByVectorSearch(body: IFormsDataVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IFormsDataSearchResponse | IError>;
83
+ getFormsDataByVectorSearch(body: IFormsDataVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IFormsDataSearchResponse> | IError>;
84
84
  }
85
85
  /**
86
86
  * Body for semantic (vector) form data search.
@@ -567,7 +567,7 @@ interface ICaptchaValue {
567
567
  * @property {string} formData[].marker - The marker identifying the form field. Example: "name".
568
568
  * @property {string} formData[].type - The type of the form field. Example: "string".
569
569
  * @property {string} formData[].value - The value of the form field. Example: "name".
570
- * @property {IUploadingQuery} [fileQuery] - Optional file query for uploading files.
570
+ * @property {IUploadingQuery} [fileQuery] - Optional file query for uploading files. Kept for compatibility: the SDK reads `fileQuery` from the **file field itself** (see IBodyTypeFile), not from the body, so one set here does not change where a file is uploaded.
571
571
  * @example
572
572
  {
573
573
  "type": "page",
@@ -715,7 +715,7 @@ interface ITextWithHeaderValue {
715
715
  * @interface IBodyTypeImageGroupOfImages
716
716
  * @property {string} marker - marker name. Example: "avatar".
717
717
  * @property {'image' | 'groupOfImages'} type - Type value — must match the attribute type in the set, note the plural in "groupOfImages". Example: "image".
718
- * @property {object} value - Image Object. Contains image information.
718
+ * @property {object} value - The attached image. The same three shapes as a `file` field accepts, mixable in one array: a `File`/`Blob` (also a `FileList`), which the SDK uploads first; the descriptor `FileUploading.upload` returns for an image **already in storage**, passed through as it is; or a hand-built {@link IImageValue}. In a SUBMISSION the value must be an **array**, as for `file` — a lone object answers `400 formData's marker '<marker>' value must be an array`. Measured on js-sdk-tests.oneentry.cloud, 2026-10-08 (CMS-990).
719
719
  * @example
720
720
  [
721
721
  {
@@ -728,12 +728,14 @@ interface ITextWithHeaderValue {
728
728
  }
729
729
  }
730
730
  ]
731
+ * @property {IUploadingQuery} [fileQuery] - Where the SDK uploads a `File`/`Blob` value to. Read **per field**, not from the body; omitted, the SDK uploads to `page`/`editor` under a random id. Ignored for an image already in storage. Example: `{ "type": "page", "entity": "editor", "id": 3787 }`.
731
732
  * @description Represents an image or a group of images with their details, including filename, download link, size, preview link, and parameters for image compression.
732
733
  */
733
734
  interface IBodyTypeImageGroupOfImages {
734
735
  marker: string;
735
736
  type: 'image' | 'groupOfImages';
736
- value: IImageValue | IImageValue[];
737
+ value: IImageValue | IUploadingReturn | File | Blob | (IImageValue | IUploadingReturn | File | Blob)[];
738
+ fileQuery?: IUploadingQuery;
737
739
  }
738
740
  /**
739
741
  * @interface IImageValueParams
@@ -764,7 +766,7 @@ interface IImageValue {
764
766
  * @interface IBodyTypeFile
765
767
  * @property {string} marker - marker name. Example: "picture".
766
768
  * @property {'file'} type - Type value. Example: "file".
767
- * @property {object} value - File Object. Contains file information. A single attached file is returned as the object itself, several files as an array.
769
+ * @property {object} value - The attached file. Three shapes are accepted and may be mixed in one array: a `File`/`Blob` (also a `FileList`), which the SDK uploads first; the descriptor `FileUploading.upload` returns for a file **already in storage**, which is passed through as it is; or a hand-built {@link IFileValue}. In a SUBMISSION the value must be an **array** — a lone descriptor or {@link IFileValue} answers `400 formData's marker '<marker>' value must be an array`, while a lone `File`/`Blob` is fine because the SDK wraps the upload result. A READ returns a single attached file as the object itself. Measured on js-sdk-tests.oneentry.cloud, 2026-10-08 (CMS-990).
768
770
  * @example
769
771
  [
770
772
  {
@@ -773,12 +775,14 @@ interface IImageValue {
773
775
  "size": 392585
774
776
  }
775
777
  ]
778
+ * @property {IUploadingQuery} [fileQuery] - Where the SDK uploads a `File`/`Blob` value to. Read **per field**, not from the body; omitted, the SDK uploads to `page`/`editor` under a random id. Ignored for a file already in storage. Example: `{ "type": "page", "entity": "editor", "id": 3787 }`.
776
779
  * @description Represents a file with its details, including filename, download link, and size.
777
780
  */
778
781
  interface IBodyTypeFile {
779
782
  marker: string;
780
783
  type: 'file';
781
- value: IFileValue | IFileValue[];
784
+ value: IFileValue | IUploadingReturn | File | Blob | (IFileValue | IUploadingReturn | File | Blob)[];
785
+ fileQuery?: IUploadingQuery;
782
786
  }
783
787
  /**
784
788
  * @interface IFileValue
@@ -10,7 +10,6 @@ import { z } from 'zod';
10
10
  export declare const GeneralTypeEntitySchema: z.ZodObject<{
11
11
  id: z.ZodNumber;
12
12
  type: z.ZodEnum<{
13
- none: "none";
14
13
  product: "product";
15
14
  order: "order";
16
15
  form: "form";
@@ -41,7 +40,6 @@ export declare const GeneralTypeEntitySchema: z.ZodObject<{
41
40
  export declare const GeneralTypesResponseSchema: z.ZodArray<z.ZodObject<{
42
41
  id: z.ZodNumber;
43
42
  type: z.ZodEnum<{
44
- none: "none";
45
43
  product: "product";
46
44
  order: "order";
47
45
  form: "form";
@@ -33,7 +33,6 @@ export const GeneralTypeEntitySchema = z.object({
33
33
  'service',
34
34
  'external_page',
35
35
  'discount',
36
- 'none',
37
36
  ]),
38
37
  });
39
38
  /**
@@ -1,6 +1,6 @@
1
1
  import AsyncModules from '../base/asyncModules.js';
2
2
  import type StateModule from '../base/stateModule.js';
3
- import type { IError } from '../base/utils.js';
3
+ import type { IError, IVectorSearchResponse } from '../base/utils.js';
4
4
  import type { IBaseOrdersEntity, ICreateOrderPreview, ICreateRefundRequest, IOrderByMarkerEntity, IOrderData, IOrderPreviewResponse, IOrdersApi, IOrdersByMarkerEntity, IOrdersEntity, IOrderStatus, IOrdersVectorSearch, IRefundRequest } from './ordersInterfaces.js';
5
5
  /**
6
6
  * Controllers for working with orders.
@@ -204,13 +204,13 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
204
204
  * @param {string} [langCode] - Language code. Default: "en_US".
205
205
  * @param {number} [offset] - Parameter for pagination. Default: 0.
206
206
  * @param {number} [limit] - Parameter for pagination. Default: 30.
207
- * @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with an array of found orders and total count.
207
+ * @returns {Promise<IVectorSearchResponse<IOrdersByMarkerEntity> | IError>} Returns an object with an array of found orders and total count.
208
208
  * @throws {IError} When isShell=false and an error occurs during the fetch
209
209
  * @description This method performs a semantic (vector) search over the orders of the authorized user. It requires user authorization.
210
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
211
  * @see {@link https://js-sdk.oneentry.cloud/docs/orders/getOrdersByVectorSearch getOrdersByVectorSearch} documentation.
212
212
  */
213
- getOrdersByVectorSearch(body: IOrdersVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
213
+ getOrdersByVectorSearch(body: IOrdersVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IOrdersByMarkerEntity> | IError>;
214
214
  /**
215
215
  * Runs a fetch against the `/orders` base URL instead of the default
216
216
  * `/orders-storage`, then restores the original URL.
@@ -224,4 +224,17 @@ export default class OrdersApi extends AsyncModules implements IOrdersApi {
224
224
  * @template T
225
225
  */
226
226
  private _withOrdersUrl;
227
+ /**
228
+ * Builds the order body the API expects: `formData` wrapped in a map keyed by locale.
229
+ *
230
+ * The wrapping is done on a copy. Writing it back into the caller's object made
231
+ * a reused body — a retry, a shared template — arrive wrapped twice: `createOrder`
232
+ * answered `400 formData's marker '#0' marker is required`, and
233
+ * `updateOrderByMarkerAndId` answered `200` and stored the broken `formData` in
234
+ * the order (CMS-1063).
235
+ * @param {IOrderData} body - Order body as the caller passed it. Left unchanged.
236
+ * @param {string} langCode - Locale key to wrap `formData` into.
237
+ * @returns {object} A new body with `formData` as `{ [langCode]: [...] }`.
238
+ */
239
+ private _wrapOrderFormData;
227
240
  }
@@ -149,13 +149,7 @@ export default class OrdersApi extends AsyncModules {
149
149
  * @see {@link https://js-sdk.oneentry.cloud/docs/orders/createOrder createOrder} documentation.
150
150
  */
151
151
  async createOrder(marker, body, langCode = this.state.lang) {
152
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
153
- const formData = {};
154
- formData[langCode] = Array.isArray(body.formData)
155
- ? body.formData
156
- : [body.formData];
157
- body.formData = formData;
158
- const result = await this._fetchPost(`/marker/${marker}/orders`, body);
152
+ const result = await this._fetchPost(`/marker/${marker}/orders`, this._wrapOrderFormData(body, langCode));
159
153
  // Validate response if validation is enabled
160
154
  const validated = await this._validateResponse(result, schema('CreateOrderResponseSchema'));
161
155
  return this._normalizeData(validated);
@@ -191,13 +185,7 @@ export default class OrdersApi extends AsyncModules {
191
185
  * @see {@link https://js-sdk.oneentry.cloud/docs/orders/updateOrderByMarkerAndId updateOrderByMarkerAndId} documentation.
192
186
  */
193
187
  async updateOrderByMarkerAndId(marker, id, body, langCode = this.state.lang) {
194
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
195
- const formData = {};
196
- formData[langCode] = Array.isArray(body.formData)
197
- ? body.formData
198
- : [body.formData];
199
- body.formData = formData;
200
- const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, body);
188
+ const result = await this._fetchPut(`/marker/${marker}/orders/${id}?langCode=${langCode}`, this._wrapOrderFormData(body, langCode));
201
189
  // Validate response if validation is enabled
202
190
  const validated = await this._validateResponse(result, schema('UpdateOrderResponseSchema'));
203
191
  return this._normalizeData(validated);
@@ -267,7 +255,7 @@ export default class OrdersApi extends AsyncModules {
267
255
  * @param {string} [langCode] - Language code. Default: "en_US".
268
256
  * @param {number} [offset] - Parameter for pagination. Default: 0.
269
257
  * @param {number} [limit] - Parameter for pagination. Default: 30.
270
- * @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with an array of found orders and total count.
258
+ * @returns {Promise<IVectorSearchResponse<IOrdersByMarkerEntity> | IError>} Returns an object with an array of found orders and total count.
271
259
  * @throws {IError} When isShell=false and an error occurs during the fetch
272
260
  * @description This method performs a semantic (vector) search over the orders of the authorized user. It requires user authorization.
273
261
  * @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}.
@@ -304,4 +292,26 @@ export default class OrdersApi extends AsyncModules {
304
292
  this._url = savedUrl;
305
293
  }
306
294
  }
295
+ /**
296
+ * Builds the order body the API expects: `formData` wrapped in a map keyed by locale.
297
+ *
298
+ * The wrapping is done on a copy. Writing it back into the caller's object made
299
+ * a reused body — a retry, a shared template — arrive wrapped twice: `createOrder`
300
+ * answered `400 formData's marker '#0' marker is required`, and
301
+ * `updateOrderByMarkerAndId` answered `200` and stored the broken `formData` in
302
+ * the order (CMS-1063).
303
+ * @param {IOrderData} body - Order body as the caller passed it. Left unchanged.
304
+ * @param {string} langCode - Locale key to wrap `formData` into.
305
+ * @returns {object} A new body with `formData` as `{ [langCode]: [...] }`.
306
+ */
307
+ _wrapOrderFormData(body, langCode) {
308
+ return {
309
+ ...body,
310
+ formData: {
311
+ [langCode]: Array.isArray(body.formData)
312
+ ? body.formData
313
+ : [body.formData],
314
+ },
315
+ };
316
+ }
307
317
  }
@@ -1,4 +1,4 @@
1
- import type { IError, ILocalizeInfo } from '../base/utils.js';
1
+ import type { IError, ILocalizeInfo, IVectorSearchResponse } from '../base/utils.js';
2
2
  /**
3
3
  * @interface IOrdersApi
4
4
  * @description Represents the API for managing orders in the order storage.
@@ -176,10 +176,10 @@ interface IOrdersApi {
176
176
  * @param {string} [langCode] - Language code. Default: "en_US".
177
177
  * @param {number} [offset] - Parameter for pagination. Default: 0.
178
178
  * @param {number} [limit] - Parameter for pagination. Default: 30.
179
- * @returns {Promise<IOrdersByMarkerEntity | IError>} Returns an object with an array of found orders and total count.
179
+ * @returns {Promise<IVectorSearchResponse<IOrdersByMarkerEntity> | IError>} Returns an object with an array of found orders and total count.
180
180
  * @throws {IError} When isShell=false and an error occurs during the fetch
181
181
  */
182
- getOrdersByVectorSearch(body: IOrdersVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IOrdersByMarkerEntity | IError>;
182
+ getOrdersByVectorSearch(body: IOrdersVectorSearch, langCode?: string, offset?: number, limit?: number): Promise<IVectorSearchResponse<IOrdersByMarkerEntity> | IError>;
183
183
  }
184
184
  /**
185
185
  * Body for semantic (vector) order search.