@uptime.app/contracts 1.0.7 → 1.0.8

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 (46) hide show
  1. package/dist/cjs/draft-hack/draft-hack-events.d.ts +18 -0
  2. package/dist/cjs/draft-hack/draft-hack-events.d.ts.map +1 -0
  3. package/dist/cjs/draft-hack/draft-hack-events.js +3 -0
  4. package/dist/cjs/draft-hack/draft-hack-events.js.map +1 -0
  5. package/dist/cjs/draft-hack/draft-hack.d.ts +171 -0
  6. package/dist/cjs/draft-hack/draft-hack.d.ts.map +1 -0
  7. package/dist/cjs/draft-hack/draft-hack.js +23 -0
  8. package/dist/cjs/draft-hack/draft-hack.js.map +1 -0
  9. package/dist/cjs/index.d.ts +4 -0
  10. package/dist/cjs/index.d.ts.map +1 -1
  11. package/dist/cjs/index.js +4 -0
  12. package/dist/cjs/index.js.map +1 -1
  13. package/dist/cjs/knowledge-source/knowledge-source-events.d.ts +18 -0
  14. package/dist/cjs/knowledge-source/knowledge-source-events.d.ts.map +1 -0
  15. package/dist/cjs/knowledge-source/knowledge-source-events.js +3 -0
  16. package/dist/cjs/knowledge-source/knowledge-source-events.js.map +1 -0
  17. package/dist/cjs/knowledge-source/knowledge-source.d.ts +38 -0
  18. package/dist/cjs/knowledge-source/knowledge-source.d.ts.map +1 -0
  19. package/dist/cjs/knowledge-source/knowledge-source.js +3 -0
  20. package/dist/cjs/knowledge-source/knowledge-source.js.map +1 -0
  21. package/dist/esm/draft-hack/draft-hack-events.d.ts +18 -0
  22. package/dist/esm/draft-hack/draft-hack-events.d.ts.map +1 -0
  23. package/dist/esm/draft-hack/draft-hack-events.js +2 -0
  24. package/dist/esm/draft-hack/draft-hack-events.js.map +1 -0
  25. package/dist/esm/draft-hack/draft-hack.d.ts +171 -0
  26. package/dist/esm/draft-hack/draft-hack.d.ts.map +1 -0
  27. package/dist/esm/draft-hack/draft-hack.js +20 -0
  28. package/dist/esm/draft-hack/draft-hack.js.map +1 -0
  29. package/dist/esm/index.d.ts +4 -0
  30. package/dist/esm/index.d.ts.map +1 -1
  31. package/dist/esm/index.js +4 -0
  32. package/dist/esm/index.js.map +1 -1
  33. package/dist/esm/knowledge-source/knowledge-source-events.d.ts +18 -0
  34. package/dist/esm/knowledge-source/knowledge-source-events.d.ts.map +1 -0
  35. package/dist/esm/knowledge-source/knowledge-source-events.js +2 -0
  36. package/dist/esm/knowledge-source/knowledge-source-events.js.map +1 -0
  37. package/dist/esm/knowledge-source/knowledge-source.d.ts +38 -0
  38. package/dist/esm/knowledge-source/knowledge-source.d.ts.map +1 -0
  39. package/dist/esm/knowledge-source/knowledge-source.js +2 -0
  40. package/dist/esm/knowledge-source/knowledge-source.js.map +1 -0
  41. package/package.json +2 -2
  42. package/src/draft-hack/draft-hack-events.ts +21 -0
  43. package/src/draft-hack/draft-hack.ts +208 -0
  44. package/src/index.ts +6 -0
  45. package/src/knowledge-source/knowledge-source-events.ts +21 -0
  46. package/src/knowledge-source/knowledge-source.ts +43 -0
@@ -0,0 +1,18 @@
1
+ import { DraftHack } from './draft-hack';
2
+ export interface DraftHackCreatedEvent {
3
+ id: string;
4
+ type: 'DraftHackCreated';
5
+ payload: DraftHack;
6
+ }
7
+ export interface DraftHackUpdatedEvent {
8
+ id: string;
9
+ type: 'DraftHackUpdated';
10
+ payload: DraftHack;
11
+ }
12
+ export interface DraftHackDeletedEvent {
13
+ id: string;
14
+ type: 'DraftHackDeleted';
15
+ payload: DraftHack;
16
+ }
17
+ export type DraftHackChangedEvent = DraftHackCreatedEvent | DraftHackUpdatedEvent | DraftHackDeletedEvent;
18
+ //# sourceMappingURL=draft-hack-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack-events.d.ts","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=draft-hack-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack-events.js","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack-events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,171 @@
1
+ import { SupportedLocale } from '../localisation/supported-locales';
2
+ export interface DraftHack extends DraftHackContent {
3
+ /** The unique id of the draft hack. */
4
+ id: string;
5
+ /** The locale (language and region) of the draft hack e.g. fr-FR. Mandatory property since 12/01/2023. */
6
+ locale: SupportedLocale;
7
+ /** @deprecated Temporarily added in 12/01/2023. Should not be used under any circumstance as only a handful of drafts will contain this property */
8
+ baseLocaleDraftHackId?: string;
9
+ /** The id of the hack. Mandatory property since Dec 2022. */
10
+ hackId: string;
11
+ /** The id of the hack in its original locale. Mandatory property since 01/02/2023. */
12
+ baseLocaleHackId: string;
13
+ v: number;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ publishedAt?: string;
17
+ publishedVersion?: number;
18
+ owner?: string;
19
+ /** workflowStatus was added in May 2022 as we move toward UGC. Older drafts have not been backfilled */
20
+ workflowStatus?: DraftHackWorkflowStatus;
21
+ /** added in Nov 2022. Set to true whenever content changes are made to the draft */
22
+ hasUnpublishedChanges?: boolean;
23
+ /** added in March 2023. Must be set whenever content changes are made to the draft */
24
+ contentUpdatedAt?: string;
25
+ /** 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 */
26
+ baseLocaleContentUpdatedAt?: string;
27
+ }
28
+ export type DraftHackWorkflowStatus = 'publishing' | 'published';
29
+ export interface DraftHackContent {
30
+ /**
31
+ * @maxLength 150
32
+ */
33
+ title: string;
34
+ /**
35
+ * @maxLength 50
36
+ */
37
+ sourceId?: string;
38
+ /**
39
+ * @maxLength 50
40
+ */
41
+ themeId?: string;
42
+ segments: DraftHackSegments;
43
+ /**
44
+ * @maxLength 1000
45
+ */
46
+ coverUrl?: string;
47
+ notifications?: DraftHackNotifications;
48
+ affiliate?: DraftAffiliate;
49
+ /**
50
+ * @maxItems 50
51
+ */
52
+ topics?: DraftTopic[];
53
+ /**
54
+ * @maxItems 10
55
+ */
56
+ contributors?: DraftContributor[];
57
+ sourceData?: DraftSourceData;
58
+ /** For creators only. We will tackle this validation once profiles are introduce*/
59
+ externalLink?: DraftHackExternalLink;
60
+ /** For recording purpose for now, we will use this value further in the future */
61
+ contentRating?: DraftHackRating;
62
+ /**
63
+ * @maxItems 50
64
+ * @items.maxLength 150
65
+ */
66
+ tags?: string[];
67
+ type?: DraftHackType;
68
+ isCopyrightFree?: boolean;
69
+ }
70
+ export type DraftHackRating = 'mature' | 'appropriate';
71
+ export interface DraftHackNotifications {
72
+ /**
73
+ * @maxLength 1000
74
+ */
75
+ aiGeneratedText?: string;
76
+ /**
77
+ * @maxLength 1000
78
+ */
79
+ humanCuratedText?: string;
80
+ }
81
+ export interface DraftHackSegments {
82
+ favouriteQuote?: DraftHackSegment;
83
+ inANutshell?: DraftHackSegment;
84
+ introduction?: DraftHackSegment;
85
+ /**
86
+ * @maxItems 10
87
+ */
88
+ insights?: DraftHackInsightSegment[];
89
+ conclusion?: DraftHackSegment;
90
+ }
91
+ export interface DraftHackCard {
92
+ /**
93
+ * @maxLength 2000
94
+ */
95
+ markdown: string;
96
+ }
97
+ export interface DraftHackSegment {
98
+ /**
99
+ * @maxItems 50
100
+ * @items.maxLength 150
101
+ */
102
+ keywords: string[];
103
+ paragraphCards: DraftHackCard[][];
104
+ /**
105
+ * @maxLength 1000
106
+ */
107
+ textSummary?: string;
108
+ }
109
+ export interface DraftHackInsightSegment extends DraftHackSegment {
110
+ /**
111
+ * @maxLength 150
112
+ */
113
+ title?: string;
114
+ /**
115
+ * @maxItems 50
116
+ */
117
+ actions: DraftHackAction[];
118
+ }
119
+ export interface DraftHackAction {
120
+ /**
121
+ * @maxLength 150
122
+ */
123
+ title: string;
124
+ /**
125
+ * @maxLength 1000
126
+ */
127
+ markdown: string;
128
+ }
129
+ export interface DraftContributor {
130
+ /**
131
+ * @maxLength 150
132
+ */
133
+ name: string;
134
+ }
135
+ export interface DraftTopic {
136
+ /**
137
+ * @maxLength 150
138
+ */
139
+ name: string;
140
+ }
141
+ export interface DraftAffiliate {
142
+ /**
143
+ * @maxLength 1000
144
+ */
145
+ url?: string;
146
+ /**
147
+ * @maxLength 150
148
+ */
149
+ name?: string;
150
+ }
151
+ export interface DraftSourceData {
152
+ /**
153
+ * @maxLength 150
154
+ */
155
+ episodeTitle?: string;
156
+ /**
157
+ * @maxLength 50
158
+ */
159
+ releaseDate?: string;
160
+ }
161
+ export declare const draftHackListModelProperties: readonly ["id", "v", "owner", "createdAt", "updatedAt", "publishedAt", "publishedVersion", "title", "coverUrl", "type", "workflowStatus", "hasUnpublishedChanges", "tags", "locale", "hackId", "baseLocaleHackId"];
162
+ export interface DraftHackExternalLink {
163
+ /**
164
+ * @maxLength 1000
165
+ */
166
+ url: string;
167
+ type: 'Website' | 'Book' | 'Course' | 'Podcast' | 'Video' | 'Other';
168
+ }
169
+ export declare type DraftHackType = 'book' | 'course' | 'documentary' | 'podcast' | 'original';
170
+ export type DraftHackListModel = Pick<DraftHack, typeof draftHackListModelProperties[number]>;
171
+ //# sour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C9B;AAED,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACvB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC3B;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAGD,eAAO,MAAM,4BAA4B,oNAiB/B,CAAC;AAEX,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;CACvE;AAED,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,4BAA4B,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.draftHackListModelProperties = void 0;
4
+ // this is a neat way to select a subset of properties to create a new interface, and have the property names available in code
5
+ exports.draftHackListModelProperties = [
6
+ 'id',
7
+ 'v',
8
+ 'owner',
9
+ 'createdAt',
10
+ 'updatedAt',
11
+ 'publishedAt',
12
+ 'publishedVersion',
13
+ 'title',
14
+ 'coverUrl',
15
+ 'type',
16
+ 'workflowStatus',
17
+ 'hasUnpublishedChanges',
18
+ 'tags',
19
+ 'locale',
20
+ 'hackId',
21
+ 'baseLocaleHackId'
22
+ ];
23
+ //# sourceMappingURL=draft-hack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack.js","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack.ts"],"names":[],"mappings":";;;AAiLA,+HAA+H;AAClH,QAAA,4BAA4B,GAAG;IACxC,IAAI;IACJ,GAAG;IACH,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,MAAM;IACN,gBAAgB;IAChB,uBAAuB;IACvB,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,kBAAkB;CACZ,CAAC"}
@@ -1,3 +1,5 @@
1
+ export * from './draft-hack/draft-hack';
2
+ export * from './draft-hack/draft-hack-events';
1
3
  export * from './hack/extracted-subject';
2
4
  export * from './hack/hack';
3
5
  export * from './hack/hack-with-voice';
@@ -5,6 +7,8 @@ export * from './hack/hack-events';
5
7
  export * from './hack/hack-with-voice-events';
6
8
  export * from './hack-metadata/hack-metadata';
7
9
  export * from './hack-metadata/hack-metadata-events';
10
+ export * from './knowledge-source/knowledge-source';
11
+ export * from './knowledge-source/knowledge-source-events';
8
12
  export * from './localisation/live-locales';
9
13
  export * from './localisation/locale-language';
10
14
  export * from './localisation/supported-languages';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AAErD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAk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"}
package/dist/cjs/index.js CHANGED
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./draft-hack/draft-hack"), exports);
18
+ __exportStar(require("./draft-hack/draft-hack-events"), exports);
17
19
  __exportStar(require("./hack/extracted-subject"), exports);
18
20
  __exportStar(require("./hack/hack"), exports);
19
21
  __exportStar(require("./hack/hack-with-voice"), exports);
@@ -21,6 +23,8 @@ __exportStar(require("./hack/hack-events"), exports);
21
23
  __exportStar(require("./hack/hack-with-voice-events"), exports);
22
24
  __exportStar(require("./hack-metadata/hack-metadata"), exports);
23
25
  __exportStar(require("./hack-metadata/hack-metadata-events"), exports);
26
+ __exportStar(require("./knowledge-source/knowledge-source"), exports);
27
+ __exportStar(require("./knowledge-source/knowledge-source-events"), exports);
24
28
  __exportStar(require("./localisation/live-locales"), exports);
25
29
  __exportStar(require("./localisation/locale-language"), exports);
26
30
  __exportStar(require("./localisation/supported-languages"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC;AACzC,8CAA4B;AAC5B,yDAAuC;AACvC,qDAAmC;AACnC,gEAA8C;AAE9C,gEAA8C;AAC9C,uEAAqD;AAErD,8DAA4C;AAC5C,iEAA+C;AAC/C,qEAAmD;AACnD,mEAAiD;AAEjD,8DAA4C;AAC5C,qEAAmD;AACnD,yEAAuD;AACvD,gFAA8D;AAE9D,+DAA6C;AAC7C,6DAA2C;AAC3C,oDAAkC;AAElC,0EAAwD;AACxD,yEAAuD;AACvD,gEAA8C;AAE9C,8CAA4B;AAC5B,qDAAmC;AAEnC,gDAA8B;AAC9B,uDAAqC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC;AACxC,iEAA+C;AAE/C,2DAAyC;AACzC,8CAA4B;AAC5B,yDAAuC;AACvC,qDAAmC;AACnC,gEAA8C;AAE9C,gEAA8C;AAC9C,uEAAqD;AAErD,sEAAoD;AACpD,6EAA2D;AAE3D,8DAA4C;AAC5C,iEAA+C;AAC/C,qEAAmD;AACnD,mEAAiD;AAEjD,8DAA4C;AAC5C,qEAAmD;AACnD,yEAAuD;AACvD,gFAA8D;AAE9D,+DAA6C;AAC7C,6DAA2C;AAC3C,oDAAkC;AAElC,0EAAwD;AACxD,yEAAuD;AACvD,gEAA8C;AAE9C,8CAA4B;AAC5B,qDAAmC;AAEnC,gDAA8B;AAC9B,uDAAqC"}
@@ -0,0 +1,18 @@
1
+ import { KnowledgeSource } from './knowledge-source';
2
+ export interface KnowledgeSourceCreatedEvent {
3
+ id: string;
4
+ type: 'KnowledgeSourceCreated';
5
+ payload: KnowledgeSource;
6
+ }
7
+ export interface KnowledgeSourceUpdatedEvent {
8
+ id: string;
9
+ type: 'KnowledgeSourceUpdated';
10
+ payload: KnowledgeSource;
11
+ }
12
+ export interface KnowledgeSourceDeletedEvent {
13
+ id: string;
14
+ type: 'KnowledgeSourceDeleted';
15
+ payload: KnowledgeSource;
16
+ }
17
+ export type KnowledgeSourceChangedEvent = KnowledgeSourceCreatedEvent | KnowledgeSourceUpdatedEvent | KnowledgeSourceDeletedEvent;
18
+ //# sourceMappingURL=knowledge-source-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source-events.d.ts","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,GAAG,2BAA2B,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=knowledge-source-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source-events.js","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source-events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ export interface KnowledgeSource {
2
+ id: string;
3
+ /** @deprecated - use affiliate.url instead */
4
+ affiliateLink?: string;
5
+ affiliate: Affiliate;
6
+ categories: Category[];
7
+ topics: Topic[];
8
+ coverUrl?: string;
9
+ createdAt: string;
10
+ description?: string;
11
+ contributors: Contributor[];
12
+ title: string;
13
+ type: KnowledgeSourceType;
14
+ updatedAt: string;
15
+ v: number;
16
+ metadata?: {
17
+ [key: string]: any;
18
+ };
19
+ /** Number of pages in the book. only set for books. May be undefined */
20
+ pageCount?: number;
21
+ /** Set for courses, documentaries and podcasts. May be undefined */
22
+ durationInMinutes?: number;
23
+ }
24
+ export type KnowledgeSourceType = 'book' | 'course' | 'documentary' | 'podcast';
25
+ export interface Affiliate {
26
+ url?: string;
27
+ name?: string;
28
+ }
29
+ export interface Contributor {
30
+ name: string;
31
+ }
32
+ export interface Category {
33
+ name: string;
34
+ }
35
+ export interface Topic {
36
+ name: string;
37
+ }
38
+ //# sourceMappingURL=knowledge-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source.d.ts","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,CAAC,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;IACF,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC;AAEhF,MAAM,WAAW,SAAS;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=knowledge-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source.js","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { DraftHack } from './draft-hack';
2
+ export interface DraftHackCreatedEvent {
3
+ id: string;
4
+ type: 'DraftHackCreated';
5
+ payload: DraftHack;
6
+ }
7
+ export interface DraftHackUpdatedEvent {
8
+ id: string;
9
+ type: 'DraftHackUpdated';
10
+ payload: DraftHack;
11
+ }
12
+ export interface DraftHackDeletedEvent {
13
+ id: string;
14
+ type: 'DraftHackDeleted';
15
+ payload: DraftHack;
16
+ }
17
+ export type DraftHackChangedEvent = DraftHackCreatedEvent | DraftHackUpdatedEvent | DraftHackDeletedEvent;
18
+ //# sourceMappingURL=draft-hack-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack-events.d.ts","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=draft-hack-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack-events.js","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack-events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,171 @@
1
+ import { SupportedLocale } from '../localisation/supported-locales';
2
+ export interface DraftHack extends DraftHackContent {
3
+ /** The unique id of the draft hack. */
4
+ id: string;
5
+ /** The locale (language and region) of the draft hack e.g. fr-FR. Mandatory property since 12/01/2023. */
6
+ locale: SupportedLocale;
7
+ /** @deprecated Temporarily added in 12/01/2023. Should not be used under any circumstance as only a handful of drafts will contain this property */
8
+ baseLocaleDraftHackId?: string;
9
+ /** The id of the hack. Mandatory property since Dec 2022. */
10
+ hackId: string;
11
+ /** The id of the hack in its original locale. Mandatory property since 01/02/2023. */
12
+ baseLocaleHackId: string;
13
+ v: number;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ publishedAt?: string;
17
+ publishedVersion?: number;
18
+ owner?: string;
19
+ /** workflowStatus was added in May 2022 as we move toward UGC. Older drafts have not been backfilled */
20
+ workflowStatus?: DraftHackWorkflowStatus;
21
+ /** added in Nov 2022. Set to true whenever content changes are made to the draft */
22
+ hasUnpublishedChanges?: boolean;
23
+ /** added in March 2023. Must be set whenever content changes are made to the draft */
24
+ contentUpdatedAt?: string;
25
+ /** 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 */
26
+ baseLocaleContentUpdatedAt?: string;
27
+ }
28
+ export type DraftHackWorkflowStatus = 'publishing' | 'published';
29
+ export interface DraftHackContent {
30
+ /**
31
+ * @maxLength 150
32
+ */
33
+ title: string;
34
+ /**
35
+ * @maxLength 50
36
+ */
37
+ sourceId?: string;
38
+ /**
39
+ * @maxLength 50
40
+ */
41
+ themeId?: string;
42
+ segments: DraftHackSegments;
43
+ /**
44
+ * @maxLength 1000
45
+ */
46
+ coverUrl?: string;
47
+ notifications?: DraftHackNotifications;
48
+ affiliate?: DraftAffiliate;
49
+ /**
50
+ * @maxItems 50
51
+ */
52
+ topics?: DraftTopic[];
53
+ /**
54
+ * @maxItems 10
55
+ */
56
+ contributors?: DraftContributor[];
57
+ sourceData?: DraftSourceData;
58
+ /** For creators only. We will tackle this validation once profiles are introduce*/
59
+ externalLink?: DraftHackExternalLink;
60
+ /** For recording purpose for now, we will use this value further in the future */
61
+ contentRating?: DraftHackRating;
62
+ /**
63
+ * @maxItems 50
64
+ * @items.maxLength 150
65
+ */
66
+ tags?: string[];
67
+ type?: DraftHackType;
68
+ isCopyrightFree?: boolean;
69
+ }
70
+ export type DraftHackRating = 'mature' | 'appropriate';
71
+ export interface DraftHackNotifications {
72
+ /**
73
+ * @maxLength 1000
74
+ */
75
+ aiGeneratedText?: string;
76
+ /**
77
+ * @maxLength 1000
78
+ */
79
+ humanCuratedText?: string;
80
+ }
81
+ export interface DraftHackSegments {
82
+ favouriteQuote?: DraftHackSegment;
83
+ inANutshell?: DraftHackSegment;
84
+ introduction?: DraftHackSegment;
85
+ /**
86
+ * @maxItems 10
87
+ */
88
+ insights?: DraftHackInsightSegment[];
89
+ conclusion?: DraftHackSegment;
90
+ }
91
+ export interface DraftHackCard {
92
+ /**
93
+ * @maxLength 2000
94
+ */
95
+ markdown: string;
96
+ }
97
+ export interface DraftHackSegment {
98
+ /**
99
+ * @maxItems 50
100
+ * @items.maxLength 150
101
+ */
102
+ keywords: string[];
103
+ paragraphCards: DraftHackCard[][];
104
+ /**
105
+ * @maxLength 1000
106
+ */
107
+ textSummary?: string;
108
+ }
109
+ export interface DraftHackInsightSegment extends DraftHackSegment {
110
+ /**
111
+ * @maxLength 150
112
+ */
113
+ title?: string;
114
+ /**
115
+ * @maxItems 50
116
+ */
117
+ actions: DraftHackAction[];
118
+ }
119
+ export interface DraftHackAction {
120
+ /**
121
+ * @maxLength 150
122
+ */
123
+ title: string;
124
+ /**
125
+ * @maxLength 1000
126
+ */
127
+ markdown: string;
128
+ }
129
+ export interface DraftContributor {
130
+ /**
131
+ * @maxLength 150
132
+ */
133
+ name: string;
134
+ }
135
+ export interface DraftTopic {
136
+ /**
137
+ * @maxLength 150
138
+ */
139
+ name: string;
140
+ }
141
+ export interface DraftAffiliate {
142
+ /**
143
+ * @maxLength 1000
144
+ */
145
+ url?: string;
146
+ /**
147
+ * @maxLength 150
148
+ */
149
+ name?: string;
150
+ }
151
+ export interface DraftSourceData {
152
+ /**
153
+ * @maxLength 150
154
+ */
155
+ episodeTitle?: string;
156
+ /**
157
+ * @maxLength 50
158
+ */
159
+ releaseDate?: string;
160
+ }
161
+ export declare const draftHackListModelProperties: readonly ["id", "v", "owner", "createdAt", "updatedAt", "publishedAt", "publishedVersion", "title", "coverUrl", "type", "workflowStatus", "hasUnpublishedChanges", "tags", "locale", "hackId", "baseLocaleHackId"];
162
+ export interface DraftHackExternalLink {
163
+ /**
164
+ * @maxLength 1000
165
+ */
166
+ url: string;
167
+ type: 'Website' | 'Book' | 'Course' | 'Podcast' | 'Video' | 'Other';
168
+ }
169
+ export declare type DraftHackType = 'book' | 'course' | 'documentary' | 'podcast' | 'original';
170
+ export type DraftHackListModel = Pick<DraftHack, typeof draftHackListModelProperties[number]>;
171
+ //# sourceMappingURL=draft-hack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack.d.ts","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IAC/C,uCAAuC;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,0GAA0G;IAC1G,MAAM,EAAE,eAAe,CAAC;IACxB,oJAAoJ;IACpJ,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,gBAAgB,EAAE,MAAM,CAAC;IAEzB,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAA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,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;CACvE;AAED,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAE/F,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,EAAE,OAAO,4BAA4B,CAAC,MAAM,CAAC,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ // this is a neat way to select a subset of properties to create a new interface, and have the property names available in code
2
+ export const draftHackListModelProperties = [
3
+ 'id',
4
+ 'v',
5
+ 'owner',
6
+ 'createdAt',
7
+ 'updatedAt',
8
+ 'publishedAt',
9
+ 'publishedVersion',
10
+ 'title',
11
+ 'coverUrl',
12
+ 'type',
13
+ 'workflowStatus',
14
+ 'hasUnpublishedChanges',
15
+ 'tags',
16
+ 'locale',
17
+ 'hackId',
18
+ 'baseLocaleHackId'
19
+ ];
20
+ //# sourceMappingURL=draft-hack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-hack.js","sourceRoot":"","sources":["../../../src/draft-hack/draft-hack.ts"],"names":[],"mappings":"AAiLA,+HAA+H;AAC/H,MAAM,CAAC,MAAM,4BAA4B,GAAG;IACxC,IAAI;IACJ,GAAG;IACH,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,kBAAkB;IAClB,OAAO;IACP,UAAU;IACV,MAAM;IACN,gBAAgB;IAChB,uBAAuB;IACvB,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,kBAAkB;CACZ,CAAC"}
@@ -1,3 +1,5 @@
1
+ export * from './draft-hack/draft-hack';
2
+ export * from './draft-hack/draft-hack-events';
1
3
  export * from './hack/extracted-subject';
2
4
  export * from './hack/hack';
3
5
  export * from './hack/hack-with-voice';
@@ -5,6 +7,8 @@ export * from './hack/hack-events';
5
7
  export * from './hack/hack-with-voice-events';
6
8
  export * from './hack-metadata/hack-metadata';
7
9
  export * from './hack-metadata/hack-metadata-events';
10
+ export * from './knowledge-source/knowledge-source';
11
+ export * from './knowledge-source/knowledge-source-events';
8
12
  export * from './localisation/live-locales';
9
13
  export * from './localisation/locale-language';
10
14
  export * from './localisation/supported-languages';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AAErD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAElC,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAE/C,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AAErD,cAAc,qCAAqC,CAAC;AACpD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAElC,cAAc,yCAAyC,CAAC;AACxD,cAAc,wCAAwC,CAAC;AACvD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './draft-hack/draft-hack';
2
+ export * from './draft-hack/draft-hack-events';
1
3
  export * from './hack/extracted-subject';
2
4
  export * from './hack/hack';
3
5
  export * from './hack/hack-with-voice';
@@ -5,6 +7,8 @@ export * from './hack/hack-events';
5
7
  export * from './hack/hack-with-voice-events';
6
8
  export * from './hack-metadata/hack-metadata';
7
9
  export * from './hack-metadata/hack-metadata-events';
10
+ export * from './knowledge-source/knowledge-source';
11
+ export * from './knowledge-source/knowledge-source-events';
8
12
  export * from './localisation/live-locales';
9
13
  export * from './localisation/locale-language';
10
14
  export * from './localisation/supported-languages';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AAErD,cAAc,6BAA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AAC5B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { KnowledgeSource } from './knowledge-source';
2
+ export interface KnowledgeSourceCreatedEvent {
3
+ id: string;
4
+ type: 'KnowledgeSourceCreated';
5
+ payload: KnowledgeSource;
6
+ }
7
+ export interface KnowledgeSourceUpdatedEvent {
8
+ id: string;
9
+ type: 'KnowledgeSourceUpdated';
10
+ payload: KnowledgeSource;
11
+ }
12
+ export interface KnowledgeSourceDeletedEvent {
13
+ id: string;
14
+ type: 'KnowledgeSourceDeleted';
15
+ payload: KnowledgeSource;
16
+ }
17
+ export type KnowledgeSourceChangedEvent = KnowledgeSourceCreatedEvent | KnowledgeSourceUpdatedEvent | KnowledgeSourceDeletedEvent;
18
+ //# sourceMappingURL=knowledge-source-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source-events.d.ts","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,GAAG,2BAA2B,GAAG,2BAA2B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=knowledge-source-events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source-events.js","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source-events.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ export interface KnowledgeSource {
2
+ id: string;
3
+ /** @deprecated - use affiliate.url instead */
4
+ affiliateLink?: string;
5
+ affiliate: Affiliate;
6
+ categories: Category[];
7
+ topics: Topic[];
8
+ coverUrl?: string;
9
+ createdAt: string;
10
+ description?: string;
11
+ contributors: Contributor[];
12
+ title: string;
13
+ type: KnowledgeSourceType;
14
+ updatedAt: string;
15
+ v: number;
16
+ metadata?: {
17
+ [key: string]: any;
18
+ };
19
+ /** Number of pages in the book. only set for books. May be undefined */
20
+ pageCount?: number;
21
+ /** Set for courses, documentaries and podcasts. May be undefined */
22
+ durationInMinutes?: number;
23
+ }
24
+ export type KnowledgeSourceType = 'book' | 'course' | 'documentary' | 'podcast';
25
+ export interface Affiliate {
26
+ url?: string;
27
+ name?: string;
28
+ }
29
+ export interface Contributor {
30
+ name: string;
31
+ }
32
+ export interface Category {
33
+ name: string;
34
+ }
35
+ export interface Topic {
36
+ name: string;
37
+ }
38
+ //# sourceMappingURL=knowledge-source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source.d.ts","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,QAAQ,EAAE,CAAC;IACvB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,mBAAmB,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,CAAC,EAAE;QACP,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;IACF,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC;AAEhF,MAAM,WAAW,SAAS;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACrB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=knowledge-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-source.js","sourceRoot":"","sources":["../../../src/knowledge-source/knowledge-source.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uptime.app/contracts",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "license": "MIT",
5
5
  "types": "./dist/esm/index.d.ts",
6
6
  "main": "./dist/cjs/index.js",
@@ -13,5 +13,5 @@
13
13
  "devDependencies": {
14
14
  "typescript": "^5.4.3"
15
15
  },
16
- "gitHead": "0b1323069e0c218c25532b76a77b2320c219396e"
16
+ "gitHead": "13e37e694a27ae99fa581a1ef3eac868d6ee5e46"
17
17
  }
@@ -0,0 +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;
@@ -0,0 +1,208 @@
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]>;
package/src/index.ts CHANGED
@@ -1,3 +1,6 @@
1
+ export * from './draft-hack/draft-hack';
2
+ export * from './draft-hack/draft-hack-events';
3
+
1
4
  export * from './hack/extracted-subject';
2
5
  export * from './hack/hack';
3
6
  export * from './hack/hack-with-voice';
@@ -7,6 +10,9 @@ export * from './hack/hack-with-voice-events';
7
10
  export * from './hack-metadata/hack-metadata';
8
11
  export * from './hack-metadata/hack-metadata-events';
9
12
 
13
+ export * from './knowledge-source/knowledge-source';
14
+ export * from './knowledge-source/knowledge-source-events';
15
+
10
16
  export * from './localisation/live-locales';
11
17
  export * from './localisation/locale-language';
12
18
  export * from './localisation/supported-languages';
@@ -0,0 +1,21 @@
1
+ import { KnowledgeSource } from './knowledge-source';
2
+
3
+ export interface KnowledgeSourceCreatedEvent {
4
+ id: string;
5
+ type: 'KnowledgeSourceCreated';
6
+ payload: KnowledgeSource;
7
+ }
8
+
9
+ export interface KnowledgeSourceUpdatedEvent {
10
+ id: string;
11
+ type: 'KnowledgeSourceUpdated';
12
+ payload: KnowledgeSource;
13
+ }
14
+
15
+ export interface KnowledgeSourceDeletedEvent {
16
+ id: string;
17
+ type: 'KnowledgeSourceDeleted';
18
+ payload: KnowledgeSource;
19
+ }
20
+
21
+ export type KnowledgeSourceChangedEvent = KnowledgeSourceCreatedEvent | KnowledgeSourceUpdatedEvent | KnowledgeSourceDeletedEvent;
@@ -0,0 +1,43 @@
1
+ export interface KnowledgeSource {
2
+ id: string;
3
+ /** @deprecated - use affiliate.url instead */
4
+ affiliateLink?: string;
5
+ // introduced Feb 2021. May be undefined in previous events
6
+ affiliate: Affiliate;
7
+ categories: Category[];
8
+ topics: Topic[];
9
+ coverUrl?: string;
10
+ createdAt: string;
11
+ description?: string;
12
+ contributors: Contributor[];
13
+ title: string;
14
+ type: KnowledgeSourceType;
15
+ updatedAt: string;
16
+ v: number;
17
+ metadata?: {
18
+ [key: string]: any;
19
+ };
20
+ /** Number of pages in the book. only set for books. May be undefined */
21
+ pageCount?: number;
22
+ /** Set for courses, documentaries and podcasts. May be undefined */
23
+ durationInMinutes?: number;
24
+ }
25
+
26
+ export type KnowledgeSourceType = 'book' | 'course' | 'documentary' | 'podcast';
27
+
28
+ export interface Affiliate {
29
+ url?: string;
30
+ name?: string;
31
+ }
32
+
33
+ export interface Contributor {
34
+ name: string;
35
+ }
36
+
37
+ export interface Category {
38
+ name: string;
39
+ }
40
+
41
+ export interface Topic {
42
+ name: string;
43
+ }