@adobe/spacecat-shared-data-access 3.11.0 → 3.12.0

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,9 @@
1
+ ## [@adobe/spacecat-shared-data-access-v3.12.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.11.0...@adobe/spacecat-shared-data-access-v3.12.0) (2026-03-10)
2
+
3
+ ### Features
4
+
5
+ * **data-access:** restructure SentimentTopic - move subPrompts into … ([#1419](https://github.com/adobe/spacecat-shared/issues/1419)) ([1b8a73e](https://github.com/adobe/spacecat-shared/commit/1b8a73edfa1f897a7490319c187b10ccd157800a))
6
+
1
7
  ## [@adobe/spacecat-shared-data-access-v3.11.0](https://github.com/adobe/spacecat-shared/compare/@adobe/spacecat-shared-data-access-v3.10.1...@adobe/spacecat-shared-data-access-v3.11.0) (2026-03-09)
2
8
 
3
9
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/spacecat-shared-data-access",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Shared modules of the Spacecat Services - Data Access",
5
5
  "type": "module",
6
6
  "engines": {
@@ -22,38 +22,6 @@ import BaseModel from '../base/base.model.js';
22
22
  class SentimentTopic extends BaseModel {
23
23
  static ENTITY_NAME = 'SentimentTopic';
24
24
 
25
- /**
26
- * Adds a sub-prompt to the topic.
27
- * @param {string} prompt - The prompt to add.
28
- * @returns {this} The current instance for chaining.
29
- */
30
- addSubPrompt(prompt) {
31
- const subPrompts = this.getSubPrompts?.() ?? this.subPrompts ?? [];
32
- const updated = [...subPrompts, prompt];
33
- if (this.setSubPrompts) {
34
- this.setSubPrompts(updated);
35
- } else {
36
- this.subPrompts = updated;
37
- }
38
- return this;
39
- }
40
-
41
- /**
42
- * Removes a sub-prompt from the topic.
43
- * @param {string} prompt - The prompt to remove.
44
- * @returns {this} The current instance for chaining.
45
- */
46
- removeSubPrompt(prompt) {
47
- const subPrompts = this.getSubPrompts?.() ?? this.subPrompts ?? [];
48
- const filtered = subPrompts.filter((p) => p !== prompt);
49
- if (this.setSubPrompts) {
50
- this.setSubPrompts(filtered);
51
- } else {
52
- this.subPrompts = filtered;
53
- }
54
- return this;
55
- }
56
-
57
25
  /**
58
26
  * Generates the composite keys for remove/update operations.
59
27
  * Required for entities with composite primary keys.
@@ -55,13 +55,7 @@ const schema = new SchemaBuilder(SentimentTopic, SentimentTopicCollection)
55
55
  type: 'string',
56
56
  required: false,
57
57
  })
58
- .addAttribute('subPrompts', {
59
- type: 'list',
60
- items: { type: 'string' },
61
- required: true,
62
- default: [],
63
- })
64
- .addAttribute('citations', {
58
+ .addAttribute('urls', {
65
59
  type: 'list',
66
60
  required: false,
67
61
  default: [],
@@ -72,6 +66,12 @@ const schema = new SchemaBuilder(SentimentTopic, SentimentTopicCollection)
72
66
  url: { type: 'string', required: true },
73
67
  timesCited: { type: 'number', required: true },
74
68
  category: { type: 'string', required: false },
69
+ subPrompts: {
70
+ type: 'list',
71
+ items: { type: 'string' },
72
+ required: false,
73
+ default: [],
74
+ },
75
75
  },
76
76
  },
77
77
  })