@uptime.app/contracts 3.0.53-rc.1 → 3.0.54-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.
- package/dist/cjs/app-hack/app-hack-metadata.d.ts +0 -1
- package/dist/cjs/app-hack/app-hack-metadata.d.ts.map +1 -1
- package/dist/cjs/cms-hack/cms-searchable-hack.d.ts +0 -2
- package/dist/cjs/cms-hack/cms-searchable-hack.d.ts.map +1 -1
- package/dist/cjs/draft-hack/draft-hack.d.ts +0 -2
- package/dist/cjs/draft-hack/draft-hack.d.ts.map +1 -1
- package/dist/cjs/enriched-hack/enriched-hack.d.ts +0 -2
- package/dist/cjs/enriched-hack/enriched-hack.d.ts.map +1 -1
- package/dist/cjs/hack/hack.d.ts +0 -2
- package/dist/cjs/hack/hack.d.ts.map +1 -1
- package/dist/cjs/hack-mapping/app-hack-metadata.d.ts.map +1 -1
- package/dist/cjs/hack-mapping/app-hack-metadata.js +0 -1
- package/dist/cjs/hack-mapping/app-hack-metadata.js.map +1 -1
- package/dist/cjs/hackbot/hack-generation-commands.d.ts +6 -9
- package/dist/cjs/hackbot/hack-generation-commands.d.ts.map +1 -1
- package/dist/cjs/hackbot/hack-generation-trigger.d.ts +6 -9
- package/dist/cjs/hackbot/hack-generation-trigger.d.ts.map +1 -1
- package/dist/cjs/hackbot/hack-generation-trigger.js.map +1 -1
- package/dist/cjs/hackbot/knowledge-source-location.d.ts +6 -0
- package/dist/cjs/hackbot/knowledge-source-location.d.ts.map +1 -0
- package/dist/cjs/{topics/primary-topic.js → hackbot/knowledge-source-location.js} +1 -1
- package/dist/cjs/hackbot/knowledge-source-location.js.map +1 -0
- package/dist/cjs/identity-provider/identity-provider.d.ts +4 -0
- package/dist/cjs/identity-provider/identity-provider.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/knowledge-source-parsing/knowledge-source-parsing-commands.d.ts +9 -0
- package/dist/cjs/knowledge-source-parsing/knowledge-source-parsing-commands.d.ts.map +1 -1
- package/dist/cjs/pending-hack/pending-hack.d.ts +0 -2
- package/dist/cjs/pending-hack/pending-hack.d.ts.map +1 -1
- package/dist/cjs/spark/spark.d.ts +1 -1
- package/dist/cjs/spark/spark.d.ts.map +1 -1
- package/dist/esm/app-hack/app-hack-metadata.d.ts +0 -1
- package/dist/esm/app-hack/app-hack-metadata.d.ts.map +1 -1
- package/dist/esm/cms-hack/cms-searchable-hack.d.ts +0 -2
- package/dist/esm/cms-hack/cms-searchable-hack.d.ts.map +1 -1
- package/dist/esm/draft-hack/draft-hack.d.ts +0 -2
- package/dist/esm/draft-hack/draft-hack.d.ts.map +1 -1
- package/dist/esm/enriched-hack/enriched-hack.d.ts +0 -2
- package/dist/esm/enriched-hack/enriched-hack.d.ts.map +1 -1
- package/dist/esm/hack/hack.d.ts +0 -2
- package/dist/esm/hack/hack.d.ts.map +1 -1
- package/dist/esm/hack-mapping/app-hack-metadata.d.ts.map +1 -1
- package/dist/esm/hack-mapping/app-hack-metadata.js +0 -1
- package/dist/esm/hack-mapping/app-hack-metadata.js.map +1 -1
- package/dist/esm/hackbot/hack-generation-commands.d.ts +6 -9
- package/dist/esm/hackbot/hack-generation-commands.d.ts.map +1 -1
- package/dist/esm/hackbot/hack-generation-trigger.d.ts +6 -9
- package/dist/esm/hackbot/hack-generation-trigger.d.ts.map +1 -1
- package/dist/esm/hackbot/hack-generation-trigger.js.map +1 -1
- package/dist/esm/hackbot/knowledge-source-location.d.ts +6 -0
- package/dist/esm/hackbot/knowledge-source-location.d.ts.map +1 -0
- package/dist/esm/hackbot/knowledge-source-location.js +2 -0
- package/dist/esm/hackbot/knowledge-source-location.js.map +1 -0
- package/dist/esm/identity-provider/identity-provider.d.ts +4 -0
- package/dist/esm/identity-provider/identity-provider.d.ts.map +1 -1
- package/dist/esm/index.d.ts +0 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/knowledge-source-parsing/knowledge-source-parsing-commands.d.ts +9 -0
- package/dist/esm/knowledge-source-parsing/knowledge-source-parsing-commands.d.ts.map +1 -1
- package/dist/esm/pending-hack/pending-hack.d.ts +0 -2
- package/dist/esm/pending-hack/pending-hack.d.ts.map +1 -1
- package/dist/esm/spark/spark.d.ts +1 -1
- package/dist/esm/spark/spark.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/app-hack/app-hack-metadata.ts +0 -1
- package/src/cms-hack/cms-searchable-hack.ts +0 -3
- package/src/draft-hack/draft-hack.ts +0 -2
- package/src/enriched-hack/enriched-hack.ts +0 -2
- package/src/hack/hack.ts +0 -2
- package/src/hack-mapping/app-hack-metadata.ts +0 -1
- package/src/hack-mapping/test-data/enriched-hack.json +12 -17
- package/src/hack-mapping/test-data/expected-app-full-hack.json +12 -17
- package/src/hack-mapping/test-data/expected-app-hack-metadata.json +12 -17
- package/src/hack-mapping/test-data/expected-app-restricted-hack.json +12 -17
- package/src/hackbot/hack-generation-commands.ts +43 -45
- package/src/hackbot/hack-generation-trigger.ts +6 -9
- package/src/hackbot/knowledge-source-location.ts +5 -0
- package/src/identity-provider/identity-provider.ts +5 -1
- package/src/index.ts +0 -3
- package/src/knowledge-source-parsing/knowledge-source-parsing-commands.ts +50 -41
- package/src/pending-hack/pending-hack.ts +0 -2
- package/src/spark/spark.ts +1 -0
- package/dist/cjs/topics/primary-topic-mapping.d.ts +0 -7
- package/dist/cjs/topics/primary-topic-mapping.d.ts.map +0 -1
- package/dist/cjs/topics/primary-topic-mapping.js +0 -98
- package/dist/cjs/topics/primary-topic-mapping.js.map +0 -1
- package/dist/cjs/topics/primary-topic.d.ts +0 -4
- package/dist/cjs/topics/primary-topic.d.ts.map +0 -1
- package/dist/cjs/topics/primary-topic.js.map +0 -1
- package/dist/esm/topics/primary-topic-mapping.d.ts +0 -7
- package/dist/esm/topics/primary-topic-mapping.d.ts.map +0 -1
- package/dist/esm/topics/primary-topic-mapping.js +0 -94
- package/dist/esm/topics/primary-topic-mapping.js.map +0 -1
- package/dist/esm/topics/primary-topic.d.ts +0 -4
- package/dist/esm/topics/primary-topic.d.ts.map +0 -1
- package/dist/esm/topics/primary-topic.js +0 -2
- package/dist/esm/topics/primary-topic.js.map +0 -1
- package/src/topics/primary-topic-mapping.test.ts +0 -36
- package/src/topics/primary-topic-mapping.ts +0 -110
- package/src/topics/primary-topic.ts +0 -3
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
hackFromUrlWithMetadata?: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
payload: TriggerHackGenerationCommandPayload;
|
|
45
|
-
}
|
|
1
|
+
import { KnowledgeSourceLocation } from './knowledge-source-location';
|
|
2
|
+
|
|
3
|
+
export interface TriggerHackGenerationCommandPayload {
|
|
4
|
+
reference: string;
|
|
5
|
+
userId?: string;
|
|
6
|
+
|
|
7
|
+
hackFromUrl?: KnowledgeSourceLocation
|
|
8
|
+
|
|
9
|
+
hackFromUrlWithMetadata?: KnowledgeSourceLocation & {
|
|
10
|
+
typeOfHack: string; // in words e.g. "annual report", free text
|
|
11
|
+
toneOfVoice: string; // e.g. "professional", "casual", "enthusiastic", free text
|
|
12
|
+
insightsToEmphasise: string; // e.g. "key statistics", "quotes", "key facts", "keep it general", free text
|
|
13
|
+
takeawaysToEmphasise?: string; // e.g. "practical steps", "strategic advice", free text, for the "insights in action". If "shouldCreateTakeaways" is false, this will be omitted
|
|
14
|
+
shouldCreateTakeaways: boolean; // whether to create "insights in action"
|
|
15
|
+
title?: string;
|
|
16
|
+
contributors?: string;
|
|
17
|
+
useB2CSegmentLimits: boolean; // if true, use the B2C segment length limits (e.g. 850+ characters for insight bodies)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
hackFromPodcastUrl?: KnowledgeSourceLocation & {
|
|
21
|
+
useB2CSegmentLimits?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
hackFromPodcastRSS?: {
|
|
25
|
+
rssUrl: string;
|
|
26
|
+
episodeNumber: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
hackFromPodcastWithMetadata?: KnowledgeSourceLocation & {
|
|
30
|
+
podcastName: string;
|
|
31
|
+
episodeName: string;
|
|
32
|
+
episodeDescription: string;
|
|
33
|
+
episodeReleaseDate: string;
|
|
34
|
+
episodeImageUrl: string;
|
|
35
|
+
useB2CSegmentLimits: boolean;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface TriggerHackGenerationCommand {
|
|
40
|
+
id: string;
|
|
41
|
+
type: 'TriggerHackGeneration';
|
|
42
|
+
payload: TriggerHackGenerationCommandPayload;
|
|
43
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SupportedDraftHackGenerationType } from '../knowledge-source-parsing/knowledge-source-parsing-commands';
|
|
2
|
+
import { KnowledgeSourceLocation } from './knowledge-source-location';
|
|
2
3
|
|
|
3
4
|
export interface HackGenerationTrigger {
|
|
4
5
|
id: string;
|
|
@@ -8,12 +9,9 @@ export interface HackGenerationTrigger {
|
|
|
8
9
|
userId?: string;
|
|
9
10
|
reference?: string;
|
|
10
11
|
|
|
11
|
-
hackFromUrl?:
|
|
12
|
-
knowledgeSourceUrl: string;
|
|
13
|
-
}
|
|
12
|
+
hackFromUrl?: KnowledgeSourceLocation
|
|
14
13
|
|
|
15
|
-
hackFromUrlWithMetadata?: {
|
|
16
|
-
knowledgeSourceUrl: string;
|
|
14
|
+
hackFromUrlWithMetadata?: KnowledgeSourceLocation & {
|
|
17
15
|
typeOfHack: string; // in words e.g. "annual report", free text
|
|
18
16
|
toneOfVoice: string; // e.g. "professional", "casual", "enthusiastic", free text
|
|
19
17
|
insightsToEmphasise: string; // e.g. "key statistics", "quotes", "key facts", "keep it general", free text
|
|
@@ -24,8 +22,8 @@ export interface HackGenerationTrigger {
|
|
|
24
22
|
useB2CSegmentLimits: boolean; // if true, use the B2C segment length limits (e.g. 850+ characters for insight bodies)
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
hackFromPodcastUrl?: {
|
|
28
|
-
|
|
25
|
+
hackFromPodcastUrl?: KnowledgeSourceLocation & {
|
|
26
|
+
useB2CSegmentLimits?: boolean;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
hackFromPodcastRSS?: {
|
|
@@ -33,8 +31,7 @@ export interface HackGenerationTrigger {
|
|
|
33
31
|
episodeNumber: number;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
hackFromPodcastWithMetadata?: {
|
|
37
|
-
knowledgeSourceUrl: string;
|
|
34
|
+
hackFromPodcastWithMetadata?: KnowledgeSourceLocation & {
|
|
38
35
|
podcastName: string;
|
|
39
36
|
episodeName: string;
|
|
40
37
|
episodeDescription: string;
|
|
@@ -30,6 +30,8 @@ export interface IdentityProviderConfig {
|
|
|
30
30
|
'custom:ext_organisation_id'?: string;
|
|
31
31
|
'custom:ext_user_id'?: string;
|
|
32
32
|
'custom:country_code'?: string;
|
|
33
|
+
'custom:team_name'?: string;
|
|
34
|
+
'custom:is_manager'?: string;
|
|
33
35
|
};
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -44,4 +46,6 @@ export interface IdentityProviderClaims {
|
|
|
44
46
|
given_name?: string;
|
|
45
47
|
externalUserId?: string;
|
|
46
48
|
countryCode?: string;
|
|
47
|
-
|
|
49
|
+
teamName?: string;
|
|
50
|
+
isManager?: string
|
|
51
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -166,9 +166,6 @@ export * from './text-to-speech/text-segment';
|
|
|
166
166
|
export * from './theme/theme';
|
|
167
167
|
export * from './theme/theme-events';
|
|
168
168
|
|
|
169
|
-
export * from './topics/primary-topic';
|
|
170
|
-
export * from './topics/primary-topic-mapping';
|
|
171
|
-
|
|
172
169
|
export * from './translation/translation-events';
|
|
173
170
|
export * from './translation/translation';
|
|
174
171
|
|
|
@@ -1,41 +1,50 @@
|
|
|
1
|
-
import { KnowledgeSourceUserDefinedMetadata } from './knowledge-source-metadata';
|
|
2
|
-
|
|
3
|
-
export enum SupportedDraftHackGenerationType {
|
|
4
|
-
Book = 'book',
|
|
5
|
-
Podcast = 'podcast',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface ParseKnowledgeSourceCommand {
|
|
9
|
-
id: string;
|
|
10
|
-
type: 'ParseKnowledgeSource';
|
|
11
|
-
payload: {
|
|
12
|
-
knowledgeSourceUrl: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import { KnowledgeSourceUserDefinedMetadata } from './knowledge-source-metadata';
|
|
2
|
+
|
|
3
|
+
export enum SupportedDraftHackGenerationType {
|
|
4
|
+
Book = 'book',
|
|
5
|
+
Podcast = 'podcast',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ParseKnowledgeSourceCommand {
|
|
9
|
+
id: string;
|
|
10
|
+
type: 'ParseKnowledgeSource';
|
|
11
|
+
payload: {
|
|
12
|
+
knowledgeSourceUrl: string;
|
|
13
|
+
knowledgeSourceBucket?: string;
|
|
14
|
+
knowledgeSourceKey?: string;
|
|
15
|
+
reference: string;
|
|
16
|
+
hackGenerationTriggerId?: string;
|
|
17
|
+
triggerDraftHackGeneration: boolean;
|
|
18
|
+
typeOfDraftHackToGenerate: SupportedDraftHackGenerationType;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ParseKnowledgeSourceWithMetadataCommand {
|
|
23
|
+
id: string;
|
|
24
|
+
type: 'ParseKnowledgeSourceWithMetadata';
|
|
25
|
+
payload: {
|
|
26
|
+
knowledgeSourceUrl: string;
|
|
27
|
+
knowledgeSourceBucket?: string;
|
|
28
|
+
knowledgeSourceKey?: string;
|
|
29
|
+
reference: string;
|
|
30
|
+
hackGenerationTriggerId?: string;
|
|
31
|
+
triggerDraftHackGeneration: boolean;
|
|
32
|
+
typeOfDraftHackToGenerate: SupportedDraftHackGenerationType;
|
|
33
|
+
userDefinedMetadata: KnowledgeSourceUserDefinedMetadata;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ParseKnowledgeSourceFromPodcastCommand {
|
|
38
|
+
id: string;
|
|
39
|
+
type: 'ParseKnowledgeSourceFromPodcast';
|
|
40
|
+
payload: {
|
|
41
|
+
podcastUrl: string;
|
|
42
|
+
podcastBucket?: string;
|
|
43
|
+
podcastKey?: string;
|
|
44
|
+
rssEpisodeNumber?: number;
|
|
45
|
+
reference: string;
|
|
46
|
+
hackGenerationTriggerId?: string;
|
|
47
|
+
triggerDraftHackGeneration: boolean;
|
|
48
|
+
typeOfDraftHackToGenerate: SupportedDraftHackGenerationType;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { ExtractedSubject } from '../hack/extracted-subject';
|
|
3
3
|
import { HackAffiliate, HackContributor, HackType, HackSourceData, HackTopic, HackExternalLink } from '../hack/hack';
|
|
4
4
|
import { Segment } from '../segment/segment';
|
|
5
|
-
import { PrimaryTopic } from '../topics/primary-topic';
|
|
6
5
|
|
|
7
6
|
export interface PendingHack {
|
|
8
7
|
id: string;
|
|
@@ -25,7 +24,6 @@ export interface PendingHack {
|
|
|
25
24
|
copyrightFreeCoverUrl?: string;
|
|
26
25
|
affiliate?: HackAffiliate;
|
|
27
26
|
topics: HackTopic[];
|
|
28
|
-
primaryTopics: PrimaryTopic[];
|
|
29
27
|
contributors: HackContributor[];
|
|
30
28
|
type: HackType;
|
|
31
29
|
sourceData?: HackSourceData;
|
package/src/spark/spark.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PrimaryTopic } from './primary-topic';
|
|
2
|
-
export declare const VALID_PRIMARY_TOPIC_TAGS: string[];
|
|
3
|
-
export declare const OLD_TOPIC_TAGS: string[];
|
|
4
|
-
export type PrimaryTopicTag = (typeof VALID_PRIMARY_TOPIC_TAGS)[number];
|
|
5
|
-
export type OldTopicTag = (typeof OLD_TOPIC_TAGS)[number];
|
|
6
|
-
export declare function mapPrimaryTopicsToOldTopics(primaryTopics: Array<PrimaryTopic | string>): OldTopicTag[];
|
|
7
|
-
//# sourceMappingURL=primary-topic-mapping.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic-mapping.d.ts","sourceRoot":"","sources":["../../../src/topics/primary-topic-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,eAAO,MAAM,wBAAwB,UAiCpC,CAAC;AAEF,eAAO,MAAM,cAAc,UAmB1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AA0C1D,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,GAAG,WAAW,EAAE,CAQtG"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapPrimaryTopicsToOldTopics = exports.OLD_TOPIC_TAGS = exports.VALID_PRIMARY_TOPIC_TAGS = void 0;
|
|
4
|
-
exports.VALID_PRIMARY_TOPIC_TAGS = [
|
|
5
|
-
'Arts & Design',
|
|
6
|
-
'Biographies',
|
|
7
|
-
'Business',
|
|
8
|
-
'Career Success',
|
|
9
|
-
'Communication',
|
|
10
|
-
'Education & Studying',
|
|
11
|
-
'Entrepreneurship',
|
|
12
|
-
'Environment',
|
|
13
|
-
'Fitness & Sports',
|
|
14
|
-
'History',
|
|
15
|
-
'Home & Hobbies',
|
|
16
|
-
'Humanity & Societies',
|
|
17
|
-
'Identity & Equality',
|
|
18
|
-
'Investing',
|
|
19
|
-
'Leadership & Management',
|
|
20
|
-
'Marketing',
|
|
21
|
-
'Media & Entertainment',
|
|
22
|
-
'Mental Health',
|
|
23
|
-
'Mindfulness',
|
|
24
|
-
'Money & Finances',
|
|
25
|
-
'Neurodiversity',
|
|
26
|
-
'Nutrition & Health',
|
|
27
|
-
'Parenting & Family',
|
|
28
|
-
'Personal Growth',
|
|
29
|
-
'Politics, Law & Economics',
|
|
30
|
-
'Psychology & Philosophy',
|
|
31
|
-
'Relationships',
|
|
32
|
-
'Religion',
|
|
33
|
-
'Sales',
|
|
34
|
-
'Science',
|
|
35
|
-
'Sex',
|
|
36
|
-
'AI & Technology'
|
|
37
|
-
];
|
|
38
|
-
exports.OLD_TOPIC_TAGS = [
|
|
39
|
-
'Arts & Design',
|
|
40
|
-
'Biographies',
|
|
41
|
-
'Business',
|
|
42
|
-
'Culture & Society',
|
|
43
|
-
'Career & Success',
|
|
44
|
-
'Education',
|
|
45
|
-
'Health & Fitness',
|
|
46
|
-
'History',
|
|
47
|
-
'Leadership & Entrepreneurship',
|
|
48
|
-
'Lifestyle',
|
|
49
|
-
'Marketing & Sales',
|
|
50
|
-
'Mind & Philosophy',
|
|
51
|
-
'Money & Investing',
|
|
52
|
-
'Parenting & Relationships',
|
|
53
|
-
'Personal Growth',
|
|
54
|
-
'Religion & Spirituality',
|
|
55
|
-
'Science & the Environment',
|
|
56
|
-
'Technology & the Future'
|
|
57
|
-
];
|
|
58
|
-
const TOPIC_TO_PRIMARY_TOPIC_MAPPING = {
|
|
59
|
-
'Arts & Design': ['Arts & Design', 'Media & Entertainment'],
|
|
60
|
-
'Biographies': ['Biographies'],
|
|
61
|
-
'Business': ['Business'],
|
|
62
|
-
'Culture & Society': ['Identity & Equality', 'Politics, Law & Economics', 'Humanity & Societies'],
|
|
63
|
-
'Career & Success': ['Career Success'],
|
|
64
|
-
'Education': ['Education & Studying'],
|
|
65
|
-
'Health & Fitness': ['Nutrition & Health', 'Fitness & Sports', 'Mental Health', 'Neurodiversity'],
|
|
66
|
-
'History': ['History'],
|
|
67
|
-
'Leadership & Entrepreneurship': ['Leadership & Management', 'Entrepreneurship'],
|
|
68
|
-
'Lifestyle': ['Home & Hobbies'],
|
|
69
|
-
'Marketing & Sales': ['Marketing', 'Sales'],
|
|
70
|
-
'Mind & Philosophy': ['Mindfulness', 'Psychology & Philosophy'],
|
|
71
|
-
'Money & Investing': ['Money & Finances', 'Investing'],
|
|
72
|
-
'Parenting & Relationships': ['Sex', 'Relationships', 'Parenting & Family'],
|
|
73
|
-
'Personal Growth': ['Personal Growth', 'Communication'],
|
|
74
|
-
'Religion & Spirituality': ['Religion'],
|
|
75
|
-
'Science & the Environment': ['Science', 'Environment'],
|
|
76
|
-
'Technology & the Future': ['AI & Technology']
|
|
77
|
-
};
|
|
78
|
-
const PRIMARY_TOPIC_TO_OLD_TOPIC_MAPPING = Object.entries(TOPIC_TO_PRIMARY_TOPIC_MAPPING).reduce((mapping, [oldTopic, primaryTopics]) => {
|
|
79
|
-
for (const primaryTopic of primaryTopics) {
|
|
80
|
-
mapping[primaryTopic] = oldTopic;
|
|
81
|
-
}
|
|
82
|
-
return mapping;
|
|
83
|
-
}, {});
|
|
84
|
-
function primaryTopicNameOf(primaryTopic) {
|
|
85
|
-
return typeof primaryTopic === 'string' ? primaryTopic : primaryTopic.name;
|
|
86
|
-
}
|
|
87
|
-
function mapPrimaryTopicToOldTopic(primaryTopic) {
|
|
88
|
-
return PRIMARY_TOPIC_TO_OLD_TOPIC_MAPPING[primaryTopicNameOf(primaryTopic)];
|
|
89
|
-
}
|
|
90
|
-
function mapPrimaryTopicsToOldTopics(primaryTopics) {
|
|
91
|
-
return [
|
|
92
|
-
...new Set(primaryTopics
|
|
93
|
-
.map(mapPrimaryTopicToOldTopic)
|
|
94
|
-
.filter((oldTopic) => oldTopic !== undefined))
|
|
95
|
-
];
|
|
96
|
-
}
|
|
97
|
-
exports.mapPrimaryTopicsToOldTopics = mapPrimaryTopicsToOldTopics;
|
|
98
|
-
//# sourceMappingURL=primary-topic-mapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic-mapping.js","sourceRoot":"","sources":["../../../src/topics/primary-topic-mapping.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic.d.ts","sourceRoot":"","sources":["../../../src/topics/primary-topic.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic.js","sourceRoot":"","sources":["../../../src/topics/primary-topic.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PrimaryTopic } from './primary-topic';
|
|
2
|
-
export declare const VALID_PRIMARY_TOPIC_TAGS: string[];
|
|
3
|
-
export declare const OLD_TOPIC_TAGS: string[];
|
|
4
|
-
export type PrimaryTopicTag = (typeof VALID_PRIMARY_TOPIC_TAGS)[number];
|
|
5
|
-
export type OldTopicTag = (typeof OLD_TOPIC_TAGS)[number];
|
|
6
|
-
export declare function mapPrimaryTopicsToOldTopics(primaryTopics: Array<PrimaryTopic | string>): OldTopicTag[];
|
|
7
|
-
//# sourceMappingURL=primary-topic-mapping.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic-mapping.d.ts","sourceRoot":"","sources":["../../../src/topics/primary-topic-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,eAAO,MAAM,wBAAwB,UAiCpC,CAAC;AAEF,eAAO,MAAM,cAAc,UAmB1B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AACxE,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AA0C1D,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,GAAG,WAAW,EAAE,CAQtG"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
export const VALID_PRIMARY_TOPIC_TAGS = [
|
|
2
|
-
'Arts & Design',
|
|
3
|
-
'Biographies',
|
|
4
|
-
'Business',
|
|
5
|
-
'Career Success',
|
|
6
|
-
'Communication',
|
|
7
|
-
'Education & Studying',
|
|
8
|
-
'Entrepreneurship',
|
|
9
|
-
'Environment',
|
|
10
|
-
'Fitness & Sports',
|
|
11
|
-
'History',
|
|
12
|
-
'Home & Hobbies',
|
|
13
|
-
'Humanity & Societies',
|
|
14
|
-
'Identity & Equality',
|
|
15
|
-
'Investing',
|
|
16
|
-
'Leadership & Management',
|
|
17
|
-
'Marketing',
|
|
18
|
-
'Media & Entertainment',
|
|
19
|
-
'Mental Health',
|
|
20
|
-
'Mindfulness',
|
|
21
|
-
'Money & Finances',
|
|
22
|
-
'Neurodiversity',
|
|
23
|
-
'Nutrition & Health',
|
|
24
|
-
'Parenting & Family',
|
|
25
|
-
'Personal Growth',
|
|
26
|
-
'Politics, Law & Economics',
|
|
27
|
-
'Psychology & Philosophy',
|
|
28
|
-
'Relationships',
|
|
29
|
-
'Religion',
|
|
30
|
-
'Sales',
|
|
31
|
-
'Science',
|
|
32
|
-
'Sex',
|
|
33
|
-
'AI & Technology'
|
|
34
|
-
];
|
|
35
|
-
export const OLD_TOPIC_TAGS = [
|
|
36
|
-
'Arts & Design',
|
|
37
|
-
'Biographies',
|
|
38
|
-
'Business',
|
|
39
|
-
'Culture & Society',
|
|
40
|
-
'Career & Success',
|
|
41
|
-
'Education',
|
|
42
|
-
'Health & Fitness',
|
|
43
|
-
'History',
|
|
44
|
-
'Leadership & Entrepreneurship',
|
|
45
|
-
'Lifestyle',
|
|
46
|
-
'Marketing & Sales',
|
|
47
|
-
'Mind & Philosophy',
|
|
48
|
-
'Money & Investing',
|
|
49
|
-
'Parenting & Relationships',
|
|
50
|
-
'Personal Growth',
|
|
51
|
-
'Religion & Spirituality',
|
|
52
|
-
'Science & the Environment',
|
|
53
|
-
'Technology & the Future'
|
|
54
|
-
];
|
|
55
|
-
const TOPIC_TO_PRIMARY_TOPIC_MAPPING = {
|
|
56
|
-
'Arts & Design': ['Arts & Design', 'Media & Entertainment'],
|
|
57
|
-
'Biographies': ['Biographies'],
|
|
58
|
-
'Business': ['Business'],
|
|
59
|
-
'Culture & Society': ['Identity & Equality', 'Politics, Law & Economics', 'Humanity & Societies'],
|
|
60
|
-
'Career & Success': ['Career Success'],
|
|
61
|
-
'Education': ['Education & Studying'],
|
|
62
|
-
'Health & Fitness': ['Nutrition & Health', 'Fitness & Sports', 'Mental Health', 'Neurodiversity'],
|
|
63
|
-
'History': ['History'],
|
|
64
|
-
'Leadership & Entrepreneurship': ['Leadership & Management', 'Entrepreneurship'],
|
|
65
|
-
'Lifestyle': ['Home & Hobbies'],
|
|
66
|
-
'Marketing & Sales': ['Marketing', 'Sales'],
|
|
67
|
-
'Mind & Philosophy': ['Mindfulness', 'Psychology & Philosophy'],
|
|
68
|
-
'Money & Investing': ['Money & Finances', 'Investing'],
|
|
69
|
-
'Parenting & Relationships': ['Sex', 'Relationships', 'Parenting & Family'],
|
|
70
|
-
'Personal Growth': ['Personal Growth', 'Communication'],
|
|
71
|
-
'Religion & Spirituality': ['Religion'],
|
|
72
|
-
'Science & the Environment': ['Science', 'Environment'],
|
|
73
|
-
'Technology & the Future': ['AI & Technology']
|
|
74
|
-
};
|
|
75
|
-
const PRIMARY_TOPIC_TO_OLD_TOPIC_MAPPING = Object.entries(TOPIC_TO_PRIMARY_TOPIC_MAPPING).reduce((mapping, [oldTopic, primaryTopics]) => {
|
|
76
|
-
for (const primaryTopic of primaryTopics) {
|
|
77
|
-
mapping[primaryTopic] = oldTopic;
|
|
78
|
-
}
|
|
79
|
-
return mapping;
|
|
80
|
-
}, {});
|
|
81
|
-
function primaryTopicNameOf(primaryTopic) {
|
|
82
|
-
return typeof primaryTopic === 'string' ? primaryTopic : primaryTopic.name;
|
|
83
|
-
}
|
|
84
|
-
function mapPrimaryTopicToOldTopic(primaryTopic) {
|
|
85
|
-
return PRIMARY_TOPIC_TO_OLD_TOPIC_MAPPING[primaryTopicNameOf(primaryTopic)];
|
|
86
|
-
}
|
|
87
|
-
export function mapPrimaryTopicsToOldTopics(primaryTopics) {
|
|
88
|
-
return [
|
|
89
|
-
...new Set(primaryTopics
|
|
90
|
-
.map(mapPrimaryTopicToOldTopic)
|
|
91
|
-
.filter((oldTopic) => oldTopic !== undefined))
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=primary-topic-mapping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic-mapping.js","sourceRoot":"","sources":["../../../src/topics/primary-topic-mapping.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic.d.ts","sourceRoot":"","sources":["../../../src/topics/primary-topic.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"primary-topic.js","sourceRoot":"","sources":["../../../src/topics/primary-topic.ts"],"names":[],"mappings":""}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { mapPrimaryTopicsToOldTopics, OLD_TOPIC_TAGS, VALID_PRIMARY_TOPIC_TAGS } from './primary-topic-mapping';
|
|
2
|
-
|
|
3
|
-
describe('mapPrimaryTopicsToOldTopics', () => {
|
|
4
|
-
test('maps split primary topics back to their old topic', () => {
|
|
5
|
-
expect(mapPrimaryTopicsToOldTopics(['Politics, Law & Economics'])).toEqual(['Culture & Society']);
|
|
6
|
-
expect(mapPrimaryTopicsToOldTopics(['Communication'])).toEqual(['Personal Growth']);
|
|
7
|
-
expect(mapPrimaryTopicsToOldTopics(['AI & Technology'])).toEqual(['Technology & the Future']);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
test('supports PrimaryTopic objects', () => {
|
|
11
|
-
expect(mapPrimaryTopicsToOldTopics([{ name: 'Career Success' }])).toEqual(['Career & Success']);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
test('returns undefined for unknown topics', () => {
|
|
15
|
-
expect(mapPrimaryTopicsToOldTopics(['Unknown Topic'])).toEqual([]);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
test('maps every valid primary topic tag to a known old topic tag', () => {
|
|
19
|
-
for (const primaryTopic of VALID_PRIMARY_TOPIC_TAGS) {
|
|
20
|
-
const oldTopic = mapPrimaryTopicsToOldTopics([primaryTopic])[0];
|
|
21
|
-
expect(oldTopic).toBeDefined();
|
|
22
|
-
expect(OLD_TOPIC_TAGS).toContain(oldTopic);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
test('deduplicates old topics while preserving input order', () => {
|
|
26
|
-
expect(
|
|
27
|
-
mapPrimaryTopicsToOldTopics([
|
|
28
|
-
{ name: 'Marketing' },
|
|
29
|
-
{ name: 'Sales' },
|
|
30
|
-
{ name: 'Biographies' },
|
|
31
|
-
{ name: 'Marketing' },
|
|
32
|
-
{ name: 'Unknown Topic' }
|
|
33
|
-
])
|
|
34
|
-
).toEqual(['Marketing & Sales', 'Biographies']);
|
|
35
|
-
});
|
|
36
|
-
});
|