Skip to content

Commit d916b84

Browse files
committed
added Story.getMigrationMetaProperties for the dashboard
1 parent 852a0b4 commit d916b84

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @code.store/arcxp-sdk-ts
22

3+
## 4.40.4
4+
5+
### Patch Changes
6+
7+
- added Story.getMigrationMetaProperties
8+
39
## 4.40.3
410

511
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@code.store/arcxp-sdk-ts",
3-
"version": "4.40.3",
3+
"version": "4.40.4",
44
"description": "A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.",
55
"type": "commonjs",
66
"main": "./dist/index.js",

src/mapper/story.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ import { Document } from './doc';
2020
* }
2121
*/
2222
export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends Document<ANS> {
23+
async getMigrationMetaProperties() {
24+
return {
25+
// used in dashboard for migration
26+
'migration.sourceId': await this.sourceId(),
27+
// used in dashboard to show the original url
28+
'migration.url': await this.legacyUrl(),
29+
};
30+
}
31+
2332
type() {
2433
return 'story' as const;
2534
}
@@ -50,6 +59,7 @@ export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends
5059
const contentRestrictions = await this.getContentRestrictions();
5160
const planning = await this.getSchedulingInformation();
5261
const taxonomy = await this.getTaxonomy();
62+
const additionalMetaProperties = await this.getMigrationMetaProperties();
5363

5464
return {
5565
type,
@@ -88,6 +98,7 @@ export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends
8898
content_elements: contentElements,
8999
additional_properties: {
90100
url: legacyUrl,
101+
...additionalMetaProperties,
91102
},
92103
} as unknown as ANS;
93104
}

0 commit comments

Comments
 (0)