Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @code.store/arcxp-sdk-ts

## 4.43.2

### Patch Changes

- MaybePromise for getPublicationDate and getDisplayDate

## 4.43.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@code.store/arcxp-sdk-ts",
"version": "4.43.1",
"version": "4.43.2",
"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.",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/mapper/doc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ export abstract class Document<ANS extends ANSContent> {
return date.toISOString();
}

protected getDisplayDate(): Optional<Date> {
protected getDisplayDate(): MaybePromise<Optional<Date>> {
return new Date();
}

protected async getContentElements(): Promise<ArcTypes.ContentElements.ContentElementType<any>[]> {
return [];
}

protected getPublicationDate(): Optional<Date> {
protected getPublicationDate(): MaybePromise<Optional<Date>> {
return new Date();
}

Expand Down
5 changes: 3 additions & 2 deletions src/mapper/story.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends
const id = await this.arcId();
const version = this.version();
const type = this.type();
const publicationDate = this.getPublicationDate();
const publicationDate = await this.getPublicationDate();
const displayDate = await this.getDisplayDate();
const headlines = this.getHeadlines();
const subheadlines = this.getSubheadlines();
const description = this.getDescription();
Expand Down Expand Up @@ -76,7 +77,7 @@ export abstract class Story<ANS extends ANSContent = Types.Story.AStory> extends
created_date: this.formatDate(new Date()),
first_publish_date: this.formatDate(publicationDate),
publish_date: this.formatDate(publicationDate),
display_date: this.formatDate(this.getDisplayDate()),
display_date: this.formatDate(displayDate),
source,
comments,
taxonomy: {
Expand Down
Loading