@ourofoundation/ouro-js 1.1.1 → 1.1.3
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/index.d.ts +18 -19
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2 -81
- package/dist/index.js.map +1 -1
- package/dist/schema/assets.d.ts +111 -100
- package/dist/schema/assets.esm.js +2 -0
- package/dist/schema/assets.esm.js.map +1 -0
- package/dist/schema/assets.js +2 -95
- package/dist/schema/assets.js.map +1 -1
- package/dist/schema/blueprints.d.ts +105 -95
- package/dist/schema/blueprints.esm.js +2 -0
- package/dist/schema/blueprints.esm.js.map +1 -0
- package/dist/schema/blueprints.js +2 -38
- package/dist/schema/blueprints.js.map +1 -1
- package/dist/schema/comments.d.ts +91 -81
- package/dist/schema/comments.esm.js +2 -0
- package/dist/schema/comments.esm.js.map +1 -0
- package/dist/schema/comments.js +2 -32
- package/dist/schema/comments.js.map +1 -1
- package/dist/schema/common.d.ts +32 -32
- package/dist/schema/common.esm.js +2 -0
- package/dist/schema/common.esm.js.map +1 -0
- package/dist/schema/common.js +2 -87
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/conversations.d.ts +149 -139
- package/dist/schema/conversations.esm.js +2 -0
- package/dist/schema/conversations.esm.js.map +1 -0
- package/dist/schema/conversations.js +2 -54
- package/dist/schema/conversations.js.map +1 -1
- package/dist/schema/datasets.d.ts +218 -202
- package/dist/schema/datasets.esm.js +2 -0
- package/dist/schema/datasets.esm.js.map +1 -0
- package/dist/schema/datasets.js +2 -49
- package/dist/schema/datasets.js.map +1 -1
- package/dist/schema/files.d.ts +201 -185
- package/dist/schema/files.esm.js +2 -0
- package/dist/schema/files.esm.js.map +1 -0
- package/dist/schema/files.js +2 -50
- package/dist/schema/files.js.map +1 -1
- package/dist/schema/index.d.ts +14 -80
- package/dist/schema/notifications.d.ts +22 -22
- package/dist/schema/notifications.esm.js +2 -0
- package/dist/schema/notifications.esm.js.map +1 -0
- package/dist/schema/notifications.js +2 -46
- package/dist/schema/notifications.js.map +1 -1
- package/dist/schema/organizations.d.ts +11 -11
- package/dist/schema/organizations.esm.js +2 -0
- package/dist/schema/organizations.esm.js.map +1 -0
- package/dist/schema/organizations.js +2 -33
- package/dist/schema/organizations.js.map +1 -1
- package/dist/schema/posts.d.ts +326 -298
- package/dist/schema/posts.esm.js +2 -0
- package/dist/schema/posts.esm.js.map +1 -0
- package/dist/schema/posts.js +2 -81
- package/dist/schema/posts.js.map +1 -1
- package/dist/schema/replications.d.ts +125 -115
- package/dist/schema/replications.esm.js +2 -0
- package/dist/schema/replications.esm.js.map +1 -0
- package/dist/schema/replications.js +2 -42
- package/dist/schema/replications.js.map +1 -1
- package/dist/schema/services.d.ts +14 -14
- package/dist/schema/services.esm.js +2 -0
- package/dist/schema/services.esm.js.map +1 -0
- package/dist/schema/services.js +2 -39
- package/dist/schema/services.js.map +1 -1
- package/dist/schema/teams.d.ts +99 -85
- package/dist/schema/teams.esm.js +2 -0
- package/dist/schema/teams.esm.js.map +1 -0
- package/dist/schema/teams.js +2 -57
- package/dist/schema/teams.js.map +1 -1
- package/dist/schema/users.d.ts +13 -4
- package/dist/schema/users.esm.js +2 -0
- package/dist/schema/users.esm.js.map +1 -0
- package/dist/schema/users.js +2 -35
- package/dist/schema/users.js.map +1 -1
- package/dist/types/index.d.ts +14 -0
- package/dist/utils/air/index.d.ts +1 -1
- package/dist/utils/air/index.esm.js +2 -0
- package/dist/utils/air/index.esm.js.map +1 -0
- package/dist/utils/air/index.js +2 -51
- package/dist/utils/air/index.js.map +1 -1
- package/dist/utils/air/markdown-parser.esm.js +2 -0
- package/dist/utils/air/markdown-parser.esm.js.map +1 -0
- package/dist/utils/air/markdown-parser.js +2 -118
- package/dist/utils/air/markdown-parser.js.map +1 -1
- package/dist/utils/dataset.esm.js +2 -0
- package/dist/utils/dataset.esm.js.map +1 -0
- package/dist/utils/dataset.js +2 -19
- package/dist/utils/dataset.js.map +1 -1
- package/dist/utils/navigate.esm.js +2 -0
- package/dist/utils/navigate.esm.js.map +1 -0
- package/dist/utils/navigate.js +2 -56
- package/dist/utils/navigate.js.map +1 -1
- package/package.json +21 -4
- package/rollup.config.js +52 -0
package/dist/schema/assets.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
15
15
|
}, {
|
|
16
16
|
value: string;
|
|
17
17
|
}>, "many">>>;
|
|
18
|
+
post_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
18
19
|
last_active: z.ZodOptional<z.ZodString>;
|
|
19
20
|
}, "strip", z.ZodTypeAny, {
|
|
20
21
|
id?: string | undefined;
|
|
@@ -25,6 +26,7 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
25
26
|
}[] | undefined;
|
|
26
27
|
username?: string | null | undefined;
|
|
27
28
|
bio?: string | null | undefined;
|
|
29
|
+
post_id?: string | null | undefined;
|
|
28
30
|
last_active?: string | undefined;
|
|
29
31
|
}, {
|
|
30
32
|
id?: string | undefined;
|
|
@@ -35,6 +37,7 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
35
37
|
}[] | undefined;
|
|
36
38
|
username?: string | null | undefined;
|
|
37
39
|
bio?: string | null | undefined;
|
|
40
|
+
post_id?: string | null | undefined;
|
|
38
41
|
last_active?: string | undefined;
|
|
39
42
|
}>>;
|
|
40
43
|
org_id: z.ZodString;
|
|
@@ -57,27 +60,27 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
57
60
|
}, "strip", z.ZodTypeAny, {
|
|
58
61
|
id?: string | undefined;
|
|
59
62
|
name?: string | undefined;
|
|
60
|
-
size?: string | undefined;
|
|
61
|
-
email?: string | null | undefined;
|
|
62
63
|
avatar_path?: string | null | undefined;
|
|
63
64
|
mission?: string | null | undefined;
|
|
65
|
+
size?: string | undefined;
|
|
66
|
+
email?: string | null | undefined;
|
|
64
67
|
domain?: string | null | undefined;
|
|
65
68
|
urls?: {
|
|
66
69
|
value: string;
|
|
67
70
|
}[] | null | undefined;
|
|
68
|
-
base_role?: "
|
|
71
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
69
72
|
}, {
|
|
70
73
|
id?: string | undefined;
|
|
71
74
|
name?: string | undefined;
|
|
72
|
-
size?: string | undefined;
|
|
73
|
-
email?: string | null | undefined;
|
|
74
75
|
avatar_path?: string | null | undefined;
|
|
75
76
|
mission?: string | null | undefined;
|
|
77
|
+
size?: string | undefined;
|
|
78
|
+
email?: string | null | undefined;
|
|
76
79
|
domain?: string | null | undefined;
|
|
77
80
|
urls?: {
|
|
78
81
|
value: string;
|
|
79
82
|
}[] | null | undefined;
|
|
80
|
-
base_role?: "
|
|
83
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
81
84
|
}>>;
|
|
82
85
|
team_id: z.ZodString;
|
|
83
86
|
team: z.ZodOptional<z.ZodObject<{
|
|
@@ -90,20 +93,20 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
90
93
|
created_at: z.ZodOptional<z.ZodString>;
|
|
91
94
|
}, "strip", z.ZodTypeAny, {
|
|
92
95
|
id?: string | undefined;
|
|
93
|
-
name?: string | undefined;
|
|
94
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
95
|
-
description?: string | null | undefined;
|
|
96
96
|
org_id?: string | undefined;
|
|
97
97
|
created_at?: string | undefined;
|
|
98
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
99
|
-
}, {
|
|
100
|
-
id?: string | undefined;
|
|
101
98
|
name?: string | undefined;
|
|
102
|
-
visibility?: "
|
|
99
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
103
100
|
description?: string | null | undefined;
|
|
101
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
102
|
+
}, {
|
|
103
|
+
id?: string | undefined;
|
|
104
104
|
org_id?: string | undefined;
|
|
105
105
|
created_at?: string | undefined;
|
|
106
|
-
|
|
106
|
+
name?: string | undefined;
|
|
107
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
108
|
+
description?: string | null | undefined;
|
|
109
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
107
110
|
}>>;
|
|
108
111
|
parent_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
109
112
|
parent: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
@@ -127,19 +130,15 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
127
130
|
last_updated: z.ZodString;
|
|
128
131
|
}, "strip", z.ZodTypeAny, {
|
|
129
132
|
id: string;
|
|
130
|
-
name: string;
|
|
131
|
-
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
132
133
|
user_id: string;
|
|
133
134
|
org_id: string;
|
|
134
|
-
asset_type: "
|
|
135
|
+
asset_type: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
135
136
|
created_at: string;
|
|
136
137
|
last_updated: string;
|
|
138
|
+
name: string;
|
|
137
139
|
team_id: string;
|
|
140
|
+
visibility: "organization" | "public" | "private" | "monetized" | "inherit";
|
|
138
141
|
monetization: "none" | "pay-to-unlock" | "pay-per-use";
|
|
139
|
-
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
140
|
-
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
141
|
-
description?: string | null | undefined;
|
|
142
|
-
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
143
142
|
user?: {
|
|
144
143
|
id?: string | undefined;
|
|
145
144
|
user_id?: string | undefined;
|
|
@@ -149,31 +148,35 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
149
148
|
}[] | undefined;
|
|
150
149
|
username?: string | null | undefined;
|
|
151
150
|
bio?: string | null | undefined;
|
|
151
|
+
post_id?: string | null | undefined;
|
|
152
152
|
last_active?: string | undefined;
|
|
153
153
|
} | undefined;
|
|
154
154
|
organization?: {
|
|
155
155
|
id?: string | undefined;
|
|
156
156
|
name?: string | undefined;
|
|
157
|
-
size?: string | undefined;
|
|
158
|
-
email?: string | null | undefined;
|
|
159
157
|
avatar_path?: string | null | undefined;
|
|
160
158
|
mission?: string | null | undefined;
|
|
159
|
+
size?: string | undefined;
|
|
160
|
+
email?: string | null | undefined;
|
|
161
161
|
domain?: string | null | undefined;
|
|
162
162
|
urls?: {
|
|
163
163
|
value: string;
|
|
164
164
|
}[] | null | undefined;
|
|
165
|
-
base_role?: "
|
|
165
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
166
166
|
} | undefined;
|
|
167
167
|
team?: {
|
|
168
168
|
id?: string | undefined;
|
|
169
|
-
name?: string | undefined;
|
|
170
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
171
|
-
description?: string | null | undefined;
|
|
172
169
|
org_id?: string | undefined;
|
|
173
170
|
created_at?: string | undefined;
|
|
174
|
-
|
|
171
|
+
name?: string | undefined;
|
|
172
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
173
|
+
description?: string | null | undefined;
|
|
174
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
175
175
|
} | undefined;
|
|
176
|
+
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
177
|
+
description?: string | null | undefined;
|
|
176
178
|
parent_id?: string | null | undefined;
|
|
179
|
+
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
177
180
|
name_url_slug?: string | null | undefined;
|
|
178
181
|
slug?: string | null | undefined;
|
|
179
182
|
price?: number | null | undefined;
|
|
@@ -183,21 +186,18 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
183
186
|
product_id?: string | null | undefined;
|
|
184
187
|
price_id?: string | null | undefined;
|
|
185
188
|
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
189
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
186
190
|
}, {
|
|
187
191
|
id: string;
|
|
188
|
-
name: string;
|
|
189
|
-
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
190
192
|
user_id: string;
|
|
191
193
|
org_id: string;
|
|
192
|
-
asset_type: "
|
|
194
|
+
asset_type: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
193
195
|
created_at: string;
|
|
194
196
|
last_updated: string;
|
|
197
|
+
name: string;
|
|
195
198
|
team_id: string;
|
|
199
|
+
visibility: "organization" | "public" | "private" | "monetized" | "inherit";
|
|
196
200
|
monetization: "none" | "pay-to-unlock" | "pay-per-use";
|
|
197
|
-
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
198
|
-
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
199
|
-
description?: string | null | undefined;
|
|
200
|
-
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
201
201
|
user?: {
|
|
202
202
|
id?: string | undefined;
|
|
203
203
|
user_id?: string | undefined;
|
|
@@ -207,31 +207,35 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
207
207
|
}[] | undefined;
|
|
208
208
|
username?: string | null | undefined;
|
|
209
209
|
bio?: string | null | undefined;
|
|
210
|
+
post_id?: string | null | undefined;
|
|
210
211
|
last_active?: string | undefined;
|
|
211
212
|
} | undefined;
|
|
212
213
|
organization?: {
|
|
213
214
|
id?: string | undefined;
|
|
214
215
|
name?: string | undefined;
|
|
215
|
-
size?: string | undefined;
|
|
216
|
-
email?: string | null | undefined;
|
|
217
216
|
avatar_path?: string | null | undefined;
|
|
218
217
|
mission?: string | null | undefined;
|
|
218
|
+
size?: string | undefined;
|
|
219
|
+
email?: string | null | undefined;
|
|
219
220
|
domain?: string | null | undefined;
|
|
220
221
|
urls?: {
|
|
221
222
|
value: string;
|
|
222
223
|
}[] | null | undefined;
|
|
223
|
-
base_role?: "
|
|
224
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
224
225
|
} | undefined;
|
|
225
226
|
team?: {
|
|
226
227
|
id?: string | undefined;
|
|
227
|
-
name?: string | undefined;
|
|
228
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
229
|
-
description?: string | null | undefined;
|
|
230
228
|
org_id?: string | undefined;
|
|
231
229
|
created_at?: string | undefined;
|
|
232
|
-
|
|
230
|
+
name?: string | undefined;
|
|
231
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
232
|
+
description?: string | null | undefined;
|
|
233
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
233
234
|
} | undefined;
|
|
235
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
236
|
+
description?: string | null | undefined;
|
|
234
237
|
parent_id?: string | null | undefined;
|
|
238
|
+
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
235
239
|
name_url_slug?: string | null | undefined;
|
|
236
240
|
slug?: string | null | undefined;
|
|
237
241
|
price?: number | null | undefined;
|
|
@@ -241,6 +245,7 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
241
245
|
product_id?: string | null | undefined;
|
|
242
246
|
price_id?: string | null | undefined;
|
|
243
247
|
preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
248
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
244
249
|
}>;
|
|
245
250
|
declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
246
251
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -258,6 +263,7 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
258
263
|
}, {
|
|
259
264
|
value: string;
|
|
260
265
|
}>, "many">>>;
|
|
266
|
+
post_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
261
267
|
last_active: z.ZodOptional<z.ZodString>;
|
|
262
268
|
}, "strip", z.ZodTypeAny, {
|
|
263
269
|
id?: string | undefined;
|
|
@@ -268,6 +274,7 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
268
274
|
}[] | undefined;
|
|
269
275
|
username?: string | null | undefined;
|
|
270
276
|
bio?: string | null | undefined;
|
|
277
|
+
post_id?: string | null | undefined;
|
|
271
278
|
last_active?: string | undefined;
|
|
272
279
|
}, {
|
|
273
280
|
id?: string | undefined;
|
|
@@ -278,6 +285,7 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
278
285
|
}[] | undefined;
|
|
279
286
|
username?: string | null | undefined;
|
|
280
287
|
bio?: string | null | undefined;
|
|
288
|
+
post_id?: string | null | undefined;
|
|
281
289
|
last_active?: string | undefined;
|
|
282
290
|
}>>>;
|
|
283
291
|
org_id: z.ZodOptional<z.ZodString>;
|
|
@@ -300,27 +308,27 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
300
308
|
}, "strip", z.ZodTypeAny, {
|
|
301
309
|
id?: string | undefined;
|
|
302
310
|
name?: string | undefined;
|
|
303
|
-
size?: string | undefined;
|
|
304
|
-
email?: string | null | undefined;
|
|
305
311
|
avatar_path?: string | null | undefined;
|
|
306
312
|
mission?: string | null | undefined;
|
|
313
|
+
size?: string | undefined;
|
|
314
|
+
email?: string | null | undefined;
|
|
307
315
|
domain?: string | null | undefined;
|
|
308
316
|
urls?: {
|
|
309
317
|
value: string;
|
|
310
318
|
}[] | null | undefined;
|
|
311
|
-
base_role?: "
|
|
319
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
312
320
|
}, {
|
|
313
321
|
id?: string | undefined;
|
|
314
322
|
name?: string | undefined;
|
|
315
|
-
size?: string | undefined;
|
|
316
|
-
email?: string | null | undefined;
|
|
317
323
|
avatar_path?: string | null | undefined;
|
|
318
324
|
mission?: string | null | undefined;
|
|
325
|
+
size?: string | undefined;
|
|
326
|
+
email?: string | null | undefined;
|
|
319
327
|
domain?: string | null | undefined;
|
|
320
328
|
urls?: {
|
|
321
329
|
value: string;
|
|
322
330
|
}[] | null | undefined;
|
|
323
|
-
base_role?: "
|
|
331
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
324
332
|
}>>>;
|
|
325
333
|
team_id: z.ZodOptional<z.ZodString>;
|
|
326
334
|
team: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
@@ -333,20 +341,20 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
333
341
|
created_at: z.ZodOptional<z.ZodString>;
|
|
334
342
|
}, "strip", z.ZodTypeAny, {
|
|
335
343
|
id?: string | undefined;
|
|
336
|
-
name?: string | undefined;
|
|
337
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
338
|
-
description?: string | null | undefined;
|
|
339
344
|
org_id?: string | undefined;
|
|
340
345
|
created_at?: string | undefined;
|
|
341
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
342
|
-
}, {
|
|
343
|
-
id?: string | undefined;
|
|
344
346
|
name?: string | undefined;
|
|
345
|
-
visibility?: "
|
|
347
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
346
348
|
description?: string | null | undefined;
|
|
349
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
350
|
+
}, {
|
|
351
|
+
id?: string | undefined;
|
|
347
352
|
org_id?: string | undefined;
|
|
348
353
|
created_at?: string | undefined;
|
|
349
|
-
|
|
354
|
+
name?: string | undefined;
|
|
355
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
356
|
+
description?: string | null | undefined;
|
|
357
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
350
358
|
}>>>;
|
|
351
359
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
352
360
|
parent: z.ZodOptional<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
|
|
@@ -380,18 +388,18 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
380
388
|
last_updated: z.ZodDefault<z.ZodString>;
|
|
381
389
|
}>, "strip", z.ZodTypeAny, {
|
|
382
390
|
id: string;
|
|
383
|
-
state: "error" | "in-progress" | "success" | "queued";
|
|
384
|
-
name: string;
|
|
385
|
-
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
386
391
|
org_id: string | null;
|
|
387
392
|
created_at: string;
|
|
388
393
|
last_updated: string;
|
|
394
|
+
name: string;
|
|
389
395
|
team_id: string | null;
|
|
396
|
+
visibility: "organization" | "public" | "private" | "monetized" | "inherit";
|
|
397
|
+
state: "queued" | "in-progress" | "success" | "error";
|
|
398
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
390
399
|
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
391
400
|
description?: string | null | undefined;
|
|
392
|
-
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
393
|
-
asset_type?: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
394
401
|
parent_id?: string | null | undefined;
|
|
402
|
+
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
395
403
|
name_url_slug?: string | null | undefined;
|
|
396
404
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
397
405
|
price?: number | null | undefined;
|
|
@@ -404,17 +412,16 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
404
412
|
}, {
|
|
405
413
|
name: string;
|
|
406
414
|
id?: string | undefined;
|
|
407
|
-
state?: "error" | "in-progress" | "success" | "queued" | undefined;
|
|
408
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
409
|
-
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
410
|
-
description?: string | null | undefined;
|
|
411
|
-
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
412
415
|
org_id?: string | null | undefined;
|
|
413
|
-
asset_type?: "
|
|
416
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
417
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
414
418
|
created_at?: string | undefined;
|
|
415
419
|
last_updated?: string | undefined;
|
|
416
420
|
team_id?: string | null | undefined;
|
|
421
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
422
|
+
description?: string | null | undefined;
|
|
417
423
|
parent_id?: string | null | undefined;
|
|
424
|
+
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
418
425
|
name_url_slug?: string | null | undefined;
|
|
419
426
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
420
427
|
price?: number | null | undefined;
|
|
@@ -424,6 +431,7 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
424
431
|
product_id?: string | null | undefined;
|
|
425
432
|
price_id?: string | null | undefined;
|
|
426
433
|
preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
434
|
+
state?: "queued" | "in-progress" | "success" | "error" | undefined;
|
|
427
435
|
}>;
|
|
428
436
|
declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
429
437
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -441,6 +449,7 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
441
449
|
}, {
|
|
442
450
|
value: string;
|
|
443
451
|
}>, "many">>>;
|
|
452
|
+
post_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
444
453
|
last_active: z.ZodOptional<z.ZodString>;
|
|
445
454
|
}, "strip", z.ZodTypeAny, {
|
|
446
455
|
id?: string | undefined;
|
|
@@ -451,6 +460,7 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
451
460
|
}[] | undefined;
|
|
452
461
|
username?: string | null | undefined;
|
|
453
462
|
bio?: string | null | undefined;
|
|
463
|
+
post_id?: string | null | undefined;
|
|
454
464
|
last_active?: string | undefined;
|
|
455
465
|
}, {
|
|
456
466
|
id?: string | undefined;
|
|
@@ -461,6 +471,7 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
461
471
|
}[] | undefined;
|
|
462
472
|
username?: string | null | undefined;
|
|
463
473
|
bio?: string | null | undefined;
|
|
474
|
+
post_id?: string | null | undefined;
|
|
464
475
|
last_active?: string | undefined;
|
|
465
476
|
}>>>;
|
|
466
477
|
org_id: z.ZodOptional<z.ZodString>;
|
|
@@ -483,27 +494,27 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
483
494
|
}, "strip", z.ZodTypeAny, {
|
|
484
495
|
id?: string | undefined;
|
|
485
496
|
name?: string | undefined;
|
|
486
|
-
size?: string | undefined;
|
|
487
|
-
email?: string | null | undefined;
|
|
488
497
|
avatar_path?: string | null | undefined;
|
|
489
498
|
mission?: string | null | undefined;
|
|
499
|
+
size?: string | undefined;
|
|
500
|
+
email?: string | null | undefined;
|
|
490
501
|
domain?: string | null | undefined;
|
|
491
502
|
urls?: {
|
|
492
503
|
value: string;
|
|
493
504
|
}[] | null | undefined;
|
|
494
|
-
base_role?: "
|
|
505
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
495
506
|
}, {
|
|
496
507
|
id?: string | undefined;
|
|
497
508
|
name?: string | undefined;
|
|
498
|
-
size?: string | undefined;
|
|
499
|
-
email?: string | null | undefined;
|
|
500
509
|
avatar_path?: string | null | undefined;
|
|
501
510
|
mission?: string | null | undefined;
|
|
511
|
+
size?: string | undefined;
|
|
512
|
+
email?: string | null | undefined;
|
|
502
513
|
domain?: string | null | undefined;
|
|
503
514
|
urls?: {
|
|
504
515
|
value: string;
|
|
505
516
|
}[] | null | undefined;
|
|
506
|
-
base_role?: "
|
|
517
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
507
518
|
}>>>;
|
|
508
519
|
team_id: z.ZodOptional<z.ZodString>;
|
|
509
520
|
team: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
@@ -516,20 +527,20 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
516
527
|
created_at: z.ZodOptional<z.ZodString>;
|
|
517
528
|
}, "strip", z.ZodTypeAny, {
|
|
518
529
|
id?: string | undefined;
|
|
519
|
-
name?: string | undefined;
|
|
520
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
521
|
-
description?: string | null | undefined;
|
|
522
530
|
org_id?: string | undefined;
|
|
523
531
|
created_at?: string | undefined;
|
|
524
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
525
|
-
}, {
|
|
526
|
-
id?: string | undefined;
|
|
527
532
|
name?: string | undefined;
|
|
528
|
-
visibility?: "
|
|
533
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
529
534
|
description?: string | null | undefined;
|
|
535
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
536
|
+
}, {
|
|
537
|
+
id?: string | undefined;
|
|
530
538
|
org_id?: string | undefined;
|
|
531
539
|
created_at?: string | undefined;
|
|
532
|
-
|
|
540
|
+
name?: string | undefined;
|
|
541
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
542
|
+
description?: string | null | undefined;
|
|
543
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
533
544
|
}>>>;
|
|
534
545
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
535
546
|
parent: z.ZodOptional<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
|
|
@@ -551,18 +562,17 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
551
562
|
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
552
563
|
created_at: z.ZodOptional<z.ZodString>;
|
|
553
564
|
last_updated: z.ZodOptional<z.ZodString>;
|
|
554
|
-
}, "
|
|
555
|
-
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
556
|
-
name?: string | undefined;
|
|
557
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
558
|
-
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
559
|
-
description?: string | null | undefined;
|
|
560
|
-
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
565
|
+
}, "user" | "organization" | "team" | "id" | "user_id" | "created_at" | "slug">, "strip", z.ZodTypeAny, {
|
|
561
566
|
org_id?: string | undefined;
|
|
562
|
-
asset_type?: "
|
|
567
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
568
|
+
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
563
569
|
last_updated?: string | undefined;
|
|
570
|
+
name?: string | undefined;
|
|
564
571
|
team_id?: string | undefined;
|
|
572
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
573
|
+
description?: string | null | undefined;
|
|
565
574
|
parent_id?: string | null | undefined;
|
|
575
|
+
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
566
576
|
name_url_slug?: string | null | undefined;
|
|
567
577
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
568
578
|
price?: number | null | undefined;
|
|
@@ -572,18 +582,18 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
572
582
|
product_id?: string | null | undefined;
|
|
573
583
|
price_id?: string | null | undefined;
|
|
574
584
|
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
585
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
575
586
|
}, {
|
|
576
|
-
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
577
|
-
name?: string | undefined;
|
|
578
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
579
|
-
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
580
|
-
description?: string | null | undefined;
|
|
581
|
-
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
582
587
|
org_id?: string | undefined;
|
|
583
|
-
asset_type?: "
|
|
588
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
589
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
584
590
|
last_updated?: string | undefined;
|
|
591
|
+
name?: string | undefined;
|
|
585
592
|
team_id?: string | undefined;
|
|
593
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
594
|
+
description?: string | null | undefined;
|
|
586
595
|
parent_id?: string | null | undefined;
|
|
596
|
+
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
587
597
|
name_url_slug?: string | null | undefined;
|
|
588
598
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
589
599
|
price?: number | null | undefined;
|
|
@@ -593,8 +603,9 @@ declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
|
593
603
|
product_id?: string | null | undefined;
|
|
594
604
|
price_id?: string | null | undefined;
|
|
595
605
|
preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
606
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
596
607
|
}>;
|
|
597
|
-
|
|
598
|
-
type
|
|
599
|
-
type
|
|
600
|
-
export
|
|
608
|
+
export { AssetSchema, CreateAssetSchema, UpdateAssetSchema };
|
|
609
|
+
export type Asset = z.infer<typeof AssetSchema>;
|
|
610
|
+
export type CreateAsset = z.infer<typeof CreateAssetSchema>;
|
|
611
|
+
export type UpdateAsset = z.infer<typeof UpdateAssetSchema>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{z as t}from"zod";import{AssetTypeSchema as i,VisibilitySchema as a,MonetizationSchema as l,StatusSchema as n}from"./common.esm.js";import{OrganizationsSchema as e}from"./organizations.esm.js";import{TeamSchema as o}from"./teams.esm.js";import{ProfileSchema as r}from"./users.esm.js";import{uuidv7 as s}from"uuidv7";const u=t.object({id:t.string().uuid(),user_id:t.string().uuid(),user:r.partial().optional(),org_id:t.string().uuid(),organization:e.partial().optional(),team_id:t.string().uuid(),team:o.partial().optional(),parent_id:t.string().uuid().optional().nullable(),parent:t.object({}).passthrough().optional(),asset_type:i,name:t.string(),name_url_slug:t.string().optional().nullable(),slug:t.string().optional().nullable(),description:t.string().nullable().optional(),visibility:a,monetization:l,price:t.number().nullable().optional(),unit_cost:t.number().nullable().optional(),cost_accounting:t.enum(["fixed","variable"]).optional().nullable(),cost_unit:t.string().optional().nullable(),product_id:t.string().optional().nullable(),price_id:t.string().optional().nullable(),metadata:t.object({}).passthrough().optional().nullable(),preview:t.array(t.object({}).passthrough()).optional().nullable(),state:n.optional().nullable(),created_at:t.string(),last_updated:t.string()}),p=u.partial().omit({user_id:!0,user:!0,organization:!0,team:!0,slug:!0}).extend({id:t.string().uuid().default((()=>s())),team_id:t.string().uuid().nullish().default("00000000-0000-0000-0000-000000000000"),org_id:t.string().uuid().nullish().default("00000000-0000-0000-0000-000000000000"),name:t.string().min(1,{message:"Name cannot be empty"}).max(255,{message:"Name must be less than 255 characters"}),name_url_slug:t.string().optional().nullable(),state:n.optional().default("success"),visibility:a.optional().default("public"),created_at:t.string().default((()=>(new Date).toISOString())),last_updated:t.string().default((()=>(new Date).toISOString()))}),m=u.partial().omit({id:!0,user_id:!0,created_at:!0,user:!0,organization:!0,team:!0,slug:!0});export{u as AssetSchema,p as CreateAssetSchema,m as UpdateAssetSchema};
|
|
2
|
+
//# sourceMappingURL=assets.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.esm.js","sources":["../../src/schema/assets.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport {\n AssetTypeSchema,\n MonetizationSchema,\n StatusSchema,\n VisibilitySchema,\n} from \"./common\";\nimport { OrganizationsSchema } from \"./organizations\";\nimport { TeamSchema } from \"./teams\";\n\nimport { ProfileSchema } from \"./users\";\nimport { uuidv7 } from \"uuidv7\";\n\nconst AssetSchema = z.object({\n id: z.string().uuid(),\n user_id: z.string().uuid(),\n user: ProfileSchema.partial().optional(),\n org_id: z.string().uuid(),\n organization: OrganizationsSchema.partial().optional(),\n team_id: z.string().uuid(),\n team: TeamSchema.partial().optional(),\n parent_id: z.string().uuid().optional().nullable(),\n // parent: z.lazy(() => AssetSchema.partial()).optional(),\n parent: z.object({}).passthrough().optional(),\n asset_type: AssetTypeSchema,\n name: z.string(),\n name_url_slug: z.string().optional().nullable(),\n slug: z.string().optional().nullable(),\n description: z.string().nullable().optional(),\n visibility: VisibilitySchema,\n // Product information\n monetization: MonetizationSchema,\n price: z.number().nullable().optional(),\n unit_cost: z.number().nullable().optional(),\n cost_accounting: z.enum([\"fixed\", \"variable\"]).optional().nullable(),\n cost_unit: z.string().optional().nullable(),\n product_id: z.string().optional().nullable(),\n price_id: z.string().optional().nullable(),\n // Metadata information\n metadata: z.object({}).passthrough().optional().nullable(),\n preview: z.array(z.object({}).passthrough()).optional().nullable(),\n state: StatusSchema.optional().nullable(),\n created_at: z.string(),\n last_updated: z.string(),\n});\n\nconst CreateAssetSchema = AssetSchema.partial()\n .omit({\n user_id: true,\n // Remove extended foreign fields\n user: true,\n organization: true,\n team: true,\n // remove added slug\n slug: true,\n })\n .extend({\n id: z\n .string()\n .uuid()\n .default(() => uuidv7()),\n team_id: z\n .string()\n .uuid()\n .nullish()\n .default(\"00000000-0000-0000-0000-000000000000\"),\n org_id: z\n .string()\n .uuid()\n .nullish()\n .default(\"00000000-0000-0000-0000-000000000000\"),\n name: z\n .string()\n .min(1, {\n message: \"Name cannot be empty\",\n })\n .max(255, {\n message: \"Name must be less than 255 characters\",\n }), // name is required for all assets but posts and conversations\n name_url_slug: z.string().optional().nullable(),\n state: StatusSchema.optional().default(\"success\"),\n visibility: VisibilitySchema.optional().default(\"public\"),\n created_at: z.string().default(() => new Date().toISOString()),\n last_updated: z.string().default(() => new Date().toISOString()),\n });\n\nconst UpdateAssetSchema = AssetSchema.partial().omit({\n id: true,\n user_id: true,\n created_at: true,\n // Remove extended foreign fields\n user: true,\n organization: true,\n team: true,\n // remove added slug\n slug: true,\n});\n\nexport { AssetSchema, CreateAssetSchema, UpdateAssetSchema };\nexport type Asset = z.infer<typeof AssetSchema>;\nexport type CreateAsset = z.infer<typeof CreateAssetSchema>;\nexport type UpdateAsset = z.infer<typeof UpdateAssetSchema>;\n"],"names":["AssetSchema","z","object","id","string","uuid","user_id","user","ProfileSchema","partial","optional","org_id","organization","OrganizationsSchema","team_id","team","TeamSchema","parent_id","nullable","parent","passthrough","asset_type","AssetTypeSchema","name","name_url_slug","slug","description","visibility","VisibilitySchema","monetization","MonetizationSchema","price","number","unit_cost","cost_accounting","enum","cost_unit","product_id","price_id","metadata","preview","array","state","StatusSchema","created_at","last_updated","CreateAssetSchema","omit","extend","default","uuidv7","nullish","min","message","max","Date","toISOString","UpdateAssetSchema"],"mappings":"kUAcA,MAAMA,EAAcC,EAAEC,OAAO,CAC3BC,GAAIF,EAAEG,SAASC,OACfC,QAASL,EAAEG,SAASC,OACpBE,KAAMC,EAAcC,UAAUC,WAC9BC,OAAQV,EAAEG,SAASC,OACnBO,aAAcC,EAAoBJ,UAAUC,WAC5CI,QAASb,EAAEG,SAASC,OACpBU,KAAMC,EAAWP,UAAUC,WAC3BO,UAAWhB,EAAEG,SAASC,OAAOK,WAAWQ,WAExCC,OAAQlB,EAAEC,OAAO,CAAE,GAAEkB,cAAcV,WACnCW,WAAYC,EACZC,KAAMtB,EAAEG,SACRoB,cAAevB,EAAEG,SAASM,WAAWQ,WACrCO,KAAMxB,EAAEG,SAASM,WAAWQ,WAC5BQ,YAAazB,EAAEG,SAASc,WAAWR,WACnCiB,WAAYC,EAEZC,aAAcC,EACdC,MAAO9B,EAAE+B,SAASd,WAAWR,WAC7BuB,UAAWhC,EAAE+B,SAASd,WAAWR,WACjCwB,gBAAiBjC,EAAEkC,KAAK,CAAC,QAAS,aAAazB,WAAWQ,WAC1DkB,UAAWnC,EAAEG,SAASM,WAAWQ,WACjCmB,WAAYpC,EAAEG,SAASM,WAAWQ,WAClCoB,SAAUrC,EAAEG,SAASM,WAAWQ,WAEhCqB,SAAUtC,EAAEC,OAAO,CAAE,GAAEkB,cAAcV,WAAWQ,WAChDsB,QAASvC,EAAEwC,MAAMxC,EAAEC,OAAO,IAAIkB,eAAeV,WAAWQ,WACxDwB,MAAOC,EAAajC,WAAWQ,WAC/B0B,WAAY3C,EAAEG,SACdyC,aAAc5C,EAAEG,WAGZ0C,EAAoB9C,EAAYS,UACnCsC,KAAK,CACJzC,SAAS,EAETC,MAAM,EACNK,cAAc,EACdG,MAAM,EAENU,MAAM,IAEPuB,OAAO,CACN7C,GAAIF,EACDG,SACAC,OACA4C,SAAQ,IAAMC,MACjBpC,QAASb,EACNG,SACAC,OACA8C,UACAF,QAAQ,wCACXtC,OAAQV,EACLG,SACAC,OACA8C,UACAF,QAAQ,wCACX1B,KAAMtB,EACHG,SACAgD,IAAI,EAAG,CACNC,QAAS,yBAEVC,IAAI,IAAK,CACRD,QAAS,0CAEb7B,cAAevB,EAAEG,SAASM,WAAWQ,WACrCwB,MAAOC,EAAajC,WAAWuC,QAAQ,WACvCtB,WAAYC,EAAiBlB,WAAWuC,QAAQ,UAChDL,WAAY3C,EAAEG,SAAS6C,SAAQ,KAAM,IAAIM,MAAOC,gBAChDX,aAAc5C,EAAEG,SAAS6C,SAAQ,KAAM,IAAIM,MAAOC,kBAGhDC,EAAoBzD,EAAYS,UAAUsC,KAAK,CACnD5C,IAAI,EACJG,SAAS,EACTsC,YAAY,EAEZrC,MAAM,EACNK,cAAc,EACdG,MAAM,EAENU,MAAM"}
|
package/dist/schema/assets.js
CHANGED
|
@@ -1,95 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports.UpdateAssetSchema = exports.CreateAssetSchema = exports.AssetSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const common_1 = require("./common");
|
|
6
|
-
const organizations_1 = require("./organizations");
|
|
7
|
-
const teams_1 = require("./teams");
|
|
8
|
-
const users_1 = require("./users");
|
|
9
|
-
const uuidv7_1 = require("uuidv7");
|
|
10
|
-
const AssetSchema = zod_1.z.object({
|
|
11
|
-
id: zod_1.z.string().uuid(),
|
|
12
|
-
user_id: zod_1.z.string().uuid(),
|
|
13
|
-
user: users_1.ProfileSchema.partial().optional(),
|
|
14
|
-
org_id: zod_1.z.string().uuid(),
|
|
15
|
-
organization: organizations_1.OrganizationsSchema.partial().optional(),
|
|
16
|
-
team_id: zod_1.z.string().uuid(),
|
|
17
|
-
team: teams_1.TeamSchema.partial().optional(),
|
|
18
|
-
parent_id: zod_1.z.string().uuid().optional().nullable(),
|
|
19
|
-
// parent: z.lazy(() => AssetSchema.partial()).optional(),
|
|
20
|
-
parent: zod_1.z.object({}).passthrough().optional(),
|
|
21
|
-
asset_type: common_1.AssetTypeSchema,
|
|
22
|
-
name: zod_1.z.string(),
|
|
23
|
-
name_url_slug: zod_1.z.string().optional().nullable(),
|
|
24
|
-
slug: zod_1.z.string().optional().nullable(),
|
|
25
|
-
description: zod_1.z.string().nullable().optional(),
|
|
26
|
-
visibility: common_1.VisibilitySchema,
|
|
27
|
-
// Product information
|
|
28
|
-
monetization: common_1.MonetizationSchema,
|
|
29
|
-
price: zod_1.z.number().nullable().optional(),
|
|
30
|
-
unit_cost: zod_1.z.number().nullable().optional(),
|
|
31
|
-
cost_accounting: zod_1.z.enum(["fixed", "variable"]).optional().nullable(),
|
|
32
|
-
cost_unit: zod_1.z.string().optional().nullable(),
|
|
33
|
-
product_id: zod_1.z.string().optional().nullable(),
|
|
34
|
-
price_id: zod_1.z.string().optional().nullable(),
|
|
35
|
-
// Metadata information
|
|
36
|
-
metadata: zod_1.z.object({}).passthrough().optional().nullable(),
|
|
37
|
-
preview: zod_1.z.array(zod_1.z.object({}).passthrough()).optional().nullable(),
|
|
38
|
-
state: common_1.StatusSchema.optional().nullable(),
|
|
39
|
-
created_at: zod_1.z.string(),
|
|
40
|
-
last_updated: zod_1.z.string(),
|
|
41
|
-
});
|
|
42
|
-
exports.AssetSchema = AssetSchema;
|
|
43
|
-
const CreateAssetSchema = AssetSchema.partial()
|
|
44
|
-
.omit({
|
|
45
|
-
user_id: true,
|
|
46
|
-
// Remove extended foreign fields
|
|
47
|
-
user: true,
|
|
48
|
-
organization: true,
|
|
49
|
-
team: true,
|
|
50
|
-
// remove added slug
|
|
51
|
-
slug: true,
|
|
52
|
-
})
|
|
53
|
-
.extend({
|
|
54
|
-
id: zod_1.z
|
|
55
|
-
.string()
|
|
56
|
-
.uuid()
|
|
57
|
-
.default(() => (0, uuidv7_1.uuidv7)()),
|
|
58
|
-
team_id: zod_1.z
|
|
59
|
-
.string()
|
|
60
|
-
.uuid()
|
|
61
|
-
.nullish()
|
|
62
|
-
.default("00000000-0000-0000-0000-000000000000"),
|
|
63
|
-
org_id: zod_1.z
|
|
64
|
-
.string()
|
|
65
|
-
.uuid()
|
|
66
|
-
.nullish()
|
|
67
|
-
.default("00000000-0000-0000-0000-000000000000"),
|
|
68
|
-
name: zod_1.z
|
|
69
|
-
.string()
|
|
70
|
-
.min(1, {
|
|
71
|
-
message: "Name cannot be empty",
|
|
72
|
-
})
|
|
73
|
-
.max(255, {
|
|
74
|
-
message: "Name must be less than 255 characters",
|
|
75
|
-
}),
|
|
76
|
-
name_url_slug: zod_1.z.string().optional().nullable(),
|
|
77
|
-
state: common_1.StatusSchema.optional().default("success"),
|
|
78
|
-
visibility: common_1.VisibilitySchema.optional().default("public"),
|
|
79
|
-
created_at: zod_1.z.string().default(() => new Date().toISOString()),
|
|
80
|
-
last_updated: zod_1.z.string().default(() => new Date().toISOString()),
|
|
81
|
-
});
|
|
82
|
-
exports.CreateAssetSchema = CreateAssetSchema;
|
|
83
|
-
const UpdateAssetSchema = AssetSchema.partial().omit({
|
|
84
|
-
id: true,
|
|
85
|
-
user_id: true,
|
|
86
|
-
created_at: true,
|
|
87
|
-
// Remove extended foreign fields
|
|
88
|
-
user: true,
|
|
89
|
-
organization: true,
|
|
90
|
-
team: true,
|
|
91
|
-
// remove added slug
|
|
92
|
-
slug: true,
|
|
93
|
-
});
|
|
94
|
-
exports.UpdateAssetSchema = UpdateAssetSchema;
|
|
95
|
-
//# sourceMappingURL=assets.js.map
|
|
1
|
+
"use strict";var t=require("zod"),a=require("./common.js"),e=require("./organizations.js"),i=require("./teams.js"),n=require("./users.js"),l=require("uuidv7");const s=t.z.object({id:t.z.string().uuid(),user_id:t.z.string().uuid(),user:n.ProfileSchema.partial().optional(),org_id:t.z.string().uuid(),organization:e.OrganizationsSchema.partial().optional(),team_id:t.z.string().uuid(),team:i.TeamSchema.partial().optional(),parent_id:t.z.string().uuid().optional().nullable(),parent:t.z.object({}).passthrough().optional(),asset_type:a.AssetTypeSchema,name:t.z.string(),name_url_slug:t.z.string().optional().nullable(),slug:t.z.string().optional().nullable(),description:t.z.string().nullable().optional(),visibility:a.VisibilitySchema,monetization:a.MonetizationSchema,price:t.z.number().nullable().optional(),unit_cost:t.z.number().nullable().optional(),cost_accounting:t.z.enum(["fixed","variable"]).optional().nullable(),cost_unit:t.z.string().optional().nullable(),product_id:t.z.string().optional().nullable(),price_id:t.z.string().optional().nullable(),metadata:t.z.object({}).passthrough().optional().nullable(),preview:t.z.array(t.z.object({}).passthrough()).optional().nullable(),state:a.StatusSchema.optional().nullable(),created_at:t.z.string(),last_updated:t.z.string()}),r=s.partial().omit({user_id:!0,user:!0,organization:!0,team:!0,slug:!0}).extend({id:t.z.string().uuid().default((()=>l.uuidv7())),team_id:t.z.string().uuid().nullish().default("00000000-0000-0000-0000-000000000000"),org_id:t.z.string().uuid().nullish().default("00000000-0000-0000-0000-000000000000"),name:t.z.string().min(1,{message:"Name cannot be empty"}).max(255,{message:"Name must be less than 255 characters"}),name_url_slug:t.z.string().optional().nullable(),state:a.StatusSchema.optional().default("success"),visibility:a.VisibilitySchema.optional().default("public"),created_at:t.z.string().default((()=>(new Date).toISOString())),last_updated:t.z.string().default((()=>(new Date).toISOString()))}),o=s.partial().omit({id:!0,user_id:!0,created_at:!0,user:!0,organization:!0,team:!0,slug:!0});exports.AssetSchema=s,exports.CreateAssetSchema=r,exports.UpdateAssetSchema=o;
|
|
2
|
+
//# sourceMappingURL=assets.js.map
|