oneentry 1.0.175 → 1.0.177
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 +12 -5
- package/changelog.md +140 -0
- package/dist/admins/adminsApi.js +2 -9
- package/dist/admins/adminsInterfaces.d.ts +5 -5
- package/dist/admins/adminsSchemas.d.ts +4 -4
- package/dist/admins/adminsSchemas.js +2 -2
- package/dist/attribute-sets/attributeSetsApi.d.ts +1 -1
- package/dist/attribute-sets/attributeSetsApi.js +4 -4
- package/dist/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
- package/dist/attribute-sets/attributeSetsSchemas.d.ts +8 -6
- package/dist/attribute-sets/attributeSetsSchemas.js +6 -9
- package/dist/auth-provider/authProviderApi.d.ts +4 -4
- package/dist/auth-provider/authProviderApi.js +96 -29
- package/dist/auth-provider/authProviderSchemas.d.ts +1 -0
- package/dist/auth-provider/authProviderSchemas.js +1 -0
- package/dist/auth-provider/authProvidersInterfaces.d.ts +8 -6
- package/dist/base/asyncModules.d.ts +73 -1
- package/dist/base/asyncModules.js +233 -37
- package/dist/base/stateModule.d.ts +2 -0
- package/dist/base/stateModule.js +22 -12
- package/dist/base/syncModules.d.ts +18 -10
- package/dist/base/syncModules.js +100 -29
- package/dist/base/utils.d.ts +26 -21
- package/dist/base/validation.d.ts +3 -3
- package/dist/base/validation.js +6 -7
- package/dist/blocks/blocksApi.d.ts +20 -17
- package/dist/blocks/blocksApi.js +101 -74
- package/dist/blocks/blocksInterfaces.d.ts +8 -8
- package/dist/discounts/discountsApi.d.ts +9 -7
- package/dist/discounts/discountsApi.js +18 -14
- package/dist/discounts/discountsInterfaces.d.ts +14 -10
- package/dist/events/eventsApi.d.ts +3 -3
- package/dist/events/eventsApi.js +7 -7
- package/dist/events/eventsInterfaces.d.ts +10 -14
- package/dist/file-uploading/fileUploadingApi.d.ts +4 -4
- package/dist/file-uploading/fileUploadingApi.js +13 -5
- package/dist/file-uploading/fileUploadingInterfaces.d.ts +5 -6
- package/dist/filters/filtersApi.js +2 -2
- package/dist/forms/formsApi.js +2 -2
- package/dist/forms/formsInterfaces.d.ts +1 -3
- package/dist/forms/formsSchemas.d.ts +3 -6
- package/dist/forms/formsSchemas.js +2 -4
- package/dist/forms-data/formsDataApi.d.ts +26 -8
- package/dist/forms-data/formsDataApi.js +45 -14
- package/dist/forms-data/formsDataInterfaces.d.ts +91 -66
- package/dist/general-types/generalTypesInterfaces.d.ts +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.js +50 -7
- package/dist/integration-collections/integrationCollectionsApi.d.ts +15 -4
- package/dist/integration-collections/integrationCollectionsApi.js +42 -14
- package/dist/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
- package/dist/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
- package/dist/integration-collections/integrationCollectionsSchemas.js +0 -1
- package/dist/menus/menusApi.js +1 -1
- package/dist/orders/ordersApi.d.ts +1 -13
- package/dist/orders/ordersApi.js +24 -44
- package/dist/orders/ordersInterfaces.d.ts +21 -14
- package/dist/pages/pagesApi.d.ts +6 -5
- package/dist/pages/pagesApi.js +44 -31
- package/dist/pages/pagesInterfaces.d.ts +18 -15
- package/dist/pages/pagesSchemas.d.ts +0 -3
- package/dist/pages/pagesSchemas.js +0 -1
- package/dist/payments/paymentsApi.d.ts +10 -11
- package/dist/payments/paymentsApi.js +22 -18
- package/dist/payments/paymentsInterfaces.d.ts +12 -14
- package/dist/payments/paymentsSchemas.d.ts +21 -20
- package/dist/payments/paymentsSchemas.js +5 -8
- package/dist/product-statuses/productStatusesApi.d.ts +1 -1
- package/dist/product-statuses/productStatusesApi.js +4 -4
- package/dist/product-statuses/productStatusesInterfaces.d.ts +1 -4
- package/dist/products/productsApi.d.ts +38 -58
- package/dist/products/productsApi.js +59 -72
- package/dist/products/productsInterfaces.d.ts +48 -85
- package/dist/search/searchApi.d.ts +1 -1
- package/dist/search/searchApi.js +4 -3
- package/dist/sitemap/sitemapInterfaces.d.ts +10 -6
- package/dist/subscriptions/subscriptionsApi.d.ts +1 -1
- package/dist/subscriptions/subscriptionsApi.js +1 -1
- package/dist/subscriptions/subscriptionsInterfaces.d.ts +1 -1
- package/dist/system/systemApi.d.ts +2 -0
- package/dist/system/systemApi.js +2 -0
- package/dist/system/systemInterfaces.d.ts +2 -0
- package/dist/templates/templatesApi.d.ts +2 -2
- package/dist/templates/templatesApi.js +12 -11
- package/dist/templates/templatesInterfaces.d.ts +2 -2
- package/dist/templates-preview/templatesPreviewApi.js +2 -2
- package/dist/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
- package/dist/templates-preview/templatesPreviewSchemas.d.ts +7 -0
- package/dist/templates-preview/templatesPreviewSchemas.js +2 -0
- package/dist/user-groups/userGroupsApi.js +5 -5
- package/dist/user-groups/userGroupsSchemas.d.ts +4 -4
- package/dist/users/usersApi.d.ts +1 -1
- package/dist/users/usersApi.js +28 -15
- package/dist/users/usersInterfaces.d.ts +2 -9
- package/dist/web-socket/lazySocket.d.ts +6 -5
- package/dist/web-socket/lazySocket.js +212 -15
- package/dist/web-socket/wsApi.d.ts +7 -4
- package/dist/web-socket/wsApi.js +49 -12
- package/dist/web-socket/wsInterfaces.d.ts +41 -4
- package/esm/admins/adminsApi.js +2 -9
- package/esm/admins/adminsInterfaces.d.ts +5 -5
- package/esm/admins/adminsSchemas.d.ts +4 -4
- package/esm/admins/adminsSchemas.js +2 -2
- package/esm/attribute-sets/attributeSetsApi.d.ts +1 -1
- package/esm/attribute-sets/attributeSetsApi.js +4 -4
- package/esm/attribute-sets/attributeSetsInterfaces.d.ts +65 -14
- package/esm/attribute-sets/attributeSetsSchemas.d.ts +8 -6
- package/esm/attribute-sets/attributeSetsSchemas.js +6 -9
- package/esm/auth-provider/authProviderApi.d.ts +4 -4
- package/esm/auth-provider/authProviderApi.js +96 -29
- package/esm/auth-provider/authProviderSchemas.d.ts +1 -0
- package/esm/auth-provider/authProviderSchemas.js +1 -0
- package/esm/auth-provider/authProvidersInterfaces.d.ts +8 -6
- package/esm/base/asyncModules.d.ts +73 -1
- package/esm/base/asyncModules.js +233 -37
- package/esm/base/stateModule.d.ts +2 -0
- package/esm/base/stateModule.js +22 -12
- package/esm/base/syncModules.d.ts +18 -10
- package/esm/base/syncModules.js +99 -29
- package/esm/base/utils.d.ts +26 -21
- package/esm/base/validation.d.ts +3 -3
- package/esm/base/validation.js +6 -7
- package/esm/blocks/blocksApi.d.ts +20 -17
- package/esm/blocks/blocksApi.js +101 -74
- package/esm/blocks/blocksInterfaces.d.ts +8 -8
- package/esm/discounts/discountsApi.d.ts +9 -7
- package/esm/discounts/discountsApi.js +18 -14
- package/esm/discounts/discountsInterfaces.d.ts +14 -10
- package/esm/events/eventsApi.d.ts +3 -3
- package/esm/events/eventsApi.js +7 -7
- package/esm/events/eventsInterfaces.d.ts +10 -14
- package/esm/file-uploading/fileUploadingApi.d.ts +4 -4
- package/esm/file-uploading/fileUploadingApi.js +13 -5
- package/esm/file-uploading/fileUploadingInterfaces.d.ts +5 -6
- package/esm/filters/filtersApi.js +2 -2
- package/esm/forms/formsApi.js +2 -2
- package/esm/forms/formsInterfaces.d.ts +1 -3
- package/esm/forms/formsSchemas.d.ts +3 -6
- package/esm/forms/formsSchemas.js +2 -4
- package/esm/forms-data/formsDataApi.d.ts +26 -8
- package/esm/forms-data/formsDataApi.js +45 -14
- package/esm/forms-data/formsDataInterfaces.d.ts +91 -66
- package/esm/general-types/generalTypesInterfaces.d.ts +1 -1
- package/esm/index.d.ts +7 -6
- package/esm/index.js +50 -7
- package/esm/integration-collections/integrationCollectionsApi.d.ts +15 -4
- package/esm/integration-collections/integrationCollectionsApi.js +42 -14
- package/esm/integration-collections/integrationCollectionsInterfaces.d.ts +8 -9
- package/esm/integration-collections/integrationCollectionsSchemas.d.ts +0 -2
- package/esm/integration-collections/integrationCollectionsSchemas.js +0 -1
- package/esm/menus/menusApi.js +1 -1
- package/esm/orders/ordersApi.d.ts +1 -13
- package/esm/orders/ordersApi.js +24 -44
- package/esm/orders/ordersInterfaces.d.ts +21 -14
- package/esm/pages/pagesApi.d.ts +6 -5
- package/esm/pages/pagesApi.js +44 -31
- package/esm/pages/pagesInterfaces.d.ts +18 -15
- package/esm/pages/pagesSchemas.d.ts +0 -3
- package/esm/pages/pagesSchemas.js +0 -1
- package/esm/payments/paymentsApi.d.ts +10 -11
- package/esm/payments/paymentsApi.js +22 -18
- package/esm/payments/paymentsInterfaces.d.ts +12 -14
- package/esm/payments/paymentsSchemas.d.ts +21 -20
- package/esm/payments/paymentsSchemas.js +5 -8
- package/esm/product-statuses/productStatusesApi.d.ts +1 -1
- package/esm/product-statuses/productStatusesApi.js +4 -4
- package/esm/product-statuses/productStatusesInterfaces.d.ts +1 -4
- package/esm/products/productsApi.d.ts +38 -58
- package/esm/products/productsApi.js +59 -72
- package/esm/products/productsInterfaces.d.ts +48 -85
- package/esm/search/searchApi.d.ts +1 -1
- package/esm/search/searchApi.js +4 -3
- package/esm/sitemap/sitemapInterfaces.d.ts +10 -6
- package/esm/subscriptions/subscriptionsApi.d.ts +1 -1
- package/esm/subscriptions/subscriptionsApi.js +1 -1
- package/esm/subscriptions/subscriptionsInterfaces.d.ts +1 -1
- package/esm/system/systemApi.d.ts +2 -0
- package/esm/system/systemApi.js +2 -0
- package/esm/system/systemInterfaces.d.ts +2 -0
- package/esm/templates/templatesApi.d.ts +2 -2
- package/esm/templates/templatesApi.js +11 -10
- package/esm/templates/templatesInterfaces.d.ts +2 -2
- package/esm/templates-preview/templatesPreviewApi.js +2 -2
- package/esm/templates-preview/templatesPreviewInterfaces.d.ts +23 -13
- package/esm/templates-preview/templatesPreviewSchemas.d.ts +7 -0
- package/esm/templates-preview/templatesPreviewSchemas.js +2 -0
- package/esm/user-groups/userGroupsApi.js +5 -5
- package/esm/user-groups/userGroupsSchemas.d.ts +4 -4
- package/esm/users/usersApi.d.ts +1 -1
- package/esm/users/usersApi.js +28 -15
- package/esm/users/usersInterfaces.d.ts +2 -9
- package/esm/web-socket/lazySocket.d.ts +6 -5
- package/esm/web-socket/lazySocket.js +212 -15
- package/esm/web-socket/wsApi.d.ts +7 -4
- package/esm/web-socket/wsApi.js +49 -12
- package/esm/web-socket/wsInterfaces.d.ts +41 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ const api = defineOneEntry('your-url', config)
|
|
|
86
86
|
|
|
87
87
|
The second parameter of the constructor takes the 'config'. It contains the following values:
|
|
88
88
|
|
|
89
|
-
- 'token' -
|
|
89
|
+
- 'token' - The app token of your project ("Security API Token"). Required in every setup: `defineOneEntry` throws without it, certificate protection included. You can read more about the security of your project [here](https://oneentry.cloud/instructions).
|
|
90
90
|
|
|
91
91
|
- 'langCode' - Set the "langCode" to set the default language. By specifying this parameter once, you don't have to pass the langCode to the methods ONEENTRY API. If you have not passed the default language, it will be set "en_US".
|
|
92
92
|
|
|
@@ -130,6 +130,7 @@ An example of a configuration that is protected with a certificate allows you to
|
|
|
130
130
|
|
|
131
131
|
```js
|
|
132
132
|
const api = defineOneEntry('https://my-project.oneentry.cloud', {
|
|
133
|
+
token: 'my-token',
|
|
133
134
|
langCode: 'en_US',
|
|
134
135
|
traficLimit: true,
|
|
135
136
|
auth: {
|
|
@@ -148,7 +149,7 @@ This method (setAccessToken) should not be called if the method does not require
|
|
|
148
149
|
const user = api.Users.setAccessToken('my.access.token').getUser()
|
|
149
150
|
```
|
|
150
151
|
|
|
151
|
-
>
|
|
152
|
+
> The token is required: pass your project's app token in every setup.
|
|
152
153
|
|
|
153
154
|
You can get a token as follows
|
|
154
155
|
|
|
@@ -159,7 +160,7 @@ You can get a token as follows
|
|
|
159
160
|
5. Log in to the project, go to the settings section and open the token tab
|
|
160
161
|
6. Get and copy the token of your project
|
|
161
162
|
|
|
162
|
-
You can also connect a tls certificate to protect your project
|
|
163
|
+
You can also connect a tls certificate to protect your project; the "token" is still required. When using the certificate, set up a proxy in your project and pass its URL as the url parameter — an absolute URL, or in the browser a path on your site such as `/oneentry`.
|
|
163
164
|
[Learn more about security](https://oneentry.cloud/instructions)
|
|
164
165
|
|
|
165
166
|
```js
|
|
@@ -179,6 +180,8 @@ const api = defineOneEntry('your-url', {
|
|
|
179
180
|
})
|
|
180
181
|
```
|
|
181
182
|
|
|
183
|
+
> **Server-side rendering.** A client holds one session: after `AuthProvider.auth` (or with `auth.refreshToken`) every call of that client is made as that user. On a server, never sign in on a client shared between requests — the next visitor gets the previous one's profile and cart. Create a client per request for user calls (and pass `guestId` per visitor). A refresh token is bound to the device metadata it was issued with: store `getDeviceMetadata()` next to it and pass it back as `deviceMetadata`.
|
|
184
|
+
|
|
182
185
|
## TypeScript Types
|
|
183
186
|
|
|
184
187
|
All public interfaces and types are re-exported from the package root, so deep paths are not needed:
|
|
@@ -203,7 +206,9 @@ OneEntry SDK supports optional validation of API responses using Zod. This featu
|
|
|
203
206
|
|
|
204
207
|
Zod and the response schemas are loaded on demand, the first time a response actually has to be validated. Leaving validation off — the default — keeps them out of the code your app loads. Socket.io is deferred the same way, until the first `WS.connect()`.
|
|
205
208
|
|
|
206
|
-
Together that means a project
|
|
209
|
+
Together that means a project importing `defineOneEntry` from the ESM build loads about **58 kB minified (12 kB gzip)** (esbuild, 1.0.177) instead of hundreds of kilobytes, with Zod, the schemas and Socket.io landing in chunks that are never requested. This holds for the ESM build only: a bundler that resolves the CommonJS build (`require('oneentry')`) cannot split the deferred `require` calls and bundles Zod and Socket.io as well. `defineOneEntry` creates every module, so all of them are in the bundle; tree-shaking (`sideEffects: false`) drops only the helpers you do not import (`isFileAttribute`, `expandTimeIntervals`, …).
|
|
210
|
+
|
|
211
|
+
TypeScript 5.0 or later is required for the type definitions (Zod 4 types do not parse on 4.x).
|
|
207
212
|
|
|
208
213
|
### Attribute Values
|
|
209
214
|
|
|
@@ -214,6 +219,7 @@ import { defineOneEntry, getAttributeFile, getAttributeFiles } from 'oneentry'
|
|
|
214
219
|
|
|
215
220
|
const { Pages } = defineOneEntry('your-url', { token: 'your-app-token' })
|
|
216
221
|
const page = await Pages.getPageByUrl('catalog')
|
|
222
|
+
if ('statusCode' in page) throw new Error(page.message) // IError — see Errors
|
|
217
223
|
|
|
218
224
|
// Same call whether the attribute holds one file or a gallery.
|
|
219
225
|
const images = getAttributeFiles(page.attributeValues.gallery) // IAttributeFile[]
|
|
@@ -232,6 +238,7 @@ import { defineOneEntry, expandAttributeTimeIntervals } from 'oneentry'
|
|
|
232
238
|
|
|
233
239
|
const { Pages } = defineOneEntry('your-url', { token: 'your-app-token' })
|
|
234
240
|
const page = await Pages.getPageByUrl('booking')
|
|
241
|
+
if ('statusCode' in page) throw new Error(page.message) // IError — see Errors
|
|
235
242
|
|
|
236
243
|
const slots = expandAttributeTimeIntervals(page.attributeValues.interval, {
|
|
237
244
|
from: '2025-04-01',
|
|
@@ -307,5 +314,5 @@ Now you can use the following links to jump to specific entries documentation:
|
|
|
307
314
|
- [UserActivity](https://js-sdk.oneentry.cloud/docs/category/useractivity)
|
|
308
315
|
- [UserGroups](https://js-sdk.oneentry.cloud/docs/category/usergroups)
|
|
309
316
|
- [Users](https://js-sdk.oneentry.cloud/docs/category/users-1)
|
|
310
|
-
- [WS](https://js-sdk.oneentry.cloud/docs/category/
|
|
317
|
+
- [WS](https://js-sdk.oneentry.cloud/docs/category/ws)
|
|
311
318
|
- [Advanced examples](https://js-sdk.oneentry.cloud/docs/category/usage-examples)
|
package/changelog.md
CHANGED
|
@@ -1,5 +1,145 @@
|
|
|
1
1
|
# SDK Change Log
|
|
2
2
|
|
|
3
|
+
## v.1.0.177
|
|
4
|
+
|
|
5
|
+
### What's Changed
|
|
6
|
+
|
|
7
|
+
- **`Products.getProductBlockById(id, langCode?)` takes a language** (CMS-1151). It sent no `langCode` and unwrapped the answer by the client's language, so with a client on another language `localizeInfos` and `attributeValues` of the blocks stayed keyed by locale.
|
|
8
|
+
- **`IOrderProducts.previewImage` is `IPicture | IPicture[] | null`**: a product without a preview comes as `[]`, not `null` (CMS-1113).
|
|
9
|
+
- **`IntegrationCollections.getICollectionRowsByMarker(marker, langCode?, userQuery?)` pages its answer** (CMS-1163). Without paging the endpoint returns the first 30 rows only (`total: 214` on the test project); `userQuery` takes the same `limit`, `offset`, `entityType`, `entityId` as `getICollectionRowsById`.
|
|
10
|
+
- **`ICollectionFormData.value` is `string | number | null`** (CMS-1163): on reading, `integer`/`float`/`real` fields come back as numbers, and as `null` when the stored value is not a number — the type said `string`.
|
|
11
|
+
- **`Discounts.getBonusHistory` takes `offset` and `limit`** as its last two arguments (CMS-1130): the endpoint pages and validates them, the SDK could not pass them.
|
|
12
|
+
- **AttributesSets types** (CMS-1166, CMS-1126): `IAttributesSets` declares all four methods (`getAttributes` and `getAttributeSetByMarker` were missing); `IAttributeSchemaItem` declares the sign-up and notification flags, `isProductPreview` and `previewTemplateId`; `additionalFields` of an attribute and of a schema item is `Record<string, IAttributeAdditionalField>` (`{ type, value }`), not a nested attribute; `IAttributesSetsEntity.multiselect` is declared and kept by validation — the schema used to drop it.
|
|
13
|
+
- **`Payments.getSessionByOrderId` returns `ISessionEntity[] | IError`** (CMS-1171): the answer is always an array (`[]` for an order without sessions); the type allowed a single object. `Payments.getAccounts(langCode?)` and `getAccountById(id, langCode?)` take a language (CMS-1114).
|
|
14
|
+
- **`FileUploading.getFile` returns `Promise<Response>`** (CMS-1175): it always resolved to the raw `Response` — also on a `404` — and never returned an `IError`; check `response.ok`.
|
|
15
|
+
- **`IError.pageData` is optional**: the errors of the subscriptions module and of `/files/search` come without it (CMS-1178, CMS-1177). Reading `error.pageData` still compiles.
|
|
16
|
+
- **`ISignUpEntity.oauthSub`** is declared and kept by validation (CMS-1123).
|
|
17
|
+
- **Validation no longer changes the answer** (CMS-1186). With `validation.enabled` the SDK returned the object Zod had parsed, and `z.object` drops keys the schema does not describe — in strict and in non-strict mode alike, while non-strict promised the original data. A field the platform added (`weight` of a template preview proportion, `proportions.default.default`, any new field) vanished as soon as validation was on. The original object is returned now; validation only decides between it and the `422` error.
|
|
18
|
+
- **`IAdminEntity.formModuleConfigs`** replaces `moduleFormConfigs` — the API key is `formModuleConfigs` (CMS-1132); a type-only change, the API never sent `moduleFormConfigs`. `isSync` of an admin tells whether it has attribute data in the requested language.
|
|
19
|
+
- **`IProportion.weight` and `ITemplatesPreviewProportionVariants.default`** are declared (CMS-1132).
|
|
20
|
+
- **`ISitemapQuery.baseUrls` is required** (CMS-1132, CMS-1100): without it the API generates nothing and answers `502`; `url`, `lastmod`, `changefreq` and `priority` are deprecated — the API ignores them.
|
|
21
|
+
|
|
22
|
+
- **`WS.connect()` returns `Socket<IWsServerEvents>`** (CMS-1196): the `notification` payload is typed `IWsNotification` (`message`, `type`, `attributes`; other fields `unknown`); other event names stay untyped. `IWsNotification`, `IWsNotificationAttribute` and `IWsServerEvents` are exported.
|
|
23
|
+
- **`isShell: false` throws an `IError` for a request that got no answer** (CMS-1192): a dropped connection used to escape as a raw `TypeError`; it is now `{ statusCode: 0, message, … }` with the original error in `cause`.
|
|
24
|
+
- **An exception from an `errors.customErrors` handler reaches the caller** (CMS-1192), and an async handler is awaited. With `isShell: true` the exception (Next.js `redirect()`/`notFound()`) was swallowed into `{ statusCode: 0 }`.
|
|
25
|
+
- **An unset `image`/`groupOfImages`/`file`/`timeInterval`/`date`/`dateTime`/`time` attribute is `null`** (CMS-1198): the API sends `""`, which the SDK kept, so `isFileAttribute` was `false` on an empty image. An entity attribute without a `value` key gets `null` again (1.0.177 left it without the key); form fields and attribute-set schemas still get no key.
|
|
26
|
+
- **The project URL is normalized** (CMS-1194): trailing `/` and a copied `/api/content` are cut (every call answered `404`), a URL without `http://`/`https://` throws at `defineOneEntry`. `langCode: ''` counts as not set (`en_US`); `validation.strictMode` without `validation.enabled` warns.
|
|
27
|
+
- **JSDoc of `IConfig`** (CMS-1194, CMS-1191): `auth.*` have their real types; `validation.*`, `errors.isShell`, `errors.customErrors` (supported codes) and the `langCode` default are described; `auth.refreshToken` explains that on the server the `deviceMetadata` saved with the token must be passed back.
|
|
28
|
+
|
|
29
|
+
- **Public types** (CMS-1204): `IDefineApi` and 13 types used in fields of public interfaces (`IProductPriceRange`, `IProductPageRef`, `ICollectionFormData`, `IOrderProductsData`, `ISubscriptionItem`, …) are exported; `setAccessToken`/`setRefreshToken`/`setGuestId`/`setDeviceMetadata` return the module (`this`), not `any`; `auth.refreshToken` accepts `null` (`localStorage.getItem`); a `customErrors` handler gets a required `IError`.
|
|
30
|
+
- **The project URL may be a proxy path** (`/oneentry`); a URL with a query or fragment throws at `defineOneEntry` (CMS-1194).
|
|
31
|
+
- **Docs** (CMS-1203, CMS-1204): a client holds one user's session — on a server create one per request for user calls (README, manual, JSDoc of `defineOneEntry`); `guestId` must be a UUID v4; product counts do not depend on the language (CMS-1201); `getProductsByStatusMarker` returns the status, not products; README bundle size corrected (ESM ~58 kB / 12 kB gzip, the CommonJS build bundles Zod and Socket.io), TypeScript 5.0+ required.
|
|
32
|
+
|
|
33
|
+
- **`IConfig.token` is required** in the type (CMS-1132): `defineOneEntry` already threw without it, while the type let it compile.
|
|
34
|
+
- **A browser guest id is always a UUID v4** (CMS-1120): without `crypto.randomUUID` (a page over plain http) the SDK generated a base-36 id, which the platform silently replaces on every request — the guest cart was lost; a stored non-UUID guest id is replaced.
|
|
35
|
+
|
|
36
|
+
- **`IOrderProducts.title` is `string | null`** (CMS-1206): a product without a translation in the order's language comes with `title: null`.
|
|
37
|
+
- **A guest id that is not a UUID v4 is reported** (CMS-1120): `config.guestId` / `setGuestId` warn — the platform replaces any other value on every request.
|
|
38
|
+
|
|
39
|
+
- **A payment session may have no order** (CMS-1070, CMS-1092): `ISessionEntity.orderId` is `number | null` — `subscribe` now creates a payment session, and it is not linked to an order. `getSessionByOrderId` gives `[]` for an order of another user.
|
|
40
|
+
- **`IAdminEntity.identifier` is optional**: it was the admin's sign-in login, and the Content API no longer sends it (CMS-1053).
|
|
41
|
+
- **`System.test404` and `System.test500` are deprecated**: the platform removed both endpoints, they answer `404 "Cannot GET …"` (CMS-1056).
|
|
42
|
+
- **`BlockType` `'service'`**: the `type` filter of `getBlocks` and `getTemplateByType` takes it now; the note about a platform defect is gone (CMS-1073).
|
|
43
|
+
|
|
44
|
+
### What's Fixed
|
|
45
|
+
|
|
46
|
+
- **Schemas match the interfaces** (CMS-1206): `updateUser` in strict mode turned a successful empty answer into a `422`; `getActiveSessionsByMarker` is validated; `menuTitle: null` passes; attribute `listTitles`/`validators`/`additionalFields` and form `attributes` are required as in the types.
|
|
47
|
+
- **`postFormsData` does not send a form whose file upload failed** (CMS-1192): the upload error went to the platform as the field's value and the caller got a success.
|
|
48
|
+
- **Round 11 follow-ups**: `logout` retries with the current token itself instead of rewriting the retried body (a concurrent refresh left the session alive, and a form field equal to the token was rewritten too); `logout` and `WS.connect` respect the refresh block after a metadata rejection; `https:evil.example` (no `//`) is rejected; a site-root proxy opens the socket at the site root; only a UUID v4 stored guest id is kept; an empty or blank platform `message` becomes `HTTP <status>`; `active` follows the last queued `connect`/`disconnect`; README: `token` is required with a certificate too; broken `@see` links removed, README WS link fixed.
|
|
49
|
+
- **The project URL is checked strictly** (CMS-1194): a backslash "proxy path" (`/\evil.example`) passed, and browsers sent every request with the app token to that host; credentials in the URL are rejected; `/` and `/api/content` mean the site itself.
|
|
50
|
+
- **More follow-ups** (probe of 2026-10-30): a `401` retry of `logout` sends the rotated refresh token in its body, so `logout` mid-session works with `isShell: false` too and fires no `customErrors[400]`; `customErrors` is not called for the SDK's own sub-requests (page block products, page templates); a refresh rejected for its device metadata is not retried with the same metadata; `logoutAll`, `activateUser`, `changePassword`, `deleteFormsDataByid` read an empty 2xx as `true`; `""` → `null` applies to entity values only (form data of orders and users keeps `""`); a non-string `langCode` falls back to `en_US`; an empty server `message` falls back to `HTTP <status>`; a restored session refreshes before opening the socket (it connected as a guest); before Socket.io loads `off()` removes every listener and `active` turns false after a queued `disconnect()`.
|
|
51
|
+
- **Pages keep errors out of their data** (CMS-1110, CMS-1200): a failed products request of a page block left the error object in `products`/`similarProducts` (now `[]` / `{ items: [], total: 0 }`), a failed template request left it in `page.template` (now no `template`).
|
|
52
|
+
- **No request depends on `FormData`/`Blob`** (CMS-1204): without these globals every call, a GET included, threw `TypeError`.
|
|
53
|
+
- **Follow-ups of this version's fixes** (probe of 2026-10-30): `logout` mid-session retries with the token the 401 refresh rotated; a `400` about `x-device-metadata` keeps the refresh token; the refresh timeout works without `AbortSignal.timeout`; a failing answer keeps the server's `message`; `logout`/`checkCode` read an empty 2xx as `true`; a locale map left by a missing translation gets no `value: null`; unset `list`/`radioButton`/`entity` are `null`; `langCode` of spaces falls back to `en_US`; the socket sends the current token on a manual `connect()` too, and before Socket.io loads `off` is honoured by `hasListeners`, `timeout().emitWithAck()` keeps its timeout, `'on' in socket` is `true`.
|
|
54
|
+
- **The saved session** (CMS-1191):
|
|
55
|
+
- `AuthProvider.refresh(marker, token)` sends the token it was given once — on a restored session it first refreshed on its own, rotated that very token and answered `400`;
|
|
56
|
+
- `AuthProvider.logout(marker, token)` of a restored session logs out with the rotated token — it answered `400` and the session stayed alive;
|
|
57
|
+
- a refresh token rejected with `400` is dropped — each following request fired the same refresh first;
|
|
58
|
+
- the automatic refresh uses the provider of `auth`/`oauth`/`refresh`, not only `auth.providerMarker`;
|
|
59
|
+
- a refresh that does not answer within 30 s counts as failed — it held every request of the client.
|
|
60
|
+
- **A failing answer is an `IError`** (CMS-1192): a non-OK response whose body is not the platform error (`{"error":…}`, `[]`, `null` from a gateway) was returned as data — `subscribeByMarker` reported a `503` as `true`.
|
|
61
|
+
- **`attributeValues: null` / `attributes: null` no longer throw** past `isShell` (CMS-1193): one such record took down a whole list.
|
|
62
|
+
- **`getPageById`, `getUserGroupById` encode the id, `offset`/`limit` are encoded in the query** (CMS-1150): `getPageById('../menus/marker/main_menu')` returned a menu as a page.
|
|
63
|
+
- **WebSocket** (CMS-1121, CMS-1195, CMS-1196):
|
|
64
|
+
- the socket sends `x-device-metadata` — without it the platform registered every SDK socket as a guest, so personal notifications never arrived; the current token is sent on every reconnection (it kept the first one), a guest sends no `Bearer undefined`, and the token also goes in the handshake `auth` (browsers drop headers; the platform does not read it yet — CMS-1197);
|
|
65
|
+
- a path in the project URL is part of the socket path — it was read as a namespace (`Invalid namespace`);
|
|
66
|
+
- the stand-in returned before Socket.io loads: `JSON.stringify(socket)` no longer breaks the replay and loses the listeners, `emitWithAck` returns a Promise, `hasListeners`/`listeners` answer, `socket.io.on(…)` and `volatile` are queued, assignments (`socket.auth = …`) are applied, a failed load reaches `connect_error`.
|
|
67
|
+
- **Orders calls in flight at once no longer go to the wrong base path** (CMS-1149). Refund, `getOrderById` and vector search live under `/api/content/orders`, and the module swapped its own base URL for the time of the request: a parallel `getAllOrdersByMarker` (`Promise.all` on an order page) went to `/api/content/orders/marker/…` and got `404`, and two overlapping swaps could leave the instance on `/api/content/orders` for good. Such calls go through a view with its own base URL now (`AsyncModules._withBaseUrl`); `Admins.getAdminsByVectorSearch` used the same swap and is fixed too.
|
|
68
|
+
- **Page URLs, ids and `langCode` are encoded in the request URL** (CMS-1150). 1.0.176 encoded markers only:
|
|
69
|
+
- a page URL went into the path as is — `getProductsByPageUrl('../../all')` resolved to `POST /products/all`, the whole catalogue; it is encoded segment by segment now (`_pathSegments`, `/` kept) in `Products` and `Pages`;
|
|
70
|
+
- an id from a route parameter — `getOrderById('../orders-storage/marker/my_order')` returned the storage as an order, `'800?langCode=xx#'` replaced the query; ids in `Orders` and `Products` paths go through `_pathSegment`;
|
|
71
|
+
- `langCode` was glued into the query unencoded in about 50 places — `'en_US&limit=1'` added a parameter; it is encoded everywhere now.
|
|
72
|
+
- **The language of the call reaches the normalization** (CMS-1151). `Orders` methods unwrapped the answer by the client's language, not by their `langCode` argument: `createOrder(…, 'ru_RU')` returned `formData: { "ru_RU": [ … ] }`. In `getProductsByIds` the `userQuery` no longer overrides the positional `ids` and `langCode`, and `getProductsByPageId`, `getProductsByPageUrl` and `getRelatedProductsById` build the query with one serializer — a `langCode` in `userQuery` was sent twice and answered `400`.
|
|
73
|
+
- **A `401` without a refresh token is one request** (CMS-1152). Every `401` of a guest or of a wrong app token was followed by `POST …/users/refresh` with an empty body, answered `400`/`401`.
|
|
74
|
+
- **JSDoc** (CMS-1153): `IProductAdditional.prices` is the price range of the whole catalogue, not of the product; `isNormalized` is deprecated — the API no longer reads it; the limits of `limit`, the handling of unknown and repeated `ids`, a wrong `signPrice` and the missing language fallback are described; `relatedIds` is marked optional; `config.token` of `defineOneEntry` is required.
|
|
75
|
+
- **Blocks and Pages answer in the language of the call** (CMS-1160, CMS-1151). Every `Blocks` method, `Pages.getBlocksByPageUrl` with the products of its blocks, and the templates attached to pages unwrapped the answer by the client's language, not by their `langCode` argument — a call in another language returned `localizeInfos` and `attributeValues` still keyed by locale (`{ "en_US": { "title": … } }`). In `getCartComplementByProductIds`, `getCartSimilarByProductIds` and `getWishlistSimilarByProductIds` an explicit `langCode: undefined` in the body no longer overrides the default language — it answered `400 langCode must match …`.
|
|
76
|
+
- **A block keeps its shape** (CMS-1110):
|
|
77
|
+
- `countElementsPerRow` and `quantity` are lifted from `customSettings` before validation — with `strictMode` the schema dropped `customSettings` first, and both fields disappeared;
|
|
78
|
+
- internal fields (`customSettings`, `productPageUrls`, `attributeSetIdentifier`) are removed in traffic-saving mode too, and the set marker under its real name — it was misspelt (`attributesSetIdentifier`) and stayed in every block;
|
|
79
|
+
- a failed product sub-request leaves an empty value of the declared type — `similarProducts: { items: [], total: 0 }`, `products: []` — instead of the error object or an array where a container is declared;
|
|
80
|
+
- `getBlocks` no longer passes its `offset` and `limit` to the products of each block: they page the list of blocks, and `offset: 5` emptied every block's products.
|
|
81
|
+
- **`Blocks.getFrequentlyOrderedProducts` encodes the product id in the path** (CMS-1150): `'2954/../../x'` rewrote the path to `/blocks/freq_ordered/x/frequently-ordered`.
|
|
82
|
+
- **JSDoc** (CMS-1117): `getChildPagesByParentUrl` takes the page's own `pageUrl`, not a nested path — `blog/blog1` answers `404`; the `about/our-team` example is gone. A no-op `delete` of a misspelt field is removed from `getBlocksByPageUrl` (CMS-1110).
|
|
83
|
+
- **Discounts answer in the language of the call** (CMS-1130): `getAllDiscounts` and `getDiscountByMarker` unwrapped by the client's language; `getDiscountByMarker` no longer sends an empty `marker=` along. JSDoc of the class (copied from Events), `@handleName getAllDiscounts`, the marker example, `IBonusTransactionType`, the ISO date format of `getBonusHistory`.
|
|
84
|
+
- **IntegrationCollections** (CMS-1163): row and collection ids are encoded in the path (`getICollectionById('1/rows')` returned rows, `rows/2/../3` row 3); `formData` of a created or updated row is an array even when the body was keyed by another language; JSDoc of `deleteICollectionRowByMarkerAndId` (a missing row answers IError `404 Row not found`, not `false`) and `updateICollectionRow` (`formData` replaces every field).
|
|
85
|
+
- **AttributesSets JSDoc** (CMS-1166): `type` of a set is `{ id, type }` (`forProducts` …), `position` is the number of the set in the current answer, `sortBy: 'id'` sorts descending, the `listTitles` example matches the API.
|
|
86
|
+
- **In Node.js a token is refreshed from any module** (CMS-1170). The fallback device id of `x-device-metadata` was generated per module, so a refresh-token issued through `AuthProvider` was refreshed from `Payments` (or any other module) with another fingerprint and answered `400 Provided token is incorrect` — the session broke on every access-token expiry in SSR and server scripts. The id lives on the client's shared state now (`state.nodeDeviceId`). Browsers were not affected.
|
|
87
|
+
- **A request that got no answer is a failure** (CMS-1174). With `isShell` on, a dropped connection becomes `{ statusCode: 0, … }`, and `_fetchBoolean` took it for success: `subscribeByMarker`, `unsubscribeByMarker`, `subscribeToForm`, `unsubscribeFromForm`, `cancelSubscription`, `recoverSubscriptions`, `FileUploading.delete`, `trackUserActivity` returned `true`. `_isErrorResponse` recognizes the shell error now.
|
|
88
|
+
- **Templates** (CMS-1187, CMS-1131): `getAllTemplates` returns the error (`400`, `401`, `422`) instead of an empty object; `getTemplateByType` encodes `type` — `'catalog_page#x'` cut the query and answered templates instead of `400`; `getTemplateByType` and `getTemplateByMarker` unwrap the answer by their `langCode`.
|
|
89
|
+
- **Filters and Search answer in the language of the call** (CMS-1115, CMS-1116): `getFilterByMarker(marker, 'ru_RU')` returned `localizeInfos` keyed by locale; `globalSearch` unwrapped by the client's language. `globalSearch(query, [])` no longer sends `types=` — the API answered no groups.
|
|
90
|
+
- **ProductStatuses send `langCode`** (CMS-1188): `getProductStatuses` and `getProductsByStatusMarker` took a language but did not pass it, and returned `localizeInfos: { "en_US": … }` for any other language.
|
|
91
|
+
- **Numeric attributes of forms and attribute sets no longer get `value: null`** (CMS-1188): the normalization added the key to `integer`/`float`/`real` field descriptions, which carry no value.
|
|
92
|
+
- **FileUploading** (CMS-1175): `delete` and `getFile` encode every query parameter — a `#` in a file name cut `type`, `entity` and `id` off, a `&id=` added parameters; `createFileFromUrl` throws on an error status instead of turning the storage's 404 page into a file; JSDoc of `getFile` (`template` is ignored by the endpoint), of `IFileSearchQueryLanguage.source` and `IFileSearchResponse.warnings`.
|
|
93
|
+
- **Payments** (CMS-1171): ids are encoded in the path (`getSessionById('../accounts')` returned the accounts); `getSessionById` and `getAccountById` validate their answer; `PaymentAccountSchema.type` is the enum of the interface.
|
|
94
|
+
- **Events JSDoc** (CMS-1103, CMS-1119, CMS-1129): `getAllEvents` requires a user; the default language is the client's, not `en_US`; the `ISubscriptions` example is the `{ total, items }` the API sends.
|
|
95
|
+
- **Users** (CMS-1180):
|
|
96
|
+
- the FCM token and product ids are encoded in the path — `deleteFCMToken('../account')` resolved to `DELETE /users/me/account`, deleting the user, and `'..'` to `DELETE /users/me/`, archiving it;
|
|
97
|
+
- `getUser` returns `state` exactly as stored: it went through the attribute normalizer, which turned `{ en_US: 1, ru_RU: 2 }` into `1`, `{ type: 'integer', value: 'abc' }` into `value: null`, and threw a `TypeError` on `{ attributes: { x: 's' } }`; the normalizer also skips non-object entries now;
|
|
98
|
+
- `getUser` unwraps by its `langCode`; `updateUser` wraps `formData` under `body.langCode` when the body has one;
|
|
99
|
+
- `updateUser`, `archiveUser`, `deleteUser`, `addFCMToken`, `deleteFCMToken` answer `true` on an empty 2xx body instead of `{}`.
|
|
100
|
+
- **Sign-in with a session open** (CMS-1179): `auth`, `signUp` and `oauth` go without the current session's `Authorization` and never trigger a token refresh — a wrong password answers `401`, which used to refresh the open session and send the same wrong password again (two failed attempts for one); `logout`/`logoutAll` clear the tokens only on success — a failed call wiped the tokens of a session still alive on the server; `oauth` stores the tokens it receives; a manual `refresh` stores tokens only when the answer carries them; `signUp` unwraps by its `langCode`.
|
|
101
|
+
- **FormData** write methods encode the record id in the path (`updateFormsDataByid`, `updateFormsDataStatusByid`, `deleteFormsDataByid`).
|
|
102
|
+
- **JSDoc**: `Subscriptions.getAllSubscriptions` needs no signed-in user (CMS-1103); `auth` takes string values only (CMS-1123); `oauth` returns `IAuthEntity`.
|
|
103
|
+
- **JSDoc examples** (CMS-1205): product queries use an existing `signPrice` storage (`"my_order"`, a missing one fails the whole request with `404`), and the count filters a valid `conditionValue`; `getProductsCountByPageUrl` got its JSDoc back from `getProductsByVectorSearch`; `Payments.getAccounts`/`getAccountById` need no signed-in user, `Orders.getAllStatusesByStorageMarker` does; `@returns` of `getAccounts`, `getChildPagesByParentUrl` (404 for a missing parent) and `getProductBlockById` are arrays, `updateFormsDataByid` documents `body`; examples follow the API: `attributeValues` is a map by marker, block type `product_block` and products with `localizeInfos.title`, form data `formData` is an array and the extended fields come only with `isExtended`, `processingType: "script"`, unwrapped localization in attribute set schemas, list items with string `value` and `extended`, user `groups: [1]`, orders with `totalSum: "300"`, `previewImage: []`, `title`/`isGift`, preview proportions with `weight`/`default`, product statuses with `title` only, form markers `"reg"`, real general types, numeric `collectionId`.
|
|
104
|
+
|
|
105
|
+
### What's Deleted
|
|
106
|
+
|
|
107
|
+
- **`total` of a single form, discount, collection row, page and user** (`IFormsEntity`, `IDiscountsEntity`, `ICollectionRow`, `IPagesEntity`, `IUserEntity`, and their schemas): a service counter of the platform's list queries, always `"1"`. The platform stopped sending it (CMS-1088, CMS-1095).
|
|
108
|
+
- **`IPaymentAccountTestSettings.signingSecretKey`**: the Stripe webhook signing secret is no longer returned to the app token (CMS-1091).
|
|
109
|
+
|
|
110
|
+
### Tests
|
|
111
|
+
|
|
112
|
+
- **`callercontracts.spec.ts`**: overlapping `Orders` calls keep their endpoints; a page URL, an id and a `langCode` stay inside their part of the URL; positional arguments win over `userQuery`; `getProductBlockById` and `createOrder` unwrap by the language of the call; a `401` without a refresh token is not followed by a refresh.
|
|
113
|
+
- **`callercontracts.spec.ts`** (pages/blocks run): `Blocks.getBlockByMarker` and `Pages.getBlocksByPageUrl` unwrap by the language of the call; a lookup body with `langCode: undefined` keeps the default; a product block keeps `countElementsPerRow` and `quantity` under strict validation; the list offset does not page block products; a failed similar-products request leaves an empty container; traffic-saving mode removes internal fields; a product id stays inside its path segment.
|
|
114
|
+
- **`callercontracts.spec.ts`** (collections/discounts/attribute-sets run): a collection id stays inside its path segment; rows by marker are paged; a created row returns `formData` as an array; `getDiscountByMarker` sends no empty marker and unwraps by its `langCode`; `getBonusHistory` pages; `multiselect` survives strict validation. `attributesets.spec.ts` snapshots now carry `multiselect`.
|
|
115
|
+
- **`callercontracts.spec.ts`** (events/files/payments run): a file name stays inside its query parameter in `delete` and `getFile`; `createFileFromUrl` rejects an error page; a session id stays inside its path segment; a dropped connection is not a successful subscription. `payments.spec.ts` masks the payment-provider secrets before its snapshots — the snapshot used to keep the Stripe test-mode signing secret; `fileuploading.spec.ts` and `formsdata.spec.ts` point at an image that exists — the old one answered `404`, and the tests uploaded the error page as an image.
|
|
116
|
+
- **`callercontracts.spec.ts`** (users/auth-provider/subscriptions run): a failed logout keeps the tokens; a sign-in with a wrong password is one request without the session; an FCM token stays inside its path segment; `archiveUser`/`updateUser` answer `true` on an empty body; `getUser` keeps `state` as stored and does not throw on it.
|
|
117
|
+
- Platform fixes of 2026-10-29: `productstatuses.spec.ts` expects `validateMarker` to answer `true` for an existing marker (CMS-1069); `payments.spec.ts` reads the sessions of an order of the signed-in user (CMS-1092); `admins.spec.ts` no longer expects `identifier`; snapshots of users, admins, forms, discounts, payments and a collection marker follow the answers without `total`, logins and secrets.
|
|
118
|
+
|
|
119
|
+
## v.1.0.176
|
|
120
|
+
|
|
121
|
+
### What's Changed
|
|
122
|
+
|
|
123
|
+
- **`FormDataType` describes `formData` as a read returns it** (CMS-1143). Checked on `getFormsDataByMarker` against every field type of a form:
|
|
124
|
+
- new branches `IBodyTypeEntity` (`entity`, `value: number[]`) and `IBodyTypeTimeInterval` (`timeInterval`, `value: string[][]` — `[start, end]` pairs); `IBodyTypeStringNumberFloat.type` takes `'integer'`;
|
|
125
|
+
- `list` and `radioButton` come back as the stored option values — `["1"]` and `"1"` — so `IBodyTypeRadioButtonList.value` is `IListOptionValue[] | string[] | string`;
|
|
126
|
+
- `text` and `textWithHeader` come back as a one-element array without `plainValue` and with `params.editorMode`: `value` takes an array too, `plainValue` and `isEditorDisabled` are optional, `editorMode` is added;
|
|
127
|
+
- the JSDoc no longer promises numbers and single-file objects on a read: numeric fields come back as strings (`3` → `"3"`), a single file as a one-element array.
|
|
128
|
+
Code that wrote these fields still compiles; code that read `value.plainValue` or `value[0].title` of a read now sees in the types what the API sends.
|
|
129
|
+
|
|
130
|
+
### What's Fixed
|
|
131
|
+
|
|
132
|
+
- **A marker is encoded before it goes into the request path** (CMS-1144). It was put into the URL as is in 59 places: `getFormsDataByMarker('..', 2)` resolved to `POST /api/content/form-data/` — the create endpoint — and `'test-form#'` cut the whole query off. Markers go through a new `AsyncModules._pathSegment` now: `?`, `#` and `/` are encoded, and a dot-only value reaches the API as an invalid marker (`400 marker must match …`) instead of another route. Valid markers are sent exactly as before. Page and product URLs (`getPageByUrl` and similar) are not changed.
|
|
133
|
+
|
|
134
|
+
- **`FormData.postFormsData` unwraps the answer from the language it was sent in** (CMS-1125). A call with a `langCode` other than the client's returned `formData.formData` still keyed by the locale (`{ "ru_RU": [ … ] }`); the response is normalized with that `langCode` now, like the other methods of the module.
|
|
135
|
+
|
|
136
|
+
- **JSDoc of the FormData module** (CMS-1145): `offset` from `0` and `limit` from `1`; `queryText` 1–512 characters, `vectorDistanceThreshold` from `0` and `maxHits` from `1` in vector search; `dateFrom` / `dateTo` take `YYYY-MM-DD HH:MM:SS` as well. The filter description said the API silently ignores an unknown field — it answers `400 property statuses should not exist`; a marker that matches nothing answers `200` with an empty list, not `404`.
|
|
137
|
+
|
|
138
|
+
### Tests
|
|
139
|
+
|
|
140
|
+
- **`callercontracts.spec.ts`**: `..` and `#` in a marker stay inside the path, a valid marker is sent unchanged; `postFormsData` in another language returns `formData` as an array; the field shapes of a `full_form` record compile as `FormDataType`.
|
|
141
|
+
- **`formsdata.spec.ts`**: vector search no longer expects `ip` and `fingerprint` — the API does not send them.
|
|
142
|
+
|
|
3
143
|
## v.1.0.175
|
|
4
144
|
|
|
5
145
|
### What's Changed
|
package/dist/admins/adminsApi.js
CHANGED
|
@@ -115,15 +115,8 @@ class AdminsApi extends asyncModules_1.default {
|
|
|
115
115
|
offset,
|
|
116
116
|
limit,
|
|
117
117
|
};
|
|
118
|
-
const
|
|
119
|
-
this.
|
|
120
|
-
try {
|
|
121
|
-
const response = await this._fetchPost(`/vector/search?` + this._queryParamsToString(query), body);
|
|
122
|
-
return this._normalizeData(response, langCode);
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
this._url = savedUrl;
|
|
126
|
-
}
|
|
118
|
+
const response = await this._withBaseUrl(this._adminsUrl)._fetchPost(`/vector/search?` + this._queryParamsToString(query), body);
|
|
119
|
+
return this._normalizeData(response, langCode);
|
|
127
120
|
}
|
|
128
121
|
}
|
|
129
122
|
exports.default = AdminsApi;
|
|
@@ -94,10 +94,10 @@ interface IPosition {
|
|
|
94
94
|
* @interface IAdminEntity
|
|
95
95
|
* @property {number} id - Object ID. Example: 1764.
|
|
96
96
|
* @property {number | null} attributeSetId - ID of the attribute set in use. Example: 120.
|
|
97
|
-
* @property {string} identifier -
|
|
97
|
+
* @property {string} [identifier] - Not returned by the Content API: it was the admin's sign-in login, and the platform no longer sends it. Kept optional for compatibility.
|
|
98
98
|
* @property {string | null} attributeSetIdentifier - Marker of the attribute set. Example: "admins".
|
|
99
99
|
* @property {number | null} position - Position used for sorting. Example: 1.
|
|
100
|
-
* @property {boolean} isSync - Whether the
|
|
100
|
+
* @property {boolean} isSync - Whether the admin has attribute data in the requested language (`false` with empty `attributeValues` otherwise). Example: true.
|
|
101
101
|
* @property {IAttributeValues} attributeValues - Attribute values keyed by attribute marker.
|
|
102
102
|
* @example
|
|
103
103
|
[
|
|
@@ -108,19 +108,19 @@ interface IPosition {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
]
|
|
111
|
-
* @property {IFormConfig[]} [
|
|
111
|
+
* @property {IFormConfig[]} [formModuleConfigs] - Form configurations of the module associated with the admin (the API key is `formModuleConfigs`). Example: [].
|
|
112
112
|
* @property {number} [distance] - Cosine distance to the query. Returned only by the semantic (vector) search endpoint when `debug: true` is passed in the search body. Example: 0.12.
|
|
113
113
|
* @description This interface captures the essential details and additional attributes of an admin entity.
|
|
114
114
|
*/
|
|
115
115
|
interface IAdminEntity {
|
|
116
116
|
id: number;
|
|
117
117
|
attributeSetId: number | null;
|
|
118
|
-
identifier
|
|
118
|
+
identifier?: string;
|
|
119
119
|
attributeSetIdentifier: string | null;
|
|
120
120
|
position: number | null;
|
|
121
121
|
isSync: boolean;
|
|
122
122
|
attributeValues: IAttributeValues;
|
|
123
|
-
|
|
123
|
+
formModuleConfigs?: IFormConfig[];
|
|
124
124
|
distance?: number;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
@@ -10,12 +10,12 @@ import { z } from 'zod';
|
|
|
10
10
|
export declare const AdminEntitySchema: z.ZodObject<{
|
|
11
11
|
id: z.ZodNumber;
|
|
12
12
|
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
13
|
-
identifier: z.ZodString
|
|
13
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
14
14
|
attributeSetIdentifier: z.ZodNullable<z.ZodString>;
|
|
15
15
|
position: z.ZodNullable<z.ZodNumber>;
|
|
16
16
|
isSync: z.ZodBoolean;
|
|
17
17
|
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
18
|
-
|
|
18
|
+
formModuleConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
19
19
|
distance: z.ZodOptional<z.ZodNumber>;
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
/**
|
|
@@ -24,11 +24,11 @@ export declare const AdminEntitySchema: z.ZodObject<{
|
|
|
24
24
|
export declare const AdminsResponseSchema: z.ZodArray<z.ZodObject<{
|
|
25
25
|
id: z.ZodNumber;
|
|
26
26
|
attributeSetId: z.ZodNullable<z.ZodNumber>;
|
|
27
|
-
identifier: z.ZodString
|
|
27
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
28
28
|
attributeSetIdentifier: z.ZodNullable<z.ZodString>;
|
|
29
29
|
position: z.ZodNullable<z.ZodNumber>;
|
|
30
30
|
isSync: z.ZodBoolean;
|
|
31
31
|
attributeValues: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
32
|
-
|
|
32
|
+
formModuleConfigs: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
33
33
|
distance: z.ZodOptional<z.ZodNumber>;
|
|
34
34
|
}, z.core.$strip>>;
|
|
@@ -14,12 +14,12 @@ const validation_1 = require("../base/validation");
|
|
|
14
14
|
exports.AdminEntitySchema = zod_1.z.object({
|
|
15
15
|
id: zod_1.z.number(),
|
|
16
16
|
attributeSetId: zod_1.z.number().nullable(),
|
|
17
|
-
identifier: zod_1.z.string(),
|
|
17
|
+
identifier: zod_1.z.string().optional(),
|
|
18
18
|
attributeSetIdentifier: zod_1.z.string().nullable(),
|
|
19
19
|
position: zod_1.z.number().nullable(),
|
|
20
20
|
isSync: zod_1.z.boolean(),
|
|
21
21
|
attributeValues: validation_1.AttributeValuesSchema,
|
|
22
|
-
|
|
22
|
+
formModuleConfigs: zod_1.z.array(zod_1.z.any()).optional(),
|
|
23
23
|
distance: zod_1.z.number().optional(),
|
|
24
24
|
});
|
|
25
25
|
/**
|
|
@@ -27,7 +27,7 @@ export default class AttributesSetsApi extends AsyncModules implements IAttribut
|
|
|
27
27
|
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
28
28
|
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
29
29
|
* @param {number} [typeId] - ID of the attribute set type to filter by. Default: null.
|
|
30
|
-
* @param {string} [sortBy] - Field to sort by: `id` or `position`. Default: "id".
|
|
30
|
+
* @param {string} [sortBy] - Field to sort by: `id` (descending) or `position`. Default: "id".
|
|
31
31
|
* @returns {Promise<IAttributesSetsResponse | IError>} Returns object with array of IAttributeSetsEntity and total items count.
|
|
32
32
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
33
33
|
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributes getAttributes} documentation.
|
|
@@ -65,7 +65,7 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
65
65
|
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
66
66
|
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
67
67
|
* @param {number} [typeId] - ID of the attribute set type to filter by. Default: null.
|
|
68
|
-
* @param {string} [sortBy] - Field to sort by: `id` or `position`. Default: "id".
|
|
68
|
+
* @param {string} [sortBy] - Field to sort by: `id` (descending) or `position`. Default: "id".
|
|
69
69
|
* @returns {Promise<IAttributesSetsResponse | IError>} Returns object with array of IAttributeSetsEntity and total items count.
|
|
70
70
|
* @throws {IError} When isShell=false and an error occurs during the fetch
|
|
71
71
|
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributes getAttributes} documentation.
|
|
@@ -96,7 +96,7 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
96
96
|
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributesByMarker getAttributesByMarker} documentation.
|
|
97
97
|
*/
|
|
98
98
|
async getAttributesByMarker(marker, langCode = this.state.lang) {
|
|
99
|
-
const result = await this._fetchGet(`/${marker}/attributes?langCode=${langCode}`);
|
|
99
|
+
const result = await this._fetchGet(`/${this._pathSegment(marker)}/attributes?langCode=${encodeURIComponent(langCode)}`);
|
|
100
100
|
// Validate response if validation is enabled
|
|
101
101
|
const validated = await this._validateResponse(result, schema('AttributesArrayResponseSchema'));
|
|
102
102
|
return this._normalizeData(validated, langCode);
|
|
@@ -112,7 +112,7 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
112
112
|
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getSingleAttributeByMarkerSet getSingleAttributeByMarkerSet} documentation.
|
|
113
113
|
*/
|
|
114
114
|
async getSingleAttributeByMarkerSet(setMarker, attributeMarker, langCode = this.state.lang) {
|
|
115
|
-
const result = await this._fetchGet(`/${setMarker}/attributes/${attributeMarker}?langCode=${langCode}`);
|
|
115
|
+
const result = await this._fetchGet(`/${this._pathSegment(setMarker)}/attributes/${this._pathSegment(attributeMarker)}?langCode=${encodeURIComponent(langCode)}`);
|
|
116
116
|
// Validate response if validation is enabled
|
|
117
117
|
const validated = await this._validateResponse(result, schema('AttributeEntitySchema'));
|
|
118
118
|
return this._normalizeData(validated, langCode);
|
|
@@ -127,7 +127,7 @@ class AttributesSetsApi extends asyncModules_1.default {
|
|
|
127
127
|
* @see {@link https://js-sdk.oneentry.cloud/docs/attribute-sets/getAttributeSetByMarker getAttributeSetByMarker} documentation.
|
|
128
128
|
*/
|
|
129
129
|
async getAttributeSetByMarker(marker, langCode = this.state.lang) {
|
|
130
|
-
const result = await this._fetchGet(`/marker/${marker}?langCode=${langCode}`);
|
|
130
|
+
const result = await this._fetchGet(`/marker/${this._pathSegment(marker)}?langCode=${encodeURIComponent(langCode)}`);
|
|
131
131
|
// Validate response if validation is enabled
|
|
132
132
|
const validated = await this._validateResponse(result, schema('AttributeSetEntitySchema'));
|
|
133
133
|
return this._normalizeData(validated, langCode);
|
|
@@ -5,6 +5,27 @@ import type { IAttributeLocalizeInfo, IError, ITimeIntervalSchedule } from '../b
|
|
|
5
5
|
* @description This interface defines methods for retrieving attributes based on markers and language codes.
|
|
6
6
|
*/
|
|
7
7
|
interface IAttributesSets {
|
|
8
|
+
/**
|
|
9
|
+
* Getting all attribute sets objects.
|
|
10
|
+
* @handleName getAttributes
|
|
11
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
12
|
+
* @param {number} [offset] - Number of records to skip. Default: 0.
|
|
13
|
+
* @param {number} [limit] - Maximum number of records to return. Default: 30.
|
|
14
|
+
* @param {number} [typeId] - ID of the attribute set type to filter by. Default: null.
|
|
15
|
+
* @param {string} [sortBy] - Field to sort by: `id` (descending) or `position`. Default: "id".
|
|
16
|
+
* @returns {IAttributesSetsResponse} Object with the array of IAttributeSetsEntity and the total count.
|
|
17
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
18
|
+
*/
|
|
19
|
+
getAttributes(langCode?: string, offset?: number, limit?: number, typeId?: any, sortBy?: string): Promise<IAttributesSetsResponse | IError>;
|
|
20
|
+
/**
|
|
21
|
+
* Getting one attribute set object by its marker.
|
|
22
|
+
* @handleName getAttributeSetByMarker
|
|
23
|
+
* @param {string} marker - Marker of the attribute set. Example: "full_form".
|
|
24
|
+
* @param {string} [langCode] - Language code. Default: "en_US".
|
|
25
|
+
* @returns {IAttributeSetsEntity} The attribute set with its schema.
|
|
26
|
+
* @throws {IError} - If there is an error during the fetch operation, it will return an error object.
|
|
27
|
+
*/
|
|
28
|
+
getAttributeSetByMarker(marker: string, langCode?: string): Promise<IAttributeSetsEntity | IError>;
|
|
8
29
|
/**
|
|
9
30
|
* Fetches attributes by a specific marker.
|
|
10
31
|
* @handleName getAttributesByMarker
|
|
@@ -91,17 +112,15 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
|
|
|
91
112
|
[
|
|
92
113
|
{
|
|
93
114
|
"title": "red",
|
|
94
|
-
"value": 1,
|
|
115
|
+
"value": "1",
|
|
95
116
|
"position": 1,
|
|
96
|
-
"
|
|
97
|
-
"extendedValueType": null
|
|
117
|
+
"extended": { "type": null, "value": null }
|
|
98
118
|
},
|
|
99
119
|
{
|
|
100
120
|
"title": "yellow",
|
|
101
|
-
"value": 2,
|
|
121
|
+
"value": "2",
|
|
102
122
|
"position": 2,
|
|
103
|
-
"
|
|
104
|
-
"extendedValueType": null
|
|
123
|
+
"extended": { "type": null, "value": null }
|
|
105
124
|
}
|
|
106
125
|
]
|
|
107
126
|
* @property {IAttributeValidators} validators - Validators configured for the attribute; empty object when none are set.
|
|
@@ -119,7 +138,12 @@ type AttributeType = 'string' | 'text' | 'textWithHeader' | 'integer' | 'real' |
|
|
|
119
138
|
{
|
|
120
139
|
"title": "My attribute"
|
|
121
140
|
}
|
|
122
|
-
* @property {Record<string,
|
|
141
|
+
* @property {Record<string, IAttributeAdditionalField>} additionalFields - Additional fields of the attribute keyed by marker: a type and a value each, not full attributes. An empty object when there are none.
|
|
142
|
+
* @example
|
|
143
|
+
{
|
|
144
|
+
"additional_field": { "type": "string", "value": "Additional field data" }
|
|
145
|
+
}
|
|
146
|
+
* @property {boolean} [multiselect] - For `list` attributes — whether several options from `listTitles` may be selected. Example: false.
|
|
123
147
|
* @description This interface defines the structure of an attribute set entity, including its type, marker, position, validators, localization information, list titles, additional fields, and settings.
|
|
124
148
|
*/
|
|
125
149
|
interface IAttributesSetsEntity {
|
|
@@ -131,7 +155,18 @@ interface IAttributesSetsEntity {
|
|
|
131
155
|
listTitles: IListTitle[];
|
|
132
156
|
validators: IAttributeValidators;
|
|
133
157
|
localizeInfos: IAttributeLocalizeInfo;
|
|
134
|
-
additionalFields: Record<string,
|
|
158
|
+
additionalFields: Record<string, IAttributeAdditionalField>;
|
|
159
|
+
multiselect?: boolean;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* @interface IAttributeAdditionalField
|
|
163
|
+
* @property {string} type - Type of the additional field. Example: "string".
|
|
164
|
+
* @property {unknown} value - Value of the additional field. Example: "Additional field data".
|
|
165
|
+
* @description An additional field of an attribute, as `getAttributesByMarker` returns it.
|
|
166
|
+
*/
|
|
167
|
+
interface IAttributeAdditionalField {
|
|
168
|
+
type: string;
|
|
169
|
+
value: unknown;
|
|
135
170
|
}
|
|
136
171
|
/**
|
|
137
172
|
* @interface IAttributeSchemaItem
|
|
@@ -149,7 +184,7 @@ interface IAttributesSetsEntity {
|
|
|
149
184
|
* @property {boolean} [multiselect] - For `list` fields — whether several options from `listTitles` may be selected. Optional. Example: false.
|
|
150
185
|
* @property {string} [moduleIdentifier] - For `entity` fields — identifier of the module the linked entities are taken from. Optional. Example: "catalog".
|
|
151
186
|
* @property {number | null} [parentId] - Identifier of the parent field, `null` for top-level. Optional, seen on `groupOfImages` fields.
|
|
152
|
-
* @property {Record<string,
|
|
187
|
+
* @property {Record<string, IAttributeAdditionalField>} [additionalFields] - Additional fields keyed by marker: a type and a value each. Optional. Example: `{ "additional_field": { "type": "string", "value": "Additional field data" } }`.
|
|
153
188
|
* @property {IAttributeValidators} [validators] - Validation rules for the field. Optional.
|
|
154
189
|
* @property {boolean | string} [splitUnit] - Splitting unit configuration; `false` when disabled, otherwise the unit name (e.g. "percent"). Optional, used by numeric fields.
|
|
155
190
|
* @property {number[] | boolean} [splitParts] - For split-price fields — ids of the schema fields the price is split into (e.g. [2, 3]); `false` when the field does not split. Optional.
|
|
@@ -159,6 +194,14 @@ interface IAttributesSetsEntity {
|
|
|
159
194
|
* @property {boolean} [receiveValues] - For `timeInterval` fields — whether the field receives precomputed values. Optional.
|
|
160
195
|
* @property {ITimeIntervalSchedule[]} [intervals] - For `timeInterval` fields — top-level schedule definition (separate from `localizeInfos.intervals`). Optional.
|
|
161
196
|
* @property {unknown} [value] - Current value of the field: `null` on numeric fields without a value, an array of schedule groups on `timeInterval` fields. Optional.
|
|
197
|
+
* @property {boolean} [isLogin] - Whether the field is the login of a sign-up form. Optional.
|
|
198
|
+
* @property {boolean} [isSignUp] - Whether the field is filled at sign-up. Optional.
|
|
199
|
+
* @property {boolean} [isPassword] - Whether the field is the password of a sign-up form. Optional.
|
|
200
|
+
* @property {boolean} [isNotificationEmail] - Whether the field is the e-mail used for notifications. Optional.
|
|
201
|
+
* @property {boolean} [isNotificationPhoneSMS] - Whether the field is the phone used for SMS notifications. Optional.
|
|
202
|
+
* @property {boolean} [isNotificationPhonePush] - Whether the field is the phone used for push notifications. Optional.
|
|
203
|
+
* @property {boolean} [isProductPreview] - Whether the field is the product preview image. Optional.
|
|
204
|
+
* @property {number | null} [previewTemplateId] - ID of the preview template of an image field. Optional.
|
|
162
205
|
* @description Definition of a single field inside an attribute set's schema.
|
|
163
206
|
*/
|
|
164
207
|
interface IAttributeSchemaItem {
|
|
@@ -176,7 +219,7 @@ interface IAttributeSchemaItem {
|
|
|
176
219
|
listType?: string;
|
|
177
220
|
moduleIdentifier?: string;
|
|
178
221
|
parentId?: number | null;
|
|
179
|
-
additionalFields?: Record<string,
|
|
222
|
+
additionalFields?: Record<string, IAttributeAdditionalField>;
|
|
180
223
|
validators?: IAttributeValidators;
|
|
181
224
|
splitUnit?: boolean | string;
|
|
182
225
|
splitParts?: number[] | boolean;
|
|
@@ -186,6 +229,14 @@ interface IAttributeSchemaItem {
|
|
|
186
229
|
receiveValues?: boolean;
|
|
187
230
|
intervals?: ITimeIntervalSchedule[];
|
|
188
231
|
value?: unknown;
|
|
232
|
+
isLogin?: boolean;
|
|
233
|
+
isSignUp?: boolean;
|
|
234
|
+
isPassword?: boolean;
|
|
235
|
+
isNotificationEmail?: boolean;
|
|
236
|
+
isNotificationPhoneSMS?: boolean;
|
|
237
|
+
isNotificationPhonePush?: boolean;
|
|
238
|
+
isProductPreview?: boolean;
|
|
239
|
+
previewTemplateId?: number | null;
|
|
189
240
|
}
|
|
190
241
|
/**
|
|
191
242
|
* @interface IAttributeValidators
|
|
@@ -333,13 +384,13 @@ interface IAttributeValidators {
|
|
|
333
384
|
"original": true,
|
|
334
385
|
"identifier": "string",
|
|
335
386
|
"localizeInfos": {
|
|
336
|
-
"
|
|
387
|
+
"title": "String"
|
|
337
388
|
}
|
|
338
389
|
}
|
|
339
390
|
}
|
|
340
391
|
* @property {boolean} isVisible - Whether the attribute set is visible. Example: true.
|
|
341
|
-
* @property {
|
|
342
|
-
* @property {number} position -
|
|
392
|
+
* @property {IAttributeSetTypeRef} type - Type of the attribute set: an object with the type id and name. Example: `{ "id": 1, "type": "forProducts" }`.
|
|
393
|
+
* @property {number} position - Number of the set in the current answer, not a property of the set: it changes with `sortBy` (set 38 is `1` by `id` and `21` by `position`). Example: 1.
|
|
343
394
|
* @description This interface defines the structure of an attribute set entity.
|
|
344
395
|
*/
|
|
345
396
|
interface IAttributeSetsEntity {
|
|
@@ -386,4 +437,4 @@ interface IAttributesSetsResponse {
|
|
|
386
437
|
total: number;
|
|
387
438
|
items: IAttributeSetsEntity[];
|
|
388
439
|
}
|
|
389
|
-
export type { AttributeType, IAttributeSchemaItem, IAttributeSetsEntity, IAttributeSetTypeRef, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse, IAttributeValidators, IListTitle, IListTitleEntityValue, IListTitleExtended, };
|
|
440
|
+
export type { AttributeType, IAttributeAdditionalField, IAttributeSchemaItem, IAttributeSetsEntity, IAttributeSetTypeRef, IAttributesSets, IAttributesSetsEntity, IAttributesSetsResponse, IAttributeValidators, IListTitle, IListTitleEntityValue, IListTitleExtended, };
|
|
@@ -24,10 +24,11 @@ export declare const AttributeEntitySchema: z.ZodObject<{
|
|
|
24
24
|
initialValue: z.ZodAny;
|
|
25
25
|
marker: z.ZodString;
|
|
26
26
|
position: z.ZodNumber;
|
|
27
|
-
listTitles: z.
|
|
28
|
-
validators: z.
|
|
27
|
+
listTitles: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
28
|
+
validators: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
29
29
|
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
30
|
-
additionalFields: z.
|
|
30
|
+
additionalFields: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
31
|
+
multiselect: z.ZodOptional<z.ZodBoolean>;
|
|
31
32
|
}, z.core.$strip>;
|
|
32
33
|
/**
|
|
33
34
|
* Attribute set entity schema (attribute set object)
|
|
@@ -77,8 +78,9 @@ export declare const AttributesArrayResponseSchema: z.ZodArray<z.ZodObject<{
|
|
|
77
78
|
initialValue: z.ZodAny;
|
|
78
79
|
marker: z.ZodString;
|
|
79
80
|
position: z.ZodNumber;
|
|
80
|
-
listTitles: z.
|
|
81
|
-
validators: z.
|
|
81
|
+
listTitles: z.ZodUnion<readonly [z.ZodArray<z.ZodAny>, z.ZodRecord<z.ZodString, z.ZodAny>]>;
|
|
82
|
+
validators: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
82
83
|
localizeInfos: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
83
|
-
additionalFields: z.
|
|
84
|
+
additionalFields: z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodArray<z.ZodAny>]>;
|
|
85
|
+
multiselect: z.ZodOptional<z.ZodBoolean>;
|
|
84
86
|
}, z.core.$strip>>;
|
|
@@ -27,16 +27,13 @@ exports.AttributeEntitySchema = zod_1.z.object({
|
|
|
27
27
|
initialValue: zod_1.z.any(),
|
|
28
28
|
marker: zod_1.z.string(),
|
|
29
29
|
position: zod_1.z.number(),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
validators: zod_1.z
|
|
34
|
-
.union([zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z.array(zod_1.z.any())])
|
|
35
|
-
.optional(),
|
|
30
|
+
// Required as in IAttributesSetsEntity: the API sends them on every attribute
|
|
31
|
+
listTitles: zod_1.z.union([zod_1.z.array(zod_1.z.any()), zod_1.z.record(zod_1.z.string(), zod_1.z.any())]),
|
|
32
|
+
validators: zod_1.z.union([zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z.array(zod_1.z.any())]),
|
|
36
33
|
localizeInfos: zod_1.z.union([zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z.array(zod_1.z.any())]),
|
|
37
|
-
additionalFields: zod_1.z
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
additionalFields: zod_1.z.union([zod_1.z.record(zod_1.z.string(), zod_1.z.any()), zod_1.z.array(zod_1.z.any())]),
|
|
35
|
+
// The API sends it on list attributes; without it here validation dropped the field
|
|
36
|
+
multiselect: zod_1.z.boolean().optional(),
|
|
40
37
|
});
|
|
41
38
|
/**
|
|
42
39
|
* Attribute set entity schema (attribute set object)
|