@uptime.app/contracts 1.0.21-rc.0 → 1.0.21

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 (66) hide show
  1. package/package.json +2 -2
  2. package/src/access-control/collection-access-control.ts +28 -28
  3. package/src/access-control/hack-access-control.ts +29 -29
  4. package/src/app-hack/app-full-hack.ts +9 -9
  5. package/src/app-hack/app-hack-metadata.ts +56 -56
  6. package/src/app-hack/app-restricted-hack.ts +22 -22
  7. package/src/b2b-organisation/b2b-organisation-events.ts +21 -21
  8. package/src/b2b-organisation/b2b-organisation-member-events.ts +21 -21
  9. package/src/b2b-organisation/b2b-organisation-member.ts +8 -8
  10. package/src/b2b-organisation/b2b-organisation.ts +14 -14
  11. package/src/brand/brand-events.ts +21 -21
  12. package/src/brand/brand.ts +8 -8
  13. package/src/collection/collection-events.ts +21 -21
  14. package/src/collection/collection.ts +58 -58
  15. package/src/collection/enriched-collection-events.ts +18 -18
  16. package/src/collection/enriched-collection.ts +64 -64
  17. package/src/distribution/collection-distribution.ts +17 -17
  18. package/src/distribution/distribution-events.ts +61 -61
  19. package/src/distribution/hack-distribution.ts +18 -18
  20. package/src/draft-hack/draft-hack-events.ts +21 -21
  21. package/src/draft-hack/draft-hack.ts +184 -184
  22. package/src/draft-hack-generation/draft-hack-generation-events.ts +42 -42
  23. package/src/draft-hack-generation/draft-hack-generation.ts +38 -38
  24. package/src/enriched-hack/enriched-hack-events.ts +21 -21
  25. package/src/enriched-hack/enriched-hack.ts +101 -101
  26. package/src/entitlement/user-entitlements-events.ts +20 -20
  27. package/src/entitlement/user-entitlements.ts +17 -17
  28. package/src/hack/extracted-subject.ts +31 -31
  29. package/src/hack/hack-events.ts +21 -21
  30. package/src/hack/hack-with-voice-events.ts +20 -20
  31. package/src/hack/hack-with-voice.ts +33 -33
  32. package/src/hack/hack.ts +114 -114
  33. package/src/hack-metadata/hack-metadata-events.ts +21 -21
  34. package/src/hack-metadata/hack-metadata.ts +17 -17
  35. package/src/index.ts +84 -84
  36. package/src/knowledge-source/knowledge-source-events.ts +21 -21
  37. package/src/knowledge-source/knowledge-source.ts +43 -43
  38. package/src/localisation/live-locales.ts +32 -32
  39. package/src/localisation/locale-language.ts +4 -4
  40. package/src/localisation/supported-languages.ts +11 -11
  41. package/src/localisation/supported-locales.ts +43 -43
  42. package/src/pending-hack/pending-hack-events.ts +20 -20
  43. package/src/pending-hack/pending-hack-with-voice-events.ts +20 -20
  44. package/src/pending-hack/pending-hack-with-voice.ts +25 -25
  45. package/src/pending-hack/pending-hack.ts +75 -75
  46. package/src/profile/profile-events.ts +41 -41
  47. package/src/profile/profile.ts +27 -27
  48. package/src/profile/translated-profile.ts +13 -13
  49. package/src/segment/segment-commands.ts +70 -70
  50. package/src/segment/segment-events.ts +42 -42
  51. package/src/segment/segment-with-voice.ts +8 -8
  52. package/src/segment/segment.ts +82 -82
  53. package/src/skin/skin-events.ts +21 -21
  54. package/src/skin/skin.ts +6 -6
  55. package/src/text-to-speech/create-speech-commands.ts +20 -20
  56. package/src/text-to-speech/speech-created-events.ts +10 -10
  57. package/src/text-to-speech/supported-voices.ts +101 -101
  58. package/src/text-to-speech/text-segment.ts +29 -29
  59. package/src/theme/theme-events.ts +21 -21
  60. package/src/theme/theme.ts +68 -68
  61. package/src/trending/trending-events.ts +21 -21
  62. package/src/trending/trending-hacks.ts +8 -8
  63. package/src/user-context/user-context-events.ts +21 -21
  64. package/src/user-context/user-context.ts +16 -16
  65. package/tsconfig.cjs.json +7 -7
  66. package/tsconfig.npm.json +21 -21
package/src/hack/hack.ts CHANGED
@@ -1,114 +1,114 @@
1
- import { ExtractedSubject } from './extracted-subject';
2
- export interface Hack {
3
- /** The unique id of the hack. */
4
- id: string;
5
- /** The locale (language and region) of the hack e.g. fr-FR. Use @uptime.app/localisation-contracts Mandatory property since 12/01/2023. */
6
- locale: string;
7
- /** The id of the hack in its original locale. Mandatory property since 12/01/2023. */
8
- baseLocaleHackId: string;
9
- v: number;
10
- createdAt: string;
11
- updatedAt: string;
12
- owner: string;
13
- sourceId?: string;
14
- title: string;
15
- themeId: string;
16
-
17
- /** introduced Oct 2023 **/
18
- draftHackId: string;
19
- draftHackVersion: number;
20
-
21
- // TODO I'd remove it altogether, but it would be a breaking contract change. Thoughts?
22
- isHidden?: boolean;
23
-
24
- editorialTags?: string[];
25
- coverUrl?: string;
26
- notifications?: {
27
- aiGeneratedText?: string
28
- humanCuratedText?: string;
29
- },
30
- segments: {
31
- favouriteQuote: {
32
- id: string;
33
- /** added 04/2023 */
34
- v?: number;
35
- };
36
- inANutshell: {
37
- id: string;
38
- /** added 04/2023 */
39
- v?: number;
40
- };
41
- introduction: {
42
- id: string;
43
- /** added 04/2023 */
44
- v?: number;
45
- };
46
- insights: {
47
- id: string
48
- /** added 04/2023 */
49
- v?: number;
50
- }[];
51
- conclusion: {
52
- id: string;
53
- /** added 04/2023 */
54
- v?: number;
55
- };
56
-
57
- // composite segments
58
- overview: {
59
- id: string;
60
- /** added 04/2023 */
61
- v?: number;
62
- };
63
- shareableOverview: {
64
- id: string;
65
- /** added 04/2023 */
66
- v?: number;
67
- };
68
- hereAreTheInsights: {
69
- id: string;
70
- /** added 04/2023 */
71
- v?: number;
72
- };
73
- putInAction?: {
74
- id: string;
75
- /** added 04/2023 */
76
- v?: number;
77
- };
78
- };
79
- affiliate?: HackAffiliate;
80
- topics: HackTopic[];
81
- contributors?: HackContributor[];
82
- type: HackType;
83
- sourceData?: HackSourceData;
84
- externalLink?: HackExternalLink;
85
-
86
- /** added Mar 2024 */
87
- // TODO make it mandatory after a republish
88
- subjects?: ExtractedSubject[];
89
- }
90
-
91
- export interface HackContributor {
92
- name: string;
93
- }
94
-
95
- export interface HackTopic {
96
- name: string;
97
- }
98
-
99
- export interface HackAffiliate {
100
- url: string;
101
- name: string;
102
- }
103
-
104
- export type HackType = 'book' | 'course' | 'documentary' | 'podcast' | 'original';
105
-
106
- export interface HackSourceData {
107
- episodeTitle?: string;
108
- releaseDate?: string;
109
- }
110
-
111
- export interface HackExternalLink {
112
- url: string;
113
- type: 'Website' | 'Book' | 'Course' | 'Podcast' | 'Video' | 'Other';
114
- }
1
+ import { ExtractedSubject } from './extracted-subject';
2
+ export interface Hack {
3
+ /** The unique id of the hack. */
4
+ id: string;
5
+ /** The locale (language and region) of the hack e.g. fr-FR. Use @uptime.app/localisation-contracts Mandatory property since 12/01/2023. */
6
+ locale: string;
7
+ /** The id of the hack in its original locale. Mandatory property since 12/01/2023. */
8
+ baseLocaleHackId: string;
9
+ v: number;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ owner: string;
13
+ sourceId?: string;
14
+ title: string;
15
+ themeId: string;
16
+
17
+ /** introduced Oct 2023 **/
18
+ draftHackId: string;
19
+ draftHackVersion: number;
20
+
21
+ // TODO I'd remove it altogether, but it would be a breaking contract change. Thoughts?
22
+ isHidden?: boolean;
23
+
24
+ editorialTags?: string[];
25
+ coverUrl?: string;
26
+ notifications?: {
27
+ aiGeneratedText?: string
28
+ humanCuratedText?: string;
29
+ },
30
+ segments: {
31
+ favouriteQuote: {
32
+ id: string;
33
+ /** added 04/2023 */
34
+ v?: number;
35
+ };
36
+ inANutshell: {
37
+ id: string;
38
+ /** added 04/2023 */
39
+ v?: number;
40
+ };
41
+ introduction: {
42
+ id: string;
43
+ /** added 04/2023 */
44
+ v?: number;
45
+ };
46
+ insights: {
47
+ id: string
48
+ /** added 04/2023 */
49
+ v?: number;
50
+ }[];
51
+ conclusion: {
52
+ id: string;
53
+ /** added 04/2023 */
54
+ v?: number;
55
+ };
56
+
57
+ // composite segments
58
+ overview: {
59
+ id: string;
60
+ /** added 04/2023 */
61
+ v?: number;
62
+ };
63
+ shareableOverview: {
64
+ id: string;
65
+ /** added 04/2023 */
66
+ v?: number;
67
+ };
68
+ hereAreTheInsights: {
69
+ id: string;
70
+ /** added 04/2023 */
71
+ v?: number;
72
+ };
73
+ putInAction?: {
74
+ id: string;
75
+ /** added 04/2023 */
76
+ v?: number;
77
+ };
78
+ };
79
+ affiliate?: HackAffiliate;
80
+ topics: HackTopic[];
81
+ contributors?: HackContributor[];
82
+ type: HackType;
83
+ sourceData?: HackSourceData;
84
+ externalLink?: HackExternalLink;
85
+
86
+ /** added Mar 2024 */
87
+ // TODO make it mandatory after a republish
88
+ subjects?: ExtractedSubject[];
89
+ }
90
+
91
+ export interface HackContributor {
92
+ name: string;
93
+ }
94
+
95
+ export interface HackTopic {
96
+ name: string;
97
+ }
98
+
99
+ export interface HackAffiliate {
100
+ url: string;
101
+ name: string;
102
+ }
103
+
104
+ export type HackType = 'book' | 'course' | 'documentary' | 'podcast' | 'original';
105
+
106
+ export interface HackSourceData {
107
+ episodeTitle?: string;
108
+ releaseDate?: string;
109
+ }
110
+
111
+ export interface HackExternalLink {
112
+ url: string;
113
+ type: 'Website' | 'Book' | 'Course' | 'Podcast' | 'Video' | 'Other';
114
+ }
@@ -1,21 +1,21 @@
1
- import { HackMetadata } from './hack-metadata';
2
-
3
- export interface HackMetadataCreatedEvent {
4
- id: string;
5
- type: 'HackMetadataCreated';
6
- payload: HackMetadata;
7
- }
8
-
9
- export interface HackMetadataUpdatedEvent {
10
- id: string;
11
- type: 'HackMetadataUpdated';
12
- payload: HackMetadata;
13
- }
14
-
15
- export interface HackMetadataDeletedEvent {
16
- id: string;
17
- type: 'HackMetadataDeleted';
18
- payload: HackMetadata;
19
- }
20
-
21
- export type HackMetadataChangedEvent = HackMetadataCreatedEvent | HackMetadataUpdatedEvent | HackMetadataDeletedEvent;
1
+ import { HackMetadata } from './hack-metadata';
2
+
3
+ export interface HackMetadataCreatedEvent {
4
+ id: string;
5
+ type: 'HackMetadataCreated';
6
+ payload: HackMetadata;
7
+ }
8
+
9
+ export interface HackMetadataUpdatedEvent {
10
+ id: string;
11
+ type: 'HackMetadataUpdated';
12
+ payload: HackMetadata;
13
+ }
14
+
15
+ export interface HackMetadataDeletedEvent {
16
+ id: string;
17
+ type: 'HackMetadataDeleted';
18
+ payload: HackMetadata;
19
+ }
20
+
21
+ export type HackMetadataChangedEvent = HackMetadataCreatedEvent | HackMetadataUpdatedEvent | HackMetadataDeletedEvent;
@@ -1,17 +1,17 @@
1
- import { ExtractedSubject } from '../hack/extracted-subject';
2
-
3
- export interface HackMetadata {
4
- // hackId
5
- id: string;
6
- v: number;
7
- createdAt: string;
8
- updatedAt: string;
9
-
10
- hackId: string;
11
- baseLocaleHackId: string;
12
- draftHackId: string;
13
- subjects: {
14
- aiGenerated?: ExtractedSubject[],
15
- humanCurated?: ExtractedSubject[]
16
- }
17
- }
1
+ import { ExtractedSubject } from '../hack/extracted-subject';
2
+
3
+ export interface HackMetadata {
4
+ // hackId
5
+ id: string;
6
+ v: number;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+
10
+ hackId: string;
11
+ baseLocaleHackId: string;
12
+ draftHackId: string;
13
+ subjects: {
14
+ aiGenerated?: ExtractedSubject[],
15
+ humanCurated?: ExtractedSubject[]
16
+ }
17
+ }
package/src/index.ts CHANGED
@@ -1,84 +1,84 @@
1
- export * from './access-control/collection-access-control';
2
- export * from './access-control/hack-access-control';
3
-
4
- export * from './app-hack/app-full-hack';
5
- export * from './app-hack/app-hack-metadata';
6
- export * from './app-hack/app-restricted-hack';
7
-
8
- export * from './b2b-organisation/b2b-organisation';
9
- export * from './b2b-organisation/b2b-organisation-events';
10
-
11
- export * from './b2b-organisation/b2b-organisation-member';
12
- export * from './b2b-organisation/b2b-organisation-member-events';
13
-
14
- export * from './brand/brand';
15
- export * from './brand/brand-events';
16
-
17
- export * from './collection/collection';
18
- export * from './collection/collection-events';
19
- export * from './collection/enriched-collection';
20
- export * from './collection/enriched-collection-events';
21
-
22
- export * from './distribution/distribution-events';
23
- export * from './distribution/hack-distribution';
24
- export * from './distribution/collection-distribution';
25
-
26
- export * from './draft-hack/draft-hack';
27
- export * from './draft-hack/draft-hack-events';
28
-
29
- export * from './draft-hack-generation/draft-hack-generation';
30
- export * from './draft-hack-generation/draft-hack-generation-events';
31
-
32
- export * from './enriched-hack/enriched-hack';
33
- export * from './enriched-hack/enriched-hack-events';
34
-
35
- export * from './entitlement/user-entitlements';
36
- export * from './entitlement/user-entitlements-events';
37
-
38
- export * from './hack/extracted-subject';
39
- export * from './hack/hack';
40
- export * from './hack/hack-with-voice';
41
- export * from './hack/hack-events';
42
- export * from './hack/hack-with-voice-events';
43
-
44
- export * from './hack-metadata/hack-metadata';
45
- export * from './hack-metadata/hack-metadata-events';
46
-
47
- export * from './knowledge-source/knowledge-source';
48
- export * from './knowledge-source/knowledge-source-events';
49
-
50
- export * from './localisation/live-locales';
51
- export * from './localisation/locale-language';
52
- export * from './localisation/supported-languages';
53
- export * from './localisation/supported-locales';
54
-
55
- export * from './pending-hack/pending-hack';
56
- export * from './pending-hack/pending-hack-events';
57
- export * from './pending-hack/pending-hack-with-voice';
58
- export * from './pending-hack/pending-hack-with-voice-events';
59
-
60
- export * from './profile/profile';
61
- export * from './profile/translated-profile';
62
- export * from './profile/profile-events';
63
-
64
- export * from './segment/segment-with-voice';
65
- export * from './segment/segment-commands';
66
- export * from './segment/segment';
67
- export * from './segment/segment-events';
68
-
69
- export * from './skin/skin';
70
- export * from './skin/skin-events';
71
-
72
- export * from './text-to-speech/create-speech-commands';
73
- export * from './text-to-speech/speech-created-events';
74
- export * from './text-to-speech/supported-voices';
75
- export * from './text-to-speech/text-segment';
76
-
77
- export * from './theme/theme';
78
- export * from './theme/theme-events';
79
-
80
- export * from './trending/trending-hacks';
81
- export * from './trending/trending-events';
82
-
83
- export * from './user-context/user-context';
84
- export * from './user-context/user-context-events';
1
+ export * from './access-control/collection-access-control';
2
+ export * from './access-control/hack-access-control';
3
+
4
+ export * from './app-hack/app-full-hack';
5
+ export * from './app-hack/app-hack-metadata';
6
+ export * from './app-hack/app-restricted-hack';
7
+
8
+ export * from './b2b-organisation/b2b-organisation';
9
+ export * from './b2b-organisation/b2b-organisation-events';
10
+
11
+ export * from './b2b-organisation/b2b-organisation-member';
12
+ export * from './b2b-organisation/b2b-organisation-member-events';
13
+
14
+ export * from './brand/brand';
15
+ export * from './brand/brand-events';
16
+
17
+ export * from './collection/collection';
18
+ export * from './collection/collection-events';
19
+ export * from './collection/enriched-collection';
20
+ export * from './collection/enriched-collection-events';
21
+
22
+ export * from './distribution/distribution-events';
23
+ export * from './distribution/hack-distribution';
24
+ export * from './distribution/collection-distribution';
25
+
26
+ export * from './draft-hack/draft-hack';
27
+ export * from './draft-hack/draft-hack-events';
28
+
29
+ export * from './draft-hack-generation/draft-hack-generation';
30
+ export * from './draft-hack-generation/draft-hack-generation-events';
31
+
32
+ export * from './enriched-hack/enriched-hack';
33
+ export * from './enriched-hack/enriched-hack-events';
34
+
35
+ export * from './entitlement/user-entitlements';
36
+ export * from './entitlement/user-entitlements-events';
37
+
38
+ export * from './hack/extracted-subject';
39
+ export * from './hack/hack';
40
+ export * from './hack/hack-with-voice';
41
+ export * from './hack/hack-events';
42
+ export * from './hack/hack-with-voice-events';
43
+
44
+ export * from './hack-metadata/hack-metadata';
45
+ export * from './hack-metadata/hack-metadata-events';
46
+
47
+ export * from './knowledge-source/knowledge-source';
48
+ export * from './knowledge-source/knowledge-source-events';
49
+
50
+ export * from './localisation/live-locales';
51
+ export * from './localisation/locale-language';
52
+ export * from './localisation/supported-languages';
53
+ export * from './localisation/supported-locales';
54
+
55
+ export * from './pending-hack/pending-hack';
56
+ export * from './pending-hack/pending-hack-events';
57
+ export * from './pending-hack/pending-hack-with-voice';
58
+ export * from './pending-hack/pending-hack-with-voice-events';
59
+
60
+ export * from './profile/profile';
61
+ export * from './profile/translated-profile';
62
+ export * from './profile/profile-events';
63
+
64
+ export * from './segment/segment-with-voice';
65
+ export * from './segment/segment-commands';
66
+ export * from './segment/segment';
67
+ export * from './segment/segment-events';
68
+
69
+ export * from './skin/skin';
70
+ export * from './skin/skin-events';
71
+
72
+ export * from './text-to-speech/create-speech-commands';
73
+ export * from './text-to-speech/speech-created-events';
74
+ export * from './text-to-speech/supported-voices';
75
+ export * from './text-to-speech/text-segment';
76
+
77
+ export * from './theme/theme';
78
+ export * from './theme/theme-events';
79
+
80
+ export * from './trending/trending-hacks';
81
+ export * from './trending/trending-events';
82
+
83
+ export * from './user-context/user-context';
84
+ export * from './user-context/user-context-events';
@@ -1,21 +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;
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;
@@ -1,43 +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
- }
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
+ }
@@ -1,33 +1,33 @@
1
- import { DEFAULT_LOCALE, SupportedLocale } from './supported-locales';
2
-
3
- /**
4
- * All locale codes that are live and in use in the app
5
- */
6
- export function allLiveLocaleCodes(): SupportedLocale[] {
7
- return [
8
- SupportedLocale.enGB,
9
- SupportedLocale.enUS,
10
- SupportedLocale.ptBR,
11
- SupportedLocale.es,
12
- SupportedLocale.frFR,
13
- SupportedLocale.itIT,
14
- SupportedLocale.nlNL,
15
- SupportedLocale.deDE,
16
- SupportedLocale.frCA,
17
- SupportedLocale.plPL,
18
- SupportedLocale.svSE,
19
- SupportedLocale.trTR
20
- ];
21
- }
22
-
23
- export function localeCodeIsLive(localeCode: string) {
24
- return allLiveLocaleCodes().includes(localeCode as SupportedLocale);
25
- }
26
-
27
- export function liveLocaleFrom(localeCode?: string): SupportedLocale {
28
- const locale = allLiveLocaleCodes().find(liveLocale => liveLocale == localeCode);
29
- if (!locale) {
30
- return DEFAULT_LOCALE;
31
- }
32
- return locale;
1
+ import { DEFAULT_LOCALE, SupportedLocale } from './supported-locales';
2
+
3
+ /**
4
+ * All locale codes that are live and in use in the app
5
+ */
6
+ export function allLiveLocaleCodes(): SupportedLocale[] {
7
+ return [
8
+ SupportedLocale.enGB,
9
+ SupportedLocale.enUS,
10
+ SupportedLocale.ptBR,
11
+ SupportedLocale.es,
12
+ SupportedLocale.frFR,
13
+ SupportedLocale.itIT,
14
+ SupportedLocale.nlNL,
15
+ SupportedLocale.deDE,
16
+ SupportedLocale.frCA,
17
+ SupportedLocale.plPL,
18
+ SupportedLocale.svSE,
19
+ SupportedLocale.trTR
20
+ ];
21
+ }
22
+
23
+ export function localeCodeIsLive(localeCode: string) {
24
+ return allLiveLocaleCodes().includes(localeCode as SupportedLocale);
25
+ }
26
+
27
+ export function liveLocaleFrom(localeCode?: string): SupportedLocale {
28
+ const locale = allLiveLocaleCodes().find(liveLocale => liveLocale == localeCode);
29
+ if (!locale) {
30
+ return DEFAULT_LOCALE;
31
+ }
32
+ return locale;
33
33
  }