@echovisionlab/geul-common 0.4.0 → 0.6.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/README.md +23 -0
- package/package.json +4 -2
- package/src/collaboration/artist.ts +12 -14
- package/src/collaboration/campaign.ts +6 -8
- package/src/collaboration/document-layout.ts +6 -8
- package/src/collaboration/document.ts +7 -9
- package/src/collaboration/form.ts +5 -7
- package/src/collaboration/label.ts +9 -11
- package/src/collaboration/map-theme.ts +62 -67
- package/src/collaboration/member-id.ts +2 -2
- package/src/collaboration/metadata-ai.ts +21 -18
- package/src/collaboration/page.ts +2 -2
- package/src/collaboration/post.ts +8 -10
- package/src/collaboration/protocol.ts +609 -0
- package/src/collaboration/release.ts +85 -101
- package/src/collaboration/runtime-events.ts +301 -467
- package/src/collaboration/work.ts +33 -31
- package/src/page/types.ts +4 -6
- package/src/post/types.ts +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
2
|
import { memberIdSchema } from "./member-id.ts";
|
|
3
3
|
|
|
4
4
|
export const releaseTypeSchema = z.enum([
|
|
@@ -9,21 +9,21 @@ export const releaseTypeSchema = z.enum([
|
|
|
9
9
|
]);
|
|
10
10
|
export const creditTargetTypeSchema = z.enum(["artist", "member", "text"]);
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
id: z.
|
|
12
|
+
const creditItemShape = {
|
|
13
|
+
id: z.uuid(),
|
|
14
14
|
credit_type: creditTargetTypeSchema,
|
|
15
|
-
artist_id: z.
|
|
16
|
-
artist_name: z.
|
|
17
|
-
artist_slug: z.
|
|
18
|
-
member_id:
|
|
19
|
-
member_name: z.
|
|
20
|
-
credited_name: z.
|
|
21
|
-
credit_role: z.
|
|
15
|
+
artist_id: z.nullable(z.uuid()),
|
|
16
|
+
artist_name: z.nullable(z.string()),
|
|
17
|
+
artist_slug: z.nullable(z.string()),
|
|
18
|
+
member_id: z.nullable(memberIdSchema),
|
|
19
|
+
member_name: z.nullable(z.string()),
|
|
20
|
+
credited_name: z.nullable(z.string()),
|
|
21
|
+
credit_role: z.nullable(z.string()),
|
|
22
22
|
sort_order: z.number(),
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
|
|
25
25
|
function requireMemberCreditId(
|
|
26
|
-
credit: z.infer<typeof
|
|
26
|
+
credit: z.infer<z.ZodMiniObject<typeof creditItemShape>>,
|
|
27
27
|
): boolean {
|
|
28
28
|
return credit.credit_type !== "member" || credit.member_id !== null;
|
|
29
29
|
}
|
|
@@ -33,95 +33,79 @@ const memberCreditRefinement = {
|
|
|
33
33
|
path: ["member_id"] as PropertyKey[],
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export const releaseCreditItemSchema =
|
|
37
|
-
.
|
|
38
|
-
.refine(requireMemberCreditId, memberCreditRefinement);
|
|
39
|
-
|
|
40
|
-
export const releaseArtistItemSchema = z
|
|
41
|
-
.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export const
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
export const
|
|
93
|
-
.
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
.
|
|
108
|
-
|
|
109
|
-
type: releaseTypeSchema.optional(),
|
|
110
|
-
releaseDate: z.string().nullable().optional(),
|
|
111
|
-
spotifyUrl: z.string().optional(),
|
|
112
|
-
appleMusicUrl: z.string().optional(),
|
|
113
|
-
bandcampUrl: z.string().optional(),
|
|
114
|
-
youtubeMusicUrl: z.string().optional(),
|
|
115
|
-
artists: z.array(releaseArtistItemSchema).optional(),
|
|
116
|
-
credits: z.array(releaseCreditItemSchema).optional(),
|
|
117
|
-
labels: z.array(releaseLabelItemSchema).optional(),
|
|
118
|
-
categories: z.array(releaseCategoryItemSchema).optional(),
|
|
119
|
-
genres: z.array(releaseGenreItemSchema).optional(),
|
|
120
|
-
styles: z.array(releaseStyleItemSchema).optional(),
|
|
121
|
-
formats: z.array(releaseFormatItemSchema).optional(),
|
|
122
|
-
tracks: z.array(releaseTrackItemSchema).optional(),
|
|
123
|
-
})
|
|
124
|
-
.strict();
|
|
36
|
+
export const releaseCreditItemSchema = z
|
|
37
|
+
.strictObject(creditItemShape)
|
|
38
|
+
.check(z.refine(requireMemberCreditId, memberCreditRefinement));
|
|
39
|
+
|
|
40
|
+
export const releaseArtistItemSchema = z.strictObject({
|
|
41
|
+
artist_id: z.uuid(),
|
|
42
|
+
artist_name: z.string(),
|
|
43
|
+
artist_slug: z.nullable(z.string()),
|
|
44
|
+
sort_order: z.number(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export const releaseLabelItemSchema = z.strictObject({
|
|
48
|
+
label_id: z.uuid(),
|
|
49
|
+
label_name: z.string(),
|
|
50
|
+
label_slug: z.nullable(z.string()),
|
|
51
|
+
catalog_number: z.nullable(z.string()),
|
|
52
|
+
sort_order: z.number(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const releaseGenreItemSchema = z.strictObject({
|
|
56
|
+
id: z.uuid(),
|
|
57
|
+
name: z.string(),
|
|
58
|
+
slug: z.string(),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const releaseCategoryItemSchema = z.strictObject({
|
|
62
|
+
id: z.uuid(),
|
|
63
|
+
name: z.string(),
|
|
64
|
+
slug: z.string(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export const releaseStyleItemSchema = z.strictObject({
|
|
68
|
+
id: z.uuid(),
|
|
69
|
+
name: z.string(),
|
|
70
|
+
slug: z.string(),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export const releaseFormatItemSchema = z.strictObject({
|
|
74
|
+
id: z.uuid(),
|
|
75
|
+
name: z.string(),
|
|
76
|
+
slug: z.string(),
|
|
77
|
+
format_description: z.nullable(z.string()),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export const trackCreditItemSchema = z
|
|
81
|
+
.strictObject(creditItemShape)
|
|
82
|
+
.check(z.refine(requireMemberCreditId, memberCreditRefinement));
|
|
83
|
+
|
|
84
|
+
export const releaseTrackItemSchema = z.strictObject({
|
|
85
|
+
id: z.uuid(),
|
|
86
|
+
track_number: z.number(),
|
|
87
|
+
title: z.string(),
|
|
88
|
+
audio_original_file_id: z.optional(z.nullable(z.uuid())),
|
|
89
|
+
credits: z.array(trackCreditItemSchema),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
export const releaseCollabFieldsSchema = z.strictObject({
|
|
93
|
+
title: z.optional(z.string()),
|
|
94
|
+
type: z.optional(releaseTypeSchema),
|
|
95
|
+
releaseDate: z.optional(z.nullable(z.string())),
|
|
96
|
+
spotifyUrl: z.optional(z.string()),
|
|
97
|
+
appleMusicUrl: z.optional(z.string()),
|
|
98
|
+
bandcampUrl: z.optional(z.string()),
|
|
99
|
+
youtubeMusicUrl: z.optional(z.string()),
|
|
100
|
+
artists: z.optional(z.array(releaseArtistItemSchema)),
|
|
101
|
+
credits: z.optional(z.array(releaseCreditItemSchema)),
|
|
102
|
+
labels: z.optional(z.array(releaseLabelItemSchema)),
|
|
103
|
+
categories: z.optional(z.array(releaseCategoryItemSchema)),
|
|
104
|
+
genres: z.optional(z.array(releaseGenreItemSchema)),
|
|
105
|
+
styles: z.optional(z.array(releaseStyleItemSchema)),
|
|
106
|
+
formats: z.optional(z.array(releaseFormatItemSchema)),
|
|
107
|
+
tracks: z.optional(z.array(releaseTrackItemSchema)),
|
|
108
|
+
});
|
|
125
109
|
|
|
126
110
|
export const RELEASE_JSON_KEYS: ReadonlySet<
|
|
127
111
|
keyof z.infer<typeof releaseCollabFieldsSchema>
|