@uptime.app/contracts 1.0.38-rc.9 → 1.0.39

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.
Files changed (100) hide show
  1. package/dist/cjs/text-to-speech/supported-voices.d.ts.map +1 -1
  2. package/dist/cjs/text-to-speech/supported-voices.js +22 -2
  3. package/dist/cjs/text-to-speech/supported-voices.js.map +1 -1
  4. package/dist/cjs/translation/translation-events.d.ts +1 -0
  5. package/dist/cjs/translation/translation-events.d.ts.map +1 -1
  6. package/dist/esm/text-to-speech/supported-voices.d.ts.map +1 -1
  7. package/dist/esm/text-to-speech/supported-voices.js +22 -2
  8. package/dist/esm/text-to-speech/supported-voices.js.map +1 -1
  9. package/dist/esm/translation/translation-events.d.ts +1 -0
  10. package/dist/esm/translation/translation-events.d.ts.map +1 -1
  11. package/package.json +2 -2
  12. package/src/access-control/collection-access-control.ts +28 -28
  13. package/src/access-control/hack-access-control.ts +29 -29
  14. package/src/app-hack/app-full-hack.ts +9 -9
  15. package/src/app-hack/app-hack-metadata.ts +58 -58
  16. package/src/app-hack/app-restricted-hack.ts +22 -22
  17. package/src/b2b-content-access/b2b-content-access.ts +57 -57
  18. package/src/b2b-organisation/b2b-carousel.ts +34 -34
  19. package/src/b2b-organisation/b2b-organisation-events.ts +21 -21
  20. package/src/b2b-organisation/b2b-organisation-invitation.ts +31 -31
  21. package/src/b2b-organisation/b2b-organisation-member-events.ts +21 -21
  22. package/src/b2b-organisation/b2b-organisation-member.ts +8 -8
  23. package/src/b2b-organisation/b2b-organisation.ts +15 -15
  24. package/src/brand/brand-events.ts +21 -21
  25. package/src/brand/brand.ts +19 -19
  26. package/src/catalogue/catalogue.ts +118 -118
  27. package/src/collection/collection-events.ts +21 -21
  28. package/src/collection/collection.ts +58 -58
  29. package/src/collection/enriched-collection-events.ts +18 -18
  30. package/src/collection/enriched-collection.ts +64 -64
  31. package/src/creator/creator-events.ts +32 -32
  32. package/src/creator/creator.ts +7 -7
  33. package/src/distribution/collection-distribution.ts +17 -17
  34. package/src/distribution/distribution-events.ts +61 -61
  35. package/src/distribution/hack-distribution.ts +18 -18
  36. package/src/draft-hack/draft-hack-events.ts +21 -21
  37. package/src/draft-hack/draft-hack.ts +189 -189
  38. package/src/draft-hack-generation/draft-hack-generation-events.ts +42 -42
  39. package/src/draft-hack-generation/draft-hack-generation.ts +39 -39
  40. package/src/enriched-hack/enriched-hack-events.ts +21 -21
  41. package/src/enriched-hack/enriched-hack.ts +103 -103
  42. package/src/entitlement/user-entitlements-commands.ts +33 -33
  43. package/src/entitlement/user-entitlements-events.ts +29 -29
  44. package/src/entitlement/user-entitlements.ts +18 -18
  45. package/src/hack/extracted-subject.ts +31 -31
  46. package/src/hack/hack-events.ts +21 -21
  47. package/src/hack/hack-published.ts +21 -21
  48. package/src/hack/hack-with-voice-events.ts +20 -20
  49. package/src/hack/hack-with-voice.ts +33 -33
  50. package/src/hack/hack.ts +116 -116
  51. package/src/hack/publish-hack-command.ts +18 -18
  52. package/src/hack-metadata/hack-metadata-events.ts +21 -21
  53. package/src/hack-metadata/hack-metadata.ts +17 -17
  54. package/src/hack-of-the-day/hack-of-the-day-events.ts +21 -21
  55. package/src/hack-of-the-day/hack-of-the-day.ts +13 -13
  56. package/src/index.ts +120 -120
  57. package/src/knowledge-source/knowledge-source-events.ts +21 -21
  58. package/src/knowledge-source/knowledge-source.ts +43 -43
  59. package/src/localisation/live-locales.ts +37 -37
  60. package/src/localisation/locale-language.ts +4 -4
  61. package/src/localisation/supported-languages.ts +11 -11
  62. package/src/localisation/supported-locales.ts +61 -61
  63. package/src/moderation/hack-moderation-result-events.ts +18 -18
  64. package/src/moderation/hack-moderation-result.ts +27 -27
  65. package/src/partner/partner-events.ts +21 -21
  66. package/src/partner/partner.ts +7 -7
  67. package/src/pending-hack/pending-hack-events.ts +20 -20
  68. package/src/pending-hack/pending-hack-with-voice-events.ts +20 -20
  69. package/src/pending-hack/pending-hack-with-voice.ts +25 -25
  70. package/src/pending-hack/pending-hack.ts +77 -77
  71. package/src/profile/profile-events.ts +41 -41
  72. package/src/profile/profile.ts +27 -27
  73. package/src/profile/translated-profile.ts +13 -13
  74. package/src/referral/referral-events.ts +41 -41
  75. package/src/referral/referral.ts +76 -76
  76. package/src/saved/saved-collection-events.ts +19 -19
  77. package/src/saved/saved-collection.ts +8 -8
  78. package/src/segment/segment-commands.ts +70 -70
  79. package/src/segment/segment-events.ts +42 -42
  80. package/src/segment/segment-with-voice.ts +8 -8
  81. package/src/segment/segment.ts +82 -82
  82. package/src/skin/skin-events.ts +21 -21
  83. package/src/skin/skin.ts +6 -6
  84. package/src/text-to-speech/create-speech-commands.ts +20 -20
  85. package/src/text-to-speech/speech-created-events.ts +10 -10
  86. package/src/text-to-speech/supported-voices.ts +151 -127
  87. package/src/text-to-speech/text-segment.ts +29 -29
  88. package/src/theme/theme-events.ts +21 -21
  89. package/src/theme/theme.ts +68 -68
  90. package/src/translation/translation-events.ts +73 -72
  91. package/src/translation/translation.ts +25 -25
  92. package/src/trending/trending-events.ts +21 -21
  93. package/src/trending/trending-hacks.ts +8 -8
  94. package/src/user/user-events.ts +27 -27
  95. package/src/user-context/user-context-events.ts +21 -21
  96. package/src/user-context/user-context.ts +16 -16
  97. package/src/user-notification-context/user-notification-context-events.ts +21 -21
  98. package/src/user-notification-context/user-notification-context.ts +9 -9
  99. package/tsconfig.cjs.json +7 -7
  100. package/tsconfig.npm.json +21 -21
@@ -1,39 +1,39 @@
1
- export interface GeneratedDraftHackContent {
2
- title: string;
3
- segments: GeneratedDraftHackSegments;
4
- coverUrl?: string;
5
- copyrightFreeCoverUrl?: string;
6
- topics: GeneratedDraftTopic[];
7
- notification: GeneratedDraftHackNotification;
8
- contributors: GeneratedDraftContributor[];
9
- }
10
- export interface GeneratedDraftHackSegments {
11
- favouriteQuote: GeneratedDraftHackSegment;
12
- inANutshell: GeneratedDraftHackSegment;
13
- introduction: GeneratedDraftHackSegment;
14
- insights: GeneratedDraftHackInsightSegment[];
15
- conclusion: GeneratedDraftHackSegment;
16
- }
17
- export interface GeneratedDraftHackSegment {
18
- paragraphCards: GeneratedDraftHackCard[][];
19
- }
20
- export interface GeneratedDraftHackCard {
21
- markdown: string;
22
- }
23
- export interface GeneratedDraftHackInsightSegment extends GeneratedDraftHackSegment {
24
- title: string;
25
- actions: GeneratedDraftHackAction[];
26
- }
27
- export interface GeneratedDraftHackAction {
28
- title: string;
29
- markdown: string;
30
- }
31
- export interface GeneratedDraftTopic {
32
- name: string;
33
- }
34
- export interface GeneratedDraftHackNotification {
35
- aiGeneratedText: string;
36
- }
37
- export interface GeneratedDraftContributor {
38
- name: string;
39
- }
1
+ export interface GeneratedDraftHackContent {
2
+ title: string;
3
+ segments: GeneratedDraftHackSegments;
4
+ coverUrl?: string;
5
+ copyrightFreeCoverUrl?: string;
6
+ topics: GeneratedDraftTopic[];
7
+ notification: GeneratedDraftHackNotification;
8
+ contributors: GeneratedDraftContributor[];
9
+ }
10
+ export interface GeneratedDraftHackSegments {
11
+ favouriteQuote: GeneratedDraftHackSegment;
12
+ inANutshell: GeneratedDraftHackSegment;
13
+ introduction: GeneratedDraftHackSegment;
14
+ insights: GeneratedDraftHackInsightSegment[];
15
+ conclusion: GeneratedDraftHackSegment;
16
+ }
17
+ export interface GeneratedDraftHackSegment {
18
+ paragraphCards: GeneratedDraftHackCard[][];
19
+ }
20
+ export interface GeneratedDraftHackCard {
21
+ markdown: string;
22
+ }
23
+ export interface GeneratedDraftHackInsightSegment extends GeneratedDraftHackSegment {
24
+ title: string;
25
+ actions: GeneratedDraftHackAction[];
26
+ }
27
+ export interface GeneratedDraftHackAction {
28
+ title: string;
29
+ markdown: string;
30
+ }
31
+ export interface GeneratedDraftTopic {
32
+ name: string;
33
+ }
34
+ export interface GeneratedDraftHackNotification {
35
+ aiGeneratedText: string;
36
+ }
37
+ export interface GeneratedDraftContributor {
38
+ name: string;
39
+ }
@@ -1,21 +1,21 @@
1
- import { EnrichedHack } from './enriched-hack';
2
-
3
- export interface EnrichedHackCreatedEvent {
4
- id: string;
5
- type: 'EnrichedHackCreated';
6
- payload: EnrichedHack;
7
- }
8
-
9
- export interface EnrichedHackUpdatedEvent {
10
- id: string;
11
- type: 'EnrichedHackUpdated';
12
- payload: EnrichedHack;
13
- }
14
-
15
- export interface EnrichedHackDeletedEvent {
16
- id: string;
17
- type: 'EnrichedHackDeleted';
18
- payload: EnrichedHack;
19
- }
20
-
21
- export type EnrichedHackChangedEvent = EnrichedHackCreatedEvent | EnrichedHackUpdatedEvent | EnrichedHackDeletedEvent;
1
+ import { EnrichedHack } from './enriched-hack';
2
+
3
+ export interface EnrichedHackCreatedEvent {
4
+ id: string;
5
+ type: 'EnrichedHackCreated';
6
+ payload: EnrichedHack;
7
+ }
8
+
9
+ export interface EnrichedHackUpdatedEvent {
10
+ id: string;
11
+ type: 'EnrichedHackUpdated';
12
+ payload: EnrichedHack;
13
+ }
14
+
15
+ export interface EnrichedHackDeletedEvent {
16
+ id: string;
17
+ type: 'EnrichedHackDeleted';
18
+ payload: EnrichedHack;
19
+ }
20
+
21
+ export type EnrichedHackChangedEvent = EnrichedHackCreatedEvent | EnrichedHackUpdatedEvent | EnrichedHackDeletedEvent;
@@ -1,103 +1,103 @@
1
- import { HackAffiliate, HackContributor, HackExternalLink, HackSourceData, HackTopic, HackType } from '../hack/hack';
2
- import { KnowledgeSource } from '../knowledge-source/knowledge-source';
3
- import { Profile } from '../profile/profile';
4
- import { Theme } from '../theme/theme';
5
- import { HackWithVoice } from '../hack/hack-with-voice';
6
- import { ExtractedSubject } from '../hack/extracted-subject';
7
- import { SegmentType, SegmentAction, SegmentSpeech, SegmentSection, SegmentTextCard } from '../segment/segment';
8
-
9
- export interface EnrichedHack {
10
- /** The hack id */
11
- id: string;
12
- /** The hack language e.g. 'fr' if it is French */
13
- language: string;
14
- /** The locale (language and region) of the hack e.g. fr-FR. Use @uptime.app/localisation-contracts */
15
- locale: string;
16
- /** The id of the hack in its original locale. */
17
- baseLocaleHackId: string;
18
- v: number;
19
- hackVersion: number;
20
- createdAt: string;
21
- updatedAt: string;
22
-
23
- /** introduced Oct 2023 **/
24
- draftHackId: string;
25
- draftHackVersion: number;
26
-
27
- //@todo: Deprecate
28
- source?: KnowledgeSource;
29
- owner: string;
30
- acl: string[];
31
- theme: Theme;
32
- title: string;
33
- isHidden?: boolean;
34
- editorialTags?: string[];
35
- coverUrl?: string;
36
- /** Added in July 2024. This is the URL of the cover image that is free to use without any copyright. */
37
- copyrightFreeCoverUrl?: string;
38
- notifications?: EnrichedHackNotifications;
39
- /* currently contains the inANutshell segment markdown */
40
- description: string;
41
- // ...
42
-
43
- segments: HackWithVoice['segments']; // Use the 'HackWithVoice' type
44
- affiliate?: HackAffiliate;
45
- topics: HackTopic[];
46
- contributors?: HackContributor[];
47
- type: HackType;
48
- sourceData?: HackSourceData;
49
- externalLink?: HackExternalLink;
50
- profile: EnrichHackProfile;
51
-
52
- /** added April 2024 */
53
- // TODO make it mandatory after a republish
54
- subjects?: EnrichedHackSubjects;
55
-
56
- // distribution
57
- includeInEmailNotifications: boolean;
58
- includeInPushNotifications: boolean;
59
- includeInRecommendations: boolean;
60
- includeInSearchResults: boolean;
61
- includeInTrending: boolean;
62
- includeInHackOfTheDay: boolean;
63
- includeInWebsite: boolean;
64
-
65
- /**
66
- * Time saved in minutes by consuming the hack rather than the underlying knowledge source.
67
- * calculated using the knowledge source page count / duration
68
- * */
69
- timeSaved?: number;
70
- /**
71
- * An estimation of the time saved in minutes when no reliable information is available on the knowledge source.
72
- */
73
- estimatedTimeSaved?: number;
74
- }
75
-
76
- export interface EnrichedHackNotifications {
77
- aiGeneratedText?: string;
78
- humanCuratedText?: string;
79
- }
80
-
81
- export interface EnrichedHackSubjects {
82
- aiGenerated: ExtractedSubject[];
83
- humanCurated?: ExtractedSubject[];
84
- }
85
-
86
- export interface EnrichedHackSegment {
87
- id: string;
88
- createdAt: string;
89
- updatedAt: string;
90
- title: string;
91
- type: SegmentType;
92
- keywords: string[];
93
- actions: SegmentAction[];
94
- speech: SegmentSpeech[];
95
- sections: SegmentSection[];
96
- storyMode?: {
97
- cards: SegmentTextCard[];
98
- speech: SegmentSpeech[];
99
- },
100
- textSummary?: string;
101
- }
102
-
103
- export type EnrichHackProfile = Profile | { deleted: boolean, uptimeOwned: boolean, avatarUrl: string };
1
+ import { HackAffiliate, HackContributor, HackExternalLink, HackSourceData, HackTopic, HackType } from '../hack/hack';
2
+ import { KnowledgeSource } from '../knowledge-source/knowledge-source';
3
+ import { Profile } from '../profile/profile';
4
+ import { Theme } from '../theme/theme';
5
+ import { HackWithVoice } from '../hack/hack-with-voice';
6
+ import { ExtractedSubject } from '../hack/extracted-subject';
7
+ import { SegmentType, SegmentAction, SegmentSpeech, SegmentSection, SegmentTextCard } from '../segment/segment';
8
+
9
+ export interface EnrichedHack {
10
+ /** The hack id */
11
+ id: string;
12
+ /** The hack language e.g. 'fr' if it is French */
13
+ language: string;
14
+ /** The locale (language and region) of the hack e.g. fr-FR. Use @uptime.app/localisation-contracts */
15
+ locale: string;
16
+ /** The id of the hack in its original locale. */
17
+ baseLocaleHackId: string;
18
+ v: number;
19
+ hackVersion: number;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+
23
+ /** introduced Oct 2023 **/
24
+ draftHackId: string;
25
+ draftHackVersion: number;
26
+
27
+ //@todo: Deprecate
28
+ source?: KnowledgeSource;
29
+ owner: string;
30
+ acl: string[];
31
+ theme: Theme;
32
+ title: string;
33
+ isHidden?: boolean;
34
+ editorialTags?: string[];
35
+ coverUrl?: string;
36
+ /** Added in July 2024. This is the URL of the cover image that is free to use without any copyright. */
37
+ copyrightFreeCoverUrl?: string;
38
+ notifications?: EnrichedHackNotifications;
39
+ /* currently contains the inANutshell segment markdown */
40
+ description: string;
41
+ // ...
42
+
43
+ segments: HackWithVoice['segments']; // Use the 'HackWithVoice' type
44
+ affiliate?: HackAffiliate;
45
+ topics: HackTopic[];
46
+ contributors?: HackContributor[];
47
+ type: HackType;
48
+ sourceData?: HackSourceData;
49
+ externalLink?: HackExternalLink;
50
+ profile: EnrichHackProfile;
51
+
52
+ /** added April 2024 */
53
+ // TODO make it mandatory after a republish
54
+ subjects?: EnrichedHackSubjects;
55
+
56
+ // distribution
57
+ includeInEmailNotifications: boolean;
58
+ includeInPushNotifications: boolean;
59
+ includeInRecommendations: boolean;
60
+ includeInSearchResults: boolean;
61
+ includeInTrending: boolean;
62
+ includeInHackOfTheDay: boolean;
63
+ includeInWebsite: boolean;
64
+
65
+ /**
66
+ * Time saved in minutes by consuming the hack rather than the underlying knowledge source.
67
+ * calculated using the knowledge source page count / duration
68
+ * */
69
+ timeSaved?: number;
70
+ /**
71
+ * An estimation of the time saved in minutes when no reliable information is available on the knowledge source.
72
+ */
73
+ estimatedTimeSaved?: number;
74
+ }
75
+
76
+ export interface EnrichedHackNotifications {
77
+ aiGeneratedText?: string;
78
+ humanCuratedText?: string;
79
+ }
80
+
81
+ export interface EnrichedHackSubjects {
82
+ aiGenerated: ExtractedSubject[];
83
+ humanCurated?: ExtractedSubject[];
84
+ }
85
+
86
+ export interface EnrichedHackSegment {
87
+ id: string;
88
+ createdAt: string;
89
+ updatedAt: string;
90
+ title: string;
91
+ type: SegmentType;
92
+ keywords: string[];
93
+ actions: SegmentAction[];
94
+ speech: SegmentSpeech[];
95
+ sections: SegmentSection[];
96
+ storyMode?: {
97
+ cards: SegmentTextCard[];
98
+ speech: SegmentSpeech[];
99
+ },
100
+ textSummary?: string;
101
+ }
102
+
103
+ export type EnrichHackProfile = Profile | { deleted: boolean, uptimeOwned: boolean, avatarUrl: string };
@@ -1,33 +1,33 @@
1
- import { Entitlement, EntitlementName } from './user-entitlements';
2
-
3
- export interface IssueUserEntitlementCommand {
4
- id: string;
5
- type: 'IssueUserEntitlement',
6
- payload: IssueUserEntitlementCommandPayload
7
- }
8
-
9
- export interface IssueUserEntitlementCommandPayload extends Entitlement {
10
- id: string;
11
- v: number;
12
- userId: string;
13
- }
14
-
15
- export interface RemoveUserEntitlementCommand {
16
- id: string;
17
- type: 'RemoveUserEntitlement',
18
- payload: RemoveUserEntitlementCommandPayload
19
- }
20
-
21
- export interface RemoveUserEntitlementCommandPayload {
22
- issuer: string;
23
- entitlement: EntitlementName | string;
24
- userId: string;
25
- }
26
-
27
- export interface RefreshRevenueCatUserStatusCommand {
28
- id: string;
29
- type: 'RefreshRevenueCatUserStatus',
30
- payload: {
31
- userId: string;
32
- };
33
- }
1
+ import { Entitlement, EntitlementName } from './user-entitlements';
2
+
3
+ export interface IssueUserEntitlementCommand {
4
+ id: string;
5
+ type: 'IssueUserEntitlement',
6
+ payload: IssueUserEntitlementCommandPayload
7
+ }
8
+
9
+ export interface IssueUserEntitlementCommandPayload extends Entitlement {
10
+ id: string;
11
+ v: number;
12
+ userId: string;
13
+ }
14
+
15
+ export interface RemoveUserEntitlementCommand {
16
+ id: string;
17
+ type: 'RemoveUserEntitlement',
18
+ payload: RemoveUserEntitlementCommandPayload
19
+ }
20
+
21
+ export interface RemoveUserEntitlementCommandPayload {
22
+ issuer: string;
23
+ entitlement: EntitlementName | string;
24
+ userId: string;
25
+ }
26
+
27
+ export interface RefreshRevenueCatUserStatusCommand {
28
+ id: string;
29
+ type: 'RefreshRevenueCatUserStatus',
30
+ payload: {
31
+ userId: string;
32
+ };
33
+ }
@@ -1,29 +1,29 @@
1
- import { UserEntitlements } from './user-entitlements';
2
-
3
- export interface UserEntitlementsCreatedEvent {
4
- id: string;
5
- type: 'UserEntitlementsCreated';
6
- payload: UserEntitlements;
7
- }
8
-
9
- export interface UserEntitlementsUpdatedEvent {
10
- id: string;
11
- type: 'UserEntitlementsUpdated';
12
- payload: UserEntitlements;
13
- }
14
-
15
- export interface UserEntitlementsDeletedEvent {
16
- id: string;
17
- type: 'UserEntitlementsDeleted';
18
- payload: UserEntitlements;
19
- }
20
-
21
- export type UserEntitlementsChangedEvent = UserEntitlementsCreatedEvent | UserEntitlementsUpdatedEvent | UserEntitlementsDeletedEvent;
22
-
23
- export interface RevenueCatWebhookReceivedEvent {
24
- id: string;
25
- type: 'RevenueCatWebhookReceived',
26
- payload: {
27
- event: any;
28
- };
29
- }
1
+ import { UserEntitlements } from './user-entitlements';
2
+
3
+ export interface UserEntitlementsCreatedEvent {
4
+ id: string;
5
+ type: 'UserEntitlementsCreated';
6
+ payload: UserEntitlements;
7
+ }
8
+
9
+ export interface UserEntitlementsUpdatedEvent {
10
+ id: string;
11
+ type: 'UserEntitlementsUpdated';
12
+ payload: UserEntitlements;
13
+ }
14
+
15
+ export interface UserEntitlementsDeletedEvent {
16
+ id: string;
17
+ type: 'UserEntitlementsDeleted';
18
+ payload: UserEntitlements;
19
+ }
20
+
21
+ export type UserEntitlementsChangedEvent = UserEntitlementsCreatedEvent | UserEntitlementsUpdatedEvent | UserEntitlementsDeletedEvent;
22
+
23
+ export interface RevenueCatWebhookReceivedEvent {
24
+ id: string;
25
+ type: 'RevenueCatWebhookReceived',
26
+ payload: {
27
+ event: any;
28
+ };
29
+ }
@@ -1,18 +1,18 @@
1
- export type EntitlementName = 'premium' | 'trial';
2
- export type EntitlementIssuer = 'Uptime' | 'RevenueCat';
3
-
4
- export type Entitlement = {
5
- entitlement: EntitlementName | string;
6
- issuer: EntitlementIssuer | string;
7
- expiresAt: string
8
- issuedAt: string;
9
- };
10
-
11
- export interface UserEntitlements {
12
- id: string;
13
- v: number;
14
- createdAt: string;
15
- updatedAt: string;
16
- userId: string;
17
- entitlements: Entitlement[];
18
- }
1
+ export type EntitlementName = 'premium' | 'trial';
2
+ export type EntitlementIssuer = 'Uptime' | 'RevenueCat';
3
+
4
+ export type Entitlement = {
5
+ entitlement: EntitlementName | string;
6
+ issuer: EntitlementIssuer | string;
7
+ expiresAt: string
8
+ issuedAt: string;
9
+ };
10
+
11
+ export interface UserEntitlements {
12
+ id: string;
13
+ v: number;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ userId: string;
17
+ entitlements: Entitlement[];
18
+ }
@@ -1,31 +1,31 @@
1
- export interface ExtractedSubject {
2
- name: string;
3
- }
4
-
5
- export interface ExtractSubjectsCommandBody {
6
- id: string;
7
- v: number;
8
- reference: string;
9
- content: string;
10
- contentType: string; // e.g. 'hack'
11
- }
12
-
13
- export interface ExtractSubjectsCommand {
14
- id: string;
15
- type: 'ExtractSubjectsCommand';
16
- payload: ExtractSubjectsCommandBody;
17
- }
18
-
19
- export interface SubjectsExtracted {
20
- id: string;
21
- type: 'SubjectsExtracted',
22
- payload: SubjectsExtractedBody
23
- }
24
-
25
- export interface SubjectsExtractedBody {
26
- id: string,
27
- v: number,
28
- reference: string,
29
- contentType: string;
30
- subjects: ExtractedSubject[]
31
- }
1
+ export interface ExtractedSubject {
2
+ name: string;
3
+ }
4
+
5
+ export interface ExtractSubjectsCommandBody {
6
+ id: string;
7
+ v: number;
8
+ reference: string;
9
+ content: string;
10
+ contentType: string; // e.g. 'hack'
11
+ }
12
+
13
+ export interface ExtractSubjectsCommand {
14
+ id: string;
15
+ type: 'ExtractSubjectsCommand';
16
+ payload: ExtractSubjectsCommandBody;
17
+ }
18
+
19
+ export interface SubjectsExtracted {
20
+ id: string;
21
+ type: 'SubjectsExtracted',
22
+ payload: SubjectsExtractedBody
23
+ }
24
+
25
+ export interface SubjectsExtractedBody {
26
+ id: string,
27
+ v: number,
28
+ reference: string,
29
+ contentType: string;
30
+ subjects: ExtractedSubject[]
31
+ }
@@ -1,21 +1,21 @@
1
- import { Hack } from './hack';
2
-
3
- export interface HackCreatedEvent {
4
- id: string;
5
- type: 'HackCreated';
6
- payload: Hack;
7
- }
8
-
9
- export interface HackUpdatedEvent {
10
- id: string;
11
- type: 'HackUpdated';
12
- payload: Hack;
13
- }
14
-
15
- export interface HackDeletedEvent {
16
- id: string;
17
- type: 'HackDeleted';
18
- payload: Hack;
19
- }
20
-
21
- export type HackChangedEvent = HackCreatedEvent | HackUpdatedEvent | HackDeletedEvent;
1
+ import { Hack } from './hack';
2
+
3
+ export interface HackCreatedEvent {
4
+ id: string;
5
+ type: 'HackCreated';
6
+ payload: Hack;
7
+ }
8
+
9
+ export interface HackUpdatedEvent {
10
+ id: string;
11
+ type: 'HackUpdated';
12
+ payload: Hack;
13
+ }
14
+
15
+ export interface HackDeletedEvent {
16
+ id: string;
17
+ type: 'HackDeleted';
18
+ payload: Hack;
19
+ }
20
+
21
+ export type HackChangedEvent = HackCreatedEvent | HackUpdatedEvent | HackDeletedEvent;
@@ -1,21 +1,21 @@
1
- /**
2
- * HackPublished events were introduce in March 2023 and have not been backfilled. Previously PendingHackDeleted events were used.
3
- */
4
- export interface HackPublishedEvent {
5
- id: string;
6
- type: 'HackPublished';
7
- payload: {
8
- /** set as the hack id */
9
- id: string;
10
- /** set as the hack version */
11
- v: number;
12
- draftHackId: string;
13
- draftHackVersion: number;
14
- hackId: string;
15
- hackVersion: number;
16
- baseLocaleHackId: string;
17
- // added very shortly after the event was introduced so a handful of historic events may be missing this property
18
- publishCompletedAt: string
19
- publishStartedAt: string;
20
- }
21
- }
1
+ /**
2
+ * HackPublished events were introduce in March 2023 and have not been backfilled. Previously PendingHackDeleted events were used.
3
+ */
4
+ export interface HackPublishedEvent {
5
+ id: string;
6
+ type: 'HackPublished';
7
+ payload: {
8
+ /** set as the hack id */
9
+ id: string;
10
+ /** set as the hack version */
11
+ v: number;
12
+ draftHackId: string;
13
+ draftHackVersion: number;
14
+ hackId: string;
15
+ hackVersion: number;
16
+ baseLocaleHackId: string;
17
+ // added very shortly after the event was introduced so a handful of historic events may be missing this property
18
+ publishCompletedAt: string
19
+ publishStartedAt: string;
20
+ }
21
+ }