@prave/shared 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,405 @@
1
+ import { z } from 'zod';
2
+ export declare const prStatusSchema: z.ZodEnum<["open", "merged", "closed"]>;
3
+ export type PullRequestStatus = z.infer<typeof prStatusSchema>;
4
+ export declare const skillPullRequestSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ skill_id: z.ZodString;
7
+ author_id: z.ZodString;
8
+ title: z.ZodString;
9
+ summary: z.ZodNullable<z.ZodString>;
10
+ proposed_content: z.ZodString;
11
+ proposed_description: z.ZodNullable<z.ZodString>;
12
+ status: z.ZodEnum<["open", "merged", "closed"]>;
13
+ merged_by: z.ZodNullable<z.ZodString>;
14
+ merged_at: z.ZodNullable<z.ZodString>;
15
+ closed_by: z.ZodNullable<z.ZodString>;
16
+ closed_at: z.ZodNullable<z.ZodString>;
17
+ created_at: z.ZodString;
18
+ updated_at: z.ZodString;
19
+ /** Attached by the API: public-safe author slice for cards/avatars. */
20
+ author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
21
+ id: z.ZodString;
22
+ username: z.ZodNullable<z.ZodString>;
23
+ display_name: z.ZodNullable<z.ZodString>;
24
+ avatar_url: z.ZodNullable<z.ZodString>;
25
+ is_creator: z.ZodBoolean;
26
+ is_partner: z.ZodBoolean;
27
+ }, "strip", z.ZodTypeAny, {
28
+ id: string;
29
+ username: string | null;
30
+ display_name: string | null;
31
+ avatar_url: string | null;
32
+ is_creator: boolean;
33
+ is_partner: boolean;
34
+ }, {
35
+ id: string;
36
+ username: string | null;
37
+ display_name: string | null;
38
+ avatar_url: string | null;
39
+ is_creator: boolean;
40
+ is_partner: boolean;
41
+ }>>>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ status: "open" | "merged" | "closed";
44
+ id: string;
45
+ created_at: string;
46
+ updated_at: string;
47
+ skill_id: string;
48
+ summary: string | null;
49
+ author_id: string;
50
+ title: string;
51
+ proposed_content: string;
52
+ proposed_description: string | null;
53
+ merged_by: string | null;
54
+ merged_at: string | null;
55
+ closed_by: string | null;
56
+ closed_at: string | null;
57
+ author?: {
58
+ id: string;
59
+ username: string | null;
60
+ display_name: string | null;
61
+ avatar_url: string | null;
62
+ is_creator: boolean;
63
+ is_partner: boolean;
64
+ } | null | undefined;
65
+ }, {
66
+ status: "open" | "merged" | "closed";
67
+ id: string;
68
+ created_at: string;
69
+ updated_at: string;
70
+ skill_id: string;
71
+ summary: string | null;
72
+ author_id: string;
73
+ title: string;
74
+ proposed_content: string;
75
+ proposed_description: string | null;
76
+ merged_by: string | null;
77
+ merged_at: string | null;
78
+ closed_by: string | null;
79
+ closed_at: string | null;
80
+ author?: {
81
+ id: string;
82
+ username: string | null;
83
+ display_name: string | null;
84
+ avatar_url: string | null;
85
+ is_creator: boolean;
86
+ is_partner: boolean;
87
+ } | null | undefined;
88
+ }>;
89
+ export type SkillPullRequest = z.infer<typeof skillPullRequestSchema>;
90
+ export declare const createPullRequestInputSchema: z.ZodObject<{
91
+ title: z.ZodString;
92
+ summary: z.ZodNullable<z.ZodOptional<z.ZodString>>;
93
+ proposed_content: z.ZodString;
94
+ proposed_description: z.ZodNullable<z.ZodOptional<z.ZodString>>;
95
+ }, "strip", z.ZodTypeAny, {
96
+ title: string;
97
+ proposed_content: string;
98
+ summary?: string | null | undefined;
99
+ proposed_description?: string | null | undefined;
100
+ }, {
101
+ title: string;
102
+ proposed_content: string;
103
+ summary?: string | null | undefined;
104
+ proposed_description?: string | null | undefined;
105
+ }>;
106
+ export type CreatePullRequestInput = z.infer<typeof createPullRequestInputSchema>;
107
+ export declare const skillPrCommentSchema: z.ZodObject<{
108
+ id: z.ZodString;
109
+ pull_request_id: z.ZodString;
110
+ author_id: z.ZodString;
111
+ body: z.ZodString;
112
+ created_at: z.ZodString;
113
+ author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
114
+ id: z.ZodString;
115
+ username: z.ZodNullable<z.ZodString>;
116
+ display_name: z.ZodNullable<z.ZodString>;
117
+ avatar_url: z.ZodNullable<z.ZodString>;
118
+ is_creator: z.ZodBoolean;
119
+ is_partner: z.ZodBoolean;
120
+ }, "strip", z.ZodTypeAny, {
121
+ id: string;
122
+ username: string | null;
123
+ display_name: string | null;
124
+ avatar_url: string | null;
125
+ is_creator: boolean;
126
+ is_partner: boolean;
127
+ }, {
128
+ id: string;
129
+ username: string | null;
130
+ display_name: string | null;
131
+ avatar_url: string | null;
132
+ is_creator: boolean;
133
+ is_partner: boolean;
134
+ }>>>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ id: string;
137
+ created_at: string;
138
+ author_id: string;
139
+ pull_request_id: string;
140
+ body: string;
141
+ author?: {
142
+ id: string;
143
+ username: string | null;
144
+ display_name: string | null;
145
+ avatar_url: string | null;
146
+ is_creator: boolean;
147
+ is_partner: boolean;
148
+ } | null | undefined;
149
+ }, {
150
+ id: string;
151
+ created_at: string;
152
+ author_id: string;
153
+ pull_request_id: string;
154
+ body: string;
155
+ author?: {
156
+ id: string;
157
+ username: string | null;
158
+ display_name: string | null;
159
+ avatar_url: string | null;
160
+ is_creator: boolean;
161
+ is_partner: boolean;
162
+ } | null | undefined;
163
+ }>;
164
+ export type SkillPrComment = z.infer<typeof skillPrCommentSchema>;
165
+ export declare const createPrCommentInputSchema: z.ZodObject<{
166
+ body: z.ZodString;
167
+ }, "strip", z.ZodTypeAny, {
168
+ body: string;
169
+ }, {
170
+ body: string;
171
+ }>;
172
+ export type CreatePrCommentInput = z.infer<typeof createPrCommentInputSchema>;
173
+ export declare const pullRequestPageSchema: z.ZodObject<{
174
+ pull_request: z.ZodObject<{
175
+ id: z.ZodString;
176
+ skill_id: z.ZodString;
177
+ author_id: z.ZodString;
178
+ title: z.ZodString;
179
+ summary: z.ZodNullable<z.ZodString>;
180
+ proposed_content: z.ZodString;
181
+ proposed_description: z.ZodNullable<z.ZodString>;
182
+ status: z.ZodEnum<["open", "merged", "closed"]>;
183
+ merged_by: z.ZodNullable<z.ZodString>;
184
+ merged_at: z.ZodNullable<z.ZodString>;
185
+ closed_by: z.ZodNullable<z.ZodString>;
186
+ closed_at: z.ZodNullable<z.ZodString>;
187
+ created_at: z.ZodString;
188
+ updated_at: z.ZodString;
189
+ /** Attached by the API: public-safe author slice for cards/avatars. */
190
+ author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
191
+ id: z.ZodString;
192
+ username: z.ZodNullable<z.ZodString>;
193
+ display_name: z.ZodNullable<z.ZodString>;
194
+ avatar_url: z.ZodNullable<z.ZodString>;
195
+ is_creator: z.ZodBoolean;
196
+ is_partner: z.ZodBoolean;
197
+ }, "strip", z.ZodTypeAny, {
198
+ id: string;
199
+ username: string | null;
200
+ display_name: string | null;
201
+ avatar_url: string | null;
202
+ is_creator: boolean;
203
+ is_partner: boolean;
204
+ }, {
205
+ id: string;
206
+ username: string | null;
207
+ display_name: string | null;
208
+ avatar_url: string | null;
209
+ is_creator: boolean;
210
+ is_partner: boolean;
211
+ }>>>;
212
+ }, "strip", z.ZodTypeAny, {
213
+ status: "open" | "merged" | "closed";
214
+ id: string;
215
+ created_at: string;
216
+ updated_at: string;
217
+ skill_id: string;
218
+ summary: string | null;
219
+ author_id: string;
220
+ title: string;
221
+ proposed_content: string;
222
+ proposed_description: string | null;
223
+ merged_by: string | null;
224
+ merged_at: string | null;
225
+ closed_by: string | null;
226
+ closed_at: string | null;
227
+ author?: {
228
+ id: string;
229
+ username: string | null;
230
+ display_name: string | null;
231
+ avatar_url: string | null;
232
+ is_creator: boolean;
233
+ is_partner: boolean;
234
+ } | null | undefined;
235
+ }, {
236
+ status: "open" | "merged" | "closed";
237
+ id: string;
238
+ created_at: string;
239
+ updated_at: string;
240
+ skill_id: string;
241
+ summary: string | null;
242
+ author_id: string;
243
+ title: string;
244
+ proposed_content: string;
245
+ proposed_description: string | null;
246
+ merged_by: string | null;
247
+ merged_at: string | null;
248
+ closed_by: string | null;
249
+ closed_at: string | null;
250
+ author?: {
251
+ id: string;
252
+ username: string | null;
253
+ display_name: string | null;
254
+ avatar_url: string | null;
255
+ is_creator: boolean;
256
+ is_partner: boolean;
257
+ } | null | undefined;
258
+ }>;
259
+ comments: z.ZodArray<z.ZodObject<{
260
+ id: z.ZodString;
261
+ pull_request_id: z.ZodString;
262
+ author_id: z.ZodString;
263
+ body: z.ZodString;
264
+ created_at: z.ZodString;
265
+ author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
266
+ id: z.ZodString;
267
+ username: z.ZodNullable<z.ZodString>;
268
+ display_name: z.ZodNullable<z.ZodString>;
269
+ avatar_url: z.ZodNullable<z.ZodString>;
270
+ is_creator: z.ZodBoolean;
271
+ is_partner: z.ZodBoolean;
272
+ }, "strip", z.ZodTypeAny, {
273
+ id: string;
274
+ username: string | null;
275
+ display_name: string | null;
276
+ avatar_url: string | null;
277
+ is_creator: boolean;
278
+ is_partner: boolean;
279
+ }, {
280
+ id: string;
281
+ username: string | null;
282
+ display_name: string | null;
283
+ avatar_url: string | null;
284
+ is_creator: boolean;
285
+ is_partner: boolean;
286
+ }>>>;
287
+ }, "strip", z.ZodTypeAny, {
288
+ id: string;
289
+ created_at: string;
290
+ author_id: string;
291
+ pull_request_id: string;
292
+ body: string;
293
+ author?: {
294
+ id: string;
295
+ username: string | null;
296
+ display_name: string | null;
297
+ avatar_url: string | null;
298
+ is_creator: boolean;
299
+ is_partner: boolean;
300
+ } | null | undefined;
301
+ }, {
302
+ id: string;
303
+ created_at: string;
304
+ author_id: string;
305
+ pull_request_id: string;
306
+ body: string;
307
+ author?: {
308
+ id: string;
309
+ username: string | null;
310
+ display_name: string | null;
311
+ avatar_url: string | null;
312
+ is_creator: boolean;
313
+ is_partner: boolean;
314
+ } | null | undefined;
315
+ }>, "many">;
316
+ /** Snapshot of the live skill content the PR was opened against — used for diff. */
317
+ base_content: z.ZodString;
318
+ base_description: z.ZodNullable<z.ZodString>;
319
+ }, "strip", z.ZodTypeAny, {
320
+ pull_request: {
321
+ status: "open" | "merged" | "closed";
322
+ id: string;
323
+ created_at: string;
324
+ updated_at: string;
325
+ skill_id: string;
326
+ summary: string | null;
327
+ author_id: string;
328
+ title: string;
329
+ proposed_content: string;
330
+ proposed_description: string | null;
331
+ merged_by: string | null;
332
+ merged_at: string | null;
333
+ closed_by: string | null;
334
+ closed_at: string | null;
335
+ author?: {
336
+ id: string;
337
+ username: string | null;
338
+ display_name: string | null;
339
+ avatar_url: string | null;
340
+ is_creator: boolean;
341
+ is_partner: boolean;
342
+ } | null | undefined;
343
+ };
344
+ comments: {
345
+ id: string;
346
+ created_at: string;
347
+ author_id: string;
348
+ pull_request_id: string;
349
+ body: string;
350
+ author?: {
351
+ id: string;
352
+ username: string | null;
353
+ display_name: string | null;
354
+ avatar_url: string | null;
355
+ is_creator: boolean;
356
+ is_partner: boolean;
357
+ } | null | undefined;
358
+ }[];
359
+ base_content: string;
360
+ base_description: string | null;
361
+ }, {
362
+ pull_request: {
363
+ status: "open" | "merged" | "closed";
364
+ id: string;
365
+ created_at: string;
366
+ updated_at: string;
367
+ skill_id: string;
368
+ summary: string | null;
369
+ author_id: string;
370
+ title: string;
371
+ proposed_content: string;
372
+ proposed_description: string | null;
373
+ merged_by: string | null;
374
+ merged_at: string | null;
375
+ closed_by: string | null;
376
+ closed_at: string | null;
377
+ author?: {
378
+ id: string;
379
+ username: string | null;
380
+ display_name: string | null;
381
+ avatar_url: string | null;
382
+ is_creator: boolean;
383
+ is_partner: boolean;
384
+ } | null | undefined;
385
+ };
386
+ comments: {
387
+ id: string;
388
+ created_at: string;
389
+ author_id: string;
390
+ pull_request_id: string;
391
+ body: string;
392
+ author?: {
393
+ id: string;
394
+ username: string | null;
395
+ display_name: string | null;
396
+ avatar_url: string | null;
397
+ is_creator: boolean;
398
+ is_partner: boolean;
399
+ } | null | undefined;
400
+ }[];
401
+ base_content: string;
402
+ base_description: string | null;
403
+ }>;
404
+ export type PullRequestPage = z.infer<typeof pullRequestPageSchema>;
405
+ //# sourceMappingUR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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpF,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,64 @@
1
+ import { z } from 'zod';
2
+ export const prStatusSchema = z.enum(['open', 'merged', 'closed']);
3
+ export const skillPullRequestSchema = z.object({
4
+ id: z.string().uuid(),
5
+ skill_id: z.string().uuid(),
6
+ author_id: z.string().uuid(),
7
+ title: z.string().min(3).max(140),
8
+ summary: z.string().max(2000).nullable(),
9
+ proposed_content: z.string(),
10
+ proposed_description: z.string().max(500).nullable(),
11
+ status: prStatusSchema,
12
+ merged_by: z.string().uuid().nullable(),
13
+ merged_at: z.string().datetime().nullable(),
14
+ closed_by: z.string().uuid().nullable(),
15
+ closed_at: z.string().datetime().nullable(),
16
+ created_at: z.string().datetime(),
17
+ updated_at: z.string().datetime(),
18
+ /** Attached by the API: public-safe author slice for cards/avatars. */
19
+ author: z
20
+ .object({
21
+ id: z.string().uuid(),
22
+ username: z.string().nullable(),
23
+ display_name: z.string().nullable(),
24
+ avatar_url: z.string().nullable(),
25
+ is_creator: z.boolean(),
26
+ is_partner: z.boolean(),
27
+ })
28
+ .nullable()
29
+ .optional(),
30
+ });
31
+ export const createPullRequestInputSchema = z.object({
32
+ title: z.string().min(3).max(140),
33
+ summary: z.string().max(2000).optional().nullable(),
34
+ proposed_content: z.string().min(1),
35
+ proposed_description: z.string().max(500).optional().nullable(),
36
+ });
37
+ export const skillPrCommentSchema = z.object({
38
+ id: z.string().uuid(),
39
+ pull_request_id: z.string().uuid(),
40
+ author_id: z.string().uuid(),
41
+ body: z.string().min(1).max(4000),
42
+ created_at: z.string().datetime(),
43
+ author: z
44
+ .object({
45
+ id: z.string().uuid(),
46
+ username: z.string().nullable(),
47
+ display_name: z.string().nullable(),
48
+ avatar_url: z.string().nullable(),
49
+ is_creator: z.boolean(),
50
+ is_partner: z.boolean(),
51
+ })
52
+ .nullable()
53
+ .optional(),
54
+ });
55
+ export const createPrCommentInputSchema = z.object({
56
+ body: z.string().min(1).max(4000),
57
+ });
58
+ export const pullRequestPageSchema = z.object({
59
+ pull_request: skillPullRequestSchema,
60
+ comments: z.array(skillPrCommentSchema),
61
+ /** Snapshot of the live skill content the PR was opened against — used for diff. */
62
+ base_content: z.string(),
63
+ base_description: z.string().nullable(),
64
+ });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const skillVisibilitySchema: z.ZodEnum<["public", "private", "org"]>;
2
+ export declare const skillVisibilitySchema: z.ZodEnum<["public", "private"]>;
3
3
  export type SkillVisibility = z.infer<typeof skillVisibilitySchema>;
4
4
  export declare const skillSchema: z.ZodObject<{
5
5
  id: z.ZodString;
@@ -8,7 +8,7 @@ export declare const skillSchema: z.ZodObject<{
8
8
  slug: z.ZodString;
9
9
  description: z.ZodNullable<z.ZodString>;
10
10
  content: z.ZodNullable<z.ZodString>;
11
- visibility: z.ZodDefault<z.ZodEnum<["public", "private", "org"]>>;
11
+ visibility: z.ZodDefault<z.ZodEnum<["public", "private"]>>;
12
12
  source_repo: z.ZodNullable<z.ZodString>;
13
13
  license: z.ZodDefault<z.ZodString>;
14
14
  category: z.ZodNullable<z.ZodString>;
@@ -24,6 +24,29 @@ export declare const skillSchema: z.ZodObject<{
24
24
  is_owner: z.ZodOptional<z.ZodBoolean>;
25
25
  /** Attached by the API on GET: true if the caller has bookmarked the Skill. */
26
26
  bookmarked: z.ZodOptional<z.ZodBoolean>;
27
+ /** Attached by the API: a public slice of the owner profile so cards can render attribution. */
28
+ owner: z.ZodOptional<z.ZodNullable<z.ZodObject<{
29
+ id: z.ZodString;
30
+ username: z.ZodNullable<z.ZodString>;
31
+ display_name: z.ZodNullable<z.ZodString>;
32
+ avatar_url: z.ZodNullable<z.ZodString>;
33
+ is_creator: z.ZodBoolean;
34
+ is_partner: z.ZodBoolean;
35
+ }, "strip", z.ZodTypeAny, {
36
+ id: string;
37
+ username: string | null;
38
+ display_name: string | null;
39
+ avatar_url: string | null;
40
+ is_creator: boolean;
41
+ is_partner: boolean;
42
+ }, {
43
+ id: string;
44
+ username: string | null;
45
+ display_name: string | null;
46
+ avatar_url: string | null;
47
+ is_creator: boolean;
48
+ is_partner: boolean;
49
+ }>>>;
27
50
  created_at: z.ZodString;
28
51
  updated_at: z.ZodString;
29
52
  }, "strip", z.ZodTypeAny, {
@@ -33,7 +56,7 @@ export declare const skillSchema: z.ZodObject<{
33
56
  slug: string;
34
57
  description: string | null;
35
58
  content: string | null;
36
- visibility: "public" | "private" | "org";
59
+ visibility: "public" | "private";
37
60
  source_repo: string | null;
38
61
  license: string;
39
62
  category: string | null;
@@ -48,6 +71,14 @@ export declare const skillSchema: z.ZodObject<{
48
71
  purchased?: boolean | undefined;
49
72
  is_owner?: boolean | undefined;
50
73
  bookmarked?: boolean | undefined;
74
+ owner?: {
75
+ id: string;
76
+ username: string | null;
77
+ display_name: string | null;
78
+ avatar_url: string | null;
79
+ is_creator: boolean;
80
+ is_partner: boolean;
81
+ } | null | undefined;
51
82
  }, {
52
83
  id: string;
53
84
  owner_id: string;
@@ -59,7 +90,7 @@ export declare const skillSchema: z.ZodObject<{
59
90
  category: string | null;
60
91
  created_at: string;
61
92
  updated_at: string;
62
- visibility?: "public" | "private" | "org" | undefined;
93
+ visibility?: "public" | "private" | undefined;
63
94
  license?: string | undefined;
64
95
  tags?: string[] | undefined;
65
96
  install_count?: number | undefined;
@@ -70,6 +101,14 @@ export declare const skillSchema: z.ZodObject<{
70
101
  purchased?: boolean | undefined;
71
102
  is_owner?: boolean | undefined;
72
103
  bookmarked?: boolean | undefined;
104
+ owner?: {
105
+ id: string;
106
+ username: string | null;
107
+ display_name: string | null;
108
+ avatar_url: string | null;
109
+ is_creator: boolean;
110
+ is_partner: boolean;
111
+ } | null | undefined;
73
112
  }>;
74
113
  export type Skill = z.infer<typeof skillSchema>;
75
114
  export declare const createSkillInputSchema: z.ZodObject<{
@@ -77,7 +116,7 @@ export declare const createSkillInputSchema: z.ZodObject<{
77
116
  slug: z.ZodString;
78
117
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
79
118
  content: z.ZodOptional<z.ZodNullable<z.ZodString>>;
80
- visibility: z.ZodOptional<z.ZodDefault<z.ZodEnum<["public", "private", "org"]>>>;
119
+ visibility: z.ZodOptional<z.ZodDefault<z.ZodEnum<["public", "private"]>>>;
81
120
  source_repo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
82
121
  license: z.ZodOptional<z.ZodDefault<z.ZodString>>;
83
122
  category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -89,7 +128,7 @@ export declare const createSkillInputSchema: z.ZodObject<{
89
128
  slug: string;
90
129
  description?: string | null | undefined;
91
130
  content?: string | null | undefined;
92
- visibility?: "public" | "private" | "org" | undefined;
131
+ visibility?: "public" | "private" | undefined;
93
132
  source_repo?: string | null | undefined;
94
133
  license?: string | undefined;
95
134
  category?: string | null | undefined;
@@ -101,7 +140,7 @@ export declare const createSkillInputSchema: z.ZodObject<{
101
140
  slug: string;
102
141
  description?: string | null | undefined;
103
142
  content?: string | null | undefined;
104
- visibility?: "public" | "private" | "org" | undefined;
143
+ visibility?: "public" | "private" | undefined;
105
144
  source_repo?: string | null | undefined;
106
145
  license?: string | undefined;
107
146
  category?: string | null | undefined;
@@ -115,7 +154,7 @@ export declare const updateSkillInputSchema: z.ZodObject<{
115
154
  slug: z.ZodOptional<z.ZodString>;
116
155
  description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
117
156
  content: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
118
- visibility: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["public", "private", "org"]>>>>;
157
+ visibility: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<["public", "private"]>>>>;
119
158
  source_repo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
120
159
  license: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
121
160
  category: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
@@ -129,7 +168,7 @@ export declare const updateSkillInputSchema: z.ZodObject<{
129
168
  slug?: string | undefined;
130
169
  description?: string | null | undefined;
131
170
  content?: string | null | undefined;
132
- visibility?: "public" | "private" | "org" | undefined;
171
+ visibility?: "public" | "private" | undefined;
133
172
  source_repo?: string | null | undefined;
134
173
  license?: string | undefined;
135
174
  category?: string | null | undefined;
@@ -142,7 +181,7 @@ export declare const updateSkillInputSchema: z.ZodObject<{
142
181
  slug?: string | undefined;
143
182
  description?: string | null | undefined;
144
183
  content?: string | null | undefined;
145
- visibility?: "public" | "private" | "org" | undefined;
184
+ visibility?: "public" | "private" | undefined;
146
185
  source_repo?: string | null | undefined;
147
186
  license?: string | undefined;
148
187
  category?: string | null | undefined;
@@ -177,4 +216,31 @@ export declare const skillSearchQuerySchema: z.ZodObject<{
177
216
  offset?: number | undefined;
178
217
  }>;
179
218
  export type SkillSearchQuery = z.infer<typeof skillSearchQuerySchema>;
219
+ export declare const mySkillsQuerySchema: z.ZodObject<{
220
+ q: z.ZodOptional<z.ZodString>;
221
+ category: z.ZodOptional<z.ZodString>;
222
+ tag: z.ZodOptional<z.ZodString>;
223
+ sort: z.ZodDefault<z.ZodEnum<["trending", "popular", "newest", "relevance"]>>;
224
+ limit: z.ZodDefault<z.ZodNumber>;
225
+ offset: z.ZodDefault<z.ZodNumber>;
226
+ } & {
227
+ visibility: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
228
+ }, "strip", z.ZodTypeAny, {
229
+ sort: "trending" | "popular" | "newest" | "relevance";
230
+ limit: number;
231
+ offset: number;
232
+ visibility?: "public" | "private" | undefined;
233
+ category?: string | undefined;
234
+ q?: string | undefined;
235
+ tag?: string | undefined;
236
+ }, {
237
+ sort?: "trending" | "popular" | "newest" | "relevance" | undefined;
238
+ visibility?: "public" | "private" | undefined;
239
+ category?: string | undefined;
240
+ q?: string | undefined;
241
+ tag?: string | undefined;
242
+ limit?: number | undefined;
243
+ offset?: number | undefined;
244
+ }>;
245
+ export type MySkillsQuery = z.infer<typeof mySkillsQuerySchema>;
180
246
  //# sourceMappingURL=skill.schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/skill.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,qBAAqB,yCAAuC,CAAA;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;IAqBtB,6EAA6E;;IAE7E,mEAAmE;;IAEnE,+EAA+E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI/E,CAAA;AACF,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAE/C,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB/B,CAAA;AACJ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjC,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,eAAe,2DAAyD,CAAA;AACrF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;EAOjC,CAAA;AACF,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AAErE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;EAE9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export const skillVisibilitySchema = z.enum(['public', 'private', 'org']);
2
+ export const skillVisibilitySchema = z.enum(['public', 'private']);
3
3
  export const skillSchema = z.object({
4
4
  id: z.string().uuid(),
5
5
  owner_id: z.string().uuid(),
@@ -27,6 +27,18 @@ export const skillSchema = z.object({
27
27
  is_owner: z.boolean().optional(),
28
28
  /** Attached by the API on GET: true if the caller has bookmarked the Skill. */
29
29
  bookmarked: z.boolean().optional(),
30
+ /** Attached by the API: a public slice of the owner profile so cards can render attribution. */
31
+ owner: z
32
+ .object({
33
+ id: z.string().uuid(),
34
+ username: z.string().nullable(),
35
+ display_name: z.string().nullable(),
36
+ avatar_url: z.string().nullable(),
37
+ is_creator: z.boolean(),
38
+ is_partner: z.boolean(),
39
+ })
40
+ .nullable()
41
+ .optional(),
30
42
  created_at: z.string().datetime(),
31
43
  updated_at: z.string().datetime(),
32
44
  });
@@ -67,3 +79,6 @@ export const skillSearchQuerySchema = z.object({
67
79
  limit: z.coerce.number().int().min(1).max(100).default(24),
68
80
  offset: z.coerce.number().int().nonnegative().default(0),
69
81
  });
82
+ export const mySkillsQuerySchema = skillSearchQuerySchema.extend({
83
+ visibility: z.enum(['public', 'private']).optional(),
84
+ });