@ourofoundation/ouro-js 1.0.5 → 1.0.7
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 +2 -2
- package/dist/index.js +2 -2
- package/dist/schema/assets.d.ts +14 -79
- package/dist/schema/assets.js +16 -0
- package/dist/schema/assets.js.map +1 -1
- package/dist/schema/blueprints.d.ts +15 -15
- package/dist/schema/comments.d.ts +14 -14
- package/dist/schema/comments.js +2 -3
- package/dist/schema/comments.js.map +1 -1
- package/dist/schema/common.d.ts +13 -13
- package/dist/schema/common.js +3 -3
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/conversations.d.ts +39 -18
- package/dist/schema/datasets.d.ts +49 -179
- package/dist/schema/datasets.js +5 -5
- package/dist/schema/datasets.js.map +1 -1
- package/dist/schema/files.d.ts +37 -167
- package/dist/schema/files.js +5 -5
- package/dist/schema/files.js.map +1 -1
- package/dist/schema/notifications.d.ts +7 -7
- package/dist/schema/posts.d.ts +673 -301
- package/dist/schema/posts.js +21 -42
- package/dist/schema/posts.js.map +1 -1
- package/dist/schema/replications.d.ts +15 -15
- package/package.json +3 -2
package/dist/schema/posts.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const uuidv7_1 = require("uuidv7");
|
|
3
|
+
exports.UpdatePostSchema = exports.ReadPostsSchema = exports.ReadPostSchema = exports.ListPostsSchema = exports.CreatePostSchema = exports.PostSchema = exports.ContentSchema = exports.TipTapSchema = void 0;
|
|
5
4
|
const zod_1 = require("zod");
|
|
6
5
|
const assets_1 = require("./assets");
|
|
7
6
|
const common_1 = require("./common");
|
|
8
7
|
const TipTapSchema = zod_1.z.object({
|
|
9
8
|
type: zod_1.z.literal("doc"),
|
|
10
|
-
content: zod_1.z.array(zod_1.z
|
|
9
|
+
content: zod_1.z.array(zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
content: zod_1.z.array(zod_1.z.object({}).passthrough()).optional(),
|
|
12
|
+
attrs: zod_1.z.object({}).passthrough().optional(),
|
|
13
|
+
})
|
|
14
|
+
.passthrough()),
|
|
11
15
|
});
|
|
12
16
|
exports.TipTapSchema = TipTapSchema;
|
|
13
|
-
const ContentSchema = zod_1.z
|
|
17
|
+
const ContentSchema = zod_1.z
|
|
18
|
+
.object({
|
|
14
19
|
json: TipTapSchema,
|
|
15
20
|
text: zod_1.z.string(),
|
|
16
|
-
})
|
|
21
|
+
})
|
|
22
|
+
.default({ json: { type: "doc", content: [] }, text: "" });
|
|
17
23
|
exports.ContentSchema = ContentSchema;
|
|
18
24
|
const PostSchema = assets_1.AssetSchema.extend({
|
|
19
25
|
name: zod_1.z.string().nullable(),
|
|
@@ -23,32 +29,16 @@ const PostSchema = assets_1.AssetSchema.extend({
|
|
|
23
29
|
content: ContentSchema,
|
|
24
30
|
});
|
|
25
31
|
exports.PostSchema = PostSchema;
|
|
26
|
-
const CreatePostSchema =
|
|
27
|
-
.
|
|
28
|
-
id: true,
|
|
29
|
-
user_id: true,
|
|
30
|
-
})
|
|
31
|
-
.extend({
|
|
32
|
-
id: zod_1.z
|
|
33
|
-
.string()
|
|
34
|
-
.uuid()
|
|
35
|
-
.default(() => (0, uuidv7_1.uuidv7)()),
|
|
36
|
-
team_id: zod_1.z.string().uuid().default("00000000-0000-0000-0000-000000000000"),
|
|
37
|
-
org_id: zod_1.z.string().uuid().default("00000000-0000-0000-0000-000000000000"),
|
|
38
|
-
asset_type: common_1.AssetTypeSchema.default("post").refine((x) => x === "post"),
|
|
32
|
+
const CreatePostSchema = assets_1.CreateAssetSchema.extend({
|
|
33
|
+
asset_type: zod_1.z.literal("post").default("post"),
|
|
39
34
|
name: zod_1.z
|
|
40
35
|
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.nullable()
|
|
41
38
|
.default("")
|
|
42
|
-
.transform((x) => x.trim())
|
|
39
|
+
.transform((x) => x === null || x === void 0 ? void 0 : x.trim())
|
|
43
40
|
.transform((x) => x || null),
|
|
44
|
-
|
|
45
|
-
monetization: common_1.MonetizationSchema.default("none"),
|
|
46
|
-
// preview: z.object({
|
|
47
|
-
// type: z.string().refine((x) => x === "doc"),
|
|
48
|
-
// content: z.array(z.object({}).passthrough()),
|
|
49
|
-
// }),
|
|
50
|
-
created_at: zod_1.z.string().default(() => new Date().toISOString()),
|
|
51
|
-
last_updated: zod_1.z.string().default(() => new Date().toISOString()),
|
|
41
|
+
preview: TipTapSchema,
|
|
52
42
|
});
|
|
53
43
|
exports.CreatePostSchema = CreatePostSchema;
|
|
54
44
|
const ReadPostSchema = PostSchema.extend({
|
|
@@ -69,21 +59,10 @@ const ReadPostsSchema = zod_1.z.array(ReadPostSchema);
|
|
|
69
59
|
exports.ReadPostsSchema = ReadPostsSchema;
|
|
70
60
|
const ListPostsSchema = zod_1.z.array(PostSchema);
|
|
71
61
|
exports.ListPostsSchema = ListPostsSchema;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
visibility: common_1.VisibilitySchema.nullable().optional(),
|
|
76
|
-
monetization: common_1.MonetizationSchema.nullable().optional(),
|
|
77
|
-
price: zod_1.z.number().nullable().optional(),
|
|
78
|
-
metadata: zod_1.z
|
|
79
|
-
.object({
|
|
80
|
-
table_name: zod_1.z.string(),
|
|
81
|
-
})
|
|
82
|
-
.passthrough()
|
|
83
|
-
.optional()
|
|
84
|
-
.nullable(),
|
|
85
|
-
preview: zod_1.z.array(zod_1.z.object({}).passthrough()).optional().nullable(),
|
|
62
|
+
const UpdatePostSchema = CreatePostSchema.omit({
|
|
63
|
+
last_updated: true,
|
|
64
|
+
}).extend({
|
|
86
65
|
last_updated: zod_1.z.string().default(() => new Date().toISOString()),
|
|
87
66
|
});
|
|
88
|
-
exports.
|
|
67
|
+
exports.UpdatePostSchema = UpdatePostSchema;
|
|
89
68
|
//# sourceMappingURL=posts.js.map
|
package/dist/schema/posts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/schema/posts.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"posts.js","sourceRoot":"","sources":["../../src/schema/posts.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,qCAA0D;AAC1D,qCAA6D;AAE7D,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACtB,OAAO,EAAE,OAAC,CAAC,KAAK,CACd,OAAC;SACE,MAAM,CAAC;QACN,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,EAAE;QACvD,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;KAC7C,CAAC;SACD,WAAW,EAAE,CACjB;CACF,CAAC,CAAC;AA+DD,oCAAY;AA7Dd,MAAM,aAAa,GAAG,OAAC;KACpB,MAAM,CAAC;IACN,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;CACjB,CAAC;KACD,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AAyD3D,sCAAa;AAvDf,MAAM,UAAU,GAAG,oBAAW,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,UAAU,EAAE,wBAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC1E,gCAA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MAAM,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACnC,CAAC,CAAC;AA2BD,wCAAc;AAzBhB,MAAM,eAAe,GAAG,OAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AA0B9C,0CAAe;AAxBjB,MAAM,eAAe,GAAG,OAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAsB1C,0CAAe;AApBjB,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,IAAI,CAAC;IAC7C,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC,MAAM,CAAC;IACR,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;CACjE,CAAC,CAAC;AAmBD,4CAAgB"}
|
|
@@ -106,7 +106,7 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
106
106
|
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
107
107
|
}>>;
|
|
108
108
|
parent_id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
109
|
-
asset_type: z.ZodEnum<["dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
|
|
109
|
+
asset_type: z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>;
|
|
110
110
|
name: z.ZodString;
|
|
111
111
|
name_url_slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
112
112
|
slug: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
@@ -125,7 +125,7 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
125
125
|
created_at: z.ZodString;
|
|
126
126
|
last_updated: z.ZodString;
|
|
127
127
|
}, {
|
|
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">;
|
|
128
|
+
asset_type: z.ZodEffects<z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>, "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication", "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication">;
|
|
129
129
|
metadata: z.ZodObject<{
|
|
130
130
|
schedule: z.ZodOptional<z.ZodObject<{
|
|
131
131
|
cron: z.ZodString;
|
|
@@ -164,7 +164,7 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
164
164
|
};
|
|
165
165
|
user_id: string;
|
|
166
166
|
org_id: string;
|
|
167
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
167
|
+
asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
168
168
|
created_at: string;
|
|
169
169
|
last_updated: string;
|
|
170
170
|
team_id: string;
|
|
@@ -227,7 +227,7 @@ declare const ReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
227
227
|
};
|
|
228
228
|
user_id: string;
|
|
229
229
|
org_id: string;
|
|
230
|
-
asset_type: "file" | "dataset" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
230
|
+
asset_type: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication";
|
|
231
231
|
created_at: string;
|
|
232
232
|
last_updated: string;
|
|
233
233
|
team_id: string;
|
|
@@ -401,7 +401,7 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
401
401
|
state: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodEnum<["queued", "in-progress", "success", "error"]>>>>;
|
|
402
402
|
created_at: z.ZodOptional<z.ZodString>;
|
|
403
403
|
last_updated: z.ZodOptional<z.ZodString>;
|
|
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">>;
|
|
404
|
+
asset_type: z.ZodOptional<z.ZodEffects<z.ZodEnum<["user", "organization", "team", "dataset", "file", "service", "route", "post", "comment", "conversation", "blueprint", "replication"]>, "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication", "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication">>;
|
|
405
405
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
406
406
|
schedule: z.ZodOptional<z.ZodObject<{
|
|
407
407
|
cron: z.ZodString;
|
|
@@ -474,10 +474,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
474
474
|
}[] | null | undefined;
|
|
475
475
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
476
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
477
|
team?: {
|
|
482
478
|
id?: string | undefined;
|
|
483
479
|
name?: string | undefined;
|
|
@@ -487,6 +483,10 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
487
483
|
created_at?: string | undefined;
|
|
488
484
|
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
489
485
|
} | undefined;
|
|
486
|
+
user_id?: string | undefined;
|
|
487
|
+
asset_type?: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
488
|
+
created_at?: string | undefined;
|
|
489
|
+
last_updated?: string | undefined;
|
|
490
490
|
parent_id?: string | null | undefined;
|
|
491
491
|
slug?: string | null | undefined;
|
|
492
492
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
|
@@ -537,12 +537,6 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
537
537
|
}[] | null | undefined;
|
|
538
538
|
base_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
539
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;
|
|
546
540
|
team?: {
|
|
547
541
|
id?: string | undefined;
|
|
548
542
|
name?: string | undefined;
|
|
@@ -552,6 +546,12 @@ declare const CreateReplicationSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
552
546
|
created_at?: string | undefined;
|
|
553
547
|
default_role?: "none" | "admin" | "read" | "write" | undefined;
|
|
554
548
|
} | undefined;
|
|
549
|
+
user_id?: string | undefined;
|
|
550
|
+
org_id?: string | undefined;
|
|
551
|
+
asset_type?: "file" | "dataset" | "user" | "organization" | "team" | "service" | "route" | "post" | "comment" | "conversation" | "blueprint" | "replication" | undefined;
|
|
552
|
+
created_at?: string | undefined;
|
|
553
|
+
last_updated?: string | undefined;
|
|
554
|
+
team_id?: string | undefined;
|
|
555
555
|
parent_id?: string | null | undefined;
|
|
556
556
|
slug?: string | null | undefined;
|
|
557
557
|
monetization?: "none" | "pay-to-unlock" | "pay-per-use" | undefined;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ourofoundation/ouro-js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Interact with the Ouro platform in browser and node.js environments",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"publish": "npm run build && npm publish"
|
|
10
11
|
},
|
|
11
12
|
"author": "ourofoundation",
|
|
12
13
|
"license": "ISC",
|