@ourofoundation/ouro-js 3.7.7 → 3.7.9
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/chunk-5CSPQ2RL.cjs +2 -0
- package/dist/chunk-5CSPQ2RL.cjs.map +1 -0
- package/dist/chunk-V3QRQO6H.js +2 -0
- package/dist/chunk-V3QRQO6H.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/schema/quests.cjs +1 -1
- package/dist/schema/quests.d.cts +200 -150
- package/dist/schema/quests.d.ts +200 -150
- package/dist/schema/quests.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-BTHFK5MC.js +0 -2
- package/dist/chunk-BTHFK5MC.js.map +0 -1
- package/dist/chunk-ZTTLI5V5.cjs +0 -2
- package/dist/chunk-ZTTLI5V5.cjs.map +0 -1
package/dist/schema/quests.d.ts
CHANGED
|
@@ -34,10 +34,21 @@ declare const EntryStatusSchema: z.ZodEnum<{
|
|
|
34
34
|
accepted: "accepted";
|
|
35
35
|
rejected: "rejected";
|
|
36
36
|
}>;
|
|
37
|
+
/** desc = higher scores rank first; asc = lower scores rank first */
|
|
38
|
+
declare const LeaderboardOrderSchema: z.ZodEnum<{
|
|
39
|
+
desc: "desc";
|
|
40
|
+
asc: "asc";
|
|
41
|
+
}>;
|
|
37
42
|
declare const QuestItemBaseSchema: z.ZodObject<{
|
|
38
43
|
id: z.ZodUUID;
|
|
39
44
|
quest_id: z.ZodUUID;
|
|
40
|
-
description: z.
|
|
45
|
+
description: z.ZodObject<{
|
|
46
|
+
json: z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"doc">;
|
|
48
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
text: z.ZodString;
|
|
51
|
+
}, z.core.$strip>;
|
|
41
52
|
status: z.ZodDefault<z.ZodEnum<{
|
|
42
53
|
pending: "pending";
|
|
43
54
|
in_progress: "in_progress";
|
|
@@ -77,8 +88,14 @@ declare const QuestItemBaseSchema: z.ZodObject<{
|
|
|
77
88
|
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
78
89
|
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
79
90
|
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
91
|
+
eval_categories_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
92
|
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
81
93
|
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
94
|
+
leaderboard_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
95
|
+
leaderboard_order: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
desc: "desc";
|
|
97
|
+
asc: "asc";
|
|
98
|
+
}>>>;
|
|
82
99
|
submission_assets: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
83
100
|
asset_type: z.ZodEnum<{
|
|
84
101
|
dataset: "dataset";
|
|
@@ -131,7 +148,13 @@ declare const QuestItemBaseSchema: z.ZodObject<{
|
|
|
131
148
|
declare const QuestItemSchema: z.ZodObject<{
|
|
132
149
|
id: z.ZodUUID;
|
|
133
150
|
quest_id: z.ZodUUID;
|
|
134
|
-
description: z.
|
|
151
|
+
description: z.ZodObject<{
|
|
152
|
+
json: z.ZodObject<{
|
|
153
|
+
type: z.ZodLiteral<"doc">;
|
|
154
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
text: z.ZodString;
|
|
157
|
+
}, z.core.$strip>;
|
|
135
158
|
status: z.ZodDefault<z.ZodEnum<{
|
|
136
159
|
pending: "pending";
|
|
137
160
|
in_progress: "in_progress";
|
|
@@ -171,8 +194,14 @@ declare const QuestItemSchema: z.ZodObject<{
|
|
|
171
194
|
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
172
195
|
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
173
196
|
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
197
|
+
eval_categories_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
174
198
|
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
175
199
|
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
200
|
+
leaderboard_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
201
|
+
leaderboard_order: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
202
|
+
desc: "desc";
|
|
203
|
+
asc: "asc";
|
|
204
|
+
}>>>;
|
|
176
205
|
submission_assets: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
177
206
|
asset_type: z.ZodEnum<{
|
|
178
207
|
dataset: "dataset";
|
|
@@ -228,11 +257,18 @@ declare const QuestItemSchema: z.ZodObject<{
|
|
|
228
257
|
* `quest_id`, `created_by`, and lifecycle-derived fields
|
|
229
258
|
* (`auto_skipped`, `status_before_auto_skip`).
|
|
230
259
|
*
|
|
231
|
-
* Accepts a plain description string as a convenience —
|
|
232
|
-
* into `{ description }` by the `union` below.
|
|
260
|
+
* Accepts a plain description string or TipTap Content as a convenience —
|
|
261
|
+
* a bare string is lifted into `{ description }` by the `union` below.
|
|
262
|
+
* The backend normalizes either shape with `toContentFromMaybeMarkdown`.
|
|
233
263
|
*/
|
|
234
264
|
declare const CreateQuestItemObjectSchema: z.ZodObject<{
|
|
235
|
-
description: z.ZodString
|
|
265
|
+
description: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
266
|
+
json: z.ZodObject<{
|
|
267
|
+
type: z.ZodLiteral<"doc">;
|
|
268
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
269
|
+
}, z.core.$strip>;
|
|
270
|
+
text: z.ZodString;
|
|
271
|
+
}, z.core.$strip>]>;
|
|
236
272
|
type: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
237
273
|
sort_order: z.ZodOptional<z.ZodNumber>;
|
|
238
274
|
assignee_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
@@ -258,8 +294,14 @@ declare const CreateQuestItemObjectSchema: z.ZodObject<{
|
|
|
258
294
|
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
259
295
|
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
260
296
|
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
+
eval_categories_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
261
298
|
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
262
299
|
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
300
|
+
leaderboard_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
301
|
+
leaderboard_order: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
302
|
+
desc: "desc";
|
|
303
|
+
asc: "asc";
|
|
304
|
+
}>>>;
|
|
263
305
|
submission_assets: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
264
306
|
asset_type: z.ZodEnum<{
|
|
265
307
|
dataset: "dataset";
|
|
@@ -297,10 +339,51 @@ declare const CreateQuestItemObjectSchema: z.ZodObject<{
|
|
|
297
339
|
}, z.core.$strip>>>>;
|
|
298
340
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
299
341
|
}, z.core.$strip>;
|
|
300
|
-
declare const CreateQuestItemSchema: z.
|
|
301
|
-
description: string
|
|
342
|
+
declare const CreateQuestItemSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
343
|
+
description: string | {
|
|
344
|
+
json: {
|
|
345
|
+
type: "doc";
|
|
346
|
+
content: any[];
|
|
347
|
+
};
|
|
348
|
+
text: string;
|
|
349
|
+
};
|
|
350
|
+
type: string;
|
|
351
|
+
reward_xp: number;
|
|
352
|
+
reward_currency: "usd" | "btc";
|
|
353
|
+
reward_amount: number;
|
|
354
|
+
leaderboard_enabled: boolean;
|
|
355
|
+
leaderboard_order: "desc" | "asc";
|
|
356
|
+
sort_order?: number | undefined;
|
|
357
|
+
assignee_id?: string | null | undefined;
|
|
358
|
+
expected_asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | null | undefined;
|
|
359
|
+
child_quest_id?: string | null | undefined;
|
|
360
|
+
eval_route_id?: string | null | undefined;
|
|
361
|
+
eval_score_path?: string | null | undefined;
|
|
362
|
+
eval_categories_path?: string | null | undefined;
|
|
363
|
+
eval_pass_min?: number | null | undefined;
|
|
364
|
+
eval_pass_max?: number | null | undefined;
|
|
365
|
+
submission_assets?: Record<string, {
|
|
366
|
+
[x: string]: any;
|
|
367
|
+
asset_type: "dataset" | "file" | "post";
|
|
368
|
+
required: boolean;
|
|
369
|
+
primary?: boolean | undefined;
|
|
370
|
+
input_filter?: "image" | "video" | "audio" | "pdf" | "3d model" | "atomic structure" | null | undefined;
|
|
371
|
+
file_extensions?: string[] | null | undefined;
|
|
372
|
+
contains_file_extensions?: string[] | null | undefined;
|
|
373
|
+
}> | null | undefined;
|
|
374
|
+
eval_static_inputs?: Record<string, {
|
|
375
|
+
asset_id: string;
|
|
376
|
+
asset_type: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation";
|
|
377
|
+
}> | null | undefined;
|
|
378
|
+
notes?: string | null | undefined;
|
|
302
379
|
}, string>>, z.ZodObject<{
|
|
303
|
-
description: z.ZodString
|
|
380
|
+
description: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
381
|
+
json: z.ZodObject<{
|
|
382
|
+
type: z.ZodLiteral<"doc">;
|
|
383
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
384
|
+
}, z.core.$strip>;
|
|
385
|
+
text: z.ZodString;
|
|
386
|
+
}, z.core.$strip>]>;
|
|
304
387
|
type: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
305
388
|
sort_order: z.ZodOptional<z.ZodNumber>;
|
|
306
389
|
assignee_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
@@ -326,73 +409,14 @@ declare const CreateQuestItemSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.
|
|
|
326
409
|
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
327
410
|
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
328
411
|
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
412
|
+
eval_categories_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
329
413
|
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
330
414
|
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
post: "post";
|
|
336
|
-
}>;
|
|
337
|
-
primary: z.ZodOptional<z.ZodBoolean>;
|
|
338
|
-
input_filter: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
339
|
-
image: "image";
|
|
340
|
-
video: "video";
|
|
341
|
-
audio: "audio";
|
|
342
|
-
pdf: "pdf";
|
|
343
|
-
"3d model": "3d model";
|
|
344
|
-
"atomic structure": "atomic structure";
|
|
345
|
-
}>>>;
|
|
346
|
-
file_extensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
347
|
-
contains_file_extensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
348
|
-
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
349
|
-
}, z.core.$catchall<z.ZodAny>>>>>;
|
|
350
|
-
eval_static_inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
351
|
-
asset_id: z.ZodUUID;
|
|
352
|
-
asset_type: z.ZodEnum<{
|
|
353
|
-
user: "user";
|
|
354
|
-
organization: "organization";
|
|
355
|
-
team: "team";
|
|
356
|
-
dataset: "dataset";
|
|
357
|
-
file: "file";
|
|
358
|
-
service: "service";
|
|
359
|
-
route: "route";
|
|
360
|
-
post: "post";
|
|
361
|
-
quest: "quest";
|
|
362
|
-
comment: "comment";
|
|
363
|
-
conversation: "conversation";
|
|
364
|
-
}>;
|
|
365
|
-
}, z.core.$strip>>>>;
|
|
366
|
-
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
368
|
-
description: z.ZodString;
|
|
369
|
-
type: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
370
|
-
sort_order: z.ZodOptional<z.ZodNumber>;
|
|
371
|
-
assignee_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
372
|
-
expected_asset_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
373
|
-
user: "user";
|
|
374
|
-
organization: "organization";
|
|
375
|
-
team: "team";
|
|
376
|
-
dataset: "dataset";
|
|
377
|
-
file: "file";
|
|
378
|
-
service: "service";
|
|
379
|
-
route: "route";
|
|
380
|
-
post: "post";
|
|
381
|
-
quest: "quest";
|
|
382
|
-
comment: "comment";
|
|
383
|
-
conversation: "conversation";
|
|
384
|
-
}>>>;
|
|
385
|
-
reward_xp: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
386
|
-
reward_currency: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
387
|
-
usd: "usd";
|
|
388
|
-
btc: "btc";
|
|
415
|
+
leaderboard_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
416
|
+
leaderboard_order: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
417
|
+
desc: "desc";
|
|
418
|
+
asc: "asc";
|
|
389
419
|
}>>>;
|
|
390
|
-
reward_amount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
391
|
-
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
392
|
-
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
393
|
-
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
394
|
-
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
395
|
-
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
396
420
|
submission_assets: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
397
421
|
asset_type: z.ZodEnum<{
|
|
398
422
|
dataset: "dataset";
|
|
@@ -429,7 +453,7 @@ declare const CreateQuestItemSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodPipe<z.
|
|
|
429
453
|
}>;
|
|
430
454
|
}, z.core.$strip>>>>;
|
|
431
455
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
432
|
-
}, z.core.$strip
|
|
456
|
+
}, z.core.$strip>]>;
|
|
433
457
|
declare const QuestSchema: z.ZodObject<{
|
|
434
458
|
id: z.ZodUUID;
|
|
435
459
|
user_id: z.ZodUUID;
|
|
@@ -707,7 +731,13 @@ declare const QuestSchema: z.ZodObject<{
|
|
|
707
731
|
items: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
708
732
|
id: z.ZodOptional<z.ZodUUID>;
|
|
709
733
|
quest_id: z.ZodOptional<z.ZodUUID>;
|
|
710
|
-
description: z.ZodOptional<z.
|
|
734
|
+
description: z.ZodOptional<z.ZodObject<{
|
|
735
|
+
json: z.ZodObject<{
|
|
736
|
+
type: z.ZodLiteral<"doc">;
|
|
737
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
738
|
+
}, z.core.$strip>;
|
|
739
|
+
text: z.ZodString;
|
|
740
|
+
}, z.core.$strip>>;
|
|
711
741
|
status: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
|
|
712
742
|
pending: "pending";
|
|
713
743
|
in_progress: "in_progress";
|
|
@@ -747,8 +777,14 @@ declare const QuestSchema: z.ZodObject<{
|
|
|
747
777
|
child_quest_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
748
778
|
eval_route_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
749
779
|
eval_score_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
780
|
+
eval_categories_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
750
781
|
eval_pass_min: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
751
782
|
eval_pass_max: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
783
|
+
leaderboard_enabled: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
784
|
+
leaderboard_order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
785
|
+
desc: "desc";
|
|
786
|
+
asc: "asc";
|
|
787
|
+
}>>>>;
|
|
752
788
|
submission_assets: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
753
789
|
asset_type: z.ZodEnum<{
|
|
754
790
|
dataset: "dataset";
|
|
@@ -822,10 +858,10 @@ declare const QuestSchema: z.ZodObject<{
|
|
|
822
858
|
* `CreatePostSchema` defaults `org_id`/`team_id` so non-frontend callers
|
|
823
859
|
* don't have to know about `GLOBAL_ORG_ID`.
|
|
824
860
|
*
|
|
825
|
-
* The `items` field accepts either plain strings
|
|
826
|
-
* the backend `createQuestItems`/`createQuest` paths
|
|
827
|
-
* shapes, and `CreateQuestItemSchema` normalizes strings
|
|
828
|
-
* `{ description }`.
|
|
861
|
+
* The `items` field accepts either plain strings, TipTap Content objects, or
|
|
862
|
+
* full item objects — the backend `createQuestItems`/`createQuest` paths
|
|
863
|
+
* already handle both shapes, and `CreateQuestItemSchema` normalizes strings
|
|
864
|
+
* into `{ description }`.
|
|
829
865
|
*/
|
|
830
866
|
declare const CreateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
831
867
|
parent: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
@@ -964,10 +1000,51 @@ declare const CreateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
964
1000
|
cancelled: "cancelled";
|
|
965
1001
|
}>>;
|
|
966
1002
|
max_xp_per_contributor: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
967
|
-
items: z.ZodDefault<z.ZodOptional<z.ZodArray<z.
|
|
968
|
-
description: string
|
|
1003
|
+
items: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<{
|
|
1004
|
+
description: string | {
|
|
1005
|
+
json: {
|
|
1006
|
+
type: "doc";
|
|
1007
|
+
content: any[];
|
|
1008
|
+
};
|
|
1009
|
+
text: string;
|
|
1010
|
+
};
|
|
1011
|
+
type: string;
|
|
1012
|
+
reward_xp: number;
|
|
1013
|
+
reward_currency: "usd" | "btc";
|
|
1014
|
+
reward_amount: number;
|
|
1015
|
+
leaderboard_enabled: boolean;
|
|
1016
|
+
leaderboard_order: "desc" | "asc";
|
|
1017
|
+
sort_order?: number | undefined;
|
|
1018
|
+
assignee_id?: string | null | undefined;
|
|
1019
|
+
expected_asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | null | undefined;
|
|
1020
|
+
child_quest_id?: string | null | undefined;
|
|
1021
|
+
eval_route_id?: string | null | undefined;
|
|
1022
|
+
eval_score_path?: string | null | undefined;
|
|
1023
|
+
eval_categories_path?: string | null | undefined;
|
|
1024
|
+
eval_pass_min?: number | null | undefined;
|
|
1025
|
+
eval_pass_max?: number | null | undefined;
|
|
1026
|
+
submission_assets?: Record<string, {
|
|
1027
|
+
[x: string]: any;
|
|
1028
|
+
asset_type: "dataset" | "file" | "post";
|
|
1029
|
+
required: boolean;
|
|
1030
|
+
primary?: boolean | undefined;
|
|
1031
|
+
input_filter?: "image" | "video" | "audio" | "pdf" | "3d model" | "atomic structure" | null | undefined;
|
|
1032
|
+
file_extensions?: string[] | null | undefined;
|
|
1033
|
+
contains_file_extensions?: string[] | null | undefined;
|
|
1034
|
+
}> | null | undefined;
|
|
1035
|
+
eval_static_inputs?: Record<string, {
|
|
1036
|
+
asset_id: string;
|
|
1037
|
+
asset_type: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation";
|
|
1038
|
+
}> | null | undefined;
|
|
1039
|
+
notes?: string | null | undefined;
|
|
969
1040
|
}, string>>, z.ZodObject<{
|
|
970
|
-
description: z.ZodString
|
|
1041
|
+
description: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1042
|
+
json: z.ZodObject<{
|
|
1043
|
+
type: z.ZodLiteral<"doc">;
|
|
1044
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
1045
|
+
}, z.core.$strip>;
|
|
1046
|
+
text: z.ZodString;
|
|
1047
|
+
}, z.core.$strip>]>;
|
|
971
1048
|
type: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
972
1049
|
sort_order: z.ZodOptional<z.ZodNumber>;
|
|
973
1050
|
assignee_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
@@ -993,73 +1070,14 @@ declare const CreateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
993
1070
|
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
994
1071
|
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
995
1072
|
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1073
|
+
eval_categories_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
996
1074
|
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
997
1075
|
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
post: "post";
|
|
1003
|
-
}>;
|
|
1004
|
-
primary: z.ZodOptional<z.ZodBoolean>;
|
|
1005
|
-
input_filter: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1006
|
-
image: "image";
|
|
1007
|
-
video: "video";
|
|
1008
|
-
audio: "audio";
|
|
1009
|
-
pdf: "pdf";
|
|
1010
|
-
"3d model": "3d model";
|
|
1011
|
-
"atomic structure": "atomic structure";
|
|
1012
|
-
}>>>;
|
|
1013
|
-
file_extensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1014
|
-
contains_file_extensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1015
|
-
required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1016
|
-
}, z.core.$catchall<z.ZodAny>>>>>;
|
|
1017
|
-
eval_static_inputs: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1018
|
-
asset_id: z.ZodUUID;
|
|
1019
|
-
asset_type: z.ZodEnum<{
|
|
1020
|
-
user: "user";
|
|
1021
|
-
organization: "organization";
|
|
1022
|
-
team: "team";
|
|
1023
|
-
dataset: "dataset";
|
|
1024
|
-
file: "file";
|
|
1025
|
-
service: "service";
|
|
1026
|
-
route: "route";
|
|
1027
|
-
post: "post";
|
|
1028
|
-
quest: "quest";
|
|
1029
|
-
comment: "comment";
|
|
1030
|
-
conversation: "conversation";
|
|
1031
|
-
}>;
|
|
1032
|
-
}, z.core.$strip>>>>;
|
|
1033
|
-
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1034
|
-
}, z.core.$strip>]>, z.ZodObject<{
|
|
1035
|
-
description: z.ZodString;
|
|
1036
|
-
type: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
1037
|
-
sort_order: z.ZodOptional<z.ZodNumber>;
|
|
1038
|
-
assignee_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
1039
|
-
expected_asset_type: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1040
|
-
user: "user";
|
|
1041
|
-
organization: "organization";
|
|
1042
|
-
team: "team";
|
|
1043
|
-
dataset: "dataset";
|
|
1044
|
-
file: "file";
|
|
1045
|
-
service: "service";
|
|
1046
|
-
route: "route";
|
|
1047
|
-
post: "post";
|
|
1048
|
-
quest: "quest";
|
|
1049
|
-
comment: "comment";
|
|
1050
|
-
conversation: "conversation";
|
|
1051
|
-
}>>>;
|
|
1052
|
-
reward_xp: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1053
|
-
reward_currency: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1054
|
-
usd: "usd";
|
|
1055
|
-
btc: "btc";
|
|
1076
|
+
leaderboard_enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
1077
|
+
leaderboard_order: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1078
|
+
desc: "desc";
|
|
1079
|
+
asc: "asc";
|
|
1056
1080
|
}>>>;
|
|
1057
|
-
reward_amount: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
1058
|
-
child_quest_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
1059
|
-
eval_route_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
1060
|
-
eval_score_path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1061
|
-
eval_pass_min: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1062
|
-
eval_pass_max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1063
1081
|
submission_assets: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1064
1082
|
asset_type: z.ZodEnum<{
|
|
1065
1083
|
dataset: "dataset";
|
|
@@ -1096,7 +1114,7 @@ declare const CreateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1096
1114
|
}>;
|
|
1097
1115
|
}, z.core.$strip>>>>;
|
|
1098
1116
|
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1099
|
-
}, z.core.$strip
|
|
1117
|
+
}, z.core.$strip>]>>>>;
|
|
1100
1118
|
}, z.core.$strip>, z.ZodTransform<{
|
|
1101
1119
|
id: string;
|
|
1102
1120
|
team_id: string | null;
|
|
@@ -1130,17 +1148,26 @@ declare const CreateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1130
1148
|
type: "closable" | "continuous";
|
|
1131
1149
|
status: "open" | "draft" | "closed" | "cancelled";
|
|
1132
1150
|
items: {
|
|
1133
|
-
description: string
|
|
1151
|
+
description: string | {
|
|
1152
|
+
json: {
|
|
1153
|
+
type: "doc";
|
|
1154
|
+
content: any[];
|
|
1155
|
+
};
|
|
1156
|
+
text: string;
|
|
1157
|
+
};
|
|
1134
1158
|
type: string;
|
|
1135
1159
|
reward_xp: number;
|
|
1136
1160
|
reward_currency: "usd" | "btc";
|
|
1137
1161
|
reward_amount: number;
|
|
1162
|
+
leaderboard_enabled: boolean;
|
|
1163
|
+
leaderboard_order: "desc" | "asc";
|
|
1138
1164
|
sort_order?: number | undefined;
|
|
1139
1165
|
assignee_id?: string | null | undefined;
|
|
1140
1166
|
expected_asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | null | undefined;
|
|
1141
1167
|
child_quest_id?: string | null | undefined;
|
|
1142
1168
|
eval_route_id?: string | null | undefined;
|
|
1143
1169
|
eval_score_path?: string | null | undefined;
|
|
1170
|
+
eval_categories_path?: string | null | undefined;
|
|
1144
1171
|
eval_pass_min?: number | null | undefined;
|
|
1145
1172
|
eval_pass_max?: number | null | undefined;
|
|
1146
1173
|
submission_assets?: Record<string, {
|
|
@@ -1217,17 +1244,26 @@ declare const CreateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1217
1244
|
type: "closable" | "continuous";
|
|
1218
1245
|
status: "open" | "draft" | "closed" | "cancelled";
|
|
1219
1246
|
items: {
|
|
1220
|
-
description: string
|
|
1247
|
+
description: string | {
|
|
1248
|
+
json: {
|
|
1249
|
+
type: "doc";
|
|
1250
|
+
content: any[];
|
|
1251
|
+
};
|
|
1252
|
+
text: string;
|
|
1253
|
+
};
|
|
1221
1254
|
type: string;
|
|
1222
1255
|
reward_xp: number;
|
|
1223
1256
|
reward_currency: "usd" | "btc";
|
|
1224
1257
|
reward_amount: number;
|
|
1258
|
+
leaderboard_enabled: boolean;
|
|
1259
|
+
leaderboard_order: "desc" | "asc";
|
|
1225
1260
|
sort_order?: number | undefined;
|
|
1226
1261
|
assignee_id?: string | null | undefined;
|
|
1227
1262
|
expected_asset_type?: "user" | "organization" | "team" | "dataset" | "file" | "service" | "route" | "post" | "quest" | "comment" | "conversation" | null | undefined;
|
|
1228
1263
|
child_quest_id?: string | null | undefined;
|
|
1229
1264
|
eval_route_id?: string | null | undefined;
|
|
1230
1265
|
eval_score_path?: string | null | undefined;
|
|
1266
|
+
eval_categories_path?: string | null | undefined;
|
|
1231
1267
|
eval_pass_min?: number | null | undefined;
|
|
1232
1268
|
eval_pass_max?: number | null | undefined;
|
|
1233
1269
|
submission_assets?: Record<string, {
|
|
@@ -1488,7 +1524,13 @@ declare const UpdateQuestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
1488
1524
|
preview?: Record<string, any>[] | null | undefined;
|
|
1489
1525
|
}>>;
|
|
1490
1526
|
declare const UpdateQuestItemSchema: z.ZodObject<{
|
|
1491
|
-
description: z.ZodOptional<z.ZodString
|
|
1527
|
+
description: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
1528
|
+
json: z.ZodObject<{
|
|
1529
|
+
type: z.ZodLiteral<"doc">;
|
|
1530
|
+
content: z.ZodArray<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
|
|
1531
|
+
}, z.core.$strip>;
|
|
1532
|
+
text: z.ZodString;
|
|
1533
|
+
}, z.core.$strip>]>>;
|
|
1492
1534
|
type: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodString>>>;
|
|
1493
1535
|
sort_order: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
|
|
1494
1536
|
assignee_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
@@ -1514,8 +1556,14 @@ declare const UpdateQuestItemSchema: z.ZodObject<{
|
|
|
1514
1556
|
child_quest_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
1515
1557
|
eval_route_id: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUUID>>>;
|
|
1516
1558
|
eval_score_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1559
|
+
eval_categories_path: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
1517
1560
|
eval_pass_min: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
1518
1561
|
eval_pass_max: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
|
|
1562
|
+
leaderboard_enabled: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodBoolean>>>;
|
|
1563
|
+
leaderboard_order: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodEnum<{
|
|
1564
|
+
desc: "desc";
|
|
1565
|
+
asc: "asc";
|
|
1566
|
+
}>>>>;
|
|
1519
1567
|
submission_assets: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1520
1568
|
asset_type: z.ZodEnum<{
|
|
1521
1569
|
dataset: "dataset";
|
|
@@ -1617,6 +1665,7 @@ declare const EntrySchema: z.ZodObject<{
|
|
|
1617
1665
|
reviewed_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1618
1666
|
eval_action_id: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
1619
1667
|
eval_score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1668
|
+
eval_category_scores: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNumber>>>;
|
|
1620
1669
|
eval_status: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
1621
1670
|
skipped: "skipped";
|
|
1622
1671
|
running: "running";
|
|
@@ -1673,6 +1722,7 @@ type QuestItemStatus = z.infer<typeof QuestItemStatusSchema>;
|
|
|
1673
1722
|
type RewardCurrency = z.infer<typeof RewardCurrencySchema>;
|
|
1674
1723
|
type EntryEvalStatus = z.infer<typeof EntryEvalStatusSchema>;
|
|
1675
1724
|
type EntryStatus = z.infer<typeof EntryStatusSchema>;
|
|
1725
|
+
type LeaderboardOrder = z.infer<typeof LeaderboardOrderSchema>;
|
|
1676
1726
|
type Quest = z.infer<typeof QuestSchema>;
|
|
1677
1727
|
type QuestItem = z.infer<typeof QuestItemSchema>;
|
|
1678
1728
|
type CreateQuest = z.infer<typeof CreateQuestSchema>;
|
|
@@ -1683,4 +1733,4 @@ type Entry = z.infer<typeof EntrySchema>;
|
|
|
1683
1733
|
type CreateEntry = z.infer<typeof CreateEntrySchema>;
|
|
1684
1734
|
type ReviewEntry = z.infer<typeof ReviewEntrySchema>;
|
|
1685
1735
|
|
|
1686
|
-
export { type CreateEntry, CreateEntrySchema, type CreateQuest, type CreateQuestItem, CreateQuestItemObjectSchema, CreateQuestItemSchema, CreateQuestSchema, type Entry, type EntryEvalStatus, EntryEvalStatusSchema, EntrySchema, type EntryStatus, EntryStatusSchema, type Quest, type QuestItem, QuestItemBaseSchema, QuestItemSchema, type QuestItemStatus, QuestItemStatusSchema, QuestSchema, type QuestStatus, QuestStatusSchema, type QuestType, QuestTypeSchema, type ReviewEntry, ReviewEntrySchema, type RewardCurrency, RewardCurrencySchema, type UpdateQuest, type UpdateQuestItem, UpdateQuestItemSchema, UpdateQuestSchema };
|
|
1736
|
+
export { type CreateEntry, CreateEntrySchema, type CreateQuest, type CreateQuestItem, CreateQuestItemObjectSchema, CreateQuestItemSchema, CreateQuestSchema, type Entry, type EntryEvalStatus, EntryEvalStatusSchema, EntrySchema, type EntryStatus, EntryStatusSchema, type LeaderboardOrder, LeaderboardOrderSchema, type Quest, type QuestItem, QuestItemBaseSchema, QuestItemSchema, type QuestItemStatus, QuestItemStatusSchema, QuestSchema, type QuestStatus, QuestStatusSchema, type QuestType, QuestTypeSchema, type ReviewEntry, ReviewEntrySchema, type RewardCurrency, RewardCurrencySchema, type UpdateQuest, type UpdateQuestItem, UpdateQuestItemSchema, UpdateQuestSchema };
|
package/dist/schema/quests.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{q as CreateEntrySchema,j as CreateQuestItemObjectSchema,k as CreateQuestItemSchema,m as CreateQuestSchema,e as EntryEvalStatusSchema,p as EntrySchema,f as EntryStatusSchema,g as LeaderboardOrderSchema,h as QuestItemBaseSchema,i as QuestItemSchema,c as QuestItemStatusSchema,l as QuestSchema,b as QuestStatusSchema,a as QuestTypeSchema,r as ReviewEntrySchema,d as RewardCurrencySchema,o as UpdateQuestItemSchema,n as UpdateQuestSchema}from'../chunk-V3QRQO6H.js';export{c as KeyedAssetInputSchema,a as KeyedAssetRefsSchema,d as QuestSubmissionAssetDeclarationSchema}from'../chunk-HZDBAPRY.js';import'../chunk-SIZVKGUT.js';import'../chunk-OU4JKY4M.js';import'../chunk-FDCVNMMO.js';import'../chunk-VC4DZZ3C.js';import'../chunk-42WKTHH5.js';import'../chunk-G6GCUGMM.js';import'../chunk-42ADEGDM.js';import'../chunk-DUBPWSCA.js';import'../chunk-3BZRQYRC.js';//# sourceMappingURL=quests.js.map
|
|
2
2
|
//# sourceMappingURL=quests.js.map
|
package/package.json
CHANGED
package/dist/chunk-BTHFK5MC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,d,c}from'./chunk-HZDBAPRY.js';import {f,b,h,a as a$2}from'./chunk-FDCVNMMO.js';import {a as a$1}from'./chunk-3BZRQYRC.js';import {enum as _enum,object,optional,string,array,any,record,literal,number,uuid,nullable,boolean,union}from'zod';var z=_enum(["closable","continuous"]),E=_enum(["draft","open","closed","cancelled"]),_=_enum(["pending","in_progress","done","skipped"]),C=_enum(["btc","usd"]),I=_enum(["skipped","running","passed","failed","errored"]),q=_enum(["submitted","accepted","rejected"]),k=object({type:string(),content:optional(array(any())),attrs:optional(record(string(),any())),marks:optional(array(any())),text:optional(string())}),p=object({json:object({type:literal("doc"),content:array(k)}),text:string()}),T=object({id:uuid(),quest_id:uuid(),description:string(),status:_.default("pending"),auto_skipped:optional(nullable(string().or(any()))),status_before_auto_skip:optional(nullable(_)),sort_order:number().default(0),type:string().default("task"),created_by:uuid(),assignee_id:optional(nullable(uuid())),expected_asset_type:optional(nullable(a$1)),reward_xp:number().int().nonnegative().default(0),reward_currency:C.default("btc"),reward_amount:number().int().nonnegative().default(0),child_quest_id:optional(nullable(uuid())),eval_route_id:optional(nullable(uuid())),eval_score_path:optional(nullable(string())),eval_pass_min:optional(nullable(number())),eval_pass_max:optional(nullable(number())),submission_assets:optional(nullable(record(string(),d))),eval_static_inputs:optional(nullable(a)),notes:optional(nullable(string())),contributor_keys:optional(nullable(array(object({key:string(),required:boolean().default(true),filters:object({assetType:optional(string()),fileType:optional(string()),extensions:optional(array(string())),hasConstraints:boolean().default(false)})})))),created_at:string(),updated_at:string()}),A=T,S=object({description:string().min(1,{message:"Item description cannot be empty"}),type:optional(string()).default("task"),sort_order:optional(number().int()),assignee_id:optional(nullable(uuid())),expected_asset_type:optional(nullable(a$1)),reward_xp:optional(number().int().nonnegative()).default(0),reward_currency:optional(C).default("btc"),reward_amount:optional(number().int().nonnegative()).default(0),child_quest_id:optional(nullable(uuid())),eval_route_id:optional(nullable(uuid())),eval_score_path:optional(nullable(string())),eval_pass_min:optional(nullable(number())),eval_pass_max:optional(nullable(number())),submission_assets:optional(nullable(record(string(),d))),eval_static_inputs:optional(nullable(a)),notes:optional(nullable(string()))}),R=union([string().transform(u=>({description:u})),S]).pipe(S),U=object({type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:optional(nullable(number().int().nonnegative())),closed_at:optional(nullable(string()))}),j=f.extend({asset_type:literal("quest").default("quest"),metadata:optional(nullable(b.partial())),quest:optional(U.partial()),items:optional(array(A.partial())),progress:optional(object({total:number(),resolved:number(),remaining:number(),items:optional(array(object({id:string(),status:_,waiting_on:optional(nullable(string())),waiting_until:optional(nullable(string())),waiting_check_every:optional(nullable(string()))}).partial()))}))}),Z=h.extend({asset_type:literal("quest").default("quest"),name:optional(nullable(string())).default(null),description:optional(nullable(p)),type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:optional(nullable(number().int().nonnegative())),items:optional(array(R)).default([])}).transform(u=>a$2(u)),F=j.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,items:true,progress:true,is_pinned_in_team:true}).extend({asset_type:literal("quest").default("quest"),last_updated:string().default(()=>new Date().toISOString())}).transform(u=>a$2(u)),M=S.partial().extend({status:optional(_)}),N=object({id:uuid(),quest_id:uuid(),user_id:uuid(),item_id:optional(nullable(uuid())),asset_id:optional(nullable(uuid())),asset_type:optional(nullable(a$1)),assets:optional(nullable(a)),description:optional(nullable(p)),review:optional(nullable(p)),status:q,reviewer_id:optional(nullable(uuid())),reviewed_at:optional(nullable(string())),eval_action_id:optional(nullable(uuid())),eval_score:optional(nullable(number())),eval_status:optional(nullable(I)),created_at:string(),updated_at:string()}),P=object({item_id:uuid(),assets:optional(nullable(c)),description:optional(nullable(union([string(),p])))}),G=object({status:_enum(["accepted","rejected"]),review:optional(nullable(union([string(),p])))});export{z as a,E as b,_ as c,C as d,I as e,q as f,T as g,A as h,S as i,R as j,j as k,Z as l,F as m,M as n,N as o,P as p,G as q};//# sourceMappingURL=chunk-BTHFK5MC.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-BTHFK5MC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schema/quests.ts"],"names":["QuestTypeSchema","zodEnum","QuestStatusSchema","QuestItemStatusSchema","RewardCurrencySchema","EntryEvalStatusSchema","EntryStatusSchema","TipTapNode","object","string","optional","array","any","record","ContentSchema","literal","QuestItemBaseSchema","uuid","nullable","number","AssetTypeSchema","QuestSubmissionAssetDeclarationSchema","KeyedAssetRefsSchema","zodBoolean","QuestItemSchema","CreateQuestItemObjectSchema","CreateQuestItemSchema","union","s","QuestSpecificsSchema","QuestSchema","AssetSchema","AssetMetadataSchema","CreateQuestSchema","CreateAssetSchema","value","normalizeAssetConfigForParsing","UpdateQuestSchema","UpdateQuestItemSchema","EntrySchema","CreateEntrySchema","KeyedAssetInputSchema","ReviewEntrySchema"],"mappings":"uPAkCA,IAAMA,CAAkBC,CAAAA,KAAAA,CAAQ,CAAC,UAAA,CAAY,YAAY,CAAC,CAAA,CACpDC,CAAoBD,CAAAA,KAAAA,CAAQ,CAAC,OAAA,CAAS,OAAQ,QAAU,CAAA,WAAW,CAAC,CAAA,CAEpEE,CAAwBF,CAAAA,KAAAA,CAAQ,CACpC,SACA,CAAA,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QAASD,CAAAA,IAAAA,EAAM,CAAC,CACtC,CAAA,WAAA,CAAaP,SAASQ,QAAST,CAAAA,MAAAA,EAAQ,CAAC,CACxC,CAAA,cAAA,CAAgBC,SAASQ,QAASD,CAAAA,IAAAA,EAAM,CAAC,CACzC,CAAA,UAAA,CAAYP,SAASQ,QAASC,CAAAA,MAAAA,EAAQ,CAAC,CACvC,CAAA,WAAA,CAAaT,SAASQ,QAASb,CAAAA,CAAqB,CAAC,CAAA,CACrD,UAAYI,CAAAA,MAAAA,GACZ,UAAYA,CAAAA,MAAAA,EACd,CAAC,CAEK+B,CAAAA,CAAAA,CAAoBhC,OAAO,CAC/B,OAAA,CAASS,IAAK,EAAA,CACd,MAAQP,CAAAA,QAAAA,CAASQ,SAASuB,CAAqB,CAAC,CAChD,CAAA,WAAA,CAAa/B,QAASQ,CAAAA,QAAAA,CAASS,MAAM,CAAClB,MAAAA,EAAUK,CAAAA,CAAa,CAAC,CAAC,CAAC,CAClE,CAAC,CAEK4B,CAAAA,CAAAA,CAAoBlC,MAAO,CAAA,CAC/B,OAAQP,KAAQ,CAAA,CAAC,UAAY,CAAA,UAAU,CAAC,CAAA,CACxC,OAAQS,QAASQ,CAAAA,QAAAA,CAASS,KAAM,CAAA,CAAClB,MAAO,EAAA,CAAGK,CAAa,CAAC,CAAC,CAAC,CAC7D,CAAC","file":"chunk-BTHFK5MC.js","sourcesContent":["import {\n object,\n string,\n number,\n array,\n literal,\n record,\n type z,\n any,\n optional,\n nullable,\n union,\n uuid,\n boolean as zodBoolean,\n enum as zodEnum,\n type ZodType,\n} from \"zod\";\n\nimport {\n AssetSchema,\n AssetMetadataSchema,\n CreateAssetSchema,\n normalizeAssetConfigForParsing,\n} from \"./assets\";\nimport { AssetTypeSchema } from \"./common\";\nimport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n} from \"../utils/quest-submission\";\n\n// ── Enums ──────────────────────────────────────────────────────────────\n\n/** closable: one active entry per item per user; continuous: unlimited per item */\nconst QuestTypeSchema = zodEnum([\"closable\", \"continuous\"]);\nconst QuestStatusSchema = zodEnum([\"draft\", \"open\", \"closed\", \"cancelled\"]);\n\nconst QuestItemStatusSchema = zodEnum([\n \"pending\",\n \"in_progress\",\n \"done\",\n \"skipped\",\n]);\n\nconst RewardCurrencySchema = zodEnum([\"btc\", \"usd\"]);\n\nconst EntryEvalStatusSchema = zodEnum([\n \"skipped\",\n \"running\",\n \"passed\",\n \"failed\",\n \"errored\",\n]);\n\nconst EntryStatusSchema = zodEnum([\"submitted\", \"accepted\", \"rejected\"]);\n\n// ── Content (TipTap) ───────────────────────────────────────────────────\n// Posts/quests share the same rich description shape: { json, text }.\n// We mirror it locally here so the quest schema doesn't depend on posts.\n\nconst TipTapNode: ZodType<any> = object({\n type: string(),\n content: optional(array(any())),\n attrs: optional(record(string(), any())),\n marks: optional(array(any())),\n text: optional(string()),\n});\n\nconst ContentSchema = object({\n json: object({\n type: literal(\"doc\"),\n content: array(TipTapNode),\n }),\n text: string(),\n});\n\n// ── Quest items ────────────────────────────────────────────────────────\n\nconst QuestItemBaseSchema = object({\n id: uuid(),\n quest_id: uuid(),\n description: string(),\n status: QuestItemStatusSchema.default(\"pending\"),\n auto_skipped: optional(nullable(string().or(any()))),\n status_before_auto_skip: optional(nullable(QuestItemStatusSchema)),\n sort_order: number().default(0),\n type: string().default(\"task\"),\n created_by: uuid(),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: number().int().nonnegative().default(0),\n reward_currency: RewardCurrencySchema.default(\"btc\"),\n reward_amount: number().int().nonnegative().default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n contributor_keys: optional(\n nullable(\n array(\n object({\n key: string(),\n required: zodBoolean().default(true),\n filters: object({\n assetType: optional(string()),\n fileType: optional(string()),\n extensions: optional(array(string())),\n hasConstraints: zodBoolean().default(false),\n }),\n }),\n ),\n ),\n ),\n created_at: string(),\n updated_at: string(),\n});\n\nconst QuestItemSchema = QuestItemBaseSchema;\n\n/**\n * Shape used by `POST /quests/create` (inline items) and\n * `POST /quests/:id/items` (batch add). The controller fills in\n * `quest_id`, `created_by`, and lifecycle-derived fields\n * (`auto_skipped`, `status_before_auto_skip`).\n *\n * Accepts a plain description string as a convenience — it's lifted\n * into `{ description }` by the `union` below.\n */\nconst CreateQuestItemObjectSchema = object({\n description: string().min(1, { message: \"Item description cannot be empty\" }),\n type: optional(string()).default(\"task\"),\n sort_order: optional(number().int()),\n assignee_id: optional(nullable(uuid())),\n expected_asset_type: optional(nullable(AssetTypeSchema)),\n reward_xp: optional(number().int().nonnegative()).default(0),\n reward_currency: optional(RewardCurrencySchema).default(\"btc\"),\n // Amount is in minor units of `reward_currency`: sats for BTC, cents\n // for USD. Both fit in JS numbers comfortably for our reward sizes;\n // the underlying column is `bigint`.\n reward_amount: optional(number().int().nonnegative()).default(0),\n child_quest_id: optional(nullable(uuid())),\n eval_route_id: optional(nullable(uuid())),\n eval_score_path: optional(nullable(string())),\n eval_pass_min: optional(nullable(number())),\n eval_pass_max: optional(nullable(number())),\n submission_assets: optional(\n nullable(record(string(), QuestSubmissionAssetDeclarationSchema)),\n ),\n eval_static_inputs: optional(nullable(KeyedAssetRefsSchema)),\n notes: optional(nullable(string())),\n});\n\nconst CreateQuestItemSchema = union([\n string().transform((s) => ({ description: s })),\n CreateQuestItemObjectSchema,\n]).pipe(CreateQuestItemObjectSchema);\n\n// ── Quest ──────────────────────────────────────────────────────────────\n\nconst QuestSpecificsSchema = object({\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n closed_at: optional(nullable(string())),\n});\n\nconst QuestSchema = AssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n metadata: optional(nullable(AssetMetadataSchema.partial())),\n // List and detail both nest specifics under `quest`. Detail also hoists\n // full items to the top level. Progress (counts + bar segments) is always\n // top-level `progress` on list and detail responses.\n quest: optional(QuestSpecificsSchema.partial()),\n items: optional(array(QuestItemSchema.partial())),\n progress: optional(\n object({\n total: number(),\n resolved: number(),\n remaining: number(),\n // Lightweight per-item segments for progress bars (list + detail).\n items: optional(\n array(\n object({\n id: string(),\n status: QuestItemStatusSchema,\n waiting_on: optional(nullable(string())),\n waiting_until: optional(nullable(string())),\n waiting_check_every: optional(nullable(string())),\n }).partial()\n )\n ),\n })\n ),\n});\n\n/**\n * Schema used by the backend controller and SDK clients to validate /\n * default the body of `POST /quests/create`. Mirrors how\n * `CreatePostSchema` defaults `org_id`/`team_id` so non-frontend callers\n * don't have to know about `GLOBAL_ORG_ID`.\n *\n * The `items` field accepts either plain strings or full item objects —\n * the backend `createQuestItems`/`createQuest` paths already handle both\n * shapes, and `CreateQuestItemSchema` normalizes strings into\n * `{ description }`.\n */\nconst CreateQuestSchema = CreateAssetSchema.extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n name: optional(nullable(string())).default(null),\n description: optional(nullable(ContentSchema)),\n type: QuestTypeSchema.default(\"closable\"),\n status: QuestStatusSchema.default(\"open\"),\n max_xp_per_contributor: optional(nullable(number().int().nonnegative())),\n items: optional(array(CreateQuestItemSchema)).default([]),\n}).transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestSchema = QuestSchema.partial()\n .omit({\n user_id: true,\n id: true,\n created_at: true,\n last_updated: true,\n organization: true,\n user: true,\n team: true,\n slug: true,\n items: true,\n progress: true,\n is_pinned_in_team: true,\n })\n .extend({\n asset_type: literal(\"quest\").default(\"quest\"),\n last_updated: string().default(() => new Date().toISOString()),\n })\n .transform((value) => normalizeAssetConfigForParsing(value));\n\nconst UpdateQuestItemSchema = CreateQuestItemObjectSchema.partial().extend({\n status: optional(QuestItemStatusSchema),\n});\n\n// ── Entries ────────────────────────────────────────────────────────────\n\nconst EntrySchema = object({\n id: uuid(),\n quest_id: uuid(),\n user_id: uuid(),\n item_id: optional(nullable(uuid())),\n asset_id: optional(nullable(uuid())),\n asset_type: optional(nullable(AssetTypeSchema)),\n assets: optional(nullable(KeyedAssetRefsSchema)),\n description: optional(nullable(ContentSchema)),\n review: optional(nullable(ContentSchema)),\n status: EntryStatusSchema,\n reviewer_id: optional(nullable(uuid())),\n reviewed_at: optional(nullable(string())),\n eval_action_id: optional(nullable(uuid())),\n eval_score: optional(nullable(number())),\n eval_status: optional(nullable(EntryEvalStatusSchema)),\n created_at: string(),\n updated_at: string(),\n});\n\nconst CreateEntrySchema = object({\n item_id: uuid(),\n assets: optional(nullable(KeyedAssetInputSchema)),\n description: optional(nullable(union([string(), ContentSchema]))),\n});\n\nconst ReviewEntrySchema = object({\n status: zodEnum([\"accepted\", \"rejected\"]),\n review: optional(nullable(union([string(), ContentSchema]))),\n});\n\n// ── Exports ────────────────────────────────────────────────────────────\n\nexport {\n KeyedAssetRefsSchema,\n KeyedAssetInputSchema,\n QuestSubmissionAssetDeclarationSchema,\n QuestTypeSchema,\n QuestStatusSchema,\n QuestItemStatusSchema,\n RewardCurrencySchema,\n EntryEvalStatusSchema,\n EntryStatusSchema,\n QuestSchema,\n QuestItemSchema,\n QuestItemBaseSchema,\n CreateQuestSchema,\n CreateQuestItemSchema,\n CreateQuestItemObjectSchema,\n UpdateQuestSchema,\n UpdateQuestItemSchema,\n EntrySchema,\n CreateEntrySchema,\n ReviewEntrySchema,\n};\n\nexport type QuestType = z.infer<typeof QuestTypeSchema>;\nexport type QuestStatus = z.infer<typeof QuestStatusSchema>;\nexport type QuestItemStatus = z.infer<typeof QuestItemStatusSchema>;\nexport type RewardCurrency = z.infer<typeof RewardCurrencySchema>;\nexport type EntryEvalStatus = z.infer<typeof EntryEvalStatusSchema>;\nexport type EntryStatus = z.infer<typeof EntryStatusSchema>;\nexport type Quest = z.infer<typeof QuestSchema>;\nexport type QuestItem = z.infer<typeof QuestItemSchema>;\nexport type CreateQuest = z.infer<typeof CreateQuestSchema>;\nexport type CreateQuestItem = z.infer<typeof CreateQuestItemSchema>;\nexport type UpdateQuest = z.infer<typeof UpdateQuestSchema>;\nexport type UpdateQuestItem = z.infer<typeof UpdateQuestItemSchema>;\nexport type Entry = z.infer<typeof EntrySchema>;\nexport type CreateEntry = z.infer<typeof CreateEntrySchema>;\nexport type ReviewEntry = z.infer<typeof ReviewEntrySchema>;\n"]}
|
package/dist/chunk-ZTTLI5V5.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkQJ3DLN2Y_cjs=require('./chunk-QJ3DLN2Y.cjs'),chunkTB7MTWMO_cjs=require('./chunk-TB7MTWMO.cjs'),chunkMNECKGIP_cjs=require('./chunk-MNECKGIP.cjs'),zod=require('zod');var z=zod.enum(["closable","continuous"]),E=zod.enum(["draft","open","closed","cancelled"]),_=zod.enum(["pending","in_progress","done","skipped"]),C=zod.enum(["btc","usd"]),I=zod.enum(["skipped","running","passed","failed","errored"]),q=zod.enum(["submitted","accepted","rejected"]),k=zod.object({type:zod.string(),content:zod.optional(zod.array(zod.any())),attrs:zod.optional(zod.record(zod.string(),zod.any())),marks:zod.optional(zod.array(zod.any())),text:zod.optional(zod.string())}),p=zod.object({json:zod.object({type:zod.literal("doc"),content:zod.array(k)}),text:zod.string()}),T=zod.object({id:zod.uuid(),quest_id:zod.uuid(),description:zod.string(),status:_.default("pending"),auto_skipped:zod.optional(zod.nullable(zod.string().or(zod.any()))),status_before_auto_skip:zod.optional(zod.nullable(_)),sort_order:zod.number().default(0),type:zod.string().default("task"),created_by:zod.uuid(),assignee_id:zod.optional(zod.nullable(zod.uuid())),expected_asset_type:zod.optional(zod.nullable(chunkMNECKGIP_cjs.a)),reward_xp:zod.number().int().nonnegative().default(0),reward_currency:C.default("btc"),reward_amount:zod.number().int().nonnegative().default(0),child_quest_id:zod.optional(zod.nullable(zod.uuid())),eval_route_id:zod.optional(zod.nullable(zod.uuid())),eval_score_path:zod.optional(zod.nullable(zod.string())),eval_pass_min:zod.optional(zod.nullable(zod.number())),eval_pass_max:zod.optional(zod.nullable(zod.number())),submission_assets:zod.optional(zod.nullable(zod.record(zod.string(),chunkQJ3DLN2Y_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunkQJ3DLN2Y_cjs.a)),notes:zod.optional(zod.nullable(zod.string())),contributor_keys:zod.optional(zod.nullable(zod.array(zod.object({key:zod.string(),required:zod.boolean().default(true),filters:zod.object({assetType:zod.optional(zod.string()),fileType:zod.optional(zod.string()),extensions:zod.optional(zod.array(zod.string())),hasConstraints:zod.boolean().default(false)})})))),created_at:zod.string(),updated_at:zod.string()}),A=T,S=zod.object({description:zod.string().min(1,{message:"Item description cannot be empty"}),type:zod.optional(zod.string()).default("task"),sort_order:zod.optional(zod.number().int()),assignee_id:zod.optional(zod.nullable(zod.uuid())),expected_asset_type:zod.optional(zod.nullable(chunkMNECKGIP_cjs.a)),reward_xp:zod.optional(zod.number().int().nonnegative()).default(0),reward_currency:zod.optional(C).default("btc"),reward_amount:zod.optional(zod.number().int().nonnegative()).default(0),child_quest_id:zod.optional(zod.nullable(zod.uuid())),eval_route_id:zod.optional(zod.nullable(zod.uuid())),eval_score_path:zod.optional(zod.nullable(zod.string())),eval_pass_min:zod.optional(zod.nullable(zod.number())),eval_pass_max:zod.optional(zod.nullable(zod.number())),submission_assets:zod.optional(zod.nullable(zod.record(zod.string(),chunkQJ3DLN2Y_cjs.d))),eval_static_inputs:zod.optional(zod.nullable(chunkQJ3DLN2Y_cjs.a)),notes:zod.optional(zod.nullable(zod.string()))}),R=zod.union([zod.string().transform(u=>({description:u})),S]).pipe(S),U=zod.object({type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:zod.optional(zod.nullable(zod.number().int().nonnegative())),closed_at:zod.optional(zod.nullable(zod.string()))}),j=chunkTB7MTWMO_cjs.f.extend({asset_type:zod.literal("quest").default("quest"),metadata:zod.optional(zod.nullable(chunkTB7MTWMO_cjs.b.partial())),quest:zod.optional(U.partial()),items:zod.optional(zod.array(A.partial())),progress:zod.optional(zod.object({total:zod.number(),resolved:zod.number(),remaining:zod.number(),items:zod.optional(zod.array(zod.object({id:zod.string(),status:_,waiting_on:zod.optional(zod.nullable(zod.string())),waiting_until:zod.optional(zod.nullable(zod.string())),waiting_check_every:zod.optional(zod.nullable(zod.string()))}).partial()))}))}),Z=chunkTB7MTWMO_cjs.h.extend({asset_type:zod.literal("quest").default("quest"),name:zod.optional(zod.nullable(zod.string())).default(null),description:zod.optional(zod.nullable(p)),type:z.default("closable"),status:E.default("open"),max_xp_per_contributor:zod.optional(zod.nullable(zod.number().int().nonnegative())),items:zod.optional(zod.array(R)).default([])}).transform(u=>chunkTB7MTWMO_cjs.a(u)),F=j.partial().omit({user_id:true,id:true,created_at:true,last_updated:true,organization:true,user:true,team:true,slug:true,items:true,progress:true,is_pinned_in_team:true}).extend({asset_type:zod.literal("quest").default("quest"),last_updated:zod.string().default(()=>new Date().toISOString())}).transform(u=>chunkTB7MTWMO_cjs.a(u)),M=S.partial().extend({status:zod.optional(_)}),N=zod.object({id:zod.uuid(),quest_id:zod.uuid(),user_id:zod.uuid(),item_id:zod.optional(zod.nullable(zod.uuid())),asset_id:zod.optional(zod.nullable(zod.uuid())),asset_type:zod.optional(zod.nullable(chunkMNECKGIP_cjs.a)),assets:zod.optional(zod.nullable(chunkQJ3DLN2Y_cjs.a)),description:zod.optional(zod.nullable(p)),review:zod.optional(zod.nullable(p)),status:q,reviewer_id:zod.optional(zod.nullable(zod.uuid())),reviewed_at:zod.optional(zod.nullable(zod.string())),eval_action_id:zod.optional(zod.nullable(zod.uuid())),eval_score:zod.optional(zod.nullable(zod.number())),eval_status:zod.optional(zod.nullable(I)),created_at:zod.string(),updated_at:zod.string()}),P=zod.object({item_id:zod.uuid(),assets:zod.optional(zod.nullable(chunkQJ3DLN2Y_cjs.c)),description:zod.optional(zod.nullable(zod.union([zod.string(),p])))}),G=zod.object({status:zod.enum(["accepted","rejected"]),review:zod.optional(zod.nullable(zod.union([zod.string(),p])))});exports.a=z;exports.b=E;exports.c=_;exports.d=C;exports.e=I;exports.f=q;exports.g=T;exports.h=A;exports.i=S;exports.j=R;exports.k=j;exports.l=Z;exports.m=F;exports.n=M;exports.o=N;exports.p=P;exports.q=G;//# sourceMappingURL=chunk-ZTTLI5V5.cjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-ZTTLI5V5.cjs.map
|