@jh-tech/be-content-shared 0.0.57 → 0.0.59

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.
@@ -0,0 +1,6 @@
1
+ import { type z } from 'zod';
2
+ export declare const creatorGenreRelationCreationData: z.ZodObject<{
3
+ genreId: z.ZodUUID;
4
+ primary: z.ZodBoolean;
5
+ }, z.core.$strip>;
6
+ export type CreatorGenreRelationCreationData = z.infer<typeof creatorGenreRelationCreationData>;
@@ -0,0 +1,6 @@
1
+ import { creatorGenreRelation } from '@jackhayes/util-types';
2
+ import {} from 'zod';
3
+ export const creatorGenreRelationCreationData = creatorGenreRelation.omit({
4
+ creatorId: true,
5
+ createdAt: true,
6
+ });
@@ -2,5 +2,17 @@ import { type z } from 'zod';
2
2
  export declare const genreCreationData: z.ZodObject<{
3
3
  name: z.ZodString;
4
4
  slug: z.ZodString;
5
+ projectType: z.ZodEnum<{
6
+ film: "film";
7
+ video_game: "video_game";
8
+ music: "music";
9
+ tv: "tv";
10
+ comic: "comic";
11
+ book: "book";
12
+ }>;
13
+ kind: z.ZodEnum<{
14
+ genre: "genre";
15
+ format: "format";
16
+ }>;
5
17
  }, z.core.$strip>;
6
18
  export type GenreCreationData = z.infer<typeof genreCreationData>;
@@ -3,6 +3,18 @@ export declare const projectGenre: z.ZodObject<{
3
3
  id: z.ZodUUID;
4
4
  slug: z.ZodString;
5
5
  name: z.ZodString;
6
+ projectType: z.ZodEnum<{
7
+ film: "film";
8
+ video_game: "video_game";
9
+ music: "music";
10
+ tv: "tv";
11
+ comic: "comic";
12
+ book: "book";
13
+ }>;
14
+ kind: z.ZodEnum<{
15
+ genre: "genre";
16
+ format: "format";
17
+ }>;
6
18
  createdAt: z.ZodString;
7
19
  isPrimary: z.ZodBoolean;
8
20
  }, z.core.$strip>;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,9 @@ export * as UpdateCreatorDef from './route-definitions/creator/creator.update.js
13
13
  export * as BulkCreateCreatorsDef from './route-definitions/creator/creators.bulkCreate.js';
14
14
  export * as ListCreatorsDef from './route-definitions/creator/creators.list.js';
15
15
  export * as ListCreatorProjectsDef from './route-definitions/creator/creatorProjects.list.js';
16
+ export * as ListCreatorGenresDef from './route-definitions/creator/creatorGenres.list.js';
17
+ export * as CreateCreatorGenreDef from './route-definitions/creator/creatorGenre.create.js';
18
+ export * as DeleteCreatorGenreDef from './route-definitions/creator/creatorGenre.delete.js';
16
19
  export * as BulkCreateCreatorProjectRelation from './route-definitions/project/creatorProjectRelation.bulkCreate.js';
17
20
  export * as CreateProjectDef from './route-definitions/project/project.create.js';
18
21
  export * as GetProjectDef from './route-definitions/project/project.get.js';
@@ -41,3 +44,4 @@ export * from './definitions/creatorProjectRelation.zod.js';
41
44
  export * from './definitions/genre.zod.js';
42
45
  export * from './definitions/projectGenre.zod.js';
43
46
  export * from './definitions/projectGenreRelation.zod.js';
47
+ export * from './definitions/creatorGenreRelation.zod.js';
package/dist/index.js CHANGED
@@ -13,6 +13,9 @@ export * as UpdateCreatorDef from './route-definitions/creator/creator.update.js
13
13
  export * as BulkCreateCreatorsDef from './route-definitions/creator/creators.bulkCreate.js';
14
14
  export * as ListCreatorsDef from './route-definitions/creator/creators.list.js';
15
15
  export * as ListCreatorProjectsDef from './route-definitions/creator/creatorProjects.list.js';
16
+ export * as ListCreatorGenresDef from './route-definitions/creator/creatorGenres.list.js';
17
+ export * as CreateCreatorGenreDef from './route-definitions/creator/creatorGenre.create.js';
18
+ export * as DeleteCreatorGenreDef from './route-definitions/creator/creatorGenre.delete.js';
16
19
  export * as BulkCreateCreatorProjectRelation from './route-definitions/project/creatorProjectRelation.bulkCreate.js';
17
20
  export * as CreateProjectDef from './route-definitions/project/project.create.js';
18
21
  export * as GetProjectDef from './route-definitions/project/project.get.js';
@@ -41,3 +44,4 @@ export * from './definitions/creatorProjectRelation.zod.js';
41
44
  export * from './definitions/genre.zod.js';
42
45
  export * from './definitions/projectGenre.zod.js';
43
46
  export * from './definitions/projectGenreRelation.zod.js';
47
+ export * from './definitions/creatorGenreRelation.zod.js';
@@ -0,0 +1,28 @@
1
+ import type { RouteDef, RouteSchema } from '@jh-tech/util-tools-be';
2
+ import { z } from 'zod';
3
+ declare const request: z.ZodObject<{
4
+ params: z.ZodObject<{
5
+ creatorId: z.ZodUUID;
6
+ }, z.core.$strip>;
7
+ body: z.ZodObject<{
8
+ data: z.ZodObject<{
9
+ genreId: z.ZodUUID;
10
+ primary: z.ZodBoolean;
11
+ }, z.core.$strip>;
12
+ }, z.core.$strip>;
13
+ }, z.core.$strip>;
14
+ declare const response: z.ZodObject<{
15
+ data: z.ZodObject<{
16
+ creatorId: z.ZodUUID;
17
+ genreId: z.ZodUUID;
18
+ primary: z.ZodBoolean;
19
+ createdAt: z.ZodString;
20
+ }, z.core.$strip>;
21
+ }, z.core.$strip>;
22
+ export declare const routeSchema: RouteSchema;
23
+ export type Request = z.infer<typeof request>;
24
+ export type Response = z.infer<typeof response>;
25
+ export declare const method = "post";
26
+ export declare const path = "/creator/:creatorId/genre";
27
+ export declare const definition: RouteDef;
28
+ export {};
@@ -0,0 +1,18 @@
1
+ import { creatorGenreRelation } from '@jackhayes/util-types';
2
+ import { z } from 'zod';
3
+ import { creatorGenreRelationCreationData } from '../../definitions/creatorGenreRelation.zod.js';
4
+ const request = z.object({
5
+ params: z.object({
6
+ creatorId: z.uuid(),
7
+ }),
8
+ body: z.object({
9
+ data: creatorGenreRelationCreationData,
10
+ }),
11
+ });
12
+ const response = z.object({
13
+ data: creatorGenreRelation,
14
+ });
15
+ export const routeSchema = { request, response };
16
+ export const method = 'post';
17
+ export const path = '/creator/:creatorId/genre';
18
+ export const definition = { method, path, routeSchema };
@@ -0,0 +1,16 @@
1
+ import type { RouteDef, RouteSchema } from '@jh-tech/util-tools-be';
2
+ import { z } from 'zod';
3
+ declare const request: z.ZodObject<{
4
+ params: z.ZodObject<{
5
+ creatorId: z.ZodUUID;
6
+ genreId: z.ZodUUID;
7
+ }, z.core.$strip>;
8
+ }, z.core.$strip>;
9
+ declare const response: z.ZodObject<{}, z.core.$strip>;
10
+ export declare const routeSchema: RouteSchema;
11
+ export type Request = z.infer<typeof request>;
12
+ export type Response = z.infer<typeof response>;
13
+ export declare const method = "delete";
14
+ export declare const path = "/creator/:creatorId/genre/:genreId";
15
+ export declare const definition: RouteDef;
16
+ export {};
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ const request = z.object({
3
+ params: z.object({
4
+ creatorId: z.uuid(),
5
+ genreId: z.uuid(),
6
+ }),
7
+ });
8
+ const response = z.object({});
9
+ export const routeSchema = { request, response };
10
+ export const method = 'delete';
11
+ export const path = '/creator/:creatorId/genre/:genreId';
12
+ export const definition = { method, path, routeSchema };
@@ -0,0 +1,35 @@
1
+ import type { RouteDef, RouteSchema } from '@jh-tech/util-tools-be';
2
+ import { z } from 'zod';
3
+ declare const request: z.ZodObject<{
4
+ params: z.ZodObject<{
5
+ creatorId: z.ZodUUID;
6
+ }, z.core.$strip>;
7
+ }, z.core.$strip>;
8
+ declare const response: z.ZodObject<{
9
+ data: z.ZodArray<z.ZodObject<{
10
+ id: z.ZodUUID;
11
+ slug: z.ZodString;
12
+ name: z.ZodString;
13
+ projectType: z.ZodEnum<{
14
+ film: "film";
15
+ video_game: "video_game";
16
+ music: "music";
17
+ tv: "tv";
18
+ comic: "comic";
19
+ book: "book";
20
+ }>;
21
+ kind: z.ZodEnum<{
22
+ genre: "genre";
23
+ format: "format";
24
+ }>;
25
+ createdAt: z.ZodString;
26
+ isPrimary: z.ZodBoolean;
27
+ }, z.core.$strip>>;
28
+ }, z.core.$strip>;
29
+ export declare const routeSchema: RouteSchema;
30
+ export type Request = z.infer<typeof request>;
31
+ export type Response = z.infer<typeof response>;
32
+ export declare const method = "get";
33
+ export declare const path = "/creator/:creatorId/genre";
34
+ export declare const definition: RouteDef;
35
+ export {};
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { projectGenre } from '../../definitions/projectGenre.zod.js';
3
+ const request = z.object({
4
+ params: z.object({
5
+ creatorId: z.uuid(),
6
+ }),
7
+ });
8
+ const response = z.object({
9
+ data: z.array(projectGenre),
10
+ });
11
+ export const routeSchema = { request, response };
12
+ export const method = 'get';
13
+ export const path = '/creator/:creatorId/genre';
14
+ export const definition = { method, path, routeSchema };
@@ -35,6 +35,7 @@ declare const filters: z.ZodObject<{
35
35
  "book-author": "book-author";
36
36
  "book-publisher": "book-publisher";
37
37
  }>]>>>;
38
+ name: z.ZodOptional<z.ZodString>;
38
39
  showHidden: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
39
40
  }, z.core.$strip>;
40
41
  declare const query: z.ZodObject<{
@@ -77,6 +78,7 @@ declare const query: z.ZodObject<{
77
78
  "book-author": "book-author";
78
79
  "book-publisher": "book-publisher";
79
80
  }>]>>>;
81
+ name: z.ZodOptional<z.ZodString>;
80
82
  showHidden: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
81
83
  }, z.core.$strip>>;
82
84
  sorting: z.ZodOptional<z.ZodObject<{
@@ -131,6 +133,7 @@ declare const request: z.ZodObject<{
131
133
  "book-author": "book-author";
132
134
  "book-publisher": "book-publisher";
133
135
  }>]>>>;
136
+ name: z.ZodOptional<z.ZodString>;
134
137
  showHidden: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
135
138
  }, z.core.$strip>>;
136
139
  sorting: z.ZodOptional<z.ZodObject<{
@@ -6,6 +6,7 @@ const filters = z.object({
6
6
  projectIds: z.array(z.string()).optional(),
7
7
  names: z.array(z.string()).optional(),
8
8
  primaryRoles: z.array(creatorRole).optional(),
9
+ name: z.string().optional(),
9
10
  showHidden: z.coerce.boolean().optional(),
10
11
  });
11
12
  const sorting = z.object({
@@ -5,6 +5,18 @@ declare const request: z.ZodObject<{
5
5
  data: z.ZodObject<{
6
6
  name: z.ZodString;
7
7
  slug: z.ZodString;
8
+ projectType: z.ZodEnum<{
9
+ film: "film";
10
+ video_game: "video_game";
11
+ music: "music";
12
+ tv: "tv";
13
+ comic: "comic";
14
+ book: "book";
15
+ }>;
16
+ kind: z.ZodEnum<{
17
+ genre: "genre";
18
+ format: "format";
19
+ }>;
8
20
  }, z.core.$strip>;
9
21
  }, z.core.$strip>;
10
22
  }, z.core.$strip>;
@@ -13,6 +25,18 @@ declare const response: z.ZodObject<{
13
25
  id: z.ZodUUID;
14
26
  slug: z.ZodString;
15
27
  name: z.ZodString;
28
+ projectType: z.ZodEnum<{
29
+ film: "film";
30
+ video_game: "video_game";
31
+ music: "music";
32
+ tv: "tv";
33
+ comic: "comic";
34
+ book: "book";
35
+ }>;
36
+ kind: z.ZodEnum<{
37
+ genre: "genre";
38
+ format: "format";
39
+ }>;
16
40
  createdAt: z.ZodString;
17
41
  }, z.core.$strip>;
18
42
  }, z.core.$strip>;
@@ -10,6 +10,18 @@ declare const response: z.ZodObject<{
10
10
  id: z.ZodUUID;
11
11
  slug: z.ZodString;
12
12
  name: z.ZodString;
13
+ projectType: z.ZodEnum<{
14
+ film: "film";
15
+ video_game: "video_game";
16
+ music: "music";
17
+ tv: "tv";
18
+ comic: "comic";
19
+ book: "book";
20
+ }>;
21
+ kind: z.ZodEnum<{
22
+ genre: "genre";
23
+ format: "format";
24
+ }>;
13
25
  createdAt: z.ZodString;
14
26
  }, z.core.$strip>;
15
27
  }, z.core.$strip>;
@@ -2,11 +2,23 @@ import type { RouteDef, RouteSchema } from '@jh-tech/util-tools-be';
2
2
  import { z } from 'zod';
3
3
  declare const request: z.ZodObject<{
4
4
  params: z.ZodObject<{
5
+ projectType: z.ZodEnum<{
6
+ film: "film";
7
+ video_game: "video_game";
8
+ music: "music";
9
+ tv: "tv";
10
+ comic: "comic";
11
+ book: "book";
12
+ }>;
5
13
  slug: z.ZodString;
6
14
  }, z.core.$strip>;
7
15
  body: z.ZodObject<{
8
16
  data: z.ZodObject<{
9
17
  name: z.ZodString;
18
+ kind: z.ZodEnum<{
19
+ genre: "genre";
20
+ format: "format";
21
+ }>;
10
22
  }, z.core.$strip>;
11
23
  }, z.core.$strip>;
12
24
  }, z.core.$strip>;
@@ -15,6 +27,18 @@ declare const response: z.ZodObject<{
15
27
  id: z.ZodUUID;
16
28
  slug: z.ZodString;
17
29
  name: z.ZodString;
30
+ projectType: z.ZodEnum<{
31
+ film: "film";
32
+ video_game: "video_game";
33
+ music: "music";
34
+ tv: "tv";
35
+ comic: "comic";
36
+ book: "book";
37
+ }>;
38
+ kind: z.ZodEnum<{
39
+ genre: "genre";
40
+ format: "format";
41
+ }>;
18
42
  createdAt: z.ZodString;
19
43
  }, z.core.$strip>;
20
44
  }, z.core.$strip>;
@@ -22,6 +46,6 @@ export declare const routeSchema: RouteSchema;
22
46
  export type Request = z.infer<typeof request>;
23
47
  export type Response = z.infer<typeof response>;
24
48
  export declare const method = "put";
25
- export declare const path = "/genre/:slug";
49
+ export declare const path = "/genre/:projectType/:slug";
26
50
  export declare const definition: RouteDef;
27
51
  export {};
@@ -1,12 +1,14 @@
1
- import { genre } from '@jackhayes/util-types';
1
+ import { genre, genreKind, projectType } from '@jackhayes/util-types';
2
2
  import { z } from 'zod';
3
3
  const request = z.object({
4
4
  params: z.object({
5
+ projectType: projectType,
5
6
  slug: z.string().min(1),
6
7
  }),
7
8
  body: z.object({
8
9
  data: z.object({
9
10
  name: z.string().min(1),
11
+ kind: genreKind,
10
12
  }),
11
13
  }),
12
14
  });
@@ -15,5 +17,5 @@ const response = z.object({
15
17
  });
16
18
  export const routeSchema = { request, response };
17
19
  export const method = 'put';
18
- export const path = '/genre/:slug';
20
+ export const path = '/genre/:projectType/:slug';
19
21
  export const definition = { method, path, routeSchema };
@@ -1,13 +1,34 @@
1
1
  import type { RouteDef, RouteSchema } from '@jh-tech/util-tools-be';
2
2
  import { z } from 'zod';
3
3
  declare const request: z.ZodObject<{
4
- query: z.ZodObject<{}, z.core.$strip>;
4
+ query: z.ZodObject<{
5
+ projectType: z.ZodOptional<z.ZodEnum<{
6
+ film: "film";
7
+ video_game: "video_game";
8
+ music: "music";
9
+ tv: "tv";
10
+ comic: "comic";
11
+ book: "book";
12
+ }>>;
13
+ }, z.core.$strip>;
5
14
  }, z.core.$strip>;
6
15
  declare const response: z.ZodObject<{
7
16
  data: z.ZodArray<z.ZodObject<{
8
17
  id: z.ZodUUID;
9
18
  slug: z.ZodString;
10
19
  name: z.ZodString;
20
+ projectType: z.ZodEnum<{
21
+ film: "film";
22
+ video_game: "video_game";
23
+ music: "music";
24
+ tv: "tv";
25
+ comic: "comic";
26
+ book: "book";
27
+ }>;
28
+ kind: z.ZodEnum<{
29
+ genre: "genre";
30
+ format: "format";
31
+ }>;
11
32
  createdAt: z.ZodString;
12
33
  }, z.core.$strip>>;
13
34
  }, z.core.$strip>;
@@ -1,7 +1,9 @@
1
- import { genre } from '@jackhayes/util-types';
1
+ import { genre, projectType } from '@jackhayes/util-types';
2
2
  import { z } from 'zod';
3
3
  const request = z.object({
4
- query: z.object({}),
4
+ query: z.object({
5
+ projectType: projectType.optional(),
6
+ }),
5
7
  });
6
8
  const response = z.object({
7
9
  data: z.array(genre),
@@ -10,6 +10,18 @@ declare const response: z.ZodObject<{
10
10
  id: z.ZodUUID;
11
11
  slug: z.ZodString;
12
12
  name: z.ZodString;
13
+ projectType: z.ZodEnum<{
14
+ film: "film";
15
+ video_game: "video_game";
16
+ music: "music";
17
+ tv: "tv";
18
+ comic: "comic";
19
+ book: "book";
20
+ }>;
21
+ kind: z.ZodEnum<{
22
+ genre: "genre";
23
+ format: "format";
24
+ }>;
13
25
  createdAt: z.ZodString;
14
26
  isPrimary: z.ZodBoolean;
15
27
  }, z.core.$strip>>;