@uptime.app/contracts 1.0.13 → 1.0.15-rc.1

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 (138) hide show
  1. package/dist/cjs/app-hack/app-full-hack.d.ts +9 -0
  2. package/dist/cjs/app-hack/app-full-hack.d.ts.map +1 -0
  3. package/dist/cjs/app-hack/app-full-hack.js +3 -0
  4. package/dist/cjs/app-hack/app-full-hack.js.map +1 -0
  5. package/dist/cjs/app-hack/app-hack-metadata.d.ts +58 -0
  6. package/dist/cjs/app-hack/app-hack-metadata.d.ts.map +1 -0
  7. package/dist/cjs/app-hack/app-hack-metadata.js +3 -0
  8. package/dist/cjs/app-hack/app-hack-metadata.js.map +1 -0
  9. package/dist/cjs/app-hack/app-restricted-hack.d.ts +21 -0
  10. package/dist/cjs/app-hack/app-restricted-hack.d.ts.map +1 -0
  11. package/dist/cjs/app-hack/app-restricted-hack.js +3 -0
  12. package/dist/cjs/app-hack/app-restricted-hack.js.map +1 -0
  13. package/dist/cjs/collection/collection-events.d.ts +18 -0
  14. package/dist/cjs/collection/collection-events.d.ts.map +1 -0
  15. package/dist/cjs/collection/collection-events.js +3 -0
  16. package/dist/cjs/collection/collection-events.js.map +1 -0
  17. package/dist/cjs/collection/collection.d.ts +48 -0
  18. package/dist/cjs/collection/collection.d.ts.map +1 -0
  19. package/dist/cjs/collection/collection.js +3 -0
  20. package/dist/cjs/collection/collection.js.map +1 -0
  21. package/dist/cjs/collection/enriched-collection-events.d.ts +18 -0
  22. package/dist/cjs/collection/enriched-collection-events.d.ts.map +1 -0
  23. package/dist/cjs/collection/enriched-collection-events.js +3 -0
  24. package/dist/cjs/collection/enriched-collection-events.js.map +1 -0
  25. package/dist/cjs/collection/enriched-collection.d.ts +56 -0
  26. package/dist/cjs/collection/enriched-collection.d.ts.map +1 -0
  27. package/dist/cjs/collection/enriched-collection.js +3 -0
  28. package/dist/cjs/collection/enriched-collection.js.map +1 -0
  29. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.d.ts +36 -0
  30. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.d.ts.map +1 -0
  31. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.js +3 -0
  32. package/dist/cjs/draft-hack-generation/draft-hack-generation-events.js.map +1 -0
  33. package/dist/cjs/draft-hack-generation/draft-hack-generation.d.ts +39 -0
  34. package/dist/cjs/draft-hack-generation/draft-hack-generation.d.ts.map +1 -0
  35. package/dist/cjs/draft-hack-generation/draft-hack-generation.js +3 -0
  36. package/dist/cjs/draft-hack-generation/draft-hack-generation.js.map +1 -0
  37. package/dist/cjs/index.d.ts +9 -0
  38. package/dist/cjs/index.d.ts.map +1 -1
  39. package/dist/cjs/index.js +9 -0
  40. package/dist/cjs/index.js.map +1 -1
  41. package/dist/esm/app-hack/app-full-hack.d.ts +9 -0
  42. package/dist/esm/app-hack/app-full-hack.d.ts.map +1 -0
  43. package/dist/esm/app-hack/app-full-hack.js +2 -0
  44. package/dist/esm/app-hack/app-full-hack.js.map +1 -0
  45. package/dist/esm/app-hack/app-hack-metadata.d.ts +58 -0
  46. package/dist/esm/app-hack/app-hack-metadata.d.ts.map +1 -0
  47. package/dist/esm/app-hack/app-hack-metadata.js +2 -0
  48. package/dist/esm/app-hack/app-hack-metadata.js.map +1 -0
  49. package/dist/esm/app-hack/app-restricted-hack.d.ts +21 -0
  50. package/dist/esm/app-hack/app-restricted-hack.d.ts.map +1 -0
  51. package/dist/esm/app-hack/app-restricted-hack.js +2 -0
  52. package/dist/esm/app-hack/app-restricted-hack.js.map +1 -0
  53. package/dist/esm/collection/collection-events.d.ts +18 -0
  54. package/dist/esm/collection/collection-events.d.ts.map +1 -0
  55. package/dist/esm/collection/collection-events.js +2 -0
  56. package/dist/esm/collection/collection-events.js.map +1 -0
  57. package/dist/esm/collection/collection.d.ts +48 -0
  58. package/dist/esm/collection/collection.d.ts.map +1 -0
  59. package/dist/esm/collection/collection.js +2 -0
  60. package/dist/esm/collection/collection.js.map +1 -0
  61. package/dist/esm/collection/enriched-collection-events.d.ts +18 -0
  62. package/dist/esm/collection/enriched-collection-events.d.ts.map +1 -0
  63. package/dist/esm/collection/enriched-collection-events.js +2 -0
  64. package/dist/esm/collection/enriched-collection-events.js.map +1 -0
  65. package/dist/esm/collection/enriched-collection.d.ts +56 -0
  66. package/dist/esm/collection/enriched-collection.d.ts.map +1 -0
  67. package/dist/esm/collection/enriched-collection.js +2 -0
  68. package/dist/esm/collection/enriched-collection.js.map +1 -0
  69. package/dist/esm/draft-hack-generation/draft-hack-generation-events.d.ts +36 -0
  70. package/dist/esm/draft-hack-generation/draft-hack-generation-events.d.ts.map +1 -0
  71. package/dist/esm/draft-hack-generation/draft-hack-generation-events.js +2 -0
  72. package/dist/esm/draft-hack-generation/draft-hack-generation-events.js.map +1 -0
  73. package/dist/esm/draft-hack-generation/draft-hack-generation.d.ts +39 -0
  74. package/dist/esm/draft-hack-generation/draft-hack-generation.d.ts.map +1 -0
  75. package/dist/esm/draft-hack-generation/draft-hack-generation.js +2 -0
  76. package/dist/esm/draft-hack-generation/draft-hack-generation.js.map +1 -0
  77. package/dist/esm/index.d.ts +9 -0
  78. package/dist/esm/index.d.ts.map +1 -1
  79. package/dist/esm/index.js +9 -0
  80. package/dist/esm/index.js.map +1 -1
  81. package/package.json +2 -2
  82. package/src/access-control/collection-access-control.ts +28 -28
  83. package/src/access-control/hack-access-control.ts +29 -29
  84. package/src/app-hack/app-full-hack.ts +9 -0
  85. package/src/app-hack/app-hack-metadata.ts +56 -0
  86. package/src/app-hack/app-restricted-hack.ts +22 -0
  87. package/src/b2b-organisation/b2b-organisation-events.ts +21 -21
  88. package/src/b2b-organisation/b2b-organisation-member-events.ts +21 -21
  89. package/src/b2b-organisation/b2b-organisation-member.ts +8 -8
  90. package/src/b2b-organisation/b2b-organisation.ts +14 -14
  91. package/src/brand/brand-events.ts +21 -21
  92. package/src/brand/brand.ts +8 -8
  93. package/src/collection/collection-events.ts +21 -0
  94. package/src/collection/collection.ts +58 -0
  95. package/src/collection/enriched-collection-events.ts +18 -0
  96. package/src/collection/enriched-collection.ts +64 -0
  97. package/src/distribution/collection-distribution.ts +17 -17
  98. package/src/distribution/distribution-events.ts +61 -61
  99. package/src/distribution/hack-distribution.ts +18 -18
  100. package/src/draft-hack/draft-hack-events.ts +21 -21
  101. package/src/draft-hack/draft-hack.ts +184 -184
  102. package/src/draft-hack-generation/draft-hack-generation-events.ts +42 -0
  103. package/src/draft-hack-generation/draft-hack-generation.ts +38 -0
  104. package/src/enriched-hack/enriched-hack-events.ts +21 -21
  105. package/src/enriched-hack/enriched-hack.ts +101 -101
  106. package/src/hack/extracted-subject.ts +4 -4
  107. package/src/hack/hack-events.ts +21 -21
  108. package/src/hack/hack-with-voice-events.ts +20 -20
  109. package/src/hack/hack-with-voice.ts +33 -33
  110. package/src/hack/hack.ts +114 -114
  111. package/src/hack-metadata/hack-metadata-events.ts +21 -21
  112. package/src/hack-metadata/hack-metadata.ts +17 -17
  113. package/src/index.ts +73 -61
  114. package/src/knowledge-source/knowledge-source-events.ts +21 -21
  115. package/src/knowledge-source/knowledge-source.ts +43 -43
  116. package/src/localisation/live-locales.ts +32 -32
  117. package/src/localisation/locale-language.ts +4 -4
  118. package/src/localisation/supported-languages.ts +11 -11
  119. package/src/localisation/supported-locales.ts +42 -42
  120. package/src/pending-hack/pending-hack-events.ts +20 -20
  121. package/src/pending-hack/pending-hack-with-voice-events.ts +20 -20
  122. package/src/pending-hack/pending-hack-with-voice.ts +25 -25
  123. package/src/pending-hack/pending-hack.ts +75 -75
  124. package/src/profile/profile-events.ts +41 -41
  125. package/src/profile/profile.ts +27 -27
  126. package/src/profile/translated-profile.ts +13 -13
  127. package/src/segment/segment-commands.ts +70 -70
  128. package/src/segment/segment-with-voice.ts +8 -8
  129. package/src/segment/segment.ts +82 -82
  130. package/src/skin/skin-events.ts +21 -21
  131. package/src/skin/skin.ts +6 -6
  132. package/src/text-to-speech/create-speech-commands.ts +20 -20
  133. package/src/text-to-speech/speech-created-events.ts +11 -11
  134. package/src/text-to-speech/text-segment.ts +29 -29
  135. package/src/theme/theme-events.ts +21 -21
  136. package/src/theme/theme.ts +68 -68
  137. package/tsconfig.cjs.json +7 -7
  138. package/tsconfig.npm.json +21 -21
@@ -1,75 +1,75 @@
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
- affiliate?: HackAffiliate;
23
- topics: HackTopic[];
24
- contributors: HackContributor[];
25
- type: HackType;
26
- sourceData?: HackSourceData;
27
- notifications?: {
28
- aiGeneratedText?: string;
29
- humanCuratedText?: string;
30
- };
31
- segments: {
32
- favouriteQuote: Segment | {};
33
- inANutshell: Segment | {};
34
- introduction: Segment | {};
35
- insights: [
36
- (Segment | {}),
37
- (Segment | {}),
38
- (Segment | {})
39
- ];
40
- conclusion: Segment | {};
41
- // composite segments
42
- overview: Segment | {};
43
- shareableOverview: Segment | {};
44
- hereAreTheInsights: Segment | {};
45
- putInAction?: Segment | {};
46
- };
47
- externalLink?: HackExternalLink;
48
- subjects?: ExtractedSubject[];
49
- }
50
-
51
- export interface CompletePendingHack extends PendingHack {
52
- segments: {
53
- favouriteQuote: Segment;
54
- inANutshell: Segment;
55
- introduction: Segment;
56
- insights: [
57
- Segment,
58
- Segment,
59
- Segment
60
- ];
61
- conclusion: Segment;
62
- // composite segments
63
- overview: Segment;
64
- shareableOverview: Segment;
65
- hereAreTheInsights: Segment;
66
- putInAction?: Segment;
67
- };
68
- subjects: ExtractedSubject[];
69
- }
70
-
71
- export type CompletePendingHackWithPutInAction = CompletePendingHack & {
72
- segments: {
73
- putInAction: Segment;
74
- }
75
- };
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
+ affiliate?: HackAffiliate;
23
+ topics: HackTopic[];
24
+ contributors: HackContributor[];
25
+ type: HackType;
26
+ sourceData?: HackSourceData;
27
+ notifications?: {
28
+ aiGeneratedText?: string;
29
+ humanCuratedText?: string;
30
+ };
31
+ segments: {
32
+ favouriteQuote: Segment | {};
33
+ inANutshell: Segment | {};
34
+ introduction: Segment | {};
35
+ insights: [
36
+ (Segment | {}),
37
+ (Segment | {}),
38
+ (Segment | {})
39
+ ];
40
+ conclusion: Segment | {};
41
+ // composite segments
42
+ overview: Segment | {};
43
+ shareableOverview: Segment | {};
44
+ hereAreTheInsights: Segment | {};
45
+ putInAction?: Segment | {};
46
+ };
47
+ externalLink?: HackExternalLink;
48
+ subjects?: ExtractedSubject[];
49
+ }
50
+
51
+ export interface CompletePendingHack extends PendingHack {
52
+ segments: {
53
+ favouriteQuote: Segment;
54
+ inANutshell: Segment;
55
+ introduction: Segment;
56
+ insights: [
57
+ Segment,
58
+ Segment,
59
+ Segment
60
+ ];
61
+ conclusion: Segment;
62
+ // composite segments
63
+ overview: Segment;
64
+ shareableOverview: Segment;
65
+ hereAreTheInsights: Segment;
66
+ putInAction?: Segment;
67
+ };
68
+ subjects: ExtractedSubject[];
69
+ }
70
+
71
+ export type CompletePendingHackWithPutInAction = CompletePendingHack & {
72
+ segments: {
73
+ putInAction: Segment;
74
+ }
75
+ };
@@ -1,41 +1,41 @@
1
- import { Profile } from './profile';
2
- import { TranslatedProfile } from './translated-profile';
3
-
4
- export interface ProfileCreatedEvent {
5
- id: string;
6
- type: 'ProfileCreated';
7
- payload: Profile;
8
- }
9
-
10
- export interface ProfileUpdatedEvent {
11
- id: string;
12
- type: 'ProfileUpdated';
13
- payload: Profile;
14
- }
15
-
16
- export interface ProfileDeletedEvent {
17
- id: string;
18
- type: 'ProfileDeleted';
19
- payload: Profile;
20
- }
21
-
22
- export interface TranslatedProfileCreatedEvent {
23
- id: string;
24
- type: 'TranslatedProfileCreated';
25
- payload: TranslatedProfile;
26
- }
27
-
28
- export interface TranslatedProfileUpdatedEvent {
29
- id: string;
30
- type: 'TranslatedProfileUpdated';
31
- payload: TranslatedProfile;
32
- }
33
-
34
- export interface TranslatedProfileDeletedEvent {
35
- id: string;
36
- type: 'TranslatedProfileDeleted';
37
- payload: TranslatedProfile;
38
- }
39
-
40
- export type ProfileChangedEvent = ProfileCreatedEvent | ProfileUpdatedEvent | ProfileDeletedEvent;
41
- export type TranslatedProfileChangedEvent = TranslatedProfileCreatedEvent | TranslatedProfileUpdatedEvent | TranslatedProfileDeletedEvent;
1
+ import { Profile } from './profile';
2
+ import { TranslatedProfile } from './translated-profile';
3
+
4
+ export interface ProfileCreatedEvent {
5
+ id: string;
6
+ type: 'ProfileCreated';
7
+ payload: Profile;
8
+ }
9
+
10
+ export interface ProfileUpdatedEvent {
11
+ id: string;
12
+ type: 'ProfileUpdated';
13
+ payload: Profile;
14
+ }
15
+
16
+ export interface ProfileDeletedEvent {
17
+ id: string;
18
+ type: 'ProfileDeleted';
19
+ payload: Profile;
20
+ }
21
+
22
+ export interface TranslatedProfileCreatedEvent {
23
+ id: string;
24
+ type: 'TranslatedProfileCreated';
25
+ payload: TranslatedProfile;
26
+ }
27
+
28
+ export interface TranslatedProfileUpdatedEvent {
29
+ id: string;
30
+ type: 'TranslatedProfileUpdated';
31
+ payload: TranslatedProfile;
32
+ }
33
+
34
+ export interface TranslatedProfileDeletedEvent {
35
+ id: string;
36
+ type: 'TranslatedProfileDeleted';
37
+ payload: TranslatedProfile;
38
+ }
39
+
40
+ export type ProfileChangedEvent = ProfileCreatedEvent | ProfileUpdatedEvent | ProfileDeletedEvent;
41
+ export type TranslatedProfileChangedEvent = TranslatedProfileCreatedEvent | TranslatedProfileUpdatedEvent | TranslatedProfileDeletedEvent;
@@ -1,27 +1,27 @@
1
- import { SupportedLocale } from '../localisation/supported-locales';
2
-
3
- export interface StoredProfile {
4
- id: string;
5
- v: number;
6
- createdAt: string;
7
- updatedAt: string;
8
- avatarUrl: string;
9
- name: string;
10
- owner: string;
11
- handle: string;
12
- _sanitisedHandle?: string; // use to determinate uniqueness for a handle, despite the case of it
13
- headerImageUrl?: string;
14
- tags?: string[];
15
- links?: ProfileLink[];
16
- tagline: string;
17
- description?: string;
18
- /** The locale (language and region) of the draft hack e.g. fr-FR. Mandatory property since 12/05/2023. */
19
- locale: SupportedLocale;
20
- }
21
-
22
- export type Profile = Omit<StoredProfile, '_sanitisedHandle'>;
23
-
24
- export interface ProfileLink {
25
- type: 'Other' | 'Twitter' | 'Facebook' | 'Youtube' | 'Medium' | 'Instagram' | 'Patreon' | 'TikTok' | 'LinkedIn' | 'LinkTree';
26
- url: string;
27
- }
1
+ import { SupportedLocale } from '../localisation/supported-locales';
2
+
3
+ export interface StoredProfile {
4
+ id: string;
5
+ v: number;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ avatarUrl: string;
9
+ name: string;
10
+ owner: string;
11
+ handle: string;
12
+ _sanitisedHandle?: string; // use to determinate uniqueness for a handle, despite the case of it
13
+ headerImageUrl?: string;
14
+ tags?: string[];
15
+ links?: ProfileLink[];
16
+ tagline: string;
17
+ description?: string;
18
+ /** The locale (language and region) of the draft hack e.g. fr-FR. Mandatory property since 12/05/2023. */
19
+ locale: SupportedLocale;
20
+ }
21
+
22
+ export type Profile = Omit<StoredProfile, '_sanitisedHandle'>;
23
+
24
+ export interface ProfileLink {
25
+ type: 'Other' | 'Twitter' | 'Facebook' | 'Youtube' | 'Medium' | 'Instagram' | 'Patreon' | 'TikTok' | 'LinkedIn' | 'LinkTree';
26
+ url: string;
27
+ }
@@ -1,13 +1,13 @@
1
- import { SupportedLocale } from '../localisation/supported-locales';
2
-
3
- export interface TranslatedProfile {
4
- id: string;
5
- v: number;
6
- createdAt: string;
7
- updatedAt: string;
8
- profileId: string;
9
- locale: SupportedLocale;
10
- tagline: string;
11
- description?: string;
12
- tags?: string[];
13
- }
1
+ import { SupportedLocale } from '../localisation/supported-locales';
2
+
3
+ export interface TranslatedProfile {
4
+ id: string;
5
+ v: number;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ profileId: string;
9
+ locale: SupportedLocale;
10
+ tagline: string;
11
+ description?: string;
12
+ tags?: string[];
13
+ }
@@ -1,70 +1,70 @@
1
- import { SupportedLocale } from '../localisation/supported-locales';
2
- import { SegmentType } from './segment';
3
-
4
- export interface StandaloneSegmentCard {
5
- markdown: string;
6
- }
7
-
8
- export interface StandaloneSegmentAction {
9
- title: string;
10
- cards: StandaloneSegmentCard[];
11
- }
12
-
13
- export interface StandaloneSegmentSection {
14
- heading?: string;
15
- cards: StandaloneSegmentCard[];
16
- }
17
-
18
- export interface CommandSegment {
19
- type: SegmentType;
20
- // @deprecated use hackTitle, hackType and hackContributors
21
- source?: {
22
- id: string;
23
- type: string;
24
- contributors: {
25
- name: string;
26
- }[];
27
- title: string;
28
- };
29
- hackCoverUrl?: string;
30
- hackId: string;
31
- hackTitle: string;
32
- hackType: 'book' | 'course' | 'documentary' | 'podcast' | 'original';
33
- hackContributors: {
34
- name: string;
35
- }[];
36
- locale: SupportedLocale;
37
- }
38
- export interface StandaloneSegment extends CommandSegment {
39
- title?: string;
40
- keywords?: string[];
41
- sections: StandaloneSegmentSection[];
42
- actions?: StandaloneSegmentAction[];
43
- textSummary?: string;
44
- }
45
-
46
- export interface CompositeSegment extends CommandSegment {
47
- subSegments: StandaloneSegment[];
48
- }
49
-
50
- export interface CreateSegmentCommand {
51
- id: string;
52
- type: 'CreateSegment';
53
- payload: (CompositeSegment | StandaloneSegment);
54
- }
55
-
56
- export interface UpdateSegmentCommand {
57
- id: string;
58
- type: 'UpdateSegment';
59
- payload: (CompositeSegment | StandaloneSegment) & {
60
- segmentId: string;
61
- };
62
- }
63
-
64
- export interface DeleteSegmentCommand {
65
- id: string;
66
- type: 'DeleteSegment';
67
- payload: {
68
- segmentId: string;
69
- };
70
- }
1
+ import { SupportedLocale } from '../localisation/supported-locales';
2
+ import { SegmentType } from './segment';
3
+
4
+ export interface StandaloneSegmentCard {
5
+ markdown: string;
6
+ }
7
+
8
+ export interface StandaloneSegmentAction {
9
+ title: string;
10
+ cards: StandaloneSegmentCard[];
11
+ }
12
+
13
+ export interface StandaloneSegmentSection {
14
+ heading?: string;
15
+ cards: StandaloneSegmentCard[];
16
+ }
17
+
18
+ export interface CommandSegment {
19
+ type: SegmentType;
20
+ // @deprecated use hackTitle, hackType and hackContributors
21
+ source?: {
22
+ id: string;
23
+ type: string;
24
+ contributors: {
25
+ name: string;
26
+ }[];
27
+ title: string;
28
+ };
29
+ hackCoverUrl?: string;
30
+ hackId: string;
31
+ hackTitle: string;
32
+ hackType: 'book' | 'course' | 'documentary' | 'podcast' | 'original';
33
+ hackContributors: {
34
+ name: string;
35
+ }[];
36
+ locale: SupportedLocale;
37
+ }
38
+ export interface StandaloneSegment extends CommandSegment {
39
+ title?: string;
40
+ keywords?: string[];
41
+ sections: StandaloneSegmentSection[];
42
+ actions?: StandaloneSegmentAction[];
43
+ textSummary?: string;
44
+ }
45
+
46
+ export interface CompositeSegment extends CommandSegment {
47
+ subSegments: StandaloneSegment[];
48
+ }
49
+
50
+ export interface CreateSegmentCommand {
51
+ id: string;
52
+ type: 'CreateSegment';
53
+ payload: (CompositeSegment | StandaloneSegment);
54
+ }
55
+
56
+ export interface UpdateSegmentCommand {
57
+ id: string;
58
+ type: 'UpdateSegment';
59
+ payload: (CompositeSegment | StandaloneSegment) & {
60
+ segmentId: string;
61
+ };
62
+ }
63
+
64
+ export interface DeleteSegmentCommand {
65
+ id: string;
66
+ type: 'DeleteSegment';
67
+ payload: {
68
+ segmentId: string;
69
+ };
70
+ }
@@ -1,8 +1,8 @@
1
- import { Segment } from './segment';
2
-
3
- // a segment with audio in a single voice, because having all voices in one segment would make the entity very large
4
- // the only difference is that it includes a voiceIdAndLanguage field, which can be used as a range key to find the segment for a specific voice
5
- // segmentsWithVoice may point to default or non-default voices
6
- export interface SegmentWithVoice extends Segment {
7
- voiceIdAndLanguage: string;
8
- }
1
+ import { Segment } from './segment';
2
+
3
+ // a segment with audio in a single voice, because having all voices in one segment would make the entity very large
4
+ // the only difference is that it includes a voiceIdAndLanguage field, which can be used as a range key to find the segment for a specific voice
5
+ // segmentsWithVoice may point to default or non-default voices
6
+ export interface SegmentWithVoice extends Segment {
7
+ voiceIdAndLanguage: string;
8
+ }
@@ -1,82 +1,82 @@
1
- export interface SegmentVoice {
2
- id: string;
3
- language: string;
4
- name: string;
5
- countryCode: string;
6
- speechProvider: string;
7
- }
8
-
9
- export interface Segment {
10
- id: string;
11
- v: number;
12
- createdAt: string;
13
- updatedAt: string;
14
- hackId: string;
15
- type: SegmentType;
16
- title: string;
17
- sections: SegmentSection[];
18
- keywords: string[];
19
- actions: SegmentAction[];
20
- speech: SegmentSpeech[];
21
- textSummary?: string;
22
- lastUpdatedFromPendingSegmentId?: string;
23
- hackType: string;
24
- /** use @uptime.app/text-to-speech-contracts */
25
- locale: string;
26
- }
27
-
28
- export type SegmentType =
29
- 'overview' | 'favourite-quote' | 'in-a-nutshell' |
30
- 'introduction' | 'here-are-the-insights' |
31
- 'insight-one' | 'insight-two' | 'insight-three' |
32
- 'put-in-action' | 'conclusion' |
33
- 'shareable-overview' | 'download-app-to-see-more';
34
-
35
- export type CardType = 'hack-cover' | 'action';
36
-
37
- export interface SegmentAction {
38
- title: string;
39
- cards: SegmentTextCard[];
40
- }
41
-
42
- export interface SegmentTextCard {
43
- id: string;
44
- markdown: string;
45
- segmentType: SegmentType;
46
- cardType?: CardType;
47
- isTitle?: boolean;
48
- speech?: TextCardSpeech[];
49
- }
50
-
51
- export interface SegmentSection {
52
- heading?: string;
53
- cards: SegmentTextCard[];
54
- }
55
-
56
- export interface SegmentSpeech {
57
- voice: SegmentVoice;
58
- withHeading: {
59
- url: string;
60
- lengthSeconds: number;
61
- };
62
- withoutHeading: {
63
- url: string;
64
- lengthSeconds: number;
65
- };
66
- }
67
-
68
- export interface TextCardSpeech {
69
- voiceId: string;
70
- withHeading: {
71
- timestamps: {
72
- startsAt: number;
73
- endsAt: number;
74
- };
75
- };
76
- withoutHeading: {
77
- timestamps: {
78
- startsAt: number;
79
- endsAt: number;
80
- };
81
- };
82
- }
1
+ export interface SegmentVoice {
2
+ id: string;
3
+ language: string;
4
+ name: string;
5
+ countryCode: string;
6
+ speechProvider: string;
7
+ }
8
+
9
+ export interface Segment {
10
+ id: string;
11
+ v: number;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ hackId: string;
15
+ type: SegmentType;
16
+ title: string;
17
+ sections: SegmentSection[];
18
+ keywords: string[];
19
+ actions: SegmentAction[];
20
+ speech: SegmentSpeech[];
21
+ textSummary?: string;
22
+ lastUpdatedFromPendingSegmentId?: string;
23
+ hackType: string;
24
+ /** use @uptime.app/text-to-speech-contracts */
25
+ locale: string;
26
+ }
27
+
28
+ export type SegmentType =
29
+ 'overview' | 'favourite-quote' | 'in-a-nutshell' |
30
+ 'introduction' | 'here-are-the-insights' |
31
+ 'insight-one' | 'insight-two' | 'insight-three' |
32
+ 'put-in-action' | 'conclusion' |
33
+ 'shareable-overview' | 'download-app-to-see-more';
34
+
35
+ export type CardType = 'hack-cover' | 'action';
36
+
37
+ export interface SegmentAction {
38
+ title: string;
39
+ cards: SegmentTextCard[];
40
+ }
41
+
42
+ export interface SegmentTextCard {
43
+ id: string;
44
+ markdown: string;
45
+ segmentType: SegmentType;
46
+ cardType?: CardType;
47
+ isTitle?: boolean;
48
+ speech?: TextCardSpeech[];
49
+ }
50
+
51
+ export interface SegmentSection {
52
+ heading?: string;
53
+ cards: SegmentTextCard[];
54
+ }
55
+
56
+ export interface SegmentSpeech {
57
+ voice: SegmentVoice;
58
+ withHeading: {
59
+ url: string;
60
+ lengthSeconds: number;
61
+ };
62
+ withoutHeading: {
63
+ url: string;
64
+ lengthSeconds: number;
65
+ };
66
+ }
67
+
68
+ export interface TextCardSpeech {
69
+ voiceId: string;
70
+ withHeading: {
71
+ timestamps: {
72
+ startsAt: number;
73
+ endsAt: number;
74
+ };
75
+ };
76
+ withoutHeading: {
77
+ timestamps: {
78
+ startsAt: number;
79
+ endsAt: number;
80
+ };
81
+ };
82
+ }