@jackhayes/util-types 0.0.35 → 0.0.37
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/be-content/collection.zod.d.ts +8 -0
- package/dist/be-content/collection.zod.js +7 -0
- package/dist/be-content/collectionItem.zod.d.ts +8 -0
- package/dist/be-content/collectionItem.zod.js +7 -0
- package/dist/be-content/creator.zod.d.ts +34 -0
- package/dist/be-content/creator.zod.js +14 -0
- package/dist/be-content/creatorProjectRelation.zod.d.ts +31 -0
- package/dist/be-content/creatorProjectRelation.zod.js +8 -0
- package/dist/be-content/project.zod.d.ts +700 -0
- package/dist/be-content/project.zod.js +22 -0
- package/dist/be-content/projectCreator.zod.d.ts +31 -0
- package/dist/be-content/projectCreator.zod.js +8 -0
- package/dist/be-content/update.zod.d.ts +10 -0
- package/dist/be-content/update.zod.js +9 -0
- package/dist/be-feed/contentUpdate.zod.d.ts +24 -0
- package/dist/be-feed/contentUpdate.zod.js +22 -0
- package/dist/be-search/mainSearch.zod.d.ts +38 -0
- package/dist/be-search/mainSearch.zod.js +11 -0
- package/dist/be-user/subscription.zod.d.ts +9 -0
- package/dist/be-user/subscription.zod.js +8 -0
- package/dist/common/countries.zod.d.ts +254 -0
- package/dist/common/countries.zod.js +503 -0
- package/dist/common/creatorTypes.zod.d.ts +57 -0
- package/dist/common/creatorTypes.zod.js +6 -0
- package/dist/common/languages.zod.d.ts +57 -0
- package/dist/common/languages.zod.js +109 -0
- package/dist/common/projectTypes.zod.d.ts +37 -0
- package/dist/common/projectTypes.zod.js +6 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +14 -0
- package/package.json +5 -2
- package/.prettierrc.json +0 -8
- package/.vscode/extensions.json +0 -3
- package/.vscode/settings.json +0 -18
- package/eslint.config.mjs +0 -2
- package/src/be-content/collection.zod.ts +0 -10
- package/src/be-content/collectionItem.zod.ts +0 -10
- package/src/be-content/creator.zod.ts +0 -18
- package/src/be-content/creatorProjectRelation.zod.ts +0 -12
- package/src/be-content/project.zod.ts +0 -31
- package/src/be-content/projectCreator.zod.ts +0 -12
- package/src/be-content/update.zod.ts +0 -12
- package/src/be-feed/contentUpdate.zod.ts +0 -28
- package/src/be-search/mainSearch.zod.ts +0 -15
- package/src/be-user/subscription.zod.ts +0 -11
- package/src/common/countries.zod.ts +0 -507
- package/src/common/creatorTypes.zod.ts +0 -16
- package/src/common/languages.zod.ts +0 -113
- package/src/common/projectTypes.zod.ts +0 -16
- package/src/index.ts +0 -18
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const languageCode = z.enum([
|
|
3
|
+
'af', // Afrikaans
|
|
4
|
+
'am', // Amharic
|
|
5
|
+
'ar', // Arabic
|
|
6
|
+
'bg', // Bulgarian
|
|
7
|
+
'bn', // Bengali
|
|
8
|
+
'ca', // Catalan
|
|
9
|
+
'cs', // Czech
|
|
10
|
+
'cy', // Welsh
|
|
11
|
+
'da', // Danish
|
|
12
|
+
'de', // German
|
|
13
|
+
'el', // Greek
|
|
14
|
+
'en', // English
|
|
15
|
+
'eo', // Esperanto
|
|
16
|
+
'es', // Spanish
|
|
17
|
+
'fa', // Persian (Farsi)
|
|
18
|
+
'fi', // Finnish
|
|
19
|
+
'fr', // French
|
|
20
|
+
'ga', // Irish
|
|
21
|
+
'he', // Hebrew
|
|
22
|
+
'hi', // Hindi
|
|
23
|
+
'hr', // Croatian
|
|
24
|
+
'hu', // Hungarian
|
|
25
|
+
'id', // Indonesian
|
|
26
|
+
'is', // Icelandic
|
|
27
|
+
'it', // Italian
|
|
28
|
+
'ja', // Japanese
|
|
29
|
+
'ko', // Korean
|
|
30
|
+
'la', // Latin
|
|
31
|
+
'lb', // Luxembourgish
|
|
32
|
+
'mk', // Macedonian
|
|
33
|
+
'mr', // Marathi
|
|
34
|
+
'ms', // Malay
|
|
35
|
+
'mt', // Maltese
|
|
36
|
+
'nl', // Dutch
|
|
37
|
+
'no', // Norwegian
|
|
38
|
+
'pl', // Polish
|
|
39
|
+
'pt', // Portuguese
|
|
40
|
+
'ro', // Romanian
|
|
41
|
+
'ru', // Russian
|
|
42
|
+
'sk', // Slovak
|
|
43
|
+
'sr', // Serbian
|
|
44
|
+
'sv', // Swedish
|
|
45
|
+
'sw', // Swahili
|
|
46
|
+
'ta', // Tamil
|
|
47
|
+
'te', // Telugu
|
|
48
|
+
'th', // Thai
|
|
49
|
+
'tl', // Filipino (Tagalog)
|
|
50
|
+
'tr', // Turkish
|
|
51
|
+
'uk', // Ukrainian
|
|
52
|
+
'ur', // Urdu
|
|
53
|
+
'vi', // Vietnamese
|
|
54
|
+
'zh', // Chinese
|
|
55
|
+
]);
|
|
56
|
+
export const languageNames = {
|
|
57
|
+
af: 'Afrikaans',
|
|
58
|
+
am: 'Amharic',
|
|
59
|
+
ar: 'Arabic',
|
|
60
|
+
bg: 'Bulgarian',
|
|
61
|
+
bn: 'Bengali',
|
|
62
|
+
ca: 'Catalan',
|
|
63
|
+
cs: 'Czech',
|
|
64
|
+
cy: 'Welsh',
|
|
65
|
+
da: 'Danish',
|
|
66
|
+
de: 'German',
|
|
67
|
+
el: 'Greek',
|
|
68
|
+
en: 'English',
|
|
69
|
+
eo: 'Esperanto',
|
|
70
|
+
es: 'Spanish',
|
|
71
|
+
fa: 'Persian (Farsi)',
|
|
72
|
+
fi: 'Finnish',
|
|
73
|
+
fr: 'French',
|
|
74
|
+
ga: 'Irish',
|
|
75
|
+
he: 'Hebrew',
|
|
76
|
+
hi: 'Hindi',
|
|
77
|
+
hr: 'Croatian',
|
|
78
|
+
hu: 'Hungarian',
|
|
79
|
+
id: 'Indonesian',
|
|
80
|
+
is: 'Icelandic',
|
|
81
|
+
it: 'Italian',
|
|
82
|
+
ja: 'Japanese',
|
|
83
|
+
ko: 'Korean',
|
|
84
|
+
la: 'Latin',
|
|
85
|
+
lb: 'Luxembourgish',
|
|
86
|
+
mk: 'Macedonian',
|
|
87
|
+
mr: 'Marathi',
|
|
88
|
+
ms: 'Malay',
|
|
89
|
+
mt: 'Maltese',
|
|
90
|
+
nl: 'Dutch',
|
|
91
|
+
no: 'Norwegian',
|
|
92
|
+
pl: 'Polish',
|
|
93
|
+
pt: 'Portuguese',
|
|
94
|
+
ro: 'Romanian',
|
|
95
|
+
ru: 'Russian',
|
|
96
|
+
sk: 'Slovak',
|
|
97
|
+
sr: 'Serbian',
|
|
98
|
+
sv: 'Swedish',
|
|
99
|
+
sw: 'Swahili',
|
|
100
|
+
ta: 'Tamil',
|
|
101
|
+
te: 'Telugu',
|
|
102
|
+
th: 'Thai',
|
|
103
|
+
tl: 'Filipino (Tagalog)',
|
|
104
|
+
tr: 'Turkish',
|
|
105
|
+
uk: 'Ukrainian',
|
|
106
|
+
ur: 'Urdu',
|
|
107
|
+
vi: 'Vietnamese',
|
|
108
|
+
zh: 'Chinese',
|
|
109
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const projectType: z.ZodEnum<{
|
|
3
|
+
film: "film";
|
|
4
|
+
video_game: "video_game";
|
|
5
|
+
music: "music";
|
|
6
|
+
tv: "tv";
|
|
7
|
+
}>;
|
|
8
|
+
export type ProjectType = z.infer<typeof projectType>;
|
|
9
|
+
export declare const filmSubtype: z.ZodEnum<{
|
|
10
|
+
"film-short": "film-short";
|
|
11
|
+
"film-feature": "film-feature";
|
|
12
|
+
"film-documentary": "film-documentary";
|
|
13
|
+
"film-animated": "film-animated";
|
|
14
|
+
}>;
|
|
15
|
+
export type FilmSubtype = z.infer<typeof filmSubtype>;
|
|
16
|
+
export declare const videoGameSubtype: z.ZodEnum<{
|
|
17
|
+
video_game: "video_game";
|
|
18
|
+
}>;
|
|
19
|
+
export type VideoGameSubtype = z.infer<typeof videoGameSubtype>;
|
|
20
|
+
export declare const musicSubtype: z.ZodEnum<{
|
|
21
|
+
"music-album": "music-album";
|
|
22
|
+
"music-single": "music-single";
|
|
23
|
+
"music-ep": "music-ep";
|
|
24
|
+
"music-mixtape": "music-mixtape";
|
|
25
|
+
}>;
|
|
26
|
+
export type MusicSubtype = z.infer<typeof musicSubtype>;
|
|
27
|
+
export declare const tvSubtype: z.ZodEnum<{
|
|
28
|
+
"tv-series": "tv-series";
|
|
29
|
+
"tv-miniseries": "tv-miniseries";
|
|
30
|
+
"tv-movie": "tv-movie";
|
|
31
|
+
"tv-documentary": "tv-documentary";
|
|
32
|
+
"tv-animated": "tv-animated";
|
|
33
|
+
"tv-reality": "tv-reality";
|
|
34
|
+
"tv-talk-show": "tv-talk-show";
|
|
35
|
+
"tv-anime": "tv-anime";
|
|
36
|
+
}>;
|
|
37
|
+
export type TvSubtype = z.infer<typeof tvSubtype>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const projectType = z.enum(['film', 'video_game', 'music', 'tv']);
|
|
3
|
+
export const filmSubtype = z.enum(['film-short', 'film-feature', 'film-documentary', 'film-animated']);
|
|
4
|
+
export const videoGameSubtype = z.enum(['video_game']);
|
|
5
|
+
export const musicSubtype = z.enum(['music-album', 'music-single', 'music-ep', 'music-mixtape']);
|
|
6
|
+
export const tvSubtype = z.enum(['tv-series', 'tv-miniseries', 'tv-movie', 'tv-documentary', 'tv-animated', 'tv-reality', 'tv-talk-show', 'tv-anime']);
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './be-content/collection.zod.js';
|
|
2
|
+
export * from './be-content/collectionItem.zod.js';
|
|
3
|
+
export * from './be-content/creator.zod.js';
|
|
4
|
+
export * from './be-content/creatorProjectRelation.zod.js';
|
|
5
|
+
export * from './be-content/project.zod.js';
|
|
6
|
+
export * from './be-content/projectCreator.zod.js';
|
|
7
|
+
export * from './be-content/update.zod.js';
|
|
8
|
+
export * from './be-feed/contentUpdate.zod.js';
|
|
9
|
+
export * from './be-search/mainSearch.zod.js';
|
|
10
|
+
export * from './be-user/subscription.zod.js';
|
|
11
|
+
export * from './common/countries.zod.js';
|
|
12
|
+
export * from './common/languages.zod.js';
|
|
13
|
+
export * from './common/creatorTypes.zod.js';
|
|
14
|
+
export * from './common/projectTypes.zod.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './be-content/collection.zod.js';
|
|
2
|
+
export * from './be-content/collectionItem.zod.js';
|
|
3
|
+
export * from './be-content/creator.zod.js';
|
|
4
|
+
export * from './be-content/creatorProjectRelation.zod.js';
|
|
5
|
+
export * from './be-content/project.zod.js';
|
|
6
|
+
export * from './be-content/projectCreator.zod.js';
|
|
7
|
+
export * from './be-content/update.zod.js';
|
|
8
|
+
export * from './be-feed/contentUpdate.zod.js';
|
|
9
|
+
export * from './be-search/mainSearch.zod.js';
|
|
10
|
+
export * from './be-user/subscription.zod.js';
|
|
11
|
+
export * from './common/countries.zod.js';
|
|
12
|
+
export * from './common/languages.zod.js';
|
|
13
|
+
export * from './common/creatorTypes.zod.js';
|
|
14
|
+
export * from './common/projectTypes.zod.js';
|
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jackhayes/util-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"build": "npx tsc --build",
|
|
10
|
-
"build:publish": "
|
|
10
|
+
"build:publish": "npx tsc --build && npm version patch && npm publish --access=public"
|
|
11
11
|
},
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"description": "",
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
15
18
|
"type": "module",
|
|
16
19
|
"dependencies": {
|
|
17
20
|
"@jh-tech/util-tools-be": "0.0.10",
|
package/.prettierrc.json
DELETED
package/.vscode/extensions.json
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"[yaml]": {
|
|
3
|
-
"editor.formatOnSave": true,
|
|
4
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
5
|
-
},
|
|
6
|
-
"[json]": {
|
|
7
|
-
"editor.formatOnSave": true,
|
|
8
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
9
|
-
},
|
|
10
|
-
"prettier.enable": true,
|
|
11
|
-
"editor.formatOnSave": false,
|
|
12
|
-
"editor.codeActionsOnSave": {
|
|
13
|
-
"source.fixAll.eslint": "explicit",
|
|
14
|
-
"source.addMissingImports": "explicit"
|
|
15
|
-
},
|
|
16
|
-
"eslint.validate": ["javascript", "typescript"],
|
|
17
|
-
"typescript.tsdk": "node_modules/typescript/lib",
|
|
18
|
-
}
|
package/eslint.config.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const collectionItem = z.object({
|
|
4
|
-
collectionId: z.uuid(),
|
|
5
|
-
projectId: z.uuid().optional(),
|
|
6
|
-
subCollectionId: z.uuid().optional(),
|
|
7
|
-
createdAt: z.string(),
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
export type CollectionItem = z.infer<typeof collectionItem>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
import { creatorRole } from '../common/creatorTypes.zod.js'
|
|
4
|
-
|
|
5
|
-
export const creator = z.object({
|
|
6
|
-
id: z.uuid(),
|
|
7
|
-
name: z.string(),
|
|
8
|
-
/**
|
|
9
|
-
* What type of content the creator is mostly known for.
|
|
10
|
-
*/
|
|
11
|
-
primaryRole: creatorRole,
|
|
12
|
-
description: z.string().optional(),
|
|
13
|
-
originCountry: z.string().length(2).optional(),
|
|
14
|
-
createdAt: z.string(),
|
|
15
|
-
updatedAt: z.string(),
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
export type Creator = z.infer<typeof creator>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
import { creatorRole } from '../common/creatorTypes.zod.js'
|
|
4
|
-
|
|
5
|
-
export const creatorProjectRelation = z.object({
|
|
6
|
-
creatorId: z.uuid(),
|
|
7
|
-
projectId: z.uuid(),
|
|
8
|
-
primary: z.boolean(),
|
|
9
|
-
role: creatorRole,
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export type CreatorProjectRelation = z.infer<typeof creatorProjectRelation>
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
import { countryCode } from '../common/countries.zod.js'
|
|
4
|
-
import { languageCode } from '../common/languages.zod.js'
|
|
5
|
-
import { projectType } from '../common/projectTypes.zod.js'
|
|
6
|
-
|
|
7
|
-
import { creatorProjectRelation } from './creatorProjectRelation.zod.js'
|
|
8
|
-
import { projectCreator } from './projectCreator.zod.js'
|
|
9
|
-
|
|
10
|
-
export const project = z.object({
|
|
11
|
-
id: z.uuid(),
|
|
12
|
-
title: z.string(),
|
|
13
|
-
type: projectType,
|
|
14
|
-
description: z.string().optional(),
|
|
15
|
-
releaseDate: z.string().optional(),
|
|
16
|
-
createdAt: z.string(),
|
|
17
|
-
updatedAt: z.string(),
|
|
18
|
-
originalLanguage: languageCode.optional(),
|
|
19
|
-
originCountry: countryCode.optional(),
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
23
|
-
const projectCreatorRelation = creatorProjectRelation.omit({ projectId: true })
|
|
24
|
-
|
|
25
|
-
export const projectWithCreators = project.extend({
|
|
26
|
-
creators: z.array(projectCreator).optional(),
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
export type ProjectCreatorRelation = z.infer<typeof projectCreatorRelation>
|
|
30
|
-
export type Project = z.infer<typeof project>
|
|
31
|
-
export type ProjectWithCreators = z.infer<typeof projectWithCreators>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
import { creatorRole } from '../common/creatorTypes.zod.js'
|
|
4
|
-
|
|
5
|
-
export const projectCreator = z.object({
|
|
6
|
-
id: z.uuid(),
|
|
7
|
-
name: z.string(),
|
|
8
|
-
role: creatorRole,
|
|
9
|
-
primary: z.boolean(),
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export type ProjectCreator = z.infer<typeof projectCreator>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const update = z.object({
|
|
4
|
-
id: z.uuid(),
|
|
5
|
-
title: z.string(),
|
|
6
|
-
links: z.array(z.string()),
|
|
7
|
-
projectId: z.uuid(),
|
|
8
|
-
publishedAt: z.string(),
|
|
9
|
-
createdAt: z.string(),
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export type Update = z.infer<typeof update>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
import { projectType } from '../common/projectTypes.zod.js'
|
|
4
|
-
|
|
5
|
-
export const contentUpdateTypes = z.union([projectType, z.literal('collection')])
|
|
6
|
-
|
|
7
|
-
export const contentUpdate = z.object({
|
|
8
|
-
creatorId: z.uuid().optional(),
|
|
9
|
-
projectId: z.uuid().optional(),
|
|
10
|
-
collectionId: z.uuid().optional(),
|
|
11
|
-
/**
|
|
12
|
-
* When set this represents an update made to a project.
|
|
13
|
-
*/
|
|
14
|
-
updateContentId: z.uuid().optional(),
|
|
15
|
-
/**
|
|
16
|
-
* When set this represents a project was created or added to a collection.
|
|
17
|
-
*/
|
|
18
|
-
projectContentId: z.uuid().optional(),
|
|
19
|
-
/**
|
|
20
|
-
* When set this represents a sub collection was added to a collection
|
|
21
|
-
*/
|
|
22
|
-
collectionContentId: z.uuid().optional(),
|
|
23
|
-
type: contentUpdateTypes,
|
|
24
|
-
createdAt: z.string(),
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export type ContentUpdate = z.infer<typeof contentUpdate>
|
|
28
|
-
export type ContentUpdateTypes = z.infer<typeof contentUpdateTypes>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
import { creatorRole } from '../common/creatorTypes.zod.js'
|
|
4
|
-
import { projectType } from '../common/projectTypes.zod.js'
|
|
5
|
-
|
|
6
|
-
export const mainSearchDoc = z.object({
|
|
7
|
-
creatorId: z.uuid().optional(),
|
|
8
|
-
projectId: z.uuid().optional(),
|
|
9
|
-
collectionId: z.uuid().optional(),
|
|
10
|
-
name: z.string(),
|
|
11
|
-
projectType: projectType.optional(),
|
|
12
|
-
creatorRole: creatorRole.optional(),
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
export type MainSearchDoc = z.infer<typeof mainSearchDoc>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
export const subscription = z.object({
|
|
4
|
-
userId: z.uuid(),
|
|
5
|
-
creatorId: z.uuid().optional(),
|
|
6
|
-
projectId: z.uuid().optional(),
|
|
7
|
-
collectionId: z.uuid().optional(),
|
|
8
|
-
createdAt: z.string(),
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
export type Subscription = z.infer<typeof subscription>
|