@uptime.app/contracts 1.0.11 → 1.0.13-rc.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.
Files changed (167) hide show
  1. package/dist/cjs/access-control/collection-access-control.d.ts +25 -0
  2. package/dist/cjs/access-control/collection-access-control.d.ts.map +1 -0
  3. package/dist/cjs/access-control/collection-access-control.js +3 -0
  4. package/dist/cjs/access-control/collection-access-control.js.map +1 -0
  5. package/dist/cjs/access-control/hack-access-control.d.ts +25 -0
  6. package/dist/cjs/access-control/hack-access-control.d.ts.map +1 -0
  7. package/dist/cjs/access-control/hack-access-control.js +3 -0
  8. package/dist/cjs/access-control/hack-access-control.js.map +1 -0
  9. package/dist/cjs/distribution/collection-distribution.d.ts +17 -0
  10. package/dist/cjs/distribution/collection-distribution.d.ts.map +1 -0
  11. package/dist/cjs/distribution/collection-distribution.js +3 -0
  12. package/dist/cjs/distribution/collection-distribution.js.map +1 -0
  13. package/dist/cjs/distribution/distribution-events.d.ts +53 -0
  14. package/dist/cjs/distribution/distribution-events.d.ts.map +1 -0
  15. package/dist/cjs/distribution/distribution-events.js +3 -0
  16. package/dist/cjs/distribution/distribution-events.js.map +1 -0
  17. package/dist/cjs/distribution/hack-distribution.d.ts +19 -0
  18. package/dist/cjs/distribution/hack-distribution.d.ts.map +1 -0
  19. package/dist/cjs/distribution/hack-distribution.js +3 -0
  20. package/dist/cjs/distribution/hack-distribution.js.map +1 -0
  21. package/dist/cjs/draft-hack/draft-hack.d.ts +3 -5
  22. package/dist/cjs/draft-hack/draft-hack.d.ts.map +1 -1
  23. package/dist/cjs/draft-hack/draft-hack.js +0 -20
  24. package/dist/cjs/draft-hack/draft-hack.js.map +1 -1
  25. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.d.ts +36 -0
  26. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.d.ts.map +1 -0
  27. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.js +3 -0
  28. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.js.map +1 -0
  29. package/dist/cjs/draft-hack-generation/draft-hack-generation.d.ts +39 -0
  30. package/dist/cjs/draft-hack-generation/draft-hack-generation.d.ts.map +1 -0
  31. package/dist/cjs/draft-hack-generation/draft-hack-generation.js +3 -0
  32. package/dist/cjs/draft-hack-generation/draft-hack-generation.js.map +1 -0
  33. package/dist/cjs/enriched-hack/enriched-hack-events.d.ts +18 -0
  34. package/dist/cjs/enriched-hack/enriched-hack-events.d.ts.map +1 -0
  35. package/dist/cjs/enriched-hack/enriched-hack-events.js +3 -0
  36. package/dist/cjs/enriched-hack/enriched-hack-events.js.map +1 -0
  37. package/dist/cjs/enriched-hack/enriched-hack.d.ts +90 -0
  38. package/dist/cjs/enriched-hack/enriched-hack.d.ts.map +1 -0
  39. package/dist/cjs/enriched-hack/enriched-hack.js +3 -0
  40. package/dist/cjs/enriched-hack/enriched-hack.js.map +1 -0
  41. package/dist/cjs/hack/hack.d.ts +1 -1
  42. package/dist/cjs/hack/hack.d.ts.map +1 -1
  43. package/dist/cjs/index.d.ts +18 -6
  44. package/dist/cjs/index.d.ts.map +1 -1
  45. package/dist/cjs/index.js +18 -6
  46. package/dist/cjs/index.js.map +1 -1
  47. package/dist/cjs/profile/profile-events.d.ts +35 -0
  48. package/dist/cjs/profile/profile-events.d.ts.map +1 -0
  49. package/dist/cjs/profile/profile-events.js +3 -0
  50. package/dist/cjs/profile/profile-events.js.map +1 -0
  51. package/dist/cjs/profile/profile.d.ts +25 -0
  52. package/dist/cjs/profile/profile.d.ts.map +1 -0
  53. package/dist/cjs/profile/profile.js +3 -0
  54. package/dist/cjs/profile/profile.js.map +1 -0
  55. package/dist/cjs/profile/translated-profile.d.ts +13 -0
  56. package/dist/cjs/profile/translated-profile.d.ts.map +1 -0
  57. package/dist/cjs/profile/translated-profile.js +3 -0
  58. package/dist/cjs/profile/translated-profile.js.map +1 -0
  59. package/dist/esm/access-control/collection-access-control.d.ts +25 -0
  60. package/dist/esm/access-control/collection-access-control.d.ts.map +1 -0
  61. package/dist/esm/access-control/collection-access-control.js +2 -0
  62. package/dist/esm/access-control/collection-access-control.js.map +1 -0
  63. package/dist/esm/access-control/hack-access-control.d.ts +25 -0
  64. package/dist/esm/access-control/hack-access-control.d.ts.map +1 -0
  65. package/dist/esm/access-control/hack-access-control.js +2 -0
  66. package/dist/esm/access-control/hack-access-control.js.map +1 -0
  67. package/dist/esm/distribution/collection-distribution.d.ts +17 -0
  68. package/dist/esm/distribution/collection-distribution.d.ts.map +1 -0
  69. package/dist/esm/distribution/collection-distribution.js +2 -0
  70. package/dist/esm/distribution/collection-distribution.js.map +1 -0
  71. package/dist/esm/distribution/distribution-events.d.ts +53 -0
  72. package/dist/esm/distribution/distribution-events.d.ts.map +1 -0
  73. package/dist/esm/distribution/distribution-events.js +2 -0
  74. package/dist/esm/distribution/distribution-events.js.map +1 -0
  75. package/dist/esm/distribution/hack-distribution.d.ts +19 -0
  76. package/dist/esm/distribution/hack-distribution.d.ts.map +1 -0
  77. package/dist/esm/distribution/hack-distribution.js +2 -0
  78. package/dist/esm/distribution/hack-distribution.js.map +1 -0
  79. package/dist/esm/draft-hack/draft-hack.d.ts +3 -5
  80. package/dist/esm/draft-hack/draft-hack.d.ts.map +1 -1
  81. package/dist/esm/draft-hack/draft-hack.js +1 -19
  82. package/dist/esm/draft-hack/draft-hack.js.map +1 -1
  83. package/dist/esm/draft-hack-generation/draft-hack-generation-events.d.ts +36 -0
  84. package/dist/esm/draft-hack-generation/draft-hack-generation-events.d.ts.map +1 -0
  85. package/dist/esm/draft-hack-generation/draft-hack-generation-events.js +2 -0
  86. package/dist/esm/draft-hack-generation/draft-hack-generation-events.js.map +1 -0
  87. package/dist/esm/draft-hack-generation/draft-hack-generation.d.ts +39 -0
  88. package/dist/esm/draft-hack-generation/draft-hack-generation.d.ts.map +1 -0
  89. package/dist/esm/draft-hack-generation/draft-hack-generation.js +2 -0
  90. package/dist/esm/draft-hack-generation/draft-hack-generation.js.map +1 -0
  91. package/dist/esm/enriched-hack/enriched-hack-events.d.ts +18 -0
  92. package/dist/esm/enriched-hack/enriched-hack-events.d.ts.map +1 -0
  93. package/dist/esm/enriched-hack/enriched-hack-events.js +2 -0
  94. package/dist/esm/enriched-hack/enriched-hack-events.js.map +1 -0
  95. package/dist/esm/enriched-hack/enriched-hack.d.ts +90 -0
  96. package/dist/esm/enriched-hack/enriched-hack.d.ts.map +1 -0
  97. package/dist/esm/enriched-hack/enriched-hack.js +2 -0
  98. package/dist/esm/enriched-hack/enriched-hack.js.map +1 -0
  99. package/dist/esm/hack/hack.d.ts +1 -1
  100. package/dist/esm/hack/hack.d.ts.map +1 -1
  101. package/dist/esm/index.d.ts +18 -6
  102. package/dist/esm/index.d.ts.map +1 -1
  103. package/dist/esm/index.js +18 -6
  104. package/dist/esm/index.js.map +1 -1
  105. package/dist/esm/profile/profile-events.d.ts +35 -0
  106. package/dist/esm/profile/profile-events.d.ts.map +1 -0
  107. package/dist/esm/profile/profile-events.js +2 -0
  108. package/dist/esm/profile/profile-events.js.map +1 -0
  109. package/dist/esm/profile/profile.d.ts +25 -0
  110. package/dist/esm/profile/profile.d.ts.map +1 -0
  111. package/dist/esm/profile/profile.js +2 -0
  112. package/dist/esm/profile/profile.js.map +1 -0
  113. package/dist/esm/profile/translated-profile.d.ts +13 -0
  114. package/dist/esm/profile/translated-profile.d.ts.map +1 -0
  115. package/dist/esm/profile/translated-profile.js +2 -0
  116. package/dist/esm/profile/translated-profile.js.map +1 -0
  117. package/package.json +2 -2
  118. package/src/access-control/collection-access-control.ts +28 -0
  119. package/src/access-control/hack-access-control.ts +29 -0
  120. package/src/b2b-organisation/b2b-organisation-events.ts +21 -21
  121. package/src/b2b-organisation/b2b-organisation-member-events.ts +21 -21
  122. package/src/b2b-organisation/b2b-organisation-member.ts +8 -8
  123. package/src/b2b-organisation/b2b-organisation.ts +14 -14
  124. package/src/brand/brand-events.ts +21 -21
  125. package/src/brand/brand.ts +8 -8
  126. package/src/distribution/collection-distribution.ts +17 -0
  127. package/src/distribution/distribution-events.ts +61 -0
  128. package/src/distribution/hack-distribution.ts +19 -0
  129. package/src/draft-hack/draft-hack-events.ts +21 -21
  130. package/src/draft-hack/draft-hack.ts +184 -208
  131. package/src/draft-hack-generation/draft-hack-generation-events.ts +42 -0
  132. package/src/draft-hack-generation/draft-hack-generation.ts +38 -0
  133. package/src/enriched-hack/enriched-hack-events.ts +21 -0
  134. package/src/enriched-hack/enriched-hack.ts +101 -0
  135. package/src/hack/extracted-subject.ts +4 -4
  136. package/src/hack/hack-events.ts +21 -21
  137. package/src/hack/hack-with-voice-events.ts +20 -20
  138. package/src/hack/hack-with-voice.ts +33 -33
  139. package/src/hack/hack.ts +114 -114
  140. package/src/hack-metadata/hack-metadata-events.ts +21 -21
  141. package/src/hack-metadata/hack-metadata.ts +17 -17
  142. package/src/index.ts +64 -47
  143. package/src/knowledge-source/knowledge-source-events.ts +21 -21
  144. package/src/knowledge-source/knowledge-source.ts +43 -43
  145. package/src/localisation/live-locales.ts +32 -32
  146. package/src/localisation/locale-language.ts +4 -4
  147. package/src/localisation/supported-languages.ts +11 -11
  148. package/src/localisation/supported-locales.ts +42 -42
  149. package/src/pending-hack/pending-hack-events.ts +20 -20
  150. package/src/pending-hack/pending-hack-with-voice-events.ts +20 -20
  151. package/src/pending-hack/pending-hack-with-voice.ts +25 -25
  152. package/src/pending-hack/pending-hack.ts +75 -75
  153. package/src/profile/profile-events.ts +41 -0
  154. package/src/profile/profile.ts +27 -0
  155. package/src/profile/translated-profile.ts +13 -0
  156. package/src/segment/segment-commands.ts +70 -70
  157. package/src/segment/segment-with-voice.ts +8 -8
  158. package/src/segment/segment.ts +82 -82
  159. package/src/skin/skin-events.ts +21 -21
  160. package/src/skin/skin.ts +6 -6
  161. package/src/text-to-speech/create-speech-commands.ts +20 -20
  162. package/src/text-to-speech/speech-created-events.ts +11 -11
  163. package/src/text-to-speech/text-segment.ts +29 -29
  164. package/src/theme/theme-events.ts +21 -21
  165. package/src/theme/theme.ts +68 -68
  166. package/tsconfig.cjs.json +7 -7
  167. package/tsconfig.npm.json +21 -21
@@ -0,0 +1,61 @@
1
+ import { HackDistribution } from './hack-distribution';
2
+ import { CollectionDistribution } from './collection-distribution';
3
+
4
+ export interface HackDistributionCreatedEvent {
5
+ id: string;
6
+ type: 'HackDistributionCreated';
7
+ payload: HackDistribution;
8
+ }
9
+
10
+ export interface HackDistributionUpdatedEvent {
11
+ id: string;
12
+ type: 'HackDistributionUpdated';
13
+ payload: HackDistribution;
14
+ }
15
+
16
+ export interface HackDistributionDeletedEvent {
17
+ id: string;
18
+ type: 'HackDistributionDeleted';
19
+ payload: HackDistribution;
20
+ }
21
+
22
+ export interface CollectionDistributionCreatedEvent {
23
+ id: string;
24
+ type: 'CollectionDistributionCreated';
25
+ payload: CollectionDistribution;
26
+ }
27
+
28
+ export interface CollectionDistributionUpdatedEvent {
29
+ id: string;
30
+ type: 'CollectionDistributionUpdated';
31
+ payload: CollectionDistribution;
32
+ }
33
+
34
+ export interface CollectionDistributionDeletedEvent {
35
+ id: string;
36
+ type: 'CollectionDistributionDeleted';
37
+ payload: CollectionDistribution;
38
+ }
39
+
40
+ export type HackDistributionChangedEvent = HackDistributionCreatedEvent | HackDistributionUpdatedEvent | HackDistributionDeletedEvent;
41
+ export type CollectionDistributionChangedEvent = CollectionDistributionCreatedEvent | CollectionDistributionUpdatedEvent | CollectionDistributionDeletedEvent;
42
+
43
+ export interface CheckPrivateHackDistributionEvent {
44
+ id: string;
45
+ type: 'CheckPrivateHackDistribution'
46
+ payload: {
47
+ id: string;
48
+ v: number;
49
+ hackId: string;
50
+ }
51
+ }
52
+
53
+ export interface CheckPrivateCollectionDistributionEvent {
54
+ id: string;
55
+ type: 'CheckPrivateCollectionDistribution'
56
+ payload: {
57
+ id: string;
58
+ v: number;
59
+ collectionId: string;
60
+ }
61
+ }
@@ -0,0 +1,19 @@
1
+ export interface HackDistribution extends HackDistributionProperties {
2
+ id: string;
3
+ v: number;
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ hackId: string;
7
+ baseLocaleHackId: string; // added 09/03/23 to allow syncing across hacks with the same baseLocaleHackId
8
+ }
9
+
10
+ export interface HackDistributionProperties {
11
+ includeInEmailNotifications: boolean;
12
+ includeInPushNotifications: boolean;
13
+ includeInRecommendations: boolean;
14
+ includeInSearchResults: boolean;
15
+ includeInTrending: boolean;
16
+ includeInHackOfTheDay: boolean;
17
+ includeInWebsite: boolean;
18
+ isHidden: boolean; // added 17/11/22, to replace Hack property with the same name
19
+ }
@@ -1,21 +1,21 @@
1
- import { DraftHack } from './draft-hack';
2
-
3
- export interface DraftHackCreatedEvent {
4
- id: string;
5
- type: 'DraftHackCreated';
6
- payload: DraftHack;
7
- }
8
-
9
- export interface DraftHackUpdatedEvent {
10
- id: string;
11
- type: 'DraftHackUpdated';
12
- payload: DraftHack;
13
- }
14
-
15
- export interface DraftHackDeletedEvent {
16
- id: string;
17
- type: 'DraftHackDeleted';
18
- payload: DraftHack;
19
- }
20
-
21
- export type DraftHackChangedEvent = DraftHackCreatedEvent | DraftHackUpdatedEvent | DraftHackDeletedEvent;
1
+ import { DraftHack } from './draft-hack';
2
+
3
+ export interface DraftHackCreatedEvent {
4
+ id: string;
5
+ type: 'DraftHackCreated';
6
+ payload: DraftHack;
7
+ }
8
+
9
+ export interface DraftHackUpdatedEvent {
10
+ id: string;
11
+ type: 'DraftHackUpdated';
12
+ payload: DraftHack;
13
+ }
14
+
15
+ export interface DraftHackDeletedEvent {
16
+ id: string;
17
+ type: 'DraftHackDeleted';
18
+ payload: DraftHack;
19
+ }
20
+
21
+ export type DraftHackChangedEvent = DraftHackCreatedEvent | DraftHackUpdatedEvent | DraftHackDeletedEvent;
@@ -1,208 +1,184 @@
1
- import { SupportedLocale } from '../localisation/supported-locales';
2
-
3
- export interface DraftHack extends DraftHackContent {
4
- /** The unique id of the draft hack. */
5
- id: string;
6
- /** The locale (language and region) of the draft hack e.g. fr-FR. Mandatory property since 12/01/2023. */
7
- locale: SupportedLocale;
8
- /** @deprecated Temporarily added in 12/01/2023. Should not be used under any circumstance as only a handful of drafts will contain this property */
9
- baseLocaleDraftHackId?: string;
10
- /** The id of the hack. Mandatory property since Dec 2022. */
11
- hackId: string;
12
- /** The id of the hack in its original locale. Mandatory property since 01/02/2023. */
13
- baseLocaleHackId: string;
14
-
15
- v: number;
16
- createdAt: string;
17
- updatedAt: string;
18
- publishedAt?: string;
19
- publishedVersion?: number;
20
- owner?: string;
21
- /** workflowStatus was added in May 2022 as we move toward UGC. Older drafts have not been backfilled */
22
- workflowStatus?: DraftHackWorkflowStatus;
23
- /** added in Nov 2022. Set to true whenever content changes are made to the draft */
24
- hasUnpublishedChanges?: boolean;
25
- /** added in March 2023. Must be set whenever content changes are made to the draft */
26
- contentUpdatedAt?: string;
27
- /** added in late April 2023. Only set on translations. Set to the value of contentUpdatedAt of the base locale draft that was translated. Can be used to determine if the translated draft is out of sync with the original draft */
28
- baseLocaleContentUpdatedAt?: string;
29
- }
30
-
31
- // this status is currently used to present the draft in different columns in the airtable used by the content team
32
- export type DraftHackWorkflowStatus = 'publishing' | 'published';
33
-
34
- export interface DraftHackContent {
35
- /**
36
- * @maxLength 150
37
- */
38
- title: string;
39
- /**
40
- * @maxLength 50
41
- */
42
- sourceId?: string;
43
- /**
44
- * @maxLength 50
45
- */
46
- themeId?: string;
47
- segments: DraftHackSegments;
48
- /**
49
- * @maxLength 1000
50
- */
51
- coverUrl?: string;
52
- notifications?: DraftHackNotifications
53
- affiliate?: DraftAffiliate;
54
- /**
55
- * @maxItems 50
56
- */
57
- topics?: DraftTopic[];
58
- /**
59
- * @maxItems 10
60
- */
61
- contributors?: DraftContributor[];
62
- sourceData?: DraftSourceData;
63
- /** For creators only. We will tackle this validation once profiles are introduce*/
64
- externalLink?: DraftHackExternalLink;
65
- /** For recording purpose for now, we will use this value further in the future */
66
- contentRating?: DraftHackRating;
67
- /**
68
- * @maxItems 50
69
- * @items.maxLength 150
70
- */
71
- tags?: string[];
72
- type?: DraftHackType;
73
- isCopyrightFree?: boolean;
74
- }
75
-
76
- export type DraftHackRating = 'mature' | 'appropriate';
77
-
78
- export interface DraftHackNotifications {
79
- /**
80
- * @maxLength 1000
81
- */
82
- aiGeneratedText?: string;
83
- /**
84
- * @maxLength 1000
85
- */
86
- humanCuratedText?: string;
87
- }
88
-
89
- export interface DraftHackSegments {
90
- favouriteQuote?: DraftHackSegment;
91
- inANutshell?: DraftHackSegment;
92
- introduction?: DraftHackSegment;
93
- /**
94
- * @maxItems 10
95
- */
96
- insights?: DraftHackInsightSegment[];
97
- conclusion?: DraftHackSegment;
98
- }
99
-
100
- export interface DraftHackCard {
101
- /**
102
- * @maxLength 2000
103
- */
104
- markdown: string;
105
- }
106
-
107
- export interface DraftHackSegment {
108
- /**
109
- * @maxItems 50
110
- * @items.maxLength 150
111
- */
112
- keywords: string[];
113
- paragraphCards: DraftHackCard[][];
114
- /**
115
- * @maxLength 1000
116
- */
117
- textSummary?: string;
118
- }
119
-
120
- export interface DraftHackInsightSegment extends DraftHackSegment {
121
- /**
122
- * @maxLength 150
123
- */
124
- title?: string;
125
- /**
126
- * @maxItems 50
127
- */
128
- actions: DraftHackAction[];
129
- }
130
-
131
- export interface DraftHackAction {
132
- /**
133
- * @maxLength 150
134
- */
135
- title: string;
136
- /**
137
- * @maxLength 1000
138
- */
139
- markdown: string
140
- }
141
-
142
- export interface DraftContributor {
143
- /**
144
- * @maxLength 150
145
- */
146
- name: string;
147
- }
148
-
149
- export interface DraftTopic {
150
- /**
151
- * @maxLength 150
152
- */
153
- name: string;
154
- }
155
-
156
- export interface DraftAffiliate {
157
- /**
158
- * @maxLength 1000
159
- */
160
- url?: string;
161
- /**
162
- * @maxLength 150
163
- */
164
- name?: string;
165
- }
166
-
167
- export interface DraftSourceData {
168
- /**
169
- * @maxLength 150
170
- */
171
- episodeTitle?: string;
172
- /**
173
- * @maxLength 50
174
- */
175
- releaseDate?: string;
176
- }
177
-
178
- // this is a neat way to select a subset of properties to create a new interface, and have the property names available in code
179
- export const draftHackListModelProperties = [
180
- 'id',
181
- 'v',
182
- 'owner',
183
- 'createdAt',
184
- 'updatedAt',
185
- 'publishedAt',
186
- 'publishedVersion',
187
- 'title',
188
- 'coverUrl',
189
- 'type',
190
- 'workflowStatus',
191
- 'hasUnpublishedChanges',
192
- 'tags',
193
- 'locale',
194
- 'hackId',
195
- 'baseLocaleHackId'
196
- ] as const;
197
-
198
- export interface DraftHackExternalLink {
199
- /**
200
- * @maxLength 1000
201
- */
202
- url: string;
203
- type: 'Website' | 'Book' | 'Course' | 'Podcast' | 'Video' | 'Other';
204
- }
205
-
206
- export declare type DraftHackType = 'book' | 'course' | 'documentary' | 'podcast' | 'original';
207
-
208
- export type DraftHackListModel = Pick<DraftHack, typeof draftHackListModelProperties[number]>;
1
+ import { SupportedLocale } from '../localisation/supported-locales';
2
+
3
+ export interface DraftHack extends DraftHackContent {
4
+ /** The unique id of the draft hack. */
5
+ id: string;
6
+ /** The locale (language and region) of the draft hack e.g. fr-FR. Mandatory property since 12/01/2023. */
7
+ locale: SupportedLocale;
8
+ /** @deprecated Temporarily added in 12/01/2023. Should not be used under any circumstance as only a handful of drafts will contain this property */
9
+ baseLocaleDraftHackId?: string;
10
+ /** The id of the hack. Mandatory property since Dec 2022. */
11
+ hackId: string;
12
+ /** The id of the hack in its original locale. Mandatory property since 01/02/2023. */
13
+ baseLocaleHackId: string;
14
+
15
+ v: number;
16
+ createdAt: string;
17
+ updatedAt: string;
18
+ publishedAt?: string;
19
+ publishedVersion?: number;
20
+ owner?: string;
21
+ /** workflowStatus was added in May 2022 as we move toward UGC. Older drafts have not been backfilled */
22
+ workflowStatus?: DraftHackWorkflowStatus;
23
+ /** added in Nov 2022. Set to true whenever content changes are made to the draft */
24
+ hasUnpublishedChanges?: boolean;
25
+ /** added in March 2023. Must be set whenever content changes are made to the draft */
26
+ contentUpdatedAt?: string;
27
+ /** added in late April 2023. Only set on translations. Set to the value of contentUpdatedAt of the base locale draft that was translated. Can be used to determine if the translated draft is out of sync with the original draft */
28
+ baseLocaleContentUpdatedAt?: string;
29
+ }
30
+
31
+ export interface DraftHackContent {
32
+ /**
33
+ * @maxLength 150
34
+ */
35
+ title: string;
36
+ /**
37
+ * @maxLength 50
38
+ */
39
+ sourceId?: string;
40
+ /**
41
+ * @maxLength 50
42
+ */
43
+ themeId?: string;
44
+ segments: DraftHackSegments;
45
+ /**
46
+ * @maxLength 1000
47
+ */
48
+ coverUrl?: string;
49
+ notifications?: DraftHackNotifications;
50
+ affiliate?: DraftAffiliate;
51
+ /**
52
+ * @maxItems 50
53
+ */
54
+ topics?: DraftTopic[];
55
+ /**
56
+ * @maxItems 10
57
+ */
58
+ contributors?: DraftContributor[];
59
+ sourceData?: DraftSourceData;
60
+ /** For creators only. We will tackle this validation once profiles are introduce*/
61
+ externalLink?: DraftHackExternalLink;
62
+ /** For recording purpose for now, we will use this value further in the future */
63
+ contentRating?: DraftHackRating;
64
+ /**
65
+ * @maxItems 50
66
+ * @items.maxLength 150
67
+ */
68
+ tags?: string[];
69
+ type?: DraftHackType;
70
+ isCopyrightFree?: boolean;
71
+ }
72
+
73
+ export interface DraftHackNotifications {
74
+ /**
75
+ * @maxLength 1000
76
+ */
77
+ aiGeneratedText?: string;
78
+ /**
79
+ * @maxLength 1000
80
+ */
81
+ humanCuratedText?: string;
82
+ }
83
+
84
+ export interface DraftHackSegments {
85
+ favouriteQuote?: DraftHackSegment;
86
+ inANutshell?: DraftHackSegment;
87
+ introduction?: DraftHackSegment;
88
+ /**
89
+ * @maxItems 10
90
+ */
91
+ insights?: DraftHackInsightSegment[];
92
+ conclusion?: DraftHackSegment;
93
+ }
94
+
95
+ export interface DraftHackCard {
96
+ /**
97
+ * @maxLength 2000
98
+ */
99
+ markdown: string;
100
+ }
101
+
102
+ export interface DraftHackSegment {
103
+ /**
104
+ * @maxItems 50
105
+ * @items.maxLength 150
106
+ */
107
+ keywords: string[];
108
+ paragraphCards: DraftHackCard[][];
109
+ /**
110
+ * @maxLength 1000
111
+ */
112
+ textSummary?: string;
113
+ }
114
+
115
+ export interface DraftHackInsightSegment extends DraftHackSegment {
116
+ /**
117
+ * @maxLength 150
118
+ */
119
+ title?: string;
120
+ /**
121
+ * @maxItems 50
122
+ */
123
+ actions: DraftHackAction[];
124
+ }
125
+
126
+ export interface DraftHackAction {
127
+ /**
128
+ * @maxLength 150
129
+ */
130
+ title: string;
131
+ /**
132
+ * @maxLength 1000
133
+ */
134
+ markdown: string
135
+ }
136
+
137
+ export interface DraftContributor {
138
+ /**
139
+ * @maxLength 150
140
+ */
141
+ name: string;
142
+ }
143
+
144
+ export interface DraftTopic {
145
+ /**
146
+ * @maxLength 150
147
+ */
148
+ name: string;
149
+ }
150
+
151
+ export interface DraftAffiliate {
152
+ /**
153
+ * @maxLength 1000
154
+ */
155
+ url?: string;
156
+ /**
157
+ * @maxLength 150
158
+ */
159
+ name?: string;
160
+ }
161
+
162
+ export interface DraftSourceData {
163
+ /**
164
+ * @maxLength 150
165
+ */
166
+ episodeTitle?: string;
167
+ /**
168
+ * @maxLength 50
169
+ */
170
+ releaseDate?: string;
171
+ }
172
+
173
+ export interface DraftHackExternalLink {
174
+ /**
175
+ * @maxLength 1000
176
+ */
177
+ url: string;
178
+ type: 'Website' | 'Book' | 'Course' | 'Podcast' | 'Video' | 'Other';
179
+ }
180
+
181
+ // this status is currently used to present the draft in different columns in the airtable used by the content team
182
+ export type DraftHackWorkflowStatus = 'publishing' | 'published';
183
+ export type DraftHackType = 'book' | 'course' | 'documentary' | 'podcast' | 'original';
184
+ export type DraftHackRating = 'mature' | 'appropriate';
@@ -0,0 +1,42 @@
1
+ import { GeneratedDraftHackContent } from './draft-hack-generation';
2
+
3
+ export interface DraftHackGenerated {
4
+ id: string;
5
+ type: 'DraftHackGenerated';
6
+ payload: {
7
+ // the draft hack id
8
+ id: string;
9
+ // the version
10
+ v: number;
11
+ reference: string;
12
+ draftHackId: string;
13
+ draftHackContent: GeneratedDraftHackContent;
14
+ }
15
+ }
16
+
17
+ export interface DraftHackGenerationFailed {
18
+ id: string;
19
+ type: 'DraftHackGenerationFailed';
20
+ payload: {
21
+ reference: string;
22
+ errorMessage: string;
23
+ }
24
+ }
25
+
26
+ export interface GeneratedDraftHackSavedToGoogleDrive {
27
+ id: string;
28
+ type: 'GeneratedDraftHackSavedToGoogleDrive';
29
+ payload: {
30
+ // the draft hack id
31
+ id: string;
32
+ // the version
33
+ v: number;
34
+ reference: string;
35
+ draftHackId: string;
36
+ draftHackContent: GeneratedDraftHackContent;
37
+ driveFile: {
38
+ id: string;
39
+ parentId: string;
40
+ }
41
+ }
42
+ }
@@ -0,0 +1,38 @@
1
+ export interface GeneratedDraftHackContent {
2
+ title: string;
3
+ segments: GeneratedDraftHackSegments;
4
+ coverUrl?: string;
5
+ topics: GeneratedDraftTopic[];
6
+ notification: GeneratedDraftHackNotification;
7
+ contributors: GeneratedDraftContributor[];
8
+ }
9
+ export interface GeneratedDraftHackSegments {
10
+ favouriteQuote: GeneratedDraftHackSegment;
11
+ inANutshell: GeneratedDraftHackSegment;
12
+ introduction: GeneratedDraftHackSegment;
13
+ insights: GeneratedDraftHackInsightSegment[];
14
+ conclusion: GeneratedDraftHackSegment;
15
+ }
16
+ export interface GeneratedDraftHackSegment {
17
+ paragraphCards: GeneratedDraftHackCard[][];
18
+ }
19
+ export interface GeneratedDraftHackCard {
20
+ markdown: string;
21
+ }
22
+ export interface GeneratedDraftHackInsightSegment extends GeneratedDraftHackSegment {
23
+ title: string;
24
+ actions: GeneratedDraftHackAction[];
25
+ }
26
+ export interface GeneratedDraftHackAction {
27
+ title: string;
28
+ markdown: string;
29
+ }
30
+ export interface GeneratedDraftTopic {
31
+ name: string;
32
+ }
33
+ export interface GeneratedDraftHackNotification {
34
+ aiGeneratedText: string;
35
+ }
36
+ export interface GeneratedDraftContributor {
37
+ name: string;
38
+ }
@@ -0,0 +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;