@ourofoundation/ouro-js 1.0.2 → 1.0.4
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 +5 -3
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/schema/assets.d.ts +254 -10
- package/dist/schema/assets.js +27 -1
- package/dist/schema/assets.js.map +1 -1
- package/dist/schema/blueprints.d.ts +21 -25
- package/dist/schema/comments.d.ts +20 -24
- package/dist/schema/common.d.ts +16 -14
- package/dist/schema/common.js +6 -4
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/conversations.d.ts +27 -33
- package/dist/schema/datasets.d.ts +401 -161
- package/dist/schema/datasets.js +28 -82
- package/dist/schema/datasets.js.map +1 -1
- package/dist/schema/files.d.ts +879 -29
- package/dist/schema/files.js +44 -9
- package/dist/schema/files.js.map +1 -1
- package/dist/schema/notifications.d.ts +7 -7
- package/dist/schema/organizations.d.ts +0 -3
- package/dist/schema/organizations.js +0 -1
- package/dist/schema/organizations.js.map +1 -1
- package/dist/schema/posts.d.ts +320 -163
- package/dist/schema/posts.js +9 -14
- package/dist/schema/posts.js.map +1 -1
- package/dist/schema/replications.d.ts +21 -25
- package/dist/schema/teams.d.ts +0 -10
- package/dist/utils/dataset.d.ts +7 -0
- package/dist/utils/dataset.js +19 -0
- package/dist/utils/dataset.js.map +1 -0
- package/dist/utils/navigate.d.ts +11 -0
- package/dist/utils/navigate.js +67 -0
- package/dist/utils/navigate.js.map +1 -0
- package/package.json +1 -1
package/dist/schema/posts.js
CHANGED
|
@@ -5,21 +5,8 @@ const uuidv7_1 = require("uuidv7");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
const assets_1 = require("./assets");
|
|
7
7
|
const common_1 = require("./common");
|
|
8
|
-
const PostSchema = assets_1.AssetSchema.extend({
|
|
9
|
-
name: zod_1.z.string().nullable(),
|
|
10
|
-
asset_type: common_1.AssetTypeSchema.refine((x) => ["post", "comment"].includes(x)),
|
|
11
|
-
preview: zod_1.z
|
|
12
|
-
.object({
|
|
13
|
-
type: zod_1.z.string().refine((x) => x === "doc"),
|
|
14
|
-
content: zod_1.z.array(zod_1.z.object({}).passthrough()),
|
|
15
|
-
})
|
|
16
|
-
.optional()
|
|
17
|
-
.nullable()
|
|
18
|
-
.default({ type: "doc", content: [] }),
|
|
19
|
-
});
|
|
20
|
-
exports.PostSchema = PostSchema;
|
|
21
8
|
const TipTapSchema = zod_1.z.object({
|
|
22
|
-
type: zod_1.z.
|
|
9
|
+
type: zod_1.z.literal("doc"),
|
|
23
10
|
content: zod_1.z.array(zod_1.z.object({}).passthrough()),
|
|
24
11
|
});
|
|
25
12
|
exports.TipTapSchema = TipTapSchema;
|
|
@@ -28,6 +15,14 @@ const ContentSchema = zod_1.z.object({
|
|
|
28
15
|
text: zod_1.z.string(),
|
|
29
16
|
});
|
|
30
17
|
exports.ContentSchema = ContentSchema;
|
|
18
|
+
const PostSchema = assets_1.AssetSchema.extend({
|
|
19
|
+
name: zod_1.z.string().nullable(),
|
|
20
|
+
asset_type: common_1.AssetTypeSchema.refine((x) => ["post", "comment"].includes(x)),
|
|
21
|
+
// TODO: make this ContentSchema
|
|
22
|
+
preview: TipTapSchema.default({ type: "doc", content: [] }),
|
|
23
|
+
content: ContentSchema,
|
|
24
|
+
});
|
|
25
|
+
exports.PostSchema = PostSchema;
|
|
31
26
|
const CreatePostSchema = PostSchema.partial()
|
|
32
27
|
.omit({
|
|
33
28
|
id: true,
|
package/dist/schema/posts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/schema/posts.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,6BAAwB;AAExB,qCAAuC;AACvC,qCAKkB;AAElB,MAAM,
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/schema/posts.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAChC,6B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AM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;CACjE,CAAC,CAAC;AAmBD,4CAAgB"}
|
|
@@ -40,7 +40,6 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
40
40
|
org_id: z.ZodString;
|
|
41
41
|
organization: z.ZodOptional<z.ZodObject<{
|
|
42
42
|
id: z.ZodOptional<z.ZodString>;
|
|
43
|
-
owner_id: z.ZodOptional<z.ZodString>;
|
|
44
43
|
name: z.ZodOptional<z.ZodString>;
|
|
45
44
|
avatar_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
46
45
|
mission: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -60,7 +59,6 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
60
59
|
name?: string | undefined;
|
|
61
60
|
size?: string | undefined;
|
|
62
61
|
email?: string | null | undefined;
|
|
63
|
-
owner_id?: string | undefined;
|
|
64
62
|
avatar_path?: string | null | undefined;
|
|
65
63
|
mission?: string | null | undefined;
|
|
66
64
|
domain?: string | null | undefined;
|
|
@@ -73,7 +71,6 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
73
71
|
name?: string | undefined;
|
|
74
72
|
size?: string | undefined;
|
|
75
73
|
email?: string | null | undefined;
|
|
76
|
-
owner_id?: string | undefined;
|
|
77
74
|
avatar_path?: string | null | undefined;
|
|
78
75
|
mission?: string | null | undefined;
|
|
79
76
|
domain?: string | null | undefined;
|
|
@@ -109,7 +106,7 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
109
106
|
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
110
107
|
}>>;
|
|
111
108
|
parent_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
112
|
-
asset_type: z.ZodEnum<["
|
|
109
|
+
asset_type: z.ZodEnum<["dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
|
|
113
110
|
name: z.ZodString;
|
|
114
111
|
name_url_slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
115
112
|
slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -124,10 +121,11 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
124
121
|
price_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
125
122
|
metadata: z.ZodNullable<z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>>;
|
|
126
123
|
preview: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>, "many">>>;
|
|
124
|
+
state: z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>;
|
|
127
125
|
created_at: z.ZodString;
|
|
128
126
|
last_updated: z.ZodString;
|
|
129
127
|
}, {
|
|
130
|
-
asset_type: z.ZodEffects<z.ZodEnum<["
|
|
128
|
+
asset_type: z.ZodEffects<z.ZodEnum<["dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>, "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication", "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication">;
|
|
131
129
|
metadata: z.ZodObject<{
|
|
132
130
|
schedule: z.ZodOptional<z.ZodObject<{
|
|
133
131
|
cron: z.ZodString;
|
|
@@ -166,11 +164,12 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
166
164
|
};
|
|
167
165
|
user_id: string;
|
|
168
166
|
org_id: string;
|
|
169
|
-
asset_type: "file" | "dataset" | "
|
|
167
|
+
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
170
168
|
created_at: string;
|
|
171
169
|
last_updated: string;
|
|
172
170
|
team_id: string;
|
|
173
171
|
monetization: "none" | "pay-to-unlock" | "pay-per-use";
|
|
172
|
+
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
174
173
|
description?: string | null | undefined;
|
|
175
174
|
user?: {
|
|
176
175
|
id?: string | undefined;
|
|
@@ -188,7 +187,6 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
188
187
|
name?: string | undefined;
|
|
189
188
|
size?: string | undefined;
|
|
190
189
|
email?: string | null | undefined;
|
|
191
|
-
owner_id?: string | undefined;
|
|
192
190
|
avatar_path?: string | null | undefined;
|
|
193
191
|
mission?: string | null | undefined;
|
|
194
192
|
domain?: string | null | undefined;
|
|
@@ -229,11 +227,12 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
229
227
|
};
|
|
230
228
|
user_id: string;
|
|
231
229
|
org_id: string;
|
|
232
|
-
asset_type: "file" | "dataset" | "
|
|
230
|
+
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
233
231
|
created_at: string;
|
|
234
232
|
last_updated: string;
|
|
235
233
|
team_id: string;
|
|
236
234
|
monetization: "none" | "pay-to-unlock" | "pay-per-use";
|
|
235
|
+
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
237
236
|
description?: string | null | undefined;
|
|
238
237
|
user?: {
|
|
239
238
|
id?: string | undefined;
|
|
@@ -251,7 +250,6 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
251
250
|
name?: string | undefined;
|
|
252
251
|
size?: string | undefined;
|
|
253
252
|
email?: string | null | undefined;
|
|
254
|
-
owner_id?: string | undefined;
|
|
255
253
|
avatar_path?: string | null | undefined;
|
|
256
254
|
mission?: string | null | undefined;
|
|
257
255
|
domain?: string | null | undefined;
|
|
@@ -321,7 +319,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
321
319
|
org_id: z.ZodOptional<z.ZodString>;
|
|
322
320
|
organization: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
323
321
|
id: z.ZodOptional<z.ZodString>;
|
|
324
|
-
owner_id: z.ZodOptional<z.ZodString>;
|
|
325
322
|
name: z.ZodOptional<z.ZodString>;
|
|
326
323
|
avatar_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
327
324
|
mission: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -341,7 +338,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
341
338
|
name?: string | undefined;
|
|
342
339
|
size?: string | undefined;
|
|
343
340
|
email?: string | null | undefined;
|
|
344
|
-
owner_id?: string | undefined;
|
|
345
341
|
avatar_path?: string | null | undefined;
|
|
346
342
|
mission?: string | null | undefined;
|
|
347
343
|
domain?: string | null | undefined;
|
|
@@ -354,7 +350,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
354
350
|
name?: string | undefined;
|
|
355
351
|
size?: string | undefined;
|
|
356
352
|
email?: string | null | undefined;
|
|
357
|
-
owner_id?: string | undefined;
|
|
358
353
|
avatar_path?: string | null | undefined;
|
|
359
354
|
mission?: string | null | undefined;
|
|
360
355
|
domain?: string | null | undefined;
|
|
@@ -403,9 +398,10 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
403
398
|
product_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
404
399
|
price_id: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodString>>>;
|
|
405
400
|
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">>>>;
|
|
401
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
406
402
|
created_at: z.ZodOptional<z.ZodString>;
|
|
407
403
|
last_updated: z.ZodOptional<z.ZodString>;
|
|
408
|
-
asset_type: z.ZodOptional<z.ZodEffects<z.ZodEnum<["
|
|
404
|
+
asset_type: z.ZodOptional<z.ZodEffects<z.ZodEnum<["dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>, "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication", "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication">>;
|
|
409
405
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
410
406
|
schedule: z.ZodOptional<z.ZodObject<{
|
|
411
407
|
cron: z.ZodString;
|
|
@@ -441,6 +437,7 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
441
437
|
org_id: string;
|
|
442
438
|
team_id: string;
|
|
443
439
|
name_url_slug: string;
|
|
440
|
+
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
444
441
|
name?: string | undefined;
|
|
445
442
|
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
446
443
|
metadata?: z.objectOutputType<{
|
|
@@ -469,7 +466,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
469
466
|
name?: string | undefined;
|
|
470
467
|
size?: string | undefined;
|
|
471
468
|
email?: string | null | undefined;
|
|
472
|
-
owner_id?: string | undefined;
|
|
473
469
|
avatar_path?: string | null | undefined;
|
|
474
470
|
mission?: string | null | undefined;
|
|
475
471
|
domain?: string | null | undefined;
|
|
@@ -478,6 +474,10 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
478
474
|
}[] | null | undefined;
|
|
479
475
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
480
476
|
} | undefined;
|
|
477
|
+
user_id?: string | undefined;
|
|
478
|
+
asset_type?: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
479
|
+
created_at?: string | undefined;
|
|
480
|
+
last_updated?: string | undefined;
|
|
481
481
|
team?: {
|
|
482
482
|
id?: string | undefined;
|
|
483
483
|
name?: string | undefined;
|
|
@@ -487,10 +487,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
487
487
|
created_at?: string | undefined;
|
|
488
488
|
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
489
489
|
} | undefined;
|
|
490
|
-
user_id?: string | undefined;
|
|
491
|
-
asset_type?: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
492
|
-
created_at?: string | undefined;
|
|
493
|
-
last_updated?: string | undefined;
|
|
494
490
|
parent_id?: string | null | undefined;
|
|
495
491
|
slug?: string | null | undefined;
|
|
496
492
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
@@ -504,6 +500,7 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
504
500
|
}, {
|
|
505
501
|
name_url_slug: string;
|
|
506
502
|
id?: string | undefined;
|
|
503
|
+
state?: "error" | "in-progress" | "success" | "queued" | null | undefined;
|
|
507
504
|
name?: string | undefined;
|
|
508
505
|
visibility?: "inherit" | "private" | "public" | "organization" | "monetized" | undefined;
|
|
509
506
|
metadata?: z.objectInputType<{
|
|
@@ -532,7 +529,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
532
529
|
name?: string | undefined;
|
|
533
530
|
size?: string | undefined;
|
|
534
531
|
email?: string | null | undefined;
|
|
535
|
-
owner_id?: string | undefined;
|
|
536
532
|
avatar_path?: string | null | undefined;
|
|
537
533
|
mission?: string | null | undefined;
|
|
538
534
|
domain?: string | null | undefined;
|
|
@@ -541,6 +537,12 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
541
537
|
}[] | null | undefined;
|
|
542
538
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
543
539
|
} | undefined;
|
|
540
|
+
user_id?: string | undefined;
|
|
541
|
+
org_id?: string | undefined;
|
|
542
|
+
asset_type?: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
543
|
+
created_at?: string | undefined;
|
|
544
|
+
last_updated?: string | undefined;
|
|
545
|
+
team_id?: string | undefined;
|
|
544
546
|
team?: {
|
|
545
547
|
id?: string | undefined;
|
|
546
548
|
name?: string | undefined;
|
|
@@ -550,12 +552,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
550
552
|
created_at?: string | undefined;
|
|
551
553
|
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
552
554
|
} | undefined;
|
|
553
|
-
user_id?: string | undefined;
|
|
554
|
-
org_id?: string | undefined;
|
|
555
|
-
asset_type?: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
556
|
-
created_at?: string | undefined;
|
|
557
|
-
last_updated?: string | undefined;
|
|
558
|
-
team_id?: string | undefined;
|
|
559
555
|
parent_id?: string | null | undefined;
|
|
560
556
|
slug?: string | null | undefined;
|
|
561
557
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
package/dist/schema/teams.d.ts
CHANGED
|
@@ -143,7 +143,6 @@ declare const ReadTeamSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
143
143
|
}>, "many">;
|
|
144
144
|
organization: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
145
145
|
id: z.ZodOptional<z.ZodString>;
|
|
146
|
-
owner_id: z.ZodOptional<z.ZodString>;
|
|
147
146
|
name: z.ZodOptional<z.ZodString>;
|
|
148
147
|
avatar_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
149
148
|
mission: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -163,7 +162,6 @@ declare const ReadTeamSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
163
162
|
name?: string | undefined;
|
|
164
163
|
size?: string | undefined;
|
|
165
164
|
email?: string | null | undefined;
|
|
166
|
-
owner_id?: string | undefined;
|
|
167
165
|
avatar_path?: string | null | undefined;
|
|
168
166
|
mission?: string | null | undefined;
|
|
169
167
|
domain?: string | null | undefined;
|
|
@@ -176,7 +174,6 @@ declare const ReadTeamSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
176
174
|
name?: string | undefined;
|
|
177
175
|
size?: string | undefined;
|
|
178
176
|
email?: string | null | undefined;
|
|
179
|
-
owner_id?: string | undefined;
|
|
180
177
|
avatar_path?: string | null | undefined;
|
|
181
178
|
mission?: string | null | undefined;
|
|
182
179
|
domain?: string | null | undefined;
|
|
@@ -214,7 +211,6 @@ declare const ReadTeamSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
214
211
|
name?: string | undefined;
|
|
215
212
|
size?: string | undefined;
|
|
216
213
|
email?: string | null | undefined;
|
|
217
|
-
owner_id?: string | undefined;
|
|
218
214
|
avatar_path?: string | null | undefined;
|
|
219
215
|
mission?: string | null | undefined;
|
|
220
216
|
domain?: string | null | undefined;
|
|
@@ -256,7 +252,6 @@ declare const ReadTeamSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
256
252
|
name?: string | undefined;
|
|
257
253
|
size?: string | undefined;
|
|
258
254
|
email?: string | null | undefined;
|
|
259
|
-
owner_id?: string | undefined;
|
|
260
255
|
avatar_path?: string | null | undefined;
|
|
261
256
|
mission?: string | null | undefined;
|
|
262
257
|
domain?: string | null | undefined;
|
|
@@ -359,7 +354,6 @@ declare const ReadTeamsSchema: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z
|
|
|
359
354
|
}>, "many">;
|
|
360
355
|
organization: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
361
356
|
id: z.ZodOptional<z.ZodString>;
|
|
362
|
-
owner_id: z.ZodOptional<z.ZodString>;
|
|
363
357
|
name: z.ZodOptional<z.ZodString>;
|
|
364
358
|
avatar_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
365
359
|
mission: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
@@ -379,7 +373,6 @@ declare const ReadTeamsSchema: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z
|
|
|
379
373
|
name?: string | undefined;
|
|
380
374
|
size?: string | undefined;
|
|
381
375
|
email?: string | null | undefined;
|
|
382
|
-
owner_id?: string | undefined;
|
|
383
376
|
avatar_path?: string | null | undefined;
|
|
384
377
|
mission?: string | null | undefined;
|
|
385
378
|
domain?: string | null | undefined;
|
|
@@ -392,7 +385,6 @@ declare const ReadTeamsSchema: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z
|
|
|
392
385
|
name?: string | undefined;
|
|
393
386
|
size?: string | undefined;
|
|
394
387
|
email?: string | null | undefined;
|
|
395
|
-
owner_id?: string | undefined;
|
|
396
388
|
avatar_path?: string | null | undefined;
|
|
397
389
|
mission?: string | null | undefined;
|
|
398
390
|
domain?: string | null | undefined;
|
|
@@ -435,7 +427,6 @@ declare const ReadTeamsSchema: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z
|
|
|
435
427
|
name?: string | undefined;
|
|
436
428
|
size?: string | undefined;
|
|
437
429
|
email?: string | null | undefined;
|
|
438
|
-
owner_id?: string | undefined;
|
|
439
430
|
avatar_path?: string | null | undefined;
|
|
440
431
|
mission?: string | null | undefined;
|
|
441
432
|
domain?: string | null | undefined;
|
|
@@ -479,7 +470,6 @@ declare const ReadTeamsSchema: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<z
|
|
|
479
470
|
name?: string | undefined;
|
|
480
471
|
size?: string | undefined;
|
|
481
472
|
email?: string | null | undefined;
|
|
482
|
-
owner_id?: string | undefined;
|
|
483
473
|
avatar_path?: string | null | undefined;
|
|
484
474
|
mission?: string | null | undefined;
|
|
485
475
|
domain?: string | null | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterListToString = void 0;
|
|
4
|
+
// Convert a list of filter object into a filter string for URL
|
|
5
|
+
function filterListToString(filters, onlyActive = false) {
|
|
6
|
+
if (!filters || !Array.isArray(filters))
|
|
7
|
+
return "";
|
|
8
|
+
return filters
|
|
9
|
+
.map((filter) => {
|
|
10
|
+
// If onlyActive is true, only include filters that have active property true, or without active property (different creation source)
|
|
11
|
+
if (onlyActive &&
|
|
12
|
+
(filter.hasOwnProperty("active") ? !filter.active : false))
|
|
13
|
+
return "";
|
|
14
|
+
return `${filter.column}.${filter.operator}.${filter.value}`;
|
|
15
|
+
})
|
|
16
|
+
.join(",");
|
|
17
|
+
}
|
|
18
|
+
exports.filterListToString = filterListToString;
|
|
19
|
+
//# sourceMappingURL=dataset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../src/utils/dataset.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAC/D,SAAS,kBAAkB,CACzB,OAKG,EACH,UAAU,GAAG,KAAK;IAElB,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnD,OAAO,OAAO;SACX,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,qIAAqI;QACrI,IACE,UAAU;YACV,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC;YAE1D,OAAO,EAAE,CAAC;QACZ,OAAO,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;IAC/D,CAAC,CAAC;SACD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAEQ,gDAAkB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const createNameUrlSlug: (name: string) => string;
|
|
2
|
+
declare const createUrlSlug: (asset: any) => string;
|
|
3
|
+
declare const getAssetUrl: (asset: any, config?: {
|
|
4
|
+
intent?: "share";
|
|
5
|
+
filters?: {
|
|
6
|
+
column: string;
|
|
7
|
+
value: string;
|
|
8
|
+
operator: string;
|
|
9
|
+
}[];
|
|
10
|
+
}) => string;
|
|
11
|
+
export { getAssetUrl, createUrlSlug, createNameUrlSlug };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNameUrlSlug = exports.createUrlSlug = exports.getAssetUrl = void 0;
|
|
4
|
+
const dataset_1 = require("./dataset");
|
|
5
|
+
const createNameUrlSlug = (name) => {
|
|
6
|
+
return (name
|
|
7
|
+
// Convert to lowercase
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
// Normalize unicode characters
|
|
10
|
+
.normalize("NFD")
|
|
11
|
+
// Remove diacritical marks
|
|
12
|
+
.replace(/[\u0300-\u036f]/g, "")
|
|
13
|
+
// Replace spaces, forward slashes, and underscores with hyphens
|
|
14
|
+
.replace(/[\s\/\_]+/g, "-")
|
|
15
|
+
// Remove special characters
|
|
16
|
+
.replace(/[^\w\-]+/g, "")
|
|
17
|
+
// Remove multiple consecutive hyphens
|
|
18
|
+
.replace(/\-\-+/g, "-")
|
|
19
|
+
// Trim hyphens from start and end
|
|
20
|
+
.replace(/^-+/, "")
|
|
21
|
+
.replace(/-+$/, ""));
|
|
22
|
+
};
|
|
23
|
+
exports.createNameUrlSlug = createNameUrlSlug;
|
|
24
|
+
const createUrlSlug = (asset) => {
|
|
25
|
+
if (asset.asset_type === "conversation") {
|
|
26
|
+
return `/conversations/${asset.id}`;
|
|
27
|
+
}
|
|
28
|
+
const entityName = asset.org_id !== "00000000-0000-0000-0000-000000000000"
|
|
29
|
+
? asset.organization.name
|
|
30
|
+
: asset.user.username;
|
|
31
|
+
const name = asset.name ? createNameUrlSlug(asset.name) : asset.id;
|
|
32
|
+
const assetType = asset.asset_type;
|
|
33
|
+
return `/${assetType}s/${entityName}/${name}`;
|
|
34
|
+
};
|
|
35
|
+
exports.createUrlSlug = createUrlSlug;
|
|
36
|
+
const getParentAssetUrl = (asset, config) => {
|
|
37
|
+
if (!(asset === null || asset === void 0 ? void 0 : asset.parent))
|
|
38
|
+
return "#";
|
|
39
|
+
const postfix = asset.asset_type === "comment" ? `#comment-${asset.id}` : "";
|
|
40
|
+
return `${getAssetUrl(asset.parent, config)}${postfix}`;
|
|
41
|
+
};
|
|
42
|
+
const getAssetUrl = (asset, config) => {
|
|
43
|
+
const assetType = (asset === null || asset === void 0 ? void 0 : asset.asset_type) || (asset === null || asset === void 0 ? void 0 : asset.assetType);
|
|
44
|
+
const slug = (asset === null || asset === void 0 ? void 0 : asset.slug) || createUrlSlug(asset);
|
|
45
|
+
const pathPostfix = (config === null || config === void 0 ? void 0 : config.intent) ? `?intent=${config.intent}` : "";
|
|
46
|
+
// Gradual conversion to new URL
|
|
47
|
+
let url = [
|
|
48
|
+
"file",
|
|
49
|
+
"dataset",
|
|
50
|
+
"service",
|
|
51
|
+
"route",
|
|
52
|
+
"post",
|
|
53
|
+
"blueprint",
|
|
54
|
+
"replication",
|
|
55
|
+
"conversation",
|
|
56
|
+
].includes(assetType)
|
|
57
|
+
? `${slug}${pathPostfix}`
|
|
58
|
+
: ["comment"].includes(assetType)
|
|
59
|
+
? getParentAssetUrl(asset, config)
|
|
60
|
+
: "#";
|
|
61
|
+
if (config === null || config === void 0 ? void 0 : config.filters) {
|
|
62
|
+
url += `?filters=${(0, dataset_1.filterListToString)(config.filters)}`;
|
|
63
|
+
}
|
|
64
|
+
return url;
|
|
65
|
+
};
|
|
66
|
+
exports.getAssetUrl = getAssetUrl;
|
|
67
|
+
//# sourceMappingURL=navigate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigate.js","sourceRoot":"","sources":["../../src/utils/navigate.ts"],"names":[],"mappings":";;;AAAA,uCAA+C;AAE/C,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;IACzC,OAAO,CACL,IAAI;QACF,uBAAuB;SACtB,WAAW,EAAE;QACd,+BAA+B;SAC9B,SAAS,CAAC,KAAK,CAAC;QACjB,2BAA2B;SAC1B,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;QAChC,gEAAgE;SAC/D,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC;QAC3B,4BAA4B;SAC3B,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;QACzB,sCAAsC;SACrC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;QACvB,kCAAkC;SACjC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,CAAC;AACJ,CAAC,CAAC;AAsDmC,8CAAiB;AApDtD,MAAM,aAAa,GAAG,CAAC,KAAU,EAAE,EAAE;IACnC,IAAI,KAAK,CAAC,UAAU,KAAK,cAAc,EAAE;QACvC,OAAO,kBAAkB,KAAK,CAAC,EAAE,EAAE,CAAC;KACrC;IACD,MAAM,UAAU,GACd,KAAK,CAAC,MAAM,KAAK,sCAAsC;QACrD,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI;QACzB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC;IAC1B,MA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