@uptime.app/contracts 1.0.41-rc.8 → 1.0.41

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 (109) hide show
  1. package/package.json +2 -2
  2. package/src/access-control/collection-access-control.ts +28 -28
  3. package/src/access-control/hack-access-control.ts +29 -29
  4. package/src/app-hack/app-full-hack.ts +9 -9
  5. package/src/app-hack/app-hack-metadata.ts +58 -58
  6. package/src/app-hack/app-restricted-hack.ts +22 -22
  7. package/src/b2b-content-access/b2b-content-access.ts +57 -57
  8. package/src/b2b-organisation/b2b-carousel.ts +34 -34
  9. package/src/b2b-organisation/b2b-organisation-events.ts +21 -21
  10. package/src/b2b-organisation/b2b-organisation-invitation.ts +31 -31
  11. package/src/b2b-organisation/b2b-organisation-member-events.ts +21 -21
  12. package/src/b2b-organisation/b2b-organisation-member.ts +8 -8
  13. package/src/b2b-organisation/b2b-organisation.ts +15 -15
  14. package/src/brand/brand-events.ts +21 -21
  15. package/src/brand/brand.ts +19 -19
  16. package/src/catalogue/catalogue.ts +118 -118
  17. package/src/collection/collection-events.ts +21 -21
  18. package/src/collection/collection.ts +58 -58
  19. package/src/collection/enriched-collection-events.ts +18 -18
  20. package/src/collection/enriched-collection.ts +64 -64
  21. package/src/creator/creator-events.ts +32 -32
  22. package/src/creator/creator.ts +7 -7
  23. package/src/distribution/collection-distribution.ts +17 -17
  24. package/src/distribution/distribution-events.ts +61 -61
  25. package/src/distribution/hack-distribution.ts +18 -18
  26. package/src/draft-hack/draft-hack-events.ts +21 -21
  27. package/src/draft-hack/draft-hack.ts +189 -189
  28. package/src/draft-hack-generation/draft-hack-generation-commands.ts +33 -33
  29. package/src/draft-hack-generation/draft-hack-generation-events.ts +42 -42
  30. package/src/draft-hack-generation/draft-hack-generation.ts +39 -39
  31. package/src/enriched-hack/enriched-hack-events.ts +21 -21
  32. package/src/enriched-hack/enriched-hack.ts +103 -103
  33. package/src/enrichment-asset/hack-enrichment-video-events.ts +55 -55
  34. package/src/enrichment-asset/hack-enrichment-video.ts +40 -40
  35. package/src/entitlement/user-entitlements-commands.ts +33 -33
  36. package/src/entitlement/user-entitlements-events.ts +29 -29
  37. package/src/entitlement/user-entitlements.ts +18 -18
  38. package/src/flashcard/flashcard-events.ts +85 -85
  39. package/src/flashcard/flashcard.ts +138 -138
  40. package/src/hack/extracted-subject.ts +31 -31
  41. package/src/hack/hack-events.ts +21 -21
  42. package/src/hack/hack-published.ts +21 -21
  43. package/src/hack/hack-with-voice-events.ts +20 -20
  44. package/src/hack/hack-with-voice.ts +33 -33
  45. package/src/hack/hack.ts +116 -116
  46. package/src/hack/publish-hack-command.ts +18 -18
  47. package/src/hack-metadata/hack-metadata-events.ts +21 -21
  48. package/src/hack-metadata/hack-metadata.ts +17 -17
  49. package/src/hack-of-the-day/hack-of-the-day-events.ts +21 -21
  50. package/src/hack-of-the-day/hack-of-the-day.ts +13 -13
  51. package/src/history/history-events.ts +21 -21
  52. package/src/history/history.ts +46 -46
  53. package/src/index.ts +147 -147
  54. package/src/interest/interest-events.ts +21 -21
  55. package/src/interest/interest.ts +15 -15
  56. package/src/knowledge-source/knowledge-source-events.ts +21 -21
  57. package/src/knowledge-source/knowledge-source.ts +43 -43
  58. package/src/localisation/live-locales.ts +37 -37
  59. package/src/localisation/locale-language.ts +4 -4
  60. package/src/localisation/supported-languages.ts +11 -11
  61. package/src/localisation/supported-locales.ts +61 -61
  62. package/src/moderation/hack-moderation-result-events.ts +18 -18
  63. package/src/moderation/hack-moderation-result.ts +27 -27
  64. package/src/partner/partner-events.ts +21 -21
  65. package/src/partner/partner.ts +7 -7
  66. package/src/pending-hack/pending-hack-events.ts +20 -20
  67. package/src/pending-hack/pending-hack-with-voice-events.ts +20 -20
  68. package/src/pending-hack/pending-hack-with-voice.ts +25 -25
  69. package/src/pending-hack/pending-hack.ts +77 -77
  70. package/src/preferences/preferences-events.ts +15 -15
  71. package/src/preferences/preferences.ts +35 -35
  72. package/src/profile/profile-events.ts +41 -41
  73. package/src/profile/profile.ts +27 -27
  74. package/src/profile/translated-profile.ts +13 -13
  75. package/src/referral/referral-events.ts +41 -41
  76. package/src/referral/referral.ts +76 -76
  77. package/src/saved/saved-collection-events.ts +19 -19
  78. package/src/saved/saved-collection.ts +8 -8
  79. package/src/segment/segment-commands.ts +70 -70
  80. package/src/segment/segment-events.ts +42 -42
  81. package/src/segment/segment-with-voice.ts +8 -8
  82. package/src/segment/segment.ts +82 -82
  83. package/src/skin/skin-events.ts +21 -21
  84. package/src/skin/skin.ts +6 -6
  85. package/src/spark/spark-board-read-model.ts +17 -17
  86. package/src/spark/spark-board.ts +12 -12
  87. package/src/spark/spark-events.ts +42 -42
  88. package/src/spark/spark.ts +80 -80
  89. package/src/text-to-speech/create-speech-commands.ts +20 -20
  90. package/src/text-to-speech/speech-created-events.ts +10 -10
  91. package/src/text-to-speech/supported-voices.ts +151 -151
  92. package/src/text-to-speech/text-segment.ts +29 -29
  93. package/src/theme/theme-events.ts +21 -21
  94. package/src/theme/theme.ts +68 -68
  95. package/src/translation/translation-events.ts +73 -73
  96. package/src/translation/translation.ts +25 -25
  97. package/src/trending/trending-events.ts +21 -21
  98. package/src/trending/trending-hacks.ts +8 -8
  99. package/src/user/user-events.ts +27 -27
  100. package/src/user-context/user-context-events.ts +21 -21
  101. package/src/user-context/user-context.ts +16 -16
  102. package/src/user-notification-context/user-notification-context-events.ts +21 -21
  103. package/src/user-notification-context/user-notification-context.ts +9 -9
  104. package/src/user-statistics/user-statistics-events.ts +97 -97
  105. package/src/user-statistics/user-statistics.ts +82 -82
  106. package/src/video-cropping/video-cropping-events.ts +43 -43
  107. package/src/video-cropping/video-metadata.ts +12 -12
  108. package/tsconfig.cjs.json +7 -7
  109. package/tsconfig.npm.json +21 -21
@@ -1,61 +1,61 @@
1
- export enum SupportedLocale {
2
- /** English (United Kingdom) */
3
- enGB = 'en-GB',
4
- /** English (United States) */
5
- enUS = 'en-US',
6
- /** Portuguese (Brazil) */
7
- ptBR = 'pt-BR',
8
- /** Spanish (International) */
9
- es = 'es',
10
- /** French (France) */
11
- frFR = 'fr-FR',
12
- /** Italian */
13
- itIT = 'it-IT',
14
- /** Dutch */
15
- nlNL = 'nl-NL',
16
- /** German */
17
- deDE = 'de-DE',
18
- /** Polish */
19
- plPL = 'pl-PL',
20
- /** Swedish */
21
- svSE = 'sv-SE',
22
- /** Turkish */
23
- trTR = 'tr-TR',
24
- /** Canadian French */
25
- frCA = 'fr-CA',
26
- /** Traditional Chinese */
27
- zhTW = 'zh-TW',
28
- /** Simplified Chinese */
29
- zhCN = 'zh-CN',
30
- /** Norwegian */
31
- nbNO = 'nb-NO',
32
- /** Malaysian Malay */
33
- msMY = 'ms-MY',
34
- /** Modern Standard Arabic */
35
- ar = 'ar',
36
- /** Hebrew */
37
- heIL = 'he-IL',
38
- /** Japanese */
39
- jaJP = 'ja-JP',
40
- /** Bahasa Indonesian */
41
- idID = 'id-ID',
42
- /** Vietnamese */
43
- viVN = 'vi-VN',
44
- /** Russian */
45
- ruRU = 'ru-RU',
46
- /** Korean */
47
- koKR = 'ko-KR',
48
- /** Thai */
49
- thTH = 'th-TH',
50
- /** Hindi */
51
- hiIN = 'hi-IN',
52
- }
53
-
54
- /**
55
- * All supported locale codes. Use allLiveLocaleCodes() instead when checking for locale codes supported by the app
56
- */
57
- export function allSupportedLocaleCodes(): string[] {
58
- return Object.values(SupportedLocale);
59
- }
60
-
61
- export const DEFAULT_LOCALE = SupportedLocale.enUS;
1
+ export enum SupportedLocale {
2
+ /** English (United Kingdom) */
3
+ enGB = 'en-GB',
4
+ /** English (United States) */
5
+ enUS = 'en-US',
6
+ /** Portuguese (Brazil) */
7
+ ptBR = 'pt-BR',
8
+ /** Spanish (International) */
9
+ es = 'es',
10
+ /** French (France) */
11
+ frFR = 'fr-FR',
12
+ /** Italian */
13
+ itIT = 'it-IT',
14
+ /** Dutch */
15
+ nlNL = 'nl-NL',
16
+ /** German */
17
+ deDE = 'de-DE',
18
+ /** Polish */
19
+ plPL = 'pl-PL',
20
+ /** Swedish */
21
+ svSE = 'sv-SE',
22
+ /** Turkish */
23
+ trTR = 'tr-TR',
24
+ /** Canadian French */
25
+ frCA = 'fr-CA',
26
+ /** Traditional Chinese */
27
+ zhTW = 'zh-TW',
28
+ /** Simplified Chinese */
29
+ zhCN = 'zh-CN',
30
+ /** Norwegian */
31
+ nbNO = 'nb-NO',
32
+ /** Malaysian Malay */
33
+ msMY = 'ms-MY',
34
+ /** Modern Standard Arabic */
35
+ ar = 'ar',
36
+ /** Hebrew */
37
+ heIL = 'he-IL',
38
+ /** Japanese */
39
+ jaJP = 'ja-JP',
40
+ /** Bahasa Indonesian */
41
+ idID = 'id-ID',
42
+ /** Vietnamese */
43
+ viVN = 'vi-VN',
44
+ /** Russian */
45
+ ruRU = 'ru-RU',
46
+ /** Korean */
47
+ koKR = 'ko-KR',
48
+ /** Thai */
49
+ thTH = 'th-TH',
50
+ /** Hindi */
51
+ hiIN = 'hi-IN',
52
+ }
53
+
54
+ /**
55
+ * All supported locale codes. Use allLiveLocaleCodes() instead when checking for locale codes supported by the app
56
+ */
57
+ export function allSupportedLocaleCodes(): string[] {
58
+ return Object.values(SupportedLocale);
59
+ }
60
+
61
+ export const DEFAULT_LOCALE = SupportedLocale.enUS;
@@ -1,18 +1,18 @@
1
- import { HackModerationResult } from './hack-moderation-result';
2
-
3
- export interface HackModerationResultCreatedEvent {
4
- id: string;
5
- type: 'HackModerationResultCreated';
6
- payload: HackModerationResult;
7
- }
8
- export interface HackModerationResultUpdatedEvent {
9
- id: string;
10
- type: 'HackModerationResultUpdated';
11
- payload: HackModerationResult;
12
- }
13
- export interface HackModerationResultDeletedEvent {
14
- id: string;
15
- type: 'HackModerationResultDeleted';
16
- payload: HackModerationResult;
17
- }
18
- export declare type HackModerationResultChangedEvent = HackModerationResultCreatedEvent | HackModerationResultUpdatedEvent | HackModerationResultDeletedEvent;
1
+ import { HackModerationResult } from './hack-moderation-result';
2
+
3
+ export interface HackModerationResultCreatedEvent {
4
+ id: string;
5
+ type: 'HackModerationResultCreated';
6
+ payload: HackModerationResult;
7
+ }
8
+ export interface HackModerationResultUpdatedEvent {
9
+ id: string;
10
+ type: 'HackModerationResultUpdated';
11
+ payload: HackModerationResult;
12
+ }
13
+ export interface HackModerationResultDeletedEvent {
14
+ id: string;
15
+ type: 'HackModerationResultDeleted';
16
+ payload: HackModerationResult;
17
+ }
18
+ export declare type HackModerationResultChangedEvent = HackModerationResultCreatedEvent | HackModerationResultUpdatedEvent | HackModerationResultDeletedEvent;
@@ -1,27 +1,27 @@
1
- export interface HackModerationResult {
2
- id: string;
3
- v: number;
4
- createdAt: string;
5
- updatedAt: string;
6
- hackId: string;
7
- hackVersion: number;
8
- draftHackId: string;
9
- draftHackVersion: number;
10
- moderationLabels: ModerationLabel[];
11
- moderationActions: ModerationAction[];
12
- }
13
-
14
- export interface ModerationLabel {
15
- label: string;
16
- content: string;
17
- }
18
-
19
- export enum ModerationAction {
20
- Accept = 'accept',
21
- PartialDistribution = 'partial_distribution',
22
- NoDistribution = 'no_distribution',
23
- Review = 'review',
24
- Notify = 'notify',
25
- Hide = 'hide',
26
- Escalate = 'escalate'
27
- }
1
+ export interface HackModerationResult {
2
+ id: string;
3
+ v: number;
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ hackId: string;
7
+ hackVersion: number;
8
+ draftHackId: string;
9
+ draftHackVersion: number;
10
+ moderationLabels: ModerationLabel[];
11
+ moderationActions: ModerationAction[];
12
+ }
13
+
14
+ export interface ModerationLabel {
15
+ label: string;
16
+ content: string;
17
+ }
18
+
19
+ export enum ModerationAction {
20
+ Accept = 'accept',
21
+ PartialDistribution = 'partial_distribution',
22
+ NoDistribution = 'no_distribution',
23
+ Review = 'review',
24
+ Notify = 'notify',
25
+ Hide = 'hide',
26
+ Escalate = 'escalate'
27
+ }
@@ -1,21 +1,21 @@
1
- import { Partner } from './partner';
2
-
3
- export interface PartnerCreatedEvent {
4
- id: string;
5
- type: 'PartnerCreated';
6
- payload: Partner;
7
- }
8
-
9
- export interface PartnerUpdatedEvent {
10
- id: string;
11
- type: 'PartnerUpdated';
12
- payload: Partner;
13
- }
14
-
15
- export interface PartnerDeletedEvent {
16
- id: string;
17
- type: 'PartnerDeleted';
18
- payload: Partner;
19
- }
20
-
21
- export type PartnerChangedEvent = PartnerCreatedEvent | PartnerUpdatedEvent | PartnerDeletedEvent;
1
+ import { Partner } from './partner';
2
+
3
+ export interface PartnerCreatedEvent {
4
+ id: string;
5
+ type: 'PartnerCreated';
6
+ payload: Partner;
7
+ }
8
+
9
+ export interface PartnerUpdatedEvent {
10
+ id: string;
11
+ type: 'PartnerUpdated';
12
+ payload: Partner;
13
+ }
14
+
15
+ export interface PartnerDeletedEvent {
16
+ id: string;
17
+ type: 'PartnerDeleted';
18
+ payload: Partner;
19
+ }
20
+
21
+ export type PartnerChangedEvent = PartnerCreatedEvent | PartnerUpdatedEvent | PartnerDeletedEvent;
@@ -1,7 +1,7 @@
1
- export interface Partner {
2
- id: string;
3
- v: number;
4
- createdAt: string;
5
- updatedAt: string;
6
- owner: string;
7
- }
1
+ export interface Partner {
2
+ id: string;
3
+ v: number;
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ owner: string;
7
+ }
@@ -1,21 +1,21 @@
1
- import { PendingHack } from './pending-hack';
2
-
3
- export interface PendingHackCreatedEvent {
4
- id: string;
5
- type: 'PendingHackCreated';
6
- payload: PendingHack;
7
- }
8
-
9
- export interface PendingHackUpdatedEvent {
10
- id: string;
11
- type: 'PendingHackUpdated';
12
- payload: PendingHack;
13
- }
14
-
15
- export interface PendingHackDeletedEvent {
16
- id: string;
17
- type: 'PendingHackDeleted';
18
- payload: PendingHack;
19
- }
20
-
1
+ import { PendingHack } from './pending-hack';
2
+
3
+ export interface PendingHackCreatedEvent {
4
+ id: string;
5
+ type: 'PendingHackCreated';
6
+ payload: PendingHack;
7
+ }
8
+
9
+ export interface PendingHackUpdatedEvent {
10
+ id: string;
11
+ type: 'PendingHackUpdated';
12
+ payload: PendingHack;
13
+ }
14
+
15
+ export interface PendingHackDeletedEvent {
16
+ id: string;
17
+ type: 'PendingHackDeleted';
18
+ payload: PendingHack;
19
+ }
20
+
21
21
  export type PendingHackChangedEvent = PendingHackCreatedEvent | PendingHackUpdatedEvent | PendingHackDeletedEvent;
@@ -1,21 +1,21 @@
1
- import { PendingHackWithVoice } from './pending-hack-with-voice';
2
-
3
- export interface PendingHackWithVoiceCreatedEvent {
4
- id: string;
5
- type: 'PendingHackWithVoiceCreated';
6
- payload: PendingHackWithVoice;
7
- }
8
-
9
- export interface PendingHackWithVoiceUpdatedEvent {
10
- id: string;
11
- type: 'PendingHackWithVoiceUpdated';
12
- payload: PendingHackWithVoice;
13
- }
14
-
15
- export interface PendingHackWithVoiceDeletedEvent {
16
- id: string;
17
- type: 'PendingHackWithVoiceDeleted';
18
- payload: PendingHackWithVoice;
19
- }
20
-
1
+ import { PendingHackWithVoice } from './pending-hack-with-voice';
2
+
3
+ export interface PendingHackWithVoiceCreatedEvent {
4
+ id: string;
5
+ type: 'PendingHackWithVoiceCreated';
6
+ payload: PendingHackWithVoice;
7
+ }
8
+
9
+ export interface PendingHackWithVoiceUpdatedEvent {
10
+ id: string;
11
+ type: 'PendingHackWithVoiceUpdated';
12
+ payload: PendingHackWithVoice;
13
+ }
14
+
15
+ export interface PendingHackWithVoiceDeletedEvent {
16
+ id: string;
17
+ type: 'PendingHackWithVoiceDeleted';
18
+ payload: PendingHackWithVoice;
19
+ }
20
+
21
21
  export type PendingHackWithVoiceChangedEvent = PendingHackWithVoiceCreatedEvent | PendingHackWithVoiceUpdatedEvent | PendingHackWithVoiceDeletedEvent;
@@ -1,25 +1,25 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
- import { Segment } from '../segment/segment';
3
- import { CompletePendingHack, PendingHack } from './pending-hack';
4
-
5
- export interface PendingHackWithVoice {
6
- id: string;
7
- v: number;
8
- createdAt: string;
9
- updatedAt: string;
10
- voiceId: string;
11
- isDefaultVoice: boolean;
12
- hackId: string;
13
- baseLocaleHackId: string;
14
- segments: PendingHack['segments'];
15
- }
16
-
17
- export interface CompletePendingHackWithVoice extends PendingHackWithVoice {
18
- segments: CompletePendingHack['segments'];
19
- }
20
-
21
- export type CompletePendingHackWithVoiceWithPutInAction = CompletePendingHackWithVoice & {
22
- segments: {
23
- putInAction: Segment;
24
- }
25
- };
1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+ import { Segment } from '../segment/segment';
3
+ import { CompletePendingHack, PendingHack } from './pending-hack';
4
+
5
+ export interface PendingHackWithVoice {
6
+ id: string;
7
+ v: number;
8
+ createdAt: string;
9
+ updatedAt: string;
10
+ voiceId: string;
11
+ isDefaultVoice: boolean;
12
+ hackId: string;
13
+ baseLocaleHackId: string;
14
+ segments: PendingHack['segments'];
15
+ }
16
+
17
+ export interface CompletePendingHackWithVoice extends PendingHackWithVoice {
18
+ segments: CompletePendingHack['segments'];
19
+ }
20
+
21
+ export type CompletePendingHackWithVoiceWithPutInAction = CompletePendingHackWithVoice & {
22
+ segments: {
23
+ putInAction: Segment;
24
+ }
25
+ };
@@ -1,77 +1,77 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
- import { ExtractedSubject } from '../hack/extracted-subject';
3
- import { HackAffiliate, HackContributor, HackType, HackSourceData, HackTopic, HackExternalLink } from '../hack/hack';
4
- import { Segment } from '../segment/segment';
5
-
6
- export interface PendingHack {
7
- id: string;
8
- /** use @uptime.app/localisation-contracts */
9
- locale: string;
10
- baseLocaleHackId: string;
11
- v: number;
12
- createdAt: string;
13
- updatedAt: string;
14
- owner?: string;
15
- draftHackId: string;
16
- draftHackVersion: number;
17
- hackId: string;
18
- sourceId?: string;
19
- title: string;
20
- themeId: string;
21
- coverUrl?: string;
22
- /** Added in July 2024. This is the URL of the cover image that is free to use without any copyright. */
23
- copyrightFreeCoverUrl?: string;
24
- affiliate?: HackAffiliate;
25
- topics: HackTopic[];
26
- contributors: HackContributor[];
27
- type: HackType;
28
- sourceData?: HackSourceData;
29
- notifications?: {
30
- aiGeneratedText?: string;
31
- humanCuratedText?: string;
32
- };
33
- segments: {
34
- favouriteQuote: Segment | {};
35
- inANutshell: Segment | {};
36
- introduction: Segment | {};
37
- insights: [
38
- (Segment | {}),
39
- (Segment | {}),
40
- (Segment | {})
41
- ];
42
- conclusion: Segment | {};
43
- // composite segments
44
- overview: Segment | {};
45
- shareableOverview: Segment | {};
46
- hereAreTheInsights: Segment | {};
47
- putInAction?: Segment | {};
48
- };
49
- externalLink?: HackExternalLink;
50
- subjects?: ExtractedSubject[];
51
- }
52
-
53
- export interface CompletePendingHack extends PendingHack {
54
- segments: {
55
- favouriteQuote: Segment;
56
- inANutshell: Segment;
57
- introduction: Segment;
58
- insights: [
59
- Segment,
60
- Segment,
61
- Segment
62
- ];
63
- conclusion: Segment;
64
- // composite segments
65
- overview: Segment;
66
- shareableOverview: Segment;
67
- hereAreTheInsights: Segment;
68
- putInAction?: Segment;
69
- };
70
- subjects: ExtractedSubject[];
71
- }
72
-
73
- export type CompletePendingHackWithPutInAction = CompletePendingHack & {
74
- segments: {
75
- putInAction: Segment;
76
- }
77
- };
1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+ import { ExtractedSubject } from '../hack/extracted-subject';
3
+ import { HackAffiliate, HackContributor, HackType, HackSourceData, HackTopic, HackExternalLink } from '../hack/hack';
4
+ import { Segment } from '../segment/segment';
5
+
6
+ export interface PendingHack {
7
+ id: string;
8
+ /** use @uptime.app/localisation-contracts */
9
+ locale: string;
10
+ baseLocaleHackId: string;
11
+ v: number;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ owner?: string;
15
+ draftHackId: string;
16
+ draftHackVersion: number;
17
+ hackId: string;
18
+ sourceId?: string;
19
+ title: string;
20
+ themeId: string;
21
+ coverUrl?: string;
22
+ /** Added in July 2024. This is the URL of the cover image that is free to use without any copyright. */
23
+ copyrightFreeCoverUrl?: string;
24
+ affiliate?: HackAffiliate;
25
+ topics: HackTopic[];
26
+ contributors: HackContributor[];
27
+ type: HackType;
28
+ sourceData?: HackSourceData;
29
+ notifications?: {
30
+ aiGeneratedText?: string;
31
+ humanCuratedText?: string;
32
+ };
33
+ segments: {
34
+ favouriteQuote: Segment | {};
35
+ inANutshell: Segment | {};
36
+ introduction: Segment | {};
37
+ insights: [
38
+ (Segment | {}),
39
+ (Segment | {}),
40
+ (Segment | {})
41
+ ];
42
+ conclusion: Segment | {};
43
+ // composite segments
44
+ overview: Segment | {};
45
+ shareableOverview: Segment | {};
46
+ hereAreTheInsights: Segment | {};
47
+ putInAction?: Segment | {};
48
+ };
49
+ externalLink?: HackExternalLink;
50
+ subjects?: ExtractedSubject[];
51
+ }
52
+
53
+ export interface CompletePendingHack extends PendingHack {
54
+ segments: {
55
+ favouriteQuote: Segment;
56
+ inANutshell: Segment;
57
+ introduction: Segment;
58
+ insights: [
59
+ Segment,
60
+ Segment,
61
+ Segment
62
+ ];
63
+ conclusion: Segment;
64
+ // composite segments
65
+ overview: Segment;
66
+ shareableOverview: Segment;
67
+ hereAreTheInsights: Segment;
68
+ putInAction?: Segment;
69
+ };
70
+ subjects: ExtractedSubject[];
71
+ }
72
+
73
+ export type CompletePendingHackWithPutInAction = CompletePendingHack & {
74
+ segments: {
75
+ putInAction: Segment;
76
+ }
77
+ };
@@ -1,15 +1,15 @@
1
- import { Preferences } from './preferences';
2
-
3
- export interface UserPreferencesCreatedEvent {
4
- id: string;
5
- type: 'UserPreferencesCreated';
6
- payload: Preferences;
7
- }
8
-
9
- export interface UserPreferencesUpdatedEvent {
10
- id: string;
11
- type: 'UserPreferencesUpdated';
12
- payload: Preferences;
13
- }
14
-
15
- export type UserPreferencesChangedEvent = UserPreferencesCreatedEvent | UserPreferencesUpdatedEvent;
1
+ import { Preferences } from './preferences';
2
+
3
+ export interface UserPreferencesCreatedEvent {
4
+ id: string;
5
+ type: 'UserPreferencesCreated';
6
+ payload: Preferences;
7
+ }
8
+
9
+ export interface UserPreferencesUpdatedEvent {
10
+ id: string;
11
+ type: 'UserPreferencesUpdated';
12
+ payload: Preferences;
13
+ }
14
+
15
+ export type UserPreferencesChangedEvent = UserPreferencesCreatedEvent | UserPreferencesUpdatedEvent;
@@ -1,35 +1,35 @@
1
- export type Preferences = PreferencesItem & UpdatablePreferences;
2
-
3
- interface PreferencesItem {
4
- id: string;
5
- v: number;
6
- createdAt: string;
7
- updatedAt: string;
8
- userId: string;
9
- }
10
-
11
- export interface UpdatablePreferences {
12
- 'flashcards.showFlashcardsFromInsights': boolean;
13
- // ISO date, UTC. Required to figure out if to generate flashcards from insights in the flashcard-service: ViewedHack event times are compared against it.
14
- 'flashcards.showFlashcardsFromInsights.datePreferenceUpdated': string;
15
- 'notifications.backdrop.email': boolean;
16
- 'notifications.backdrop.push': boolean;
17
- 'notifications.challenges.email': boolean;
18
- 'notifications.challenges.push': boolean;
19
- 'notifications.generalReminders.email': boolean;
20
- 'notifications.generalReminders.push': boolean;
21
- 'notifications.getBackToUptime.email': boolean;
22
- 'notifications.getBackToUptime.push': boolean;
23
- 'notifications.getBackToUptime.timeToReceive': string;
24
- 'notifications.flashcards.newToday.email': boolean;
25
- 'notifications.flashcards.newToday.push': boolean;
26
- 'notifications.recommendedContent.email': boolean;
27
- 'notifications.recommendedContent.push': boolean;
28
- 'notifications.research.email': boolean;
29
- 'notifications.research.push': boolean;
30
- 'notifications.savedHacks.email': boolean;
31
- 'notifications.savedHacks.push': boolean;
32
- 'notifications.uptimeNews.email': boolean;
33
- 'notifications.uptimeNews.push': boolean;
34
- 'timezone': string;
35
- }
1
+ export type Preferences = PreferencesItem & UpdatablePreferences;
2
+
3
+ interface PreferencesItem {
4
+ id: string;
5
+ v: number;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ userId: string;
9
+ }
10
+
11
+ export interface UpdatablePreferences {
12
+ 'flashcards.showFlashcardsFromInsights': boolean;
13
+ // ISO date, UTC. Required to figure out if to generate flashcards from insights in the flashcard-service: ViewedHack event times are compared against it.
14
+ 'flashcards.showFlashcardsFromInsights.datePreferenceUpdated': string;
15
+ 'notifications.backdrop.email': boolean;
16
+ 'notifications.backdrop.push': boolean;
17
+ 'notifications.challenges.email': boolean;
18
+ 'notifications.challenges.push': boolean;
19
+ 'notifications.generalReminders.email': boolean;
20
+ 'notifications.generalReminders.push': boolean;
21
+ 'notifications.getBackToUptime.email': boolean;
22
+ 'notifications.getBackToUptime.push': boolean;
23
+ 'notifications.getBackToUptime.timeToReceive': string;
24
+ 'notifications.flashcards.newToday.email': boolean;
25
+ 'notifications.flashcards.newToday.push': boolean;
26
+ 'notifications.recommendedContent.email': boolean;
27
+ 'notifications.recommendedContent.push': boolean;
28
+ 'notifications.research.email': boolean;
29
+ 'notifications.research.push': boolean;
30
+ 'notifications.savedHacks.email': boolean;
31
+ 'notifications.savedHacks.push': boolean;
32
+ 'notifications.uptimeNews.email': boolean;
33
+ 'notifications.uptimeNews.push': boolean;
34
+ 'timezone': string;
35
+ }