@uptime.app/contracts 1.0.3 → 1.0.4-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.
@@ -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,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,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
+ }
@@ -1,20 +1,20 @@
1
- import { TextSegment, Voice } from './text-segment';
2
-
3
- export interface CreateSpeechFromTextCommand {
4
- id: string;
5
- type: 'CreateSpeechFromText';
6
- payload: {
7
- locale: string;
8
- textSegments: TextSegment[];
9
- };
10
- }
11
-
12
- export interface CreateSpeechWithVoiceCommand {
13
- id: string;
14
- type: 'CreateSpeechWithVoice';
15
- payload: {
16
- locale: string;
17
- textSegments: TextSegment[];
18
- voice: Voice;
19
- };
20
- }
1
+ import { TextSegment, Voice } from './text-segment';
2
+
3
+ export interface CreateSpeechFromTextCommand {
4
+ id: string;
5
+ type: 'CreateSpeechFromText';
6
+ payload: {
7
+ locale: string;
8
+ textSegments: TextSegment[];
9
+ };
10
+ }
11
+
12
+ export interface CreateSpeechWithVoiceCommand {
13
+ id: string;
14
+ type: 'CreateSpeechWithVoice';
15
+ payload: {
16
+ locale: string;
17
+ textSegments: TextSegment[];
18
+ voice: Voice;
19
+ };
20
+ }
@@ -1,11 +1,11 @@
1
- import { TextSegmentWithSpeech } from './text-segment';
2
- import { SupportedLocale } from '../localisation/supported-locales';
3
-
4
- export interface SpeechFromTextCreatedEvent {
5
- id: string;
6
- type: 'SpeechFromTextCreated';
7
- payload: {
8
- locale: SupportedLocale;
9
- textSegments: TextSegmentWithSpeech[];
10
- };
11
- }
1
+ import { TextSegmentWithSpeech } from './text-segment';
2
+ import { SupportedLocale } from '../localisation/supported-locales';
3
+
4
+ export interface SpeechFromTextCreatedEvent {
5
+ id: string;
6
+ type: 'SpeechFromTextCreated';
7
+ payload: {
8
+ locale: SupportedLocale;
9
+ textSegments: TextSegmentWithSpeech[];
10
+ };
11
+ }