@ourofoundation/ouro-js 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateDatasetSchema = exports.CreateDatasetFromSchemaSchema = exports.CreateDatasetFromFileSchema = exports.DatasetSchema = void 0;
4
+ const uuidv7_1 = require("uuidv7");
5
+ const zod_1 = require("zod");
6
+ const assets_1 = require("@/schema/assets");
7
+ const index_1 = require("@/schema/index");
8
+ const DatasetMetadataSchema = zod_1.z.object({
9
+ table_name: zod_1.z.string(),
10
+ schema: zod_1.z
11
+ .string()
12
+ .default("datasets")
13
+ .refine((val) => val === "datasets"),
14
+ // Properties for if the dataset came from a file
15
+ columns: zod_1.z.array(zod_1.z.string()).optional(),
16
+ type: zod_1.z.string().optional(),
17
+ size: zod_1.z.number().optional(),
18
+ width: zod_1.z.number().optional(),
19
+ height: zod_1.z.number().optional(),
20
+ path: zod_1.z.string().optional(),
21
+ fullPath: zod_1.z.string().optional(),
22
+ name: zod_1.z.string().optional(),
23
+ id: zod_1.z.string().uuid().optional(),
24
+ });
25
+ const DatasetSchema = assets_1.AssetSchema.extend({
26
+ asset_type: index_1.AssetTypeSchema.refine((val) => val === "dataset"),
27
+ metadata: DatasetMetadataSchema,
28
+ preview: zod_1.z.array(zod_1.z.object({}).passthrough()).optional().nullable(),
29
+ });
30
+ exports.DatasetSchema = DatasetSchema;
31
+ const CreateDatasetFromFileSchema = assets_1.AssetSchema.partial()
32
+ .omit({
33
+ // id: true, // it's actually very important we take the id from the body
34
+ // It's the id of the file that was uploaded
35
+ user_id: true,
36
+ })
37
+ .extend({
38
+ id: zod_1.z
39
+ .string()
40
+ .uuid()
41
+ .default(() => (0, uuidv7_1.uuidv7)()),
42
+ team_id: zod_1.z
43
+ .string()
44
+ .uuid()
45
+ .nullish()
46
+ .default("00000000-0000-0000-0000-000000000000"),
47
+ org_id: zod_1.z
48
+ .string()
49
+ .uuid()
50
+ .nullish()
51
+ .default("00000000-0000-0000-0000-000000000000"),
52
+ name_url_slug: zod_1.z.string().optional().nullable(),
53
+ metadata: DatasetMetadataSchema.omit({
54
+ schema: true,
55
+ }).extend({
56
+ // File has already been uploaded to storage
57
+ type: zod_1.z.string(),
58
+ path: zod_1.z.string(),
59
+ name: zod_1.z.string(),
60
+ size: zod_1.z.number(),
61
+ width: zod_1.z.number().optional().nullable(),
62
+ height: zod_1.z.number().optional().nullable(),
63
+ // Will be determined from the file type
64
+ table_name: zod_1.z.string().optional().nullable(),
65
+ bucket: zod_1.z.string().optional().nullable(),
66
+ }),
67
+ });
68
+ exports.CreateDatasetFromFileSchema = CreateDatasetFromFileSchema;
69
+ const CreateDatasetFromSchemaSchema = assets_1.AssetSchema.partial()
70
+ .omit({
71
+ // id: true, // it's actually very important we take the id from the body
72
+ // It's the id of the file that was uploaded
73
+ // user_id: true,
74
+ })
75
+ .extend({
76
+ id: zod_1.z
77
+ .string()
78
+ .uuid()
79
+ .default(() => (0, uuidv7_1.uuidv7)()),
80
+ team_id: zod_1.z.string().uuid().default("00000000-0000-0000-0000-000000000000"),
81
+ org_id: zod_1.z.string().uuid().default("00000000-0000-0000-0000-000000000000"),
82
+ name_url_slug: zod_1.z.string().optional().nullable(),
83
+ });
84
+ exports.CreateDatasetFromSchemaSchema = CreateDatasetFromSchemaSchema;
85
+ const updateDatasetSchema = zod_1.z.object({
86
+ team_id: zod_1.z.string().uuid().nullable().optional(),
87
+ name_url_slug: zod_1.z.string().nullable().optional(),
88
+ name: zod_1.z.string().nullable().optional(),
89
+ description: zod_1.z.string().nullable().optional(),
90
+ visibility: index_1.VisibilitySchema.nullable().optional(),
91
+ monetization: index_1.MonetizationSchema.nullable().optional(),
92
+ price: zod_1.z.number().nullable().optional(),
93
+ metadata: zod_1.z
94
+ .object({
95
+ table_name: zod_1.z.string(),
96
+ })
97
+ .passthrough()
98
+ .optional()
99
+ .nullable(),
100
+ preview: zod_1.z.array(zod_1.z.object({}).passthrough()).optional().nullable(),
101
+ last_updated: zod_1.z.string().default(() => new Date().toISOString()),
102
+ });
103
+ exports.updateDatasetSchema = updateDatasetSchema;
@@ -0,0 +1,277 @@
1
+ import { z } from "zod";
2
+ declare const FileSchema: z.ZodObject<z.objectUtil.extendShape<{
3
+ id: z.ZodString;
4
+ user_id: z.ZodString;
5
+ user: z.ZodOptional<z.ZodObject<{
6
+ id: z.ZodOptional<z.ZodString>;
7
+ user_id: z.ZodOptional<z.ZodString>;
8
+ username: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
9
+ avatar_path: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
10
+ bio: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
11
+ urls: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
12
+ value: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ value: string;
15
+ }, {
16
+ value: string;
17
+ }>, "many">>>;
18
+ last_active: z.ZodOptional<z.ZodString>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id?: string | undefined;
21
+ user_id?: string | undefined;
22
+ avatar_path?: string | null | undefined;
23
+ urls?: {
24
+ value: string;
25
+ }[] | undefined;
26
+ username?: string | null | undefined;
27
+ bio?: string | null | undefined;
28
+ last_active?: string | undefined;
29
+ }, {
30
+ id?: string | undefined;
31
+ user_id?: string | undefined;
32
+ avatar_path?: string | null | undefined;
33
+ urls?: {
34
+ value: string;
35
+ }[] | undefined;
36
+ username?: string | null | undefined;
37
+ bio?: string | null | undefined;
38
+ last_active?: string | undefined;
39
+ }>>;
40
+ org_id: z.ZodString;
41
+ organization: z.ZodOptional<z.ZodObject<{
42
+ id: z.ZodOptional<z.ZodString>;
43
+ owner_id: z.ZodOptional<z.ZodString>;
44
+ name: z.ZodOptional<z.ZodString>;
45
+ avatar_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
46
+ mission: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
47
+ size: z.ZodOptional<z.ZodString>;
48
+ email: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
49
+ domain: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
50
+ urls: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
51
+ value: z.ZodString;
52
+ }, "strip", z.ZodTypeAny, {
53
+ value: string;
54
+ }, {
55
+ value: string;
56
+ }>, "many">>>>;
57
+ base_role: z.ZodOptional<z.ZodDefault<z.ZodEnum<["admin", "read", "write", "none"]>>>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ id?: string | undefined;
60
+ name?: string | undefined;
61
+ size?: string | undefined;
62
+ email?: string | null | undefined;
63
+ owner_id?: string | undefined;
64
+ avatar_path?: string | null | undefined;
65
+ mission?: string | null | undefined;
66
+ domain?: string | null | undefined;
67
+ urls?: {
68
+ value: string;
69
+ }[] | null | undefined;
70
+ base_role?: "none" | "admin" | "read" | "write" | undefined;
71
+ }, {
72
+ id?: string | undefined;
73
+ name?: string | undefined;
74
+ size?: string | undefined;
75
+ email?: string | null | undefined;
76
+ owner_id?: string | undefined;
77
+ avatar_path?: string | null | undefined;
78
+ mission?: string | null | undefined;
79
+ domain?: string | null | undefined;
80
+ urls?: {
81
+ value: string;
82
+ }[] | null | undefined;
83
+ base_role?: "none" | "admin" | "read" | "write" | undefined;
84
+ }>>;
85
+ team_id: z.ZodString;
86
+ team: z.ZodOptional<z.ZodObject<{
87
+ id: z.ZodOptional<z.ZodString>;
88
+ org_id: z.ZodOptional<z.ZodString>;
89
+ name: z.ZodOptional<z.ZodString>;
90
+ description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
91
+ default_role: z.ZodOptional<z.ZodEnum<["admin", "read", "write", "none"]>>;
92
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>>;
93
+ created_at: z.ZodOptional<z.ZodString>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ id?: string | undefined;
96
+ name?: string | undefined;
97
+ visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
98
+ description?: string | null | undefined;
99
+ org_id?: string | undefined;
100
+ created_at?: string | undefined;
101
+ default_role?: "none" | "admin" | "read" | "write" | undefined;
102
+ }, {
103
+ id?: string | undefined;
104
+ name?: string | undefined;
105
+ visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
106
+ description?: string | null | undefined;
107
+ org_id?: string | undefined;
108
+ created_at?: string | undefined;
109
+ default_role?: "none" | "admin" | "read" | "write" | undefined;
110
+ }>>;
111
+ parent_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
112
+ asset_type: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
113
+ name: z.ZodString;
114
+ name_url_slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
115
+ slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
116
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
117
+ visibility: z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>;
118
+ monetization: z.ZodEnum<["none", "pay-to-unlock", "pay-per-use"]>;
119
+ price: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
120
+ unit_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
121
+ cost_accounting: z.ZodNullable<z.ZodOptional<z.ZodEnum<["fixed", "variable"]>>>;
122
+ cost_unit: z.ZodNullable<z.ZodOptional<z.ZodString>>;
123
+ product_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
124
+ price_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
125
+ metadata: z.ZodNullable<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
126
+ preview: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">>>;
127
+ created_at: z.ZodString;
128
+ last_updated: z.ZodString;
129
+ }, {
130
+ metadata: z.ZodObject<{
131
+ eTag: z.ZodString;
132
+ size: z.ZodNumber;
133
+ mimetype: z.ZodString;
134
+ cacheControl: z.ZodString;
135
+ lastModified: z.ZodString;
136
+ }, "strip", z.ZodTypeAny, {
137
+ lastModified: string;
138
+ size: number;
139
+ eTag: string;
140
+ mimetype: string;
141
+ cacheControl: string;
142
+ }, {
143
+ lastModified: string;
144
+ size: number;
145
+ eTag: string;
146
+ mimetype: string;
147
+ cacheControl: string;
148
+ }>;
149
+ }>, "strip", z.ZodTypeAny, {
150
+ id: string;
151
+ name: string;
152
+ visibility: "inherit" | "private" | "public" | "organization" | "monetized";
153
+ metadata: {
154
+ lastModified: string;
155
+ size: number;
156
+ eTag: string;
157
+ mimetype: string;
158
+ cacheControl: string;
159
+ };
160
+ user_id: string;
161
+ org_id: string;
162
+ asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
163
+ created_at: string;
164
+ last_updated: string;
165
+ team_id: string;
166
+ monetization: "none" | "pay-to-unlock" | "pay-per-use";
167
+ description?: string | null | undefined;
168
+ user?: {
169
+ id?: string | undefined;
170
+ user_id?: string | undefined;
171
+ avatar_path?: string | null | undefined;
172
+ urls?: {
173
+ value: string;
174
+ }[] | undefined;
175
+ username?: string | null | undefined;
176
+ bio?: string | null | undefined;
177
+ last_active?: string | undefined;
178
+ } | undefined;
179
+ organization?: {
180
+ id?: string | undefined;
181
+ name?: string | undefined;
182
+ size?: string | undefined;
183
+ email?: string | null | undefined;
184
+ owner_id?: string | undefined;
185
+ avatar_path?: string | null | undefined;
186
+ mission?: string | null | undefined;
187
+ domain?: string | null | undefined;
188
+ urls?: {
189
+ value: string;
190
+ }[] | null | undefined;
191
+ base_role?: "none" | "admin" | "read" | "write" | undefined;
192
+ } | undefined;
193
+ team?: {
194
+ id?: string | undefined;
195
+ name?: string | undefined;
196
+ visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
197
+ description?: string | null | undefined;
198
+ org_id?: string | undefined;
199
+ created_at?: string | undefined;
200
+ default_role?: "none" | "admin" | "read" | "write" | undefined;
201
+ } | undefined;
202
+ parent_id?: string | null | undefined;
203
+ name_url_slug?: string | null | undefined;
204
+ slug?: string | null | undefined;
205
+ price?: number | null | undefined;
206
+ unit_cost?: number | null | undefined;
207
+ cost_accounting?: "fixed" | "variable" | null | undefined;
208
+ cost_unit?: string | null | undefined;
209
+ product_id?: string | null | undefined;
210
+ price_id?: string | null | undefined;
211
+ preview?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
212
+ }, {
213
+ id: string;
214
+ name: string;
215
+ visibility: "inherit" | "private" | "public" | "organization" | "monetized";
216
+ metadata: {
217
+ lastModified: string;
218
+ size: number;
219
+ eTag: string;
220
+ mimetype: string;
221
+ cacheControl: string;
222
+ };
223
+ user_id: string;
224
+ org_id: string;
225
+ asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
226
+ created_at: string;
227
+ last_updated: string;
228
+ team_id: string;
229
+ monetization: "none" | "pay-to-unlock" | "pay-per-use";
230
+ description?: string | null | undefined;
231
+ user?: {
232
+ id?: string | undefined;
233
+ user_id?: string | undefined;
234
+ avatar_path?: string | null | undefined;
235
+ urls?: {
236
+ value: string;
237
+ }[] | undefined;
238
+ username?: string | null | undefined;
239
+ bio?: string | null | undefined;
240
+ last_active?: string | undefined;
241
+ } | undefined;
242
+ organization?: {
243
+ id?: string | undefined;
244
+ name?: string | undefined;
245
+ size?: string | undefined;
246
+ email?: string | null | undefined;
247
+ owner_id?: string | undefined;
248
+ avatar_path?: string | null | undefined;
249
+ mission?: string | null | undefined;
250
+ domain?: string | null | undefined;
251
+ urls?: {
252
+ value: string;
253
+ }[] | null | undefined;
254
+ base_role?: "none" | "admin" | "read" | "write" | undefined;
255
+ } | undefined;
256
+ team?: {
257
+ id?: string | undefined;
258
+ name?: string | undefined;
259
+ visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
260
+ description?: string | null | undefined;
261
+ org_id?: string | undefined;
262
+ created_at?: string | undefined;
263
+ default_role?: "none" | "admin" | "read" | "write" | undefined;
264
+ } | undefined;
265
+ parent_id?: string | null | undefined;
266
+ name_url_slug?: string | null | undefined;
267
+ slug?: string | null | undefined;
268
+ price?: number | null | undefined;
269
+ unit_cost?: number | null | undefined;
270
+ cost_accounting?: "fixed" | "variable" | null | undefined;
271
+ cost_unit?: string | null | undefined;
272
+ product_id?: string | null | undefined;
273
+ price_id?: string | null | undefined;
274
+ preview?: z.objectInputType<{}, z.ZodTypeAny, "passthrough">[] | null | undefined;
275
+ }>;
276
+ type File = z.infer<typeof FileSchema>;
277
+ export { FileSchema, type File };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FileSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const assets_1 = require("@/schema/assets");
6
+ const FileSchema = assets_1.AssetSchema.extend({
7
+ metadata: zod_1.z.object({
8
+ eTag: zod_1.z.string(),
9
+ size: zod_1.z.number(),
10
+ mimetype: zod_1.z.string(),
11
+ cacheControl: zod_1.z.string(),
12
+ lastModified: zod_1.z.string(),
13
+ }),
14
+ // preview: z.array(z.object({}).passthrough()).optional().nullable(),
15
+ });
16
+ exports.FileSchema = FileSchema;
@@ -0,0 +1,80 @@
1
+ import { z } from "zod";
2
+ declare const AssetTypeSchema: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
3
+ declare const VisibilitySchema: z.ZodEnum<["public", "private", "organization", "monetized", "inherit"]>;
4
+ declare const RoleSchema: z.ZodEnum<["admin", "read", "write", "none"]>;
5
+ declare const MonetizationSchema: z.ZodEnum<["none", "pay-to-unlock", "pay-per-use"]>;
6
+ declare const EmbeddingSchema: z.ZodObject<{
7
+ id: z.ZodString;
8
+ user_id: z.ZodString;
9
+ org_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
+ embedding: z.ZodArray<z.ZodNumber, "many">;
11
+ content: z.ZodString;
12
+ asset_type: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
13
+ asset_id: z.ZodString;
14
+ metadata: z.ZodOptional<z.ZodNullable<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
15
+ created_at: z.ZodString;
16
+ last_updated: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ id: string;
19
+ content: string;
20
+ user_id: string;
21
+ embedding: number[];
22
+ asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
23
+ asset_id: string;
24
+ created_at: string;
25
+ last_updated: string;
26
+ metadata?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
27
+ org_id?: string | null | undefined;
28
+ }, {
29
+ id: string;
30
+ content: string;
31
+ user_id: string;
32
+ embedding: number[];
33
+ asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
34
+ asset_id: string;
35
+ created_at: string;
36
+ last_updated: string;
37
+ metadata?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | null | undefined;
38
+ org_id?: string | null | undefined;
39
+ }>;
40
+ declare const ConnectionSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ user_id: z.ZodString;
43
+ type: z.ZodEnum<["comment", "reference", "mention", "action"]>;
44
+ action_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
+ source_id: z.ZodString;
46
+ target_id: z.ZodString;
47
+ source_asset_type: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
48
+ target_asset_type: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
49
+ created_at: z.ZodString;
50
+ last_updated: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ type: "action" | "comment" | "reference" | "mention";
53
+ id: string;
54
+ user_id: string;
55
+ created_at: string;
56
+ last_updated: string;
57
+ source_id: string;
58
+ target_id: string;
59
+ source_asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
60
+ target_asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
61
+ action_id?: string | null | undefined;
62
+ }, {
63
+ type: "action" | "comment" | "reference" | "mention";
64
+ id: string;
65
+ user_id: string;
66
+ created_at: string;
67
+ last_updated: string;
68
+ source_id: string;
69
+ target_id: string;
70
+ source_asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
71
+ target_asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
72
+ action_id?: string | null | undefined;
73
+ }>;
74
+ type Role = z.infer<typeof RoleSchema>;
75
+ type Connection = z.infer<typeof ConnectionSchema>;
76
+ type Embedding = z.infer<typeof EmbeddingSchema>;
77
+ type Visibility = z.infer<typeof VisibilitySchema>;
78
+ type Monetization = z.infer<typeof MonetizationSchema>;
79
+ type AssetTypes = z.infer<typeof AssetTypeSchema>;
80
+ export { RoleSchema, VisibilitySchema, MonetizationSchema, ConnectionSchema, EmbeddingSchema, AssetTypeSchema, type Role, type Connection, type Embedding, type Visibility, type Monetization, type AssetTypes, };
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AssetTypeSchema = exports.EmbeddingSchema = exports.ConnectionSchema = exports.MonetizationSchema = exports.VisibilitySchema = exports.RoleSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const AssetTypeSchema = zod_1.z.enum([
6
+ "user",
7
+ "organization",
8
+ "team",
9
+ "dataset",
10
+ "file",
11
+ "service",
12
+ "route",
13
+ "post",
14
+ "comment",
15
+ "conversation",
16
+ "blueprint",
17
+ "replication",
18
+ ]);
19
+ exports.AssetTypeSchema = AssetTypeSchema;
20
+ const VisibilitySchema = zod_1.z.enum([
21
+ "public",
22
+ "private",
23
+ "organization",
24
+ "monetized",
25
+ "inherit",
26
+ ]);
27
+ exports.VisibilitySchema = VisibilitySchema;
28
+ const RoleSchema = zod_1.z.enum(["admin", "read", "write", "none"]);
29
+ exports.RoleSchema = RoleSchema;
30
+ const MonetizationSchema = zod_1.z.enum(["none", "pay-to-unlock", "pay-per-use"]);
31
+ exports.MonetizationSchema = MonetizationSchema;
32
+ const EmbeddingSchema = zod_1.z.object({
33
+ id: zod_1.z.string(),
34
+ user_id: zod_1.z.string(),
35
+ org_id: zod_1.z.string().nullable().optional(),
36
+ embedding: zod_1.z.array(zod_1.z.number()),
37
+ content: zod_1.z.string(),
38
+ asset_type: AssetTypeSchema,
39
+ asset_id: zod_1.z.string(),
40
+ metadata: zod_1.z.object({}).passthrough().nullable().optional(),
41
+ created_at: zod_1.z.string(),
42
+ last_updated: zod_1.z.string(),
43
+ });
44
+ exports.EmbeddingSchema = EmbeddingSchema;
45
+ const ConnectionTypeSchema = zod_1.z.enum([
46
+ "comment",
47
+ "reference",
48
+ "mention",
49
+ "action",
50
+ ]);
51
+ const ConnectionSchema = zod_1.z.object({
52
+ id: zod_1.z.string().uuid(),
53
+ user_id: zod_1.z.string().uuid(),
54
+ type: ConnectionTypeSchema,
55
+ action_id: zod_1.z.string().uuid().optional().nullable(),
56
+ source_id: zod_1.z.string().uuid(),
57
+ target_id: zod_1.z.string().uuid(),
58
+ source_asset_type: AssetTypeSchema,
59
+ target_asset_type: AssetTypeSchema,
60
+ created_at: zod_1.z.string(),
61
+ last_updated: zod_1.z.string(),
62
+ });
63
+ exports.ConnectionSchema = ConnectionSchema;
@@ -0,0 +1,97 @@
1
+ import { z } from "zod";
2
+ declare const NotificationSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ source_user_id: z.ZodString;
5
+ destination_user_id: z.ZodString;
6
+ org_id: z.ZodString;
7
+ asset_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
8
+ type: z.ZodEnum<["follow", "like", "comment", "reply", "mention", "reference", "invite", "payment", "event", "share", "other"]>;
9
+ content: z.ZodObject<{
10
+ text: z.ZodOptional<z.ZodString>;
11
+ asset: z.ZodOptional<z.ZodObject<{
12
+ assetId: z.ZodString;
13
+ assetType: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ assetId: string;
16
+ assetType: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
17
+ }, {
18
+ assetId: string;
19
+ assetType: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
20
+ }>>;
21
+ mention: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
22
+ event: z.ZodOptional<z.ZodObject<{
23
+ type: z.ZodEnum<["success", "error"]>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ type: "error" | "success";
26
+ }, {
27
+ type: "error" | "success";
28
+ }>>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ text?: string | undefined;
31
+ event?: {
32
+ type: "error" | "success";
33
+ } | undefined;
34
+ mention?: {} | undefined;
35
+ asset?: {
36
+ assetId: string;
37
+ assetType: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
38
+ } | undefined;
39
+ }, {
40
+ text?: string | undefined;
41
+ event?: {
42
+ type: "error" | "success";
43
+ } | undefined;
44
+ mention?: {} | undefined;
45
+ asset?: {
46
+ assetId: string;
47
+ assetType: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
48
+ } | undefined;
49
+ }>;
50
+ viewed: z.ZodBoolean;
51
+ created_at: z.ZodString;
52
+ last_updated: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ type: "follow" | "event" | "other" | "comment" | "reference" | "mention" | "like" | "reply" | "invite" | "payment" | "share";
55
+ id: string;
56
+ content: {
57
+ text?: string | undefined;
58
+ event?: {
59
+ type: "error" | "success";
60
+ } | undefined;
61
+ mention?: {} | undefined;
62
+ asset?: {
63
+ assetId: string;
64
+ assetType: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
65
+ } | undefined;
66
+ };
67
+ org_id: string;
68
+ created_at: string;
69
+ last_updated: string;
70
+ source_user_id: string;
71
+ destination_user_id: string;
72
+ viewed: boolean;
73
+ asset_id?: string | null | undefined;
74
+ }, {
75
+ type: "follow" | "event" | "other" | "comment" | "reference" | "mention" | "like" | "reply" | "invite" | "payment" | "share";
76
+ id: string;
77
+ content: {
78
+ text?: string | undefined;
79
+ event?: {
80
+ type: "error" | "success";
81
+ } | undefined;
82
+ mention?: {} | undefined;
83
+ asset?: {
84
+ assetId: string;
85
+ assetType: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
86
+ } | undefined;
87
+ };
88
+ org_id: string;
89
+ created_at: string;
90
+ last_updated: string;
91
+ source_user_id: string;
92
+ destination_user_id: string;
93
+ viewed: boolean;
94
+ asset_id?: string | null | undefined;
95
+ }>;
96
+ type Notification = z.infer<typeof NotificationSchema>;
97
+ export { NotificationSchema, type Notification };