@jackhayes/util-types 0.0.36 → 0.0.38

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.
@@ -25,6 +25,13 @@ export declare const creator: z.ZodObject<{
25
25
  "tv-actor": "tv-actor";
26
26
  "tv-studio": "tv-studio";
27
27
  "tv-network": "tv-network";
28
+ }>, z.ZodEnum<{
29
+ "comic-artist": "comic-artist";
30
+ "comic-writer": "comic-writer";
31
+ "comic-publisher": "comic-publisher";
32
+ }>, z.ZodEnum<{
33
+ "book-author": "book-author";
34
+ "book-publisher": "book-publisher";
28
35
  }>]>;
29
36
  description: z.ZodOptional<z.ZodString>;
30
37
  originCountry: z.ZodOptional<z.ZodString>;
@@ -26,6 +26,13 @@ export declare const creatorProjectRelation: z.ZodObject<{
26
26
  "tv-actor": "tv-actor";
27
27
  "tv-studio": "tv-studio";
28
28
  "tv-network": "tv-network";
29
+ }>, z.ZodEnum<{
30
+ "comic-artist": "comic-artist";
31
+ "comic-writer": "comic-writer";
32
+ "comic-publisher": "comic-publisher";
33
+ }>, z.ZodEnum<{
34
+ "book-author": "book-author";
35
+ "book-publisher": "book-publisher";
29
36
  }>]>;
30
37
  }, z.core.$strip>;
31
38
  export type CreatorProjectRelation = z.infer<typeof creatorProjectRelation>;
@@ -7,6 +7,8 @@ export declare const project: z.ZodObject<{
7
7
  video_game: "video_game";
8
8
  music: "music";
9
9
  tv: "tv";
10
+ comic: "comic";
11
+ book: "book";
10
12
  }>;
11
13
  description: z.ZodOptional<z.ZodString>;
12
14
  releaseDate: z.ZodOptional<z.ZodString>;
@@ -342,6 +344,13 @@ declare const projectCreatorRelation: z.ZodObject<{
342
344
  "tv-actor": "tv-actor";
343
345
  "tv-studio": "tv-studio";
344
346
  "tv-network": "tv-network";
347
+ }>, z.ZodEnum<{
348
+ "comic-artist": "comic-artist";
349
+ "comic-writer": "comic-writer";
350
+ "comic-publisher": "comic-publisher";
351
+ }>, z.ZodEnum<{
352
+ "book-author": "book-author";
353
+ "book-publisher": "book-publisher";
345
354
  }>]>;
346
355
  creatorId: z.ZodUUID;
347
356
  primary: z.ZodBoolean;
@@ -354,6 +363,8 @@ export declare const projectWithCreators: z.ZodObject<{
354
363
  video_game: "video_game";
355
364
  music: "music";
356
365
  tv: "tv";
366
+ comic: "comic";
367
+ book: "book";
357
368
  }>;
358
369
  description: z.ZodOptional<z.ZodString>;
359
370
  releaseDate: z.ZodOptional<z.ZodString>;
@@ -690,6 +701,13 @@ export declare const projectWithCreators: z.ZodObject<{
690
701
  "tv-actor": "tv-actor";
691
702
  "tv-studio": "tv-studio";
692
703
  "tv-network": "tv-network";
704
+ }>, z.ZodEnum<{
705
+ "comic-artist": "comic-artist";
706
+ "comic-writer": "comic-writer";
707
+ "comic-publisher": "comic-publisher";
708
+ }>, z.ZodEnum<{
709
+ "book-author": "book-author";
710
+ "book-publisher": "book-publisher";
693
711
  }>]>;
694
712
  primary: z.ZodBoolean;
695
713
  }, z.core.$strip>>>;
@@ -25,6 +25,13 @@ export declare const projectCreator: z.ZodObject<{
25
25
  "tv-actor": "tv-actor";
26
26
  "tv-studio": "tv-studio";
27
27
  "tv-network": "tv-network";
28
+ }>, z.ZodEnum<{
29
+ "comic-artist": "comic-artist";
30
+ "comic-writer": "comic-writer";
31
+ "comic-publisher": "comic-publisher";
32
+ }>, z.ZodEnum<{
33
+ "book-author": "book-author";
34
+ "book-publisher": "book-publisher";
28
35
  }>]>;
29
36
  primary: z.ZodBoolean;
30
37
  }, z.core.$strip>;
@@ -4,6 +4,8 @@ export declare const contentUpdateTypes: z.ZodUnion<readonly [z.ZodEnum<{
4
4
  video_game: "video_game";
5
5
  music: "music";
6
6
  tv: "tv";
7
+ comic: "comic";
8
+ book: "book";
7
9
  }>, z.ZodLiteral<"collection">]>;
8
10
  export declare const contentUpdate: z.ZodObject<{
9
11
  creatorId: z.ZodOptional<z.ZodUUID>;
@@ -17,6 +19,8 @@ export declare const contentUpdate: z.ZodObject<{
17
19
  video_game: "video_game";
18
20
  music: "music";
19
21
  tv: "tv";
22
+ comic: "comic";
23
+ book: "book";
20
24
  }>, z.ZodLiteral<"collection">]>;
21
25
  createdAt: z.ZodString;
22
26
  }, z.core.$strip>;
@@ -9,6 +9,8 @@ export declare const mainSearchDoc: z.ZodObject<{
9
9
  video_game: "video_game";
10
10
  music: "music";
11
11
  tv: "tv";
12
+ comic: "comic";
13
+ book: "book";
12
14
  }>>;
13
15
  creatorRole: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
14
16
  "film-director": "film-director";
@@ -33,6 +35,13 @@ export declare const mainSearchDoc: z.ZodObject<{
33
35
  "tv-actor": "tv-actor";
34
36
  "tv-studio": "tv-studio";
35
37
  "tv-network": "tv-network";
38
+ }>, z.ZodEnum<{
39
+ "comic-artist": "comic-artist";
40
+ "comic-writer": "comic-writer";
41
+ "comic-publisher": "comic-publisher";
42
+ }>, z.ZodEnum<{
43
+ "book-author": "book-author";
44
+ "book-publisher": "book-publisher";
36
45
  }>]>>;
37
46
  }, z.core.$strip>;
38
47
  export type MainSearchDoc = z.infer<typeof mainSearchDoc>;
@@ -30,6 +30,17 @@ export declare const tvCreator: z.ZodEnum<{
30
30
  "tv-network": "tv-network";
31
31
  }>;
32
32
  export type TvCreator = z.infer<typeof tvCreator>;
33
+ export declare const comicCreator: z.ZodEnum<{
34
+ "comic-artist": "comic-artist";
35
+ "comic-writer": "comic-writer";
36
+ "comic-publisher": "comic-publisher";
37
+ }>;
38
+ export type ComicCreator = z.infer<typeof comicCreator>;
39
+ export declare const bookCreator: z.ZodEnum<{
40
+ "book-author": "book-author";
41
+ "book-publisher": "book-publisher";
42
+ }>;
43
+ export type BookCreator = z.infer<typeof bookCreator>;
33
44
  export declare const creatorRole: z.ZodUnion<readonly [z.ZodEnum<{
34
45
  "film-director": "film-director";
35
46
  "film-producer": "film-producer";
@@ -53,5 +64,12 @@ export declare const creatorRole: z.ZodUnion<readonly [z.ZodEnum<{
53
64
  "tv-actor": "tv-actor";
54
65
  "tv-studio": "tv-studio";
55
66
  "tv-network": "tv-network";
67
+ }>, z.ZodEnum<{
68
+ "comic-artist": "comic-artist";
69
+ "comic-writer": "comic-writer";
70
+ "comic-publisher": "comic-publisher";
71
+ }>, z.ZodEnum<{
72
+ "book-author": "book-author";
73
+ "book-publisher": "book-publisher";
56
74
  }>]>;
57
75
  export type CreatorRole = z.infer<typeof creatorRole>;
@@ -3,4 +3,6 @@ export const filmCreator = z.enum(['film-director', 'film-producer', 'film-write
3
3
  export const videoGameCreator = z.enum(['video_game-studio', 'video_game-publisher', 'video_game-developer']);
4
4
  export const musicCreator = z.enum(['music-artist', 'music-producer', 'music-label', 'music-band']);
5
5
  export const tvCreator = z.enum(['tv-director', 'tv-producer', 'tv-writer', 'tv-actor', 'tv-studio', 'tv-network']);
6
- export const creatorRole = z.union([filmCreator, videoGameCreator, musicCreator, tvCreator]);
6
+ export const comicCreator = z.enum(['comic-artist', 'comic-writer', 'comic-publisher']);
7
+ export const bookCreator = z.enum(['book-author', 'book-publisher']);
8
+ export const creatorRole = z.union([filmCreator, videoGameCreator, musicCreator, tvCreator, comicCreator, bookCreator]);
@@ -4,6 +4,8 @@ export declare const projectType: z.ZodEnum<{
4
4
  video_game: "video_game";
5
5
  music: "music";
6
6
  tv: "tv";
7
+ comic: "comic";
8
+ book: "book";
7
9
  }>;
8
10
  export type ProjectType = z.infer<typeof projectType>;
9
11
  export declare const filmSubtype: z.ZodEnum<{
@@ -14,7 +16,7 @@ export declare const filmSubtype: z.ZodEnum<{
14
16
  }>;
15
17
  export type FilmSubtype = z.infer<typeof filmSubtype>;
16
18
  export declare const videoGameSubtype: z.ZodEnum<{
17
- video_game: "video_game";
19
+ "video-game": "video-game";
18
20
  }>;
19
21
  export type VideoGameSubtype = z.infer<typeof videoGameSubtype>;
20
22
  export declare const musicSubtype: z.ZodEnum<{
@@ -35,3 +37,16 @@ export declare const tvSubtype: z.ZodEnum<{
35
37
  "tv-anime": "tv-anime";
36
38
  }>;
37
39
  export type TvSubtype = z.infer<typeof tvSubtype>;
40
+ export declare const comicSubtype: z.ZodEnum<{
41
+ "graphic-novel": "graphic-novel";
42
+ "comic-book": "comic-book";
43
+ manga: "manga";
44
+ manhwa: "manhwa";
45
+ manhua: "manhua";
46
+ }>;
47
+ export type ComicSubtype = z.infer<typeof comicSubtype>;
48
+ export declare const bookSubtype: z.ZodEnum<{
49
+ novel: "novel";
50
+ "non-fiction": "non-fiction";
51
+ }>;
52
+ export type BookSubtype = z.infer<typeof bookSubtype>;
@@ -1,6 +1,8 @@
1
1
  import { z } from 'zod';
2
- export const projectType = z.enum(['film', 'video_game', 'music', 'tv']);
2
+ export const projectType = z.enum(['film', 'video_game', 'music', 'tv', 'comic', 'book']);
3
3
  export const filmSubtype = z.enum(['film-short', 'film-feature', 'film-documentary', 'film-animated']);
4
- export const videoGameSubtype = z.enum(['video_game']);
4
+ export const videoGameSubtype = z.enum(['video-game']);
5
5
  export const musicSubtype = z.enum(['music-album', 'music-single', 'music-ep', 'music-mixtape']);
6
6
  export const tvSubtype = z.enum(['tv-series', 'tv-miniseries', 'tv-movie', 'tv-documentary', 'tv-animated', 'tv-reality', 'tv-talk-show', 'tv-anime']);
7
+ export const comicSubtype = z.enum(['graphic-novel', 'comic-book', 'manga', 'manhwa', 'manhua']);
8
+ export const bookSubtype = z.enum(['novel', 'non-fiction']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jackhayes/util-types",
3
- "version": "0.0.36",
3
+ "version": "0.0.38",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "sideEffects": false,
@@ -12,6 +12,9 @@
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
@@ -1,8 +0,0 @@
1
- {
2
- "semi": false,
3
- "trailingComma": "all",
4
- "singleQuote": true,
5
- "endOfLine": "auto",
6
- "useTabs": true,
7
- "printWidth": 150
8
- }
@@ -1,3 +0,0 @@
1
- {
2
- "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3
- }
@@ -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,2 +0,0 @@
1
- import eslintConfig from '@jh-tech/util-tools-be/eslint.config.mjs';
2
- export default eslintConfig;
@@ -1,10 +0,0 @@
1
- import { z } from 'zod'
2
-
3
- export const collection = z.object({
4
- id: z.uuid(),
5
- name: z.string(),
6
- createdAt: z.string(),
7
- updatedAt: z.string(),
8
- })
9
-
10
- export type Collection = z.infer<typeof collection>
@@ -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>