@adobe/spacecat-shared-tokowaka-client 1.2.3 → 1.2.4

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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [@adobe/spacecat-shared-tokowaka-client-v1.2.4](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-tokowaka-client-v1.2.3...@adobe/spacecat-shared-tokowaka-client-v1.2.4) (2025-11-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * url param in tokowaka readability mapper ([#1192](https://github.com/adobe/spacecat-shared/issues/1192)) ([566b9f1](https://github.com/adobe/spacecat-shared/commit/566b9f1d9ca03a9ffe6bbf59a89d6ccba8b278c0))
7
+
1
8
  # [@adobe/spacecat-shared-tokowaka-client-v1.2.3](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-tokowaka-client-v1.2.2...@adobe/spacecat-shared-tokowaka-client-v1.2.3) (2025-11-28)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-tokowaka-client",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Tokowaka Client for SpaceCat - Edge optimization config management",
5
5
  "type": "module",
6
6
  "engines": {
@@ -89,8 +89,8 @@ export default class ReadabilityMapper extends BaseOpportunityMapper {
89
89
 
90
90
  const { transformRules } = data;
91
91
 
92
- if (!isValidUrl(data.pageUrl)) {
93
- return { eligible: false, reason: `pageUrl ${data.pageUrl} is not a valid URL` };
92
+ if (!isValidUrl(data.url)) {
93
+ return { eligible: false, reason: `url ${data.url} is not a valid URL` };
94
94
  }
95
95
 
96
96
  if (!hasText(transformRules.selector)) {
@@ -46,7 +46,7 @@ describe('ReadabilityMapper', () => {
46
46
  const suggestion = {
47
47
  getData: () => ({
48
48
  textPreview: 'Lorem ipsum...',
49
- pageUrl: 'https://www.website.com',
49
+ url: 'https://www.website.com',
50
50
  transformRules: {
51
51
  value: 'Tech enthusiasts keep up with the latest tech news...',
52
52
  op: 'replace',
@@ -66,7 +66,7 @@ describe('ReadabilityMapper', () => {
66
66
  const suggestion = {
67
67
  getData: () => ({
68
68
  textPreview: 'Lorem ipsum...',
69
- pageUrl: 'https://www.website.com',
69
+ url: 'https://www.website.com',
70
70
  transformRules: {
71
71
  value: 'Improved readability text...',
72
72
  op: 'replace',
@@ -84,7 +84,7 @@ describe('ReadabilityMapper', () => {
84
84
  const suggestion = {
85
85
  getData: () => ({
86
86
  textPreview: 'Lorem ipsum...',
87
- pageUrl: 'https://www.website.com',
87
+ url: 'https://www.website.com',
88
88
  }),
89
89
  };
90
90
 
@@ -113,7 +113,7 @@ describe('ReadabilityMapper', () => {
113
113
  const suggestion = {
114
114
  getData: () => ({
115
115
  textPreview: 'Text...',
116
- pageUrl: 'https://www.example.com',
116
+ url: 'https://www.example.com',
117
117
  transformRules: {
118
118
  value: 'New text',
119
119
  op: 'replace',
@@ -133,7 +133,7 @@ describe('ReadabilityMapper', () => {
133
133
  const suggestion = {
134
134
  getData: () => ({
135
135
  textPreview: 'Text...',
136
- pageUrl: 'https://www.example.com',
136
+ url: 'https://www.example.com',
137
137
  transformRules: {
138
138
  value: 'New text',
139
139
  selector: '#content',
@@ -153,7 +153,7 @@ describe('ReadabilityMapper', () => {
153
153
  const suggestion = {
154
154
  getData: () => ({
155
155
  textPreview: 'Text...',
156
- pageUrl: 'https://www.example.com',
156
+ url: 'https://www.example.com',
157
157
  transformRules: {
158
158
  value: 'New text',
159
159
  op: 'insertAfter',
@@ -174,7 +174,7 @@ describe('ReadabilityMapper', () => {
174
174
  const suggestion = {
175
175
  getData: () => ({
176
176
  textPreview: 'Text...',
177
- pageUrl: 'https://www.example.com',
177
+ url: 'https://www.example.com',
178
178
  transformRules: {
179
179
  op: 'replace',
180
180
  selector: '#content',
@@ -194,7 +194,7 @@ describe('ReadabilityMapper', () => {
194
194
  const suggestion = {
195
195
  getData: () => ({
196
196
  textPreview: 'Text...',
197
- pageUrl: 'https://www.example.com',
197
+ url: 'https://www.example.com',
198
198
  transformRules: {
199
199
  value: 'New text',
200
200
  op: 'replace',
@@ -211,11 +211,11 @@ describe('ReadabilityMapper', () => {
211
211
  });
212
212
  });
213
213
 
214
- it('should return ineligible when pageUrl is invalid', () => {
214
+ it('should return ineligible when url is invalid', () => {
215
215
  const suggestion = {
216
216
  getData: () => ({
217
217
  textPreview: 'Text...',
218
- pageUrl: 'not-a-valid-url',
218
+ url: 'not-a-valid-url',
219
219
  transformRules: {
220
220
  value: 'New text',
221
221
  op: 'replace',
@@ -228,11 +228,11 @@ describe('ReadabilityMapper', () => {
228
228
 
229
229
  expect(result).to.deep.equal({
230
230
  eligible: false,
231
- reason: 'pageUrl not-a-valid-url is not a valid URL',
231
+ reason: 'url not-a-valid-url is not a valid URL',
232
232
  });
233
233
  });
234
234
 
235
- it('should return ineligible when pageUrl is missing', () => {
235
+ it('should return ineligible when url is missing', () => {
236
236
  const suggestion = {
237
237
  getData: () => ({
238
238
  textPreview: 'Text...',
@@ -248,7 +248,7 @@ describe('ReadabilityMapper', () => {
248
248
 
249
249
  expect(result).to.deep.equal({
250
250
  eligible: false,
251
- reason: 'pageUrl undefined is not a valid URL',
251
+ reason: 'url undefined is not a valid URL',
252
252
  });
253
253
  });
254
254
  });
@@ -260,7 +260,7 @@ describe('ReadabilityMapper', () => {
260
260
  getUpdatedAt: () => '2025-01-15T10:00:00.000Z',
261
261
  getData: () => ({
262
262
  textPreview: 'Lorem ipsum...',
263
- pageUrl: 'https://www.website.com',
263
+ url: 'https://www.website.com',
264
264
  scrapedAt: '2025-09-20T06:21:12.584Z',
265
265
  transformRules: {
266
266
  value: 'Tech enthusiasts keep up with the latest tech news...',
@@ -296,7 +296,7 @@ describe('ReadabilityMapper', () => {
296
296
  getUpdatedAt: () => '2025-01-15T10:00:00.000Z',
297
297
  getData: () => ({
298
298
  textPreview: 'Original text...',
299
- pageUrl: 'https://www.example.com',
299
+ url: 'https://www.example.com',
300
300
  scrapedAt: '2025-09-20T06:21:12.584Z',
301
301
  transformRules: {
302
302
  value: 'Improved readability text',
@@ -319,7 +319,7 @@ describe('ReadabilityMapper', () => {
319
319
  getUpdatedAt: () => '2025-01-15T10:00:00.000Z',
320
320
  getData: () => ({
321
321
  textPreview: 'Text...',
322
- pageUrl: 'https://www.example.com',
322
+ url: 'https://www.example.com',
323
323
  transformRules: {
324
324
  value: 'Better text',
325
325
  op: 'replace',
@@ -341,7 +341,7 @@ describe('ReadabilityMapper', () => {
341
341
  getId: () => 'sugg-999',
342
342
  getData: () => ({
343
343
  textPreview: 'Text...',
344
- pageUrl: 'https://www.example.com',
344
+ url: 'https://www.example.com',
345
345
  // Missing transformRules
346
346
  }),
347
347
  };
@@ -364,7 +364,7 @@ describe('ReadabilityMapper', () => {
364
364
  getId: () => 'sugg-warn',
365
365
  getData: () => ({
366
366
  textPreview: 'Text...',
367
- pageUrl: 'https://www.example.com',
367
+ url: 'https://www.example.com',
368
368
  transformRules: {
369
369
  op: 'replace',
370
370
  // Missing selector and value
@@ -386,7 +386,7 @@ describe('ReadabilityMapper', () => {
386
386
  getUpdatedAt: () => '2025-01-15T10:00:00.000Z',
387
387
  getData: () => ({
388
388
  textPreview: 'Original text 1',
389
- pageUrl: 'https://www.example.com/page1',
389
+ url: 'https://www.example.com/page1',
390
390
  transformRules: {
391
391
  value: 'First improved text',
392
392
  op: 'replace',
@@ -399,7 +399,7 @@ describe('ReadabilityMapper', () => {
399
399
  getUpdatedAt: () => '2025-01-15T10:00:00.000Z',
400
400
  getData: () => ({
401
401
  textPreview: 'Original text 2',
402
- pageUrl: 'https://www.example.com/page2',
402
+ url: 'https://www.example.com/page2',
403
403
  transformRules: {
404
404
  value: 'Second improved text',
405
405
  op: 'replace',