@ourofoundation/ouro-js 1.1.0 → 1.1.2
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 -80
- package/dist/index.js.map +1 -1
- package/dist/schema/assets.d.ts +240 -70
- package/dist/schema/assets.esm.js +2 -0
- package/dist/schema/assets.esm.js.map +1 -0
- package/dist/schema/assets.js +2 -83
- package/dist/schema/assets.js.map +1 -1
- package/dist/schema/blueprints.d.ts +95 -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 +81 -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 +139 -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 +202 -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 +185 -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 +390 -301
- package/dist/schema/posts.esm.js +2 -0
- package/dist/schema/posts.esm.js.map +1 -0
- package/dist/schema/posts.js +2 -76
- package/dist/schema/posts.js.map +1 -1
- package/dist/schema/replications.d.ts +115 -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 +85 -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 +4 -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
|
@@ -57,27 +57,27 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
58
|
id?: string | undefined;
|
|
59
59
|
name?: string | undefined;
|
|
60
|
-
size?: string | undefined;
|
|
61
|
-
email?: string | null | undefined;
|
|
62
60
|
avatar_path?: string | null | undefined;
|
|
63
61
|
mission?: string | null | undefined;
|
|
62
|
+
size?: string | undefined;
|
|
63
|
+
email?: string | null | undefined;
|
|
64
64
|
domain?: string | null | undefined;
|
|
65
65
|
urls?: {
|
|
66
66
|
value: string;
|
|
67
67
|
}[] | null | undefined;
|
|
68
|
-
base_role?: "
|
|
68
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
69
69
|
}, {
|
|
70
70
|
id?: string | undefined;
|
|
71
71
|
name?: string | undefined;
|
|
72
|
-
size?: string | undefined;
|
|
73
|
-
email?: string | null | undefined;
|
|
74
72
|
avatar_path?: string | null | undefined;
|
|
75
73
|
mission?: string | null | undefined;
|
|
74
|
+
size?: string | undefined;
|
|
75
|
+
email?: string | null | undefined;
|
|
76
76
|
domain?: string | null | undefined;
|
|
77
77
|
urls?: {
|
|
78
78
|
value: string;
|
|
79
79
|
}[] | null | undefined;
|
|
80
|
-
base_role?: "
|
|
80
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
81
81
|
}>>;
|
|
82
82
|
team_id: z.ZodString;
|
|
83
83
|
team: z.ZodOptional<z.ZodObject<{
|
|
@@ -90,20 +90,20 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
90
90
|
created_at: z.ZodOptional<z.ZodString>;
|
|
91
91
|
}, "strip", z.ZodTypeAny, {
|
|
92
92
|
id?: string | undefined;
|
|
93
|
-
name?: string | undefined;
|
|
94
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
95
|
-
description?: string | null | undefined;
|
|
96
93
|
org_id?: string | undefined;
|
|
97
94
|
created_at?: string | undefined;
|
|
98
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
99
|
-
}, {
|
|
100
|
-
id?: string | undefined;
|
|
101
95
|
name?: string | undefined;
|
|
102
|
-
visibility?: "
|
|
96
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
103
97
|
description?: string | null | undefined;
|
|
98
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
id?: string | undefined;
|
|
104
101
|
org_id?: string | undefined;
|
|
105
102
|
created_at?: string | undefined;
|
|
106
|
-
|
|
103
|
+
name?: string | undefined;
|
|
104
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
105
|
+
description?: string | null | undefined;
|
|
106
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
107
107
|
}>>;
|
|
108
108
|
parent_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
109
109
|
parent: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
|
|
@@ -127,19 +127,15 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
127
127
|
last_updated: z.ZodString;
|
|
128
128
|
}, "strip", z.ZodTypeAny, {
|
|
129
129
|
id: string;
|
|
130
|
-
name: string;
|
|
131
|
-
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
132
130
|
user_id: string;
|
|
133
131
|
org_id: string;
|
|
134
|
-
asset_type: "
|
|
132
|
+
asset_type: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
135
133
|
created_at: string;
|
|
136
134
|
last_updated: string;
|
|
135
|
+
name: string;
|
|
137
136
|
team_id: string;
|
|
137
|
+
visibility: "organization" | "public" | "private" | "monetized" | "inherit";
|
|
138
138
|
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
139
|
user?: {
|
|
144
140
|
id?: string | undefined;
|
|
145
141
|
user_id?: string | undefined;
|
|
@@ -154,26 +150,29 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
154
150
|
organization?: {
|
|
155
151
|
id?: string | undefined;
|
|
156
152
|
name?: string | undefined;
|
|
157
|
-
size?: string | undefined;
|
|
158
|
-
email?: string | null | undefined;
|
|
159
153
|
avatar_path?: string | null | undefined;
|
|
160
154
|
mission?: string | null | undefined;
|
|
155
|
+
size?: string | undefined;
|
|
156
|
+
email?: string | null | undefined;
|
|
161
157
|
domain?: string | null | undefined;
|
|
162
158
|
urls?: {
|
|
163
159
|
value: string;
|
|
164
160
|
}[] | null | undefined;
|
|
165
|
-
base_role?: "
|
|
161
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
166
162
|
} | undefined;
|
|
167
163
|
team?: {
|
|
168
164
|
id?: string | undefined;
|
|
169
|
-
name?: string | undefined;
|
|
170
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
171
|
-
description?: string | null | undefined;
|
|
172
165
|
org_id?: string | undefined;
|
|
173
166
|
created_at?: string | undefined;
|
|
174
|
-
|
|
167
|
+
name?: string | undefined;
|
|
168
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
169
|
+
description?: string | null | undefined;
|
|
170
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
175
171
|
} | undefined;
|
|
172
|
+
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
173
|
+
description?: string | null | undefined;
|
|
176
174
|
parent_id?: string | null | undefined;
|
|
175
|
+
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
177
176
|
name_url_slug?: string | null | undefined;
|
|
178
177
|
slug?: string | null | undefined;
|
|
179
178
|
price?: number | null | undefined;
|
|
@@ -183,21 +182,18 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
183
182
|
product_id?: string | null | undefined;
|
|
184
183
|
price_id?: string | null | undefined;
|
|
185
184
|
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
185
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
186
186
|
}, {
|
|
187
187
|
id: string;
|
|
188
|
-
name: string;
|
|
189
|
-
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
190
188
|
user_id: string;
|
|
191
189
|
org_id: string;
|
|
192
|
-
asset_type: "
|
|
190
|
+
asset_type: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
193
191
|
created_at: string;
|
|
194
192
|
last_updated: string;
|
|
193
|
+
name: string;
|
|
195
194
|
team_id: string;
|
|
195
|
+
visibility: "organization" | "public" | "private" | "monetized" | "inherit";
|
|
196
196
|
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
197
|
user?: {
|
|
202
198
|
id?: string | undefined;
|
|
203
199
|
user_id?: string | undefined;
|
|
@@ -212,26 +208,29 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
212
208
|
organization?: {
|
|
213
209
|
id?: string | undefined;
|
|
214
210
|
name?: string | undefined;
|
|
215
|
-
size?: string | undefined;
|
|
216
|
-
email?: string | null | undefined;
|
|
217
211
|
avatar_path?: string | null | undefined;
|
|
218
212
|
mission?: string | null | undefined;
|
|
213
|
+
size?: string | undefined;
|
|
214
|
+
email?: string | null | undefined;
|
|
219
215
|
domain?: string | null | undefined;
|
|
220
216
|
urls?: {
|
|
221
217
|
value: string;
|
|
222
218
|
}[] | null | undefined;
|
|
223
|
-
base_role?: "
|
|
219
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
224
220
|
} | undefined;
|
|
225
221
|
team?: {
|
|
226
222
|
id?: string | undefined;
|
|
227
|
-
name?: string | undefined;
|
|
228
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
229
|
-
description?: string | null | undefined;
|
|
230
223
|
org_id?: string | undefined;
|
|
231
224
|
created_at?: string | undefined;
|
|
232
|
-
|
|
225
|
+
name?: string | undefined;
|
|
226
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
227
|
+
description?: string | null | undefined;
|
|
228
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
233
229
|
} | undefined;
|
|
230
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
231
|
+
description?: string | null | undefined;
|
|
234
232
|
parent_id?: string | null | undefined;
|
|
233
|
+
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
235
234
|
name_url_slug?: string | null | undefined;
|
|
236
235
|
slug?: string | null | undefined;
|
|
237
236
|
price?: number | null | undefined;
|
|
@@ -241,6 +240,7 @@ declare const AssetSchema: z.ZodObject<{
|
|
|
241
240
|
product_id?: string | null | undefined;
|
|
242
241
|
price_id?: string | null | undefined;
|
|
243
242
|
preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
243
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
244
244
|
}>;
|
|
245
245
|
declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
246
246
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -300,27 +300,27 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
300
300
|
}, "strip", z.ZodTypeAny, {
|
|
301
301
|
id?: string | undefined;
|
|
302
302
|
name?: string | undefined;
|
|
303
|
-
size?: string | undefined;
|
|
304
|
-
email?: string | null | undefined;
|
|
305
303
|
avatar_path?: string | null | undefined;
|
|
306
304
|
mission?: string | null | undefined;
|
|
305
|
+
size?: string | undefined;
|
|
306
|
+
email?: string | null | undefined;
|
|
307
307
|
domain?: string | null | undefined;
|
|
308
308
|
urls?: {
|
|
309
309
|
value: string;
|
|
310
310
|
}[] | null | undefined;
|
|
311
|
-
base_role?: "
|
|
311
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
312
312
|
}, {
|
|
313
313
|
id?: string | undefined;
|
|
314
314
|
name?: string | undefined;
|
|
315
|
-
size?: string | undefined;
|
|
316
|
-
email?: string | null | undefined;
|
|
317
315
|
avatar_path?: string | null | undefined;
|
|
318
316
|
mission?: string | null | undefined;
|
|
317
|
+
size?: string | undefined;
|
|
318
|
+
email?: string | null | undefined;
|
|
319
319
|
domain?: string | null | undefined;
|
|
320
320
|
urls?: {
|
|
321
321
|
value: string;
|
|
322
322
|
}[] | null | undefined;
|
|
323
|
-
base_role?: "
|
|
323
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
324
324
|
}>>>;
|
|
325
325
|
team_id: z.ZodOptional<z.ZodString>;
|
|
326
326
|
team: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
@@ -333,20 +333,20 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
333
333
|
created_at: z.ZodOptional<z.ZodString>;
|
|
334
334
|
}, "strip", z.ZodTypeAny, {
|
|
335
335
|
id?: string | undefined;
|
|
336
|
-
name?: string | undefined;
|
|
337
|
-
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
338
|
-
description?: string | null | undefined;
|
|
339
336
|
org_id?: string | undefined;
|
|
340
337
|
created_at?: string | undefined;
|
|
341
|
-
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
342
|
-
}, {
|
|
343
|
-
id?: string | undefined;
|
|
344
338
|
name?: string | undefined;
|
|
345
|
-
visibility?: "
|
|
339
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
346
340
|
description?: string | null | undefined;
|
|
341
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
342
|
+
}, {
|
|
343
|
+
id?: string | undefined;
|
|
347
344
|
org_id?: string | undefined;
|
|
348
345
|
created_at?: string | undefined;
|
|
349
|
-
|
|
346
|
+
name?: string | undefined;
|
|
347
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
348
|
+
description?: string | null | undefined;
|
|
349
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
350
350
|
}>>>;
|
|
351
351
|
parent_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
352
352
|
parent: z.ZodOptional<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
|
|
@@ -380,18 +380,18 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
380
380
|
last_updated: z.ZodDefault<z.ZodString>;
|
|
381
381
|
}>, "strip", z.ZodTypeAny, {
|
|
382
382
|
id: string;
|
|
383
|
-
state: "error" | "in-progress" | "success" | "queued";
|
|
384
|
-
name: string;
|
|
385
|
-
visibility: "inherit" | "private" | "public" | "organization" | "monetized";
|
|
386
383
|
org_id: string | null;
|
|
387
384
|
created_at: string;
|
|
388
385
|
last_updated: string;
|
|
386
|
+
name: string;
|
|
389
387
|
team_id: string | null;
|
|
388
|
+
visibility: "organization" | "public" | "private" | "monetized" | "inherit";
|
|
389
|
+
state: "queued" | "in-progress" | "success" | "error";
|
|
390
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
390
391
|
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
391
392
|
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
393
|
parent_id?: string | null | undefined;
|
|
394
|
+
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
395
395
|
name_url_slug?: string | null | undefined;
|
|
396
396
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
397
397
|
price?: number | null | undefined;
|
|
@@ -404,17 +404,185 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
404
404
|
}, {
|
|
405
405
|
name: string;
|
|
406
406
|
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
407
|
org_id?: string | null | undefined;
|
|
413
|
-
asset_type?: "
|
|
408
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
409
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
414
410
|
created_at?: string | undefined;
|
|
415
411
|
last_updated?: string | undefined;
|
|
416
412
|
team_id?: string | null | undefined;
|
|
413
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
414
|
+
description?: string | null | undefined;
|
|
417
415
|
parent_id?: string | null | undefined;
|
|
416
|
+
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
417
|
+
name_url_slug?: string | null | undefined;
|
|
418
|
+
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
419
|
+
price?: number | null | undefined;
|
|
420
|
+
unit_cost?: number | null | undefined;
|
|
421
|
+
cost_accounting?: "fixed" | "variable" | null | undefined;
|
|
422
|
+
cost_unit?: string | null | undefined;
|
|
423
|
+
product_id?: string | null | undefined;
|
|
424
|
+
price_id?: string | null | undefined;
|
|
425
|
+
preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
426
|
+
state?: "queued" | "in-progress" | "success" | "error" | undefined;
|
|
427
|
+
}>;
|
|
428
|
+
declare const UpdateAssetSchema: z.ZodObject<Omit<{
|
|
429
|
+
id: z.ZodOptional<z.ZodString>;
|
|
430
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
431
|
+
user: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
432
|
+
id: z.ZodOptional<z.ZodString>;
|
|
433
|
+
user_id: z.ZodOptional<z.ZodString>;
|
|
434
|
+
username: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
435
|
+
avatar_path: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
436
|
+
bio: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
437
|
+
urls: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
438
|
+
value: z.ZodString;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
value: string;
|
|
441
|
+
}, {
|
|
442
|
+
value: string;
|
|
443
|
+
}>, "many">>>;
|
|
444
|
+
last_active: z.ZodOptional<z.ZodString>;
|
|
445
|
+
}, "strip", z.ZodTypeAny, {
|
|
446
|
+
id?: string | undefined;
|
|
447
|
+
user_id?: string | undefined;
|
|
448
|
+
avatar_path?: string | null | undefined;
|
|
449
|
+
urls?: {
|
|
450
|
+
value: string;
|
|
451
|
+
}[] | undefined;
|
|
452
|
+
username?: string | null | undefined;
|
|
453
|
+
bio?: string | null | undefined;
|
|
454
|
+
last_active?: string | undefined;
|
|
455
|
+
}, {
|
|
456
|
+
id?: string | undefined;
|
|
457
|
+
user_id?: string | undefined;
|
|
458
|
+
avatar_path?: string | null | undefined;
|
|
459
|
+
urls?: {
|
|
460
|
+
value: string;
|
|
461
|
+
}[] | undefined;
|
|
462
|
+
username?: string | null | undefined;
|
|
463
|
+
bio?: string | null | undefined;
|
|
464
|
+
last_active?: string | undefined;
|
|
465
|
+
}>>>;
|
|
466
|
+
org_id: z.ZodOptional<z.ZodString>;
|
|
467
|
+
organization: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
468
|
+
id: z.ZodOptional<z.ZodString>;
|
|
469
|
+
name: z.ZodOptional<z.ZodString>;
|
|
470
|
+
avatar_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
471
|
+
mission: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
472
|
+
size: z.ZodOptional<z.ZodString>;
|
|
473
|
+
email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
474
|
+
domain: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
475
|
+
urls: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
476
|
+
value: z.ZodString;
|
|
477
|
+
}, "strip", z.ZodTypeAny, {
|
|
478
|
+
value: string;
|
|
479
|
+
}, {
|
|
480
|
+
value: string;
|
|
481
|
+
}>, "many">>>>;
|
|
482
|
+
base_role: z.ZodOptional<z.ZodDefault<z.ZodEnum<["admin", "read", "write", "none"]>>>;
|
|
483
|
+
}, "strip", z.ZodTypeAny, {
|
|
484
|
+
id?: string | undefined;
|
|
485
|
+
name?: string | undefined;
|
|
486
|
+
avatar_path?: string | null | undefined;
|
|
487
|
+
mission?: string | null | undefined;
|
|
488
|
+
size?: string | undefined;
|
|
489
|
+
email?: string | null | undefined;
|
|
490
|
+
domain?: string | null | undefined;
|
|
491
|
+
urls?: {
|
|
492
|
+
value: string;
|
|
493
|
+
}[] | null | undefined;
|
|
494
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
495
|
+
}, {
|
|
496
|
+
id?: string | undefined;
|
|
497
|
+
name?: string | undefined;
|
|
498
|
+
avatar_path?: string | null | undefined;
|
|
499
|
+
mission?: string | null | undefined;
|
|
500
|
+
size?: string | undefined;
|
|
501
|
+
email?: string | null | undefined;
|
|
502
|
+
domain?: string | null | undefined;
|
|
503
|
+
urls?: {
|
|
504
|
+
value: string;
|
|
505
|
+
}[] | null | undefined;
|
|
506
|
+
base_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
507
|
+
}>>>;
|
|
508
|
+
team_id: z.ZodOptional<z.ZodString>;
|
|
509
|
+
team: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
510
|
+
id: z.ZodOptional<z.ZodString>;
|
|
511
|
+
org_id: z.ZodOptional<z.ZodString>;
|
|
512
|
+
name: z.ZodOptional<z.ZodString>;
|
|
513
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
514
|
+
default_role: z.ZodOptional<z.ZodEnum<["admin", "read", "write", "none"]>>;
|
|
515
|
+
visibility: z.ZodOptional<z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>>;
|
|
516
|
+
created_at: z.ZodOptional<z.ZodString>;
|
|
517
|
+
}, "strip", z.ZodTypeAny, {
|
|
518
|
+
id?: string | undefined;
|
|
519
|
+
org_id?: string | undefined;
|
|
520
|
+
created_at?: string | undefined;
|
|
521
|
+
name?: string | undefined;
|
|
522
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
523
|
+
description?: string | null | undefined;
|
|
524
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
525
|
+
}, {
|
|
526
|
+
id?: string | undefined;
|
|
527
|
+
org_id?: string | undefined;
|
|
528
|
+
created_at?: string | undefined;
|
|
529
|
+
name?: string | undefined;
|
|
530
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
531
|
+
description?: string | null | undefined;
|
|
532
|
+
default_role?: "admin" | "read" | "write" | "none" | undefined;
|
|
533
|
+
}>>>;
|
|
534
|
+
parent_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
535
|
+
parent: z.ZodOptional<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
|
|
536
|
+
asset_type: z.ZodOptional<z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>>;
|
|
537
|
+
name: z.ZodOptional<z.ZodString>;
|
|
538
|
+
name_url_slug: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
539
|
+
slug: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
540
|
+
description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
541
|
+
visibility: z.ZodOptional<z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>>;
|
|
542
|
+
monetization: z.ZodOptional<z.ZodEnum<["none", "pay-to-unlock", "pay-per-use"]>>;
|
|
543
|
+
price: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
544
|
+
unit_cost: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
545
|
+
cost_accounting: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["fixed", "variable"]>>>>;
|
|
546
|
+
cost_unit: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
547
|
+
product_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
548
|
+
price_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
549
|
+
metadata: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>>;
|
|
550
|
+
preview: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">>>>;
|
|
551
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
552
|
+
created_at: z.ZodOptional<z.ZodString>;
|
|
553
|
+
last_updated: z.ZodOptional<z.ZodString>;
|
|
554
|
+
}, "user" | "organization" | "team" | "id" | "user_id" | "created_at" | "slug">, "strip", z.ZodTypeAny, {
|
|
555
|
+
org_id?: string | undefined;
|
|
556
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
557
|
+
metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
558
|
+
last_updated?: string | undefined;
|
|
559
|
+
name?: string | undefined;
|
|
560
|
+
team_id?: string | undefined;
|
|
561
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
562
|
+
description?: string | null | undefined;
|
|
563
|
+
parent_id?: string | null | undefined;
|
|
564
|
+
parent?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
565
|
+
name_url_slug?: string | null | undefined;
|
|
566
|
+
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
567
|
+
price?: number | null | undefined;
|
|
568
|
+
unit_cost?: number | null | undefined;
|
|
569
|
+
cost_accounting?: "fixed" | "variable" | null | undefined;
|
|
570
|
+
cost_unit?: string | null | undefined;
|
|
571
|
+
product_id?: string | null | undefined;
|
|
572
|
+
price_id?: string | null | undefined;
|
|
573
|
+
preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
574
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
575
|
+
}, {
|
|
576
|
+
org_id?: string | undefined;
|
|
577
|
+
asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
578
|
+
metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
|
|
579
|
+
last_updated?: string | undefined;
|
|
580
|
+
name?: string | undefined;
|
|
581
|
+
team_id?: string | undefined;
|
|
582
|
+
visibility?: "organization" | "public" | "private" | "monetized" | "inherit" | undefined;
|
|
583
|
+
description?: string | null | undefined;
|
|
584
|
+
parent_id?: string | null | undefined;
|
|
585
|
+
parent?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
418
586
|
name_url_slug?: string | null | undefined;
|
|
419
587
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
420
588
|
price?: number | null | undefined;
|
|
@@ -424,7 +592,9 @@ declare const CreateAssetSchema: z.ZodObject<z.objectUtil.extendShape<Omit<{
|
|
|
424
592
|
product_id?: string | null | undefined;
|
|
425
593
|
price_id?: string | null | undefined;
|
|
426
594
|
preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
|
|
595
|
+
state?: "queued" | "in-progress" | "success" | "error" | null | undefined;
|
|
427
596
|
}>;
|
|
428
|
-
|
|
429
|
-
type
|
|
430
|
-
export
|
|
597
|
+
export { AssetSchema, CreateAssetSchema, UpdateAssetSchema };
|
|
598
|
+
export type Asset = z.infer<typeof AssetSchema>;
|
|
599
|
+
export type CreateAsset = z.infer<typeof CreateAssetSchema>;
|
|
600
|
+
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,83 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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
|
-
//# 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.js","
|
|
1
|
+
{"version":3,"file":"assets.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":"+JAcA,MAAMA,EAAcC,EAACA,EAACC,OAAO,CAC3BC,GAAIF,EAACA,EAACG,SAASC,OACfC,QAASL,EAACA,EAACG,SAASC,OACpBE,KAAMC,EAAaA,cAACC,UAAUC,WAC9BC,OAAQV,EAACA,EAACG,SAASC,OACnBO,aAAcC,EAAmBA,oBAACJ,UAAUC,WAC5CI,QAASb,EAACA,EAACG,SAASC,OACpBU,KAAMC,EAAUA,WAACP,UAAUC,WAC3BO,UAAWhB,EAACA,EAACG,SAASC,OAAOK,WAAWQ,WAExCC,OAAQlB,EAACA,EAACC,OAAO,CAAE,GAAEkB,cAAcV,WACnCW,WAAYC,EAAeA,gBAC3BC,KAAMtB,EAACA,EAACG,SACRoB,cAAevB,EAAAA,EAAEG,SAASM,WAAWQ,WACrCO,KAAMxB,EAAAA,EAAEG,SAASM,WAAWQ,WAC5BQ,YAAazB,EAAAA,EAAEG,SAASc,WAAWR,WACnCiB,WAAYC,EAAgBA,iBAE5BC,aAAcC,EAAkBA,mBAChCC,MAAO9B,EAAAA,EAAE+B,SAASd,WAAWR,WAC7BuB,UAAWhC,EAAAA,EAAE+B,SAASd,WAAWR,WACjCwB,gBAAiBjC,EAAAA,EAAEkC,KAAK,CAAC,QAAS,aAAazB,WAAWQ,WAC1DkB,UAAWnC,EAAAA,EAAEG,SAASM,WAAWQ,WACjCmB,WAAYpC,EAAAA,EAAEG,SAASM,WAAWQ,WAClCoB,SAAUrC,EAAAA,EAAEG,SAASM,WAAWQ,WAEhCqB,SAAUtC,EAAAA,EAAEC,OAAO,CAAE,GAAEkB,cAAcV,WAAWQ,WAChDsB,QAASvC,EAACA,EAACwC,MAAMxC,EAAAA,EAAEC,OAAO,IAAIkB,eAAeV,WAAWQ,WACxDwB,MAAOC,EAAYA,aAACjC,WAAWQ,WAC/B0B,WAAY3C,EAACA,EAACG,SACdyC,aAAc5C,EAACA,EAACG,WAGZ0C,EAAoB9C,EAAYS,UACnCsC,KAAK,CACJzC,SAAS,EAETC,MAAM,EACNK,cAAc,EACdG,MAAM,EAENU,MAAM,IAEPuB,OAAO,CACN7C,GAAIF,EAAAA,EACDG,SACAC,OACA4C,SAAQ,IAAMC,EAAAA,WACjBpC,QAASb,EAAAA,EACNG,SACAC,OACA8C,UACAF,QAAQ,wCACXtC,OAAQV,EAAAA,EACLG,SACAC,OACA8C,UACAF,QAAQ,wCACX1B,KAAMtB,EAAAA,EACHG,SACAgD,IAAI,EAAG,CACNC,QAAS,yBAEVC,IAAI,IAAK,CACRD,QAAS,0CAEb7B,cAAevB,EAAAA,EAAEG,SAASM,WAAWQ,WACrCwB,MAAOC,EAAAA,aAAajC,WAAWuC,QAAQ,WACvCtB,WAAYC,EAAAA,iBAAiBlB,WAAWuC,QAAQ,UAChDL,WAAY3C,EAAAA,EAAEG,SAAS6C,SAAQ,KAAM,IAAIM,MAAOC,gBAChDX,aAAc5C,EAAAA,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"}
|