@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/files.js
CHANGED
|
@@ -1,17 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileSchema = void 0;
|
|
3
|
+
exports.updateFileSchema = exports.CreateFileSchema = exports.FileSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const assets_1 = require("./assets");
|
|
6
|
+
const common_1 = require("./common");
|
|
7
|
+
const FileMetadataSchema = zod_1.z.object({
|
|
8
|
+
id: zod_1.z.string().uuid(),
|
|
9
|
+
path: zod_1.z.string(),
|
|
10
|
+
bucket: zod_1.z.enum(["public-files", "files"]),
|
|
11
|
+
name: zod_1.z.string(),
|
|
12
|
+
type: zod_1.z.string(),
|
|
13
|
+
size: zod_1.z.number(),
|
|
14
|
+
// If the file is an image, we store width and height
|
|
15
|
+
width: zod_1.z.number().optional(),
|
|
16
|
+
height: zod_1.z.number().optional(),
|
|
17
|
+
});
|
|
6
18
|
const FileSchema = assets_1.AssetSchema.extend({
|
|
7
|
-
|
|
8
|
-
|
|
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(),
|
|
19
|
+
asset_type: common_1.AssetTypeSchema.refine((val) => val === "file"),
|
|
20
|
+
metadata: FileMetadataSchema,
|
|
15
21
|
});
|
|
16
22
|
exports.FileSchema = FileSchema;
|
|
23
|
+
const CreateFileSchema = zod_1.z.discriminatedUnion("state", [
|
|
24
|
+
// Success state, file is ready
|
|
25
|
+
assets_1.CreateAssetSchema.extend({
|
|
26
|
+
asset_type: common_1.AssetTypeSchema.refine((val) => val === "file"),
|
|
27
|
+
state: zod_1.z.literal("success"),
|
|
28
|
+
metadata: FileMetadataSchema,
|
|
29
|
+
}),
|
|
30
|
+
// In-progress state, file is being processed
|
|
31
|
+
assets_1.CreateAssetSchema.extend({
|
|
32
|
+
asset_type: common_1.AssetTypeSchema.refine((val) => val === "file"),
|
|
33
|
+
state: zod_1.z.literal("in-progress"),
|
|
34
|
+
metadata: zod_1.z.object({
|
|
35
|
+
type: zod_1.z.string(),
|
|
36
|
+
}),
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
exports.CreateFileSchema = CreateFileSchema;
|
|
40
|
+
const updateFileSchema = FileSchema.partial()
|
|
41
|
+
.omit({
|
|
42
|
+
user_id: true,
|
|
43
|
+
id: true,
|
|
44
|
+
created_at: true,
|
|
45
|
+
last_updated: true,
|
|
46
|
+
})
|
|
47
|
+
.extend({
|
|
48
|
+
asset_type: common_1.AssetTypeSchema.refine((val) => val === "file"),
|
|
49
|
+
last_updated: zod_1.z.string().default(() => new Date().toISOString()),
|
|
50
|
+
});
|
|
51
|
+
exports.updateFileSchema = updateFileSchema;
|
|
17
52
|
//# sourceMappingURL=files.js.map
|
package/dist/schema/files.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/schema/files.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/schema/files.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAA0D;AAC1D,qCAA2C;AAE3C,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,qDAAqD;IACrD,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,UAAU,GAAG,oBAAW,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,wBAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAA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Schema: z.ZodObject<{
|
|
|
10
10
|
text: z.ZodOptional<z.ZodString>;
|
|
11
11
|
asset: z.ZodOptional<z.ZodObject<{
|
|
12
12
|
assetId: z.ZodString;
|
|
13
|
-
assetType: z.ZodEnum<["
|
|
13
|
+
assetType: z.ZodEnum<["dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
|
|
14
14
|
}, "strip", z.ZodTypeAny, {
|
|
15
15
|
assetId: string;
|
|
16
|
-
assetType: "file" | "dataset" | "
|
|
16
|
+
assetType: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
17
17
|
}, {
|
|
18
18
|
assetId: string;
|
|
19
|
-
assetType: "file" | "dataset" | "
|
|
19
|
+
assetType: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
20
20
|
}>>;
|
|
21
21
|
mention: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
22
22
|
event: z.ZodOptional<z.ZodObject<{
|
|
@@ -34,7 +34,7 @@ declare const NotificationSchema: z.ZodObject<{
|
|
|
34
34
|
mention?: {} | undefined;
|
|
35
35
|
asset?: {
|
|
36
36
|
assetId: string;
|
|
37
|
-
assetType: "file" | "dataset" | "
|
|
37
|
+
assetType: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
38
38
|
} | undefined;
|
|
39
39
|
}, {
|
|
40
40
|
text?: string | undefined;
|
|
@@ -44,7 +44,7 @@ declare const NotificationSchema: z.ZodObject<{
|
|
|
44
44
|
mention?: {} | undefined;
|
|
45
45
|
asset?: {
|
|
46
46
|
assetId: string;
|
|
47
|
-
assetType: "file" | "dataset" | "
|
|
47
|
+
assetType: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
48
48
|
} | undefined;
|
|
49
49
|
}>;
|
|
50
50
|
viewed: z.ZodBoolean;
|
|
@@ -61,7 +61,7 @@ declare const NotificationSchema: z.ZodObject<{
|
|
|
61
61
|
mention?: {} | undefined;
|
|
62
62
|
asset?: {
|
|
63
63
|
assetId: string;
|
|
64
|
-
assetType: "file" | "dataset" | "
|
|
64
|
+
assetType: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
65
65
|
} | undefined;
|
|
66
66
|
};
|
|
67
67
|
org_id: string;
|
|
@@ -82,7 +82,7 @@ declare const NotificationSchema: z.ZodObject<{
|
|
|
82
82
|
mention?: {} | undefined;
|
|
83
83
|
asset?: {
|
|
84
84
|
assetId: string;
|
|
85
|
-
assetType: "file" | "dataset" | "
|
|
85
|
+
assetType: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
86
86
|
} | undefined;
|
|
87
87
|
};
|
|
88
88
|
org_id: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
declare const OrganizationsSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodString;
|
|
4
|
-
owner_id: z.ZodString;
|
|
5
4
|
name: z.ZodString;
|
|
6
5
|
avatar_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
6
|
mission: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -20,7 +19,6 @@ declare const OrganizationsSchema: z.ZodObject<{
|
|
|
20
19
|
id: string;
|
|
21
20
|
name: string;
|
|
22
21
|
size: string;
|
|
23
|
-
owner_id: string;
|
|
24
22
|
base_role: "none" | "admin" | "read" | "write";
|
|
25
23
|
email?: string | null | undefined;
|
|
26
24
|
avatar_path?: string | null | undefined;
|
|
@@ -33,7 +31,6 @@ declare const OrganizationsSchema: z.ZodObject<{
|
|
|
33
31
|
id: string;
|
|
34
32
|
name: string;
|
|
35
33
|
size: string;
|
|
36
|
-
owner_id: string;
|
|
37
34
|
email?: string | null | undefined;
|
|
38
35
|
avatar_path?: string | null | undefined;
|
|
39
36
|
mission?: string | null | undefined;
|
|
@@ -5,7 +5,6 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const common_1 = require("./common");
|
|
6
6
|
const OrganizationsSchema = zod_1.z.object({
|
|
7
7
|
id: zod_1.z.string().uuid(),
|
|
8
|
-
owner_id: zod_1.z.string().uuid(),
|
|
9
8
|
name: zod_1.z.string(),
|
|
10
9
|
avatar_path: zod_1.z.string().nullable().optional(),
|
|
11
10
|
mission: zod_1.z.string().nullable().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/schema/organizations.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAAwD;AAExD,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,
|
|
1
|
+
{"version":3,"file":"organizations.js","sourceRoot":"","sources":["../../src/schema/organizations.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAAwD;AAExD,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACxC,IAAI,EAAE,OAAC;SACJ,KAAK,CACJ,OAAC,CAAC,MAAM,CA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