oneentry 1.0.165 → 1.0.166
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/changelog.md +8 -0
- package/dist/forms-data/formsDataApi.d.ts +1 -1
- package/dist/forms-data/formsDataApi.js +1 -1
- package/dist/forms-data/formsDataInterfaces.d.ts +9 -2
- package/esm/forms-data/formsDataApi.d.ts +1 -1
- package/esm/forms-data/formsDataApi.js +1 -1
- package/esm/forms-data/formsDataInterfaces.d.ts +9 -2
- package/package.json +2 -2
package/changelog.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# SDK Change Log
|
|
2
2
|
|
|
3
|
+
## v.1.0.166
|
|
4
|
+
|
|
5
|
+
### What's Fixed
|
|
6
|
+
|
|
7
|
+
- **FormData > `IFormsDataFilter.entityIdentifier` accepts a number.** The field was typed `string`, but an entity is not always addressed by a text marker: product-scoped records — reviews and ratings — are filtered by the **numeric product id**, and that is what the endpoint expects. So the one filter every storefront writes, `{ entityIdentifier: product.id, status: ['approved'] }`, did not compile: `TS2322: Type 'number' is not assignable to type 'string'`. The call worked perfectly at runtime, which made the error read as a mistake in the caller rather than in the type — the usual fix was a cast, and a cast on a field whose real contract nobody had written down. The declaration is now `string | number`, documented with the full contract: a text marker for content entities (`"blog"`), the numeric id for products (`2954`), the login for users and admins.
|
|
8
|
+
|
|
9
|
+
Only the **request** is widened. The API normalizes the value and sends it back as a string — the SDK's own fixture stores a product id as `entityIdentifier: "2954"` — so `IFormByMarkerDataEntity`, `IFormDataSearchEntity`, `IPostFormResponseData` and `IUpdateFormsData` keep `entityIdentifier: string`, and reading code needs no narrowing. Types only; no runtime change, and `_stripEmptyDates` never touched this field.
|
|
10
|
+
|
|
3
11
|
## v.1.0.165
|
|
4
12
|
|
|
5
13
|
### What's New
|
|
@@ -90,7 +90,7 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
90
90
|
"dateFrom": "2025-01-01",
|
|
91
91
|
"dateTo": ""
|
|
92
92
|
}
|
|
93
|
-
* @param {string} [body.entityIdentifier] -
|
|
93
|
+
* @param {string | number} [body.entityIdentifier] - Identifier of the entity the records belong to: a text marker for content entities ("blog"), the **numeric id for products** (2954), the login for users and admins. Example: "blog".
|
|
94
94
|
* @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
|
|
95
95
|
* @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
|
|
96
96
|
* @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
|
|
@@ -197,7 +197,7 @@ class FormsDataApi extends asyncModules_1.default {
|
|
|
197
197
|
"dateFrom": "2025-01-01",
|
|
198
198
|
"dateTo": ""
|
|
199
199
|
}
|
|
200
|
-
* @param {string} [body.entityIdentifier] -
|
|
200
|
+
* @param {string | number} [body.entityIdentifier] - Identifier of the entity the records belong to: a text marker for content entities ("blog"), the **numeric id for products** (2954), the login for users and admins. Example: "blog".
|
|
201
201
|
* @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
|
|
202
202
|
* @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
|
|
203
203
|
* @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
|
|
@@ -109,7 +109,7 @@ type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
|
|
|
109
109
|
/**
|
|
110
110
|
* Represents the filter body of `getFormsDataByMarker`.
|
|
111
111
|
* @interface IFormsDataFilter
|
|
112
|
-
* @property {string} [entityIdentifier] -
|
|
112
|
+
* @property {string | number} [entityIdentifier] - Identifier of the entity the records belong to; an empty string means "no filter". Text marker for content entities ("blog"), the **numeric id for products** (2954), the login for users and admins. Example: "blog".
|
|
113
113
|
* @property {number} [parentId] - Identifier of the parent record — the way to fetch replies to one comment. Example: 10.
|
|
114
114
|
* @property {string} [userIdentifier] - Text identifier of the sender; an empty string means "no filter". Example: "admin".
|
|
115
115
|
* @property {FormDataStatus[]} [status] - Moderation statuses to keep. Must be an array — a bare string is rejected with `400`. An empty array means "no filter". Example: ["approved"].
|
|
@@ -123,7 +123,14 @@ type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
|
|
|
123
123
|
* leaking onto a public page, from one typo the compiler used to accept.
|
|
124
124
|
*/
|
|
125
125
|
interface IFormsDataFilter {
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* `string | number` because the entity is not always addressed by a marker:
|
|
128
|
+
* product-scoped records (reviews, ratings) are filtered by the **numeric
|
|
129
|
+
* product id**, which is what the API expects and what every storefront
|
|
130
|
+
* passes. The response normalizes it back to a string, so the read-side
|
|
131
|
+
* interfaces keep `entityIdentifier: string` — only the request is widened.
|
|
132
|
+
*/
|
|
133
|
+
entityIdentifier?: string | number;
|
|
127
134
|
parentId?: number;
|
|
128
135
|
userIdentifier?: string;
|
|
129
136
|
status?: FormDataStatus[];
|
|
@@ -90,7 +90,7 @@ export default class FormsDataApi extends AsyncModules implements IFormsData {
|
|
|
90
90
|
"dateFrom": "2025-01-01",
|
|
91
91
|
"dateTo": ""
|
|
92
92
|
}
|
|
93
|
-
* @param {string} [body.entityIdentifier] -
|
|
93
|
+
* @param {string | number} [body.entityIdentifier] - Identifier of the entity the records belong to: a text marker for content entities ("blog"), the **numeric id for products** (2954), the login for users and admins. Example: "blog".
|
|
94
94
|
* @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
|
|
95
95
|
* @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
|
|
96
96
|
* @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
|
|
@@ -159,7 +159,7 @@ export default class FormsDataApi extends AsyncModules {
|
|
|
159
159
|
"dateFrom": "2025-01-01",
|
|
160
160
|
"dateTo": ""
|
|
161
161
|
}
|
|
162
|
-
* @param {string} [body.entityIdentifier] -
|
|
162
|
+
* @param {string | number} [body.entityIdentifier] - Identifier of the entity the records belong to: a text marker for content entities ("blog"), the **numeric id for products** (2954), the login for users and admins. Example: "blog".
|
|
163
163
|
* @param {number} [body.parentId] - Identifier of the parent record, to fetch replies to one submission. Example: 10.
|
|
164
164
|
* @param {string} [body.userIdentifier] - Text identifier of the sender. Example: "admin".
|
|
165
165
|
* @param {FormDataStatus[]} [body.status] - Moderation statuses to keep: "sent", "moderation", "approved", "banned", "deleted". Must be an array; anything outside the set is rejected with `400 each value in status must be a valid enum value`. Example: ["approved"].
|
|
@@ -109,7 +109,7 @@ type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
|
|
|
109
109
|
/**
|
|
110
110
|
* Represents the filter body of `getFormsDataByMarker`.
|
|
111
111
|
* @interface IFormsDataFilter
|
|
112
|
-
* @property {string} [entityIdentifier] -
|
|
112
|
+
* @property {string | number} [entityIdentifier] - Identifier of the entity the records belong to; an empty string means "no filter". Text marker for content entities ("blog"), the **numeric id for products** (2954), the login for users and admins. Example: "blog".
|
|
113
113
|
* @property {number} [parentId] - Identifier of the parent record — the way to fetch replies to one comment. Example: 10.
|
|
114
114
|
* @property {string} [userIdentifier] - Text identifier of the sender; an empty string means "no filter". Example: "admin".
|
|
115
115
|
* @property {FormDataStatus[]} [status] - Moderation statuses to keep. Must be an array — a bare string is rejected with `400`. An empty array means "no filter". Example: ["approved"].
|
|
@@ -123,7 +123,14 @@ type FormDataStatus = 'sent' | 'moderation' | 'approved' | 'banned' | 'deleted';
|
|
|
123
123
|
* leaking onto a public page, from one typo the compiler used to accept.
|
|
124
124
|
*/
|
|
125
125
|
interface IFormsDataFilter {
|
|
126
|
-
|
|
126
|
+
/**
|
|
127
|
+
* `string | number` because the entity is not always addressed by a marker:
|
|
128
|
+
* product-scoped records (reviews, ratings) are filtered by the **numeric
|
|
129
|
+
* product id**, which is what the API expects and what every storefront
|
|
130
|
+
* passes. The response normalizes it back to a string, so the read-side
|
|
131
|
+
* interfaces keep `entityIdentifier: string` — only the request is widened.
|
|
132
|
+
*/
|
|
133
|
+
entityIdentifier?: string | number;
|
|
127
134
|
parentId?: number;
|
|
128
135
|
userIdentifier?: string;
|
|
129
136
|
status?: FormDataStatus[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneentry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.166",
|
|
4
4
|
"description": "OneEntry NPM package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"prepublishOnly": "node ../scripts/smoke-pack.js --files-only",
|
|
51
|
-
"postpublish": "node ../scripts/verify-published.js --named defineOneEntry --expect 1.0.
|
|
51
|
+
"postpublish": "node ../scripts/verify-published.js --named defineOneEntry --expect 1.0.166"
|
|
52
52
|
},
|
|
53
53
|
"sideEffects": false,
|
|
54
54
|
"files": [
|