@prave/shared 0.1.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.
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/schemas/ai-description.schema.d.ts +82 -0
- package/dist/schemas/ai-description.schema.d.ts.map +1 -0
- package/dist/schemas/ai-description.schema.js +36 -0
- package/dist/schemas/api-response.schema.d.ts +22 -0
- package/dist/schemas/api-response.schema.d.ts.map +1 -0
- package/dist/schemas/api-response.schema.js +8 -0
- package/dist/schemas/billing.schema.d.ts +58 -0
- package/dist/schemas/billing.schema.d.ts.map +1 -0
- package/dist/schemas/billing.schema.js +33 -0
- package/dist/schemas/cli.schema.d.ts +57 -0
- package/dist/schemas/cli.schema.d.ts.map +1 -0
- package/dist/schemas/cli.schema.js +21 -0
- package/dist/schemas/index.d.ts +13 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +12 -0
- package/dist/schemas/install.schema.d.ts +115 -0
- package/dist/schemas/install.schema.d.ts.map +1 -0
- package/dist/schemas/install.schema.js +28 -0
- package/dist/schemas/marketplace.schema.d.ts +200 -0
- package/dist/schemas/marketplace.schema.d.ts.map +1 -0
- package/dist/schemas/marketplace.schema.js +51 -0
- package/dist/schemas/org.schema.d.ts +112 -0
- package/dist/schemas/org.schema.d.ts.map +1 -0
- package/dist/schemas/org.schema.js +34 -0
- package/dist/schemas/search.schema.d.ts +105 -0
- package/dist/schemas/search.schema.d.ts.map +1 -0
- package/dist/schemas/search.schema.js +20 -0
- package/dist/schemas/skill-dependency.schema.d.ts +137 -0
- package/dist/schemas/skill-dependency.schema.d.ts.map +1 -0
- package/dist/schemas/skill-dependency.schema.js +32 -0
- package/dist/schemas/skill-test.schema.d.ts +65 -0
- package/dist/schemas/skill-test.schema.d.ts.map +1 -0
- package/dist/schemas/skill-test.schema.js +30 -0
- package/dist/schemas/skill-version.schema.d.ts +69 -0
- package/dist/schemas/skill-version.schema.d.ts.map +1 -0
- package/dist/schemas/skill-version.schema.js +21 -0
- package/dist/schemas/skill.schema.d.ts +180 -0
- package/dist/schemas/skill.schema.d.ts.map +1 -0
- package/dist/schemas/skill.schema.js +69 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +1 -0
- package/package.json +43 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The structured JSON we force Claude to emit when generating a Skill
|
|
4
|
+
* description. Kept short + kebab-case tags so the shape matches what
|
|
5
|
+
* the Builder's meta sidebar already consumes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const aiDescriptionOutputSchema: z.ZodObject<{
|
|
8
|
+
description: z.ZodString;
|
|
9
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
10
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
11
|
+
key_concepts: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
description: string;
|
|
14
|
+
tags: string[];
|
|
15
|
+
key_concepts: string[];
|
|
16
|
+
summary?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
description: string;
|
|
19
|
+
tags?: string[] | undefined;
|
|
20
|
+
summary?: string | undefined;
|
|
21
|
+
key_concepts?: string[] | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
export type AiDescriptionOutput = z.infer<typeof aiDescriptionOutputSchema>;
|
|
24
|
+
/**
|
|
25
|
+
* Persisted row shape, mirrors `public.skill_ai_descriptions`. `cached`
|
|
26
|
+
* is attached by the API when we short-circuit on a hash hit — lets the
|
|
27
|
+
* UI show a subtle "served from cache" affordance.
|
|
28
|
+
*/
|
|
29
|
+
export declare const skillAiDescriptionSchema: z.ZodObject<{
|
|
30
|
+
id: z.ZodString;
|
|
31
|
+
skill_id: z.ZodString;
|
|
32
|
+
model: z.ZodString;
|
|
33
|
+
content_hash: z.ZodString;
|
|
34
|
+
description: z.ZodString;
|
|
35
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
36
|
+
tags: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
key_concepts: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
generated_by: z.ZodNullable<z.ZodString>;
|
|
39
|
+
input_tokens: z.ZodNullable<z.ZodNumber>;
|
|
40
|
+
output_tokens: z.ZodNullable<z.ZodNumber>;
|
|
41
|
+
created_at: z.ZodString;
|
|
42
|
+
cached: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
id: string;
|
|
45
|
+
description: string;
|
|
46
|
+
tags: string[];
|
|
47
|
+
created_at: string;
|
|
48
|
+
skill_id: string;
|
|
49
|
+
summary: string | null;
|
|
50
|
+
key_concepts: string[];
|
|
51
|
+
model: string;
|
|
52
|
+
content_hash: string;
|
|
53
|
+
generated_by: string | null;
|
|
54
|
+
input_tokens: number | null;
|
|
55
|
+
output_tokens: number | null;
|
|
56
|
+
cached?: boolean | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
id: string;
|
|
59
|
+
description: string;
|
|
60
|
+
tags: string[];
|
|
61
|
+
created_at: string;
|
|
62
|
+
skill_id: string;
|
|
63
|
+
summary: string | null;
|
|
64
|
+
key_concepts: string[];
|
|
65
|
+
model: string;
|
|
66
|
+
content_hash: string;
|
|
67
|
+
generated_by: string | null;
|
|
68
|
+
input_tokens: number | null;
|
|
69
|
+
output_tokens: number | null;
|
|
70
|
+
cached?: boolean | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
export type SkillAiDescription = z.infer<typeof skillAiDescriptionSchema>;
|
|
73
|
+
export declare const generateDescriptionInputSchema: z.ZodObject<{
|
|
74
|
+
/** Force a fresh generation even if a cached row matches the hash. */
|
|
75
|
+
force: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
force?: boolean | undefined;
|
|
78
|
+
}, {
|
|
79
|
+
force?: boolean | undefined;
|
|
80
|
+
}>;
|
|
81
|
+
export type GenerateDescriptionInput = z.infer<typeof generateDescriptionInputSchema>;
|
|
82
|
+
//# sourceMappingURL=ai-description.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-description.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/ai-description.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAA;AACF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,8BAA8B;IACzC,sEAAsE;;;;;;EAEtE,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The structured JSON we force Claude to emit when generating a Skill
|
|
4
|
+
* description. Kept short + kebab-case tags so the shape matches what
|
|
5
|
+
* the Builder's meta sidebar already consumes.
|
|
6
|
+
*/
|
|
7
|
+
export const aiDescriptionOutputSchema = z.object({
|
|
8
|
+
description: z.string().min(1).max(500),
|
|
9
|
+
summary: z.string().min(1).max(800).optional(),
|
|
10
|
+
tags: z.array(z.string().min(1).max(40)).max(12).default([]),
|
|
11
|
+
key_concepts: z.array(z.string().min(1).max(80)).max(8).default([]),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Persisted row shape, mirrors `public.skill_ai_descriptions`. `cached`
|
|
15
|
+
* is attached by the API when we short-circuit on a hash hit — lets the
|
|
16
|
+
* UI show a subtle "served from cache" affordance.
|
|
17
|
+
*/
|
|
18
|
+
export const skillAiDescriptionSchema = z.object({
|
|
19
|
+
id: z.string().uuid(),
|
|
20
|
+
skill_id: z.string().uuid(),
|
|
21
|
+
model: z.string(),
|
|
22
|
+
content_hash: z.string(),
|
|
23
|
+
description: z.string(),
|
|
24
|
+
summary: z.string().nullable(),
|
|
25
|
+
tags: z.array(z.string()),
|
|
26
|
+
key_concepts: z.array(z.string()),
|
|
27
|
+
generated_by: z.string().uuid().nullable(),
|
|
28
|
+
input_tokens: z.number().int().nullable(),
|
|
29
|
+
output_tokens: z.number().int().nullable(),
|
|
30
|
+
created_at: z.string().datetime(),
|
|
31
|
+
cached: z.boolean().optional(),
|
|
32
|
+
});
|
|
33
|
+
export const generateDescriptionInputSchema = z.object({
|
|
34
|
+
/** Force a fresh generation even if a cached row matches the hash. */
|
|
35
|
+
force: z.boolean().optional(),
|
|
36
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const apiResponseSchema: <T extends z.ZodTypeAny>(data: T) => z.ZodObject<{
|
|
3
|
+
success: z.ZodBoolean;
|
|
4
|
+
data: z.ZodNullable<T>;
|
|
5
|
+
error: z.ZodNullable<z.ZodString>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
7
|
+
success: z.ZodBoolean;
|
|
8
|
+
data: z.ZodNullable<T>;
|
|
9
|
+
error: z.ZodNullable<z.ZodString>;
|
|
10
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
11
|
+
success: z.ZodBoolean;
|
|
12
|
+
data: z.ZodNullable<T>;
|
|
13
|
+
error: z.ZodNullable<z.ZodString>;
|
|
14
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
15
|
+
export type ApiResponse<T> = {
|
|
16
|
+
success: boolean;
|
|
17
|
+
data: T | null;
|
|
18
|
+
error: string | null;
|
|
19
|
+
};
|
|
20
|
+
export declare const ok: <T>(data: T) => ApiResponse<T>;
|
|
21
|
+
export declare const fail: (error: string) => ApiResponse<null>;
|
|
22
|
+
//# sourceMappingURL=api-response.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-response.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/api-response.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC;;;;;;;;;;;;iEAK7D,CAAA;AAEJ,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAA;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,EAAE,GAAI,CAAC,EAAE,MAAM,CAAC,KAAG,WAAW,CAAC,CAAC,CAA2C,CAAA;AACxF,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,KAAG,WAAW,CAAC,IAAI,CAA4C,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const apiResponseSchema = (data) => z.object({
|
|
3
|
+
success: z.boolean(),
|
|
4
|
+
data: data.nullable(),
|
|
5
|
+
error: z.string().nullable(),
|
|
6
|
+
});
|
|
7
|
+
export const ok = (data) => ({ success: true, data, error: null });
|
|
8
|
+
export const fail = (error) => ({ success: false, data: null, error });
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const planSchema: z.ZodEnum<["free", "pro", "team"]>;
|
|
3
|
+
export type Plan = z.infer<typeof planSchema>;
|
|
4
|
+
export declare const subscriptionStatusSchema: z.ZodEnum<["active", "trialing", "past_due", "canceled", "incomplete", "incomplete_expired", "unpaid"]>;
|
|
5
|
+
export type SubscriptionStatus = z.infer<typeof subscriptionStatusSchema>;
|
|
6
|
+
/**
|
|
7
|
+
* The slim profile + billing snapshot the Settings/Billing UI consumes.
|
|
8
|
+
* The API layers this on top of `profiles` so the front-end never needs
|
|
9
|
+
* to talk to Stripe directly.
|
|
10
|
+
*/
|
|
11
|
+
export declare const billingProfileSchema: z.ZodObject<{
|
|
12
|
+
plan: z.ZodEnum<["free", "pro", "team"]>;
|
|
13
|
+
stripe_customer_id: z.ZodNullable<z.ZodString>;
|
|
14
|
+
stripe_subscription_id: z.ZodNullable<z.ZodString>;
|
|
15
|
+
subscription_status: z.ZodNullable<z.ZodEnum<["active", "trialing", "past_due", "canceled", "incomplete", "incomplete_expired", "unpaid"]>>;
|
|
16
|
+
current_period_end: z.ZodNullable<z.ZodString>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
plan: "free" | "pro" | "team";
|
|
19
|
+
stripe_customer_id: string | null;
|
|
20
|
+
stripe_subscription_id: string | null;
|
|
21
|
+
subscription_status: "active" | "trialing" | "past_due" | "canceled" | "incomplete" | "incomplete_expired" | "unpaid" | null;
|
|
22
|
+
current_period_end: string | null;
|
|
23
|
+
}, {
|
|
24
|
+
plan: "free" | "pro" | "team";
|
|
25
|
+
stripe_customer_id: string | null;
|
|
26
|
+
stripe_subscription_id: string | null;
|
|
27
|
+
subscription_status: "active" | "trialing" | "past_due" | "canceled" | "incomplete" | "incomplete_expired" | "unpaid" | null;
|
|
28
|
+
current_period_end: string | null;
|
|
29
|
+
}>;
|
|
30
|
+
export type BillingProfile = z.infer<typeof billingProfileSchema>;
|
|
31
|
+
export declare const billingCheckoutInputSchema: z.ZodObject<{
|
|
32
|
+
plan: z.ZodEnum<["pro", "team"]>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
plan: "pro" | "team";
|
|
35
|
+
}, {
|
|
36
|
+
plan: "pro" | "team";
|
|
37
|
+
}>;
|
|
38
|
+
export type BillingCheckoutInput = z.infer<typeof billingCheckoutInputSchema>;
|
|
39
|
+
export declare const billingCheckoutResponseSchema: z.ZodObject<{
|
|
40
|
+
url: z.ZodString;
|
|
41
|
+
session_id: z.ZodString;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
url: string;
|
|
44
|
+
session_id: string;
|
|
45
|
+
}, {
|
|
46
|
+
url: string;
|
|
47
|
+
session_id: string;
|
|
48
|
+
}>;
|
|
49
|
+
export type BillingCheckoutResponse = z.infer<typeof billingCheckoutResponseSchema>;
|
|
50
|
+
export declare const portalSessionResponseSchema: z.ZodObject<{
|
|
51
|
+
url: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
url: string;
|
|
54
|
+
}, {
|
|
55
|
+
url: string;
|
|
56
|
+
}>;
|
|
57
|
+
export type PortalSessionResponse = z.infer<typeof portalSessionResponseSchema>;
|
|
58
|
+
//# sourceMappingURL=billing.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"billing.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/billing.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,UAAU,oCAAkC,CAAA;AACzD,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AAE7C,eAAO,MAAM,wBAAwB,yGAQnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAM/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,0BAA0B;;;;;;EAErC,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE7E,eAAO,MAAM,6BAA6B;;;;;;;;;EAGxC,CAAA;AACF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEnF,eAAO,MAAM,2BAA2B;;;;;;EAEtC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const planSchema = z.enum(['free', 'pro', 'team']);
|
|
3
|
+
export const subscriptionStatusSchema = z.enum([
|
|
4
|
+
'active',
|
|
5
|
+
'trialing',
|
|
6
|
+
'past_due',
|
|
7
|
+
'canceled',
|
|
8
|
+
'incomplete',
|
|
9
|
+
'incomplete_expired',
|
|
10
|
+
'unpaid',
|
|
11
|
+
]);
|
|
12
|
+
/**
|
|
13
|
+
* The slim profile + billing snapshot the Settings/Billing UI consumes.
|
|
14
|
+
* The API layers this on top of `profiles` so the front-end never needs
|
|
15
|
+
* to talk to Stripe directly.
|
|
16
|
+
*/
|
|
17
|
+
export const billingProfileSchema = z.object({
|
|
18
|
+
plan: planSchema,
|
|
19
|
+
stripe_customer_id: z.string().nullable(),
|
|
20
|
+
stripe_subscription_id: z.string().nullable(),
|
|
21
|
+
subscription_status: subscriptionStatusSchema.nullable(),
|
|
22
|
+
current_period_end: z.string().datetime().nullable(),
|
|
23
|
+
});
|
|
24
|
+
export const billingCheckoutInputSchema = z.object({
|
|
25
|
+
plan: z.enum(['pro', 'team']),
|
|
26
|
+
});
|
|
27
|
+
export const billingCheckoutResponseSchema = z.object({
|
|
28
|
+
url: z.string().url(),
|
|
29
|
+
session_id: z.string(),
|
|
30
|
+
});
|
|
31
|
+
export const portalSessionResponseSchema = z.object({
|
|
32
|
+
url: z.string().url(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const cliDeviceCodeStatusSchema: z.ZodEnum<["pending", "authorized", "expired"]>;
|
|
3
|
+
export type CliDeviceCodeStatus = z.infer<typeof cliDeviceCodeStatusSchema>;
|
|
4
|
+
export declare const cliDeviceCodeSchema: z.ZodObject<{
|
|
5
|
+
device_code: z.ZodString;
|
|
6
|
+
status: z.ZodEnum<["pending", "authorized", "expired"]>;
|
|
7
|
+
created_at: z.ZodString;
|
|
8
|
+
expires_at: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
status: "pending" | "authorized" | "expired";
|
|
11
|
+
created_at: string;
|
|
12
|
+
device_code: string;
|
|
13
|
+
expires_at: string;
|
|
14
|
+
}, {
|
|
15
|
+
status: "pending" | "authorized" | "expired";
|
|
16
|
+
created_at: string;
|
|
17
|
+
device_code: string;
|
|
18
|
+
expires_at: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type CliDeviceCode = z.infer<typeof cliDeviceCodeSchema>;
|
|
21
|
+
export declare const cliTokenResponseSchema: z.ZodObject<{
|
|
22
|
+
access_token: z.ZodString;
|
|
23
|
+
refresh_token: z.ZodString;
|
|
24
|
+
user_id: z.ZodString;
|
|
25
|
+
email: z.ZodString;
|
|
26
|
+
expires_at: z.ZodNumber;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
expires_at: number;
|
|
29
|
+
access_token: string;
|
|
30
|
+
refresh_token: string;
|
|
31
|
+
user_id: string;
|
|
32
|
+
email: string;
|
|
33
|
+
}, {
|
|
34
|
+
expires_at: number;
|
|
35
|
+
access_token: string;
|
|
36
|
+
refresh_token: string;
|
|
37
|
+
user_id: string;
|
|
38
|
+
email: string;
|
|
39
|
+
}>;
|
|
40
|
+
export type CliTokenResponse = z.infer<typeof cliTokenResponseSchema>;
|
|
41
|
+
export declare const cliStartLoginInputSchema: z.ZodObject<{
|
|
42
|
+
device_code: z.ZodString;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
device_code: string;
|
|
45
|
+
}, {
|
|
46
|
+
device_code: string;
|
|
47
|
+
}>;
|
|
48
|
+
export type CliStartLoginInput = z.infer<typeof cliStartLoginInputSchema>;
|
|
49
|
+
export declare const cliAuthorizeInputSchema: z.ZodObject<{
|
|
50
|
+
device_code: z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
device_code: string;
|
|
53
|
+
}, {
|
|
54
|
+
device_code: string;
|
|
55
|
+
}>;
|
|
56
|
+
export type CliAuthorizeInput = z.infer<typeof cliAuthorizeInputSchema>;
|
|
57
|
+
//# sourceMappingURL=cli.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/cli.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,yBAAyB,iDAA+C,CAAA;AACrF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAK9B,CAAA;AACF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE/D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;EAMjC,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAA;AACF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const cliDeviceCodeStatusSchema = z.enum(['pending', 'authorized', 'expired']);
|
|
3
|
+
export const cliDeviceCodeSchema = z.object({
|
|
4
|
+
device_code: z.string().uuid(),
|
|
5
|
+
status: cliDeviceCodeStatusSchema,
|
|
6
|
+
created_at: z.string().datetime(),
|
|
7
|
+
expires_at: z.string().datetime(),
|
|
8
|
+
});
|
|
9
|
+
export const cliTokenResponseSchema = z.object({
|
|
10
|
+
access_token: z.string(),
|
|
11
|
+
refresh_token: z.string(),
|
|
12
|
+
user_id: z.string().uuid(),
|
|
13
|
+
email: z.string().email(),
|
|
14
|
+
expires_at: z.number().int(),
|
|
15
|
+
});
|
|
16
|
+
export const cliStartLoginInputSchema = z.object({
|
|
17
|
+
device_code: z.string().uuid(),
|
|
18
|
+
});
|
|
19
|
+
export const cliAuthorizeInputSchema = z.object({
|
|
20
|
+
device_code: z.string().uuid(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './api-response.schema.js';
|
|
2
|
+
export * from './skill.schema.js';
|
|
3
|
+
export * from './skill-version.schema.js';
|
|
4
|
+
export * from './cli.schema.js';
|
|
5
|
+
export * from './search.schema.js';
|
|
6
|
+
export * from './ai-description.schema.js';
|
|
7
|
+
export * from './skill-dependency.schema.js';
|
|
8
|
+
export * from './skill-test.schema.js';
|
|
9
|
+
export * from './marketplace.schema.js';
|
|
10
|
+
export * from './billing.schema.js';
|
|
11
|
+
export * from './org.schema.js';
|
|
12
|
+
export * from './install.schema.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,mBAAmB,CAAA;AACjC,cAAc,2BAA2B,CAAA;AACzC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './api-response.schema.js';
|
|
2
|
+
export * from './skill.schema.js';
|
|
3
|
+
export * from './skill-version.schema.js';
|
|
4
|
+
export * from './cli.schema.js';
|
|
5
|
+
export * from './search.schema.js';
|
|
6
|
+
export * from './ai-description.schema.js';
|
|
7
|
+
export * from './skill-dependency.schema.js';
|
|
8
|
+
export * from './skill-test.schema.js';
|
|
9
|
+
export * from './marketplace.schema.js';
|
|
10
|
+
export * from './billing.schema.js';
|
|
11
|
+
export * from './org.schema.js';
|
|
12
|
+
export * from './install.schema.js';
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A single `installs` row — buyer-side install receipt. */
|
|
3
|
+
export declare const installSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
user_id: z.ZodString;
|
|
6
|
+
skill_id: z.ZodString;
|
|
7
|
+
version: z.ZodNullable<z.ZodNumber>;
|
|
8
|
+
installed_at: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
id: string;
|
|
11
|
+
skill_id: string;
|
|
12
|
+
version: number | null;
|
|
13
|
+
user_id: string;
|
|
14
|
+
installed_at: string;
|
|
15
|
+
}, {
|
|
16
|
+
id: string;
|
|
17
|
+
skill_id: string;
|
|
18
|
+
version: number | null;
|
|
19
|
+
user_id: string;
|
|
20
|
+
installed_at: string;
|
|
21
|
+
}>;
|
|
22
|
+
export type Install = z.infer<typeof installSchema>;
|
|
23
|
+
/** Hydrated row used by the Installs tab + CLI list. */
|
|
24
|
+
export declare const installRowSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
user_id: z.ZodString;
|
|
27
|
+
skill_id: z.ZodString;
|
|
28
|
+
version: z.ZodNullable<z.ZodNumber>;
|
|
29
|
+
installed_at: z.ZodString;
|
|
30
|
+
} & {
|
|
31
|
+
skill: z.ZodObject<Pick<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
owner_id: z.ZodString;
|
|
34
|
+
name: z.ZodString;
|
|
35
|
+
slug: z.ZodString;
|
|
36
|
+
description: z.ZodNullable<z.ZodString>;
|
|
37
|
+
content: z.ZodNullable<z.ZodString>;
|
|
38
|
+
visibility: z.ZodDefault<z.ZodEnum<["public", "private", "org"]>>;
|
|
39
|
+
source_repo: z.ZodNullable<z.ZodString>;
|
|
40
|
+
license: z.ZodDefault<z.ZodString>;
|
|
41
|
+
category: z.ZodNullable<z.ZodString>;
|
|
42
|
+
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
install_count: z.ZodDefault<z.ZodNumber>;
|
|
44
|
+
bookmark_count: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
is_verified: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
price_cents: z.ZodDefault<z.ZodNumber>;
|
|
47
|
+
currency: z.ZodDefault<z.ZodString>;
|
|
48
|
+
purchased: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
is_owner: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
bookmarked: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
created_at: z.ZodString;
|
|
52
|
+
updated_at: z.ZodString;
|
|
53
|
+
}, "id" | "name" | "slug" | "description" | "visibility" | "license" | "updated_at">, "strip", z.ZodTypeAny, {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
slug: string;
|
|
57
|
+
description: string | null;
|
|
58
|
+
visibility: "public" | "private" | "org";
|
|
59
|
+
license: string;
|
|
60
|
+
updated_at: string;
|
|
61
|
+
}, {
|
|
62
|
+
id: string;
|
|
63
|
+
name: string;
|
|
64
|
+
slug: string;
|
|
65
|
+
description: string | null;
|
|
66
|
+
updated_at: string;
|
|
67
|
+
visibility?: "public" | "private" | "org" | undefined;
|
|
68
|
+
license?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
/** Latest version from `skill_versions`, attached by the API. */
|
|
71
|
+
latest_version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
id: string;
|
|
74
|
+
skill_id: string;
|
|
75
|
+
version: number | null;
|
|
76
|
+
user_id: string;
|
|
77
|
+
installed_at: string;
|
|
78
|
+
skill: {
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
slug: string;
|
|
82
|
+
description: string | null;
|
|
83
|
+
visibility: "public" | "private" | "org";
|
|
84
|
+
license: string;
|
|
85
|
+
updated_at: string;
|
|
86
|
+
};
|
|
87
|
+
latest_version?: number | null | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
id: string;
|
|
90
|
+
skill_id: string;
|
|
91
|
+
version: number | null;
|
|
92
|
+
user_id: string;
|
|
93
|
+
installed_at: string;
|
|
94
|
+
skill: {
|
|
95
|
+
id: string;
|
|
96
|
+
name: string;
|
|
97
|
+
slug: string;
|
|
98
|
+
description: string | null;
|
|
99
|
+
updated_at: string;
|
|
100
|
+
visibility?: "public" | "private" | "org" | undefined;
|
|
101
|
+
license?: string | undefined;
|
|
102
|
+
};
|
|
103
|
+
latest_version?: number | null | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
export type InstallRow = z.infer<typeof installRowSchema>;
|
|
106
|
+
export declare const recordInstallInputSchema: z.ZodObject<{
|
|
107
|
+
/** Optional version pin — defaults to the latest version of the skill. */
|
|
108
|
+
version: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
version?: number | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
version?: number | undefined;
|
|
113
|
+
}>;
|
|
114
|
+
export type RecordInstallInput = z.infer<typeof recordInstallInputSchema>;
|
|
115
|
+
//# sourceMappingURL=install.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/install.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,4DAA4D;AAC5D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD,wDAAwD;AACxD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAU3B,iEAAiE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjE,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEzD,eAAO,MAAM,wBAAwB;IACnC,0EAA0E;;;;;;EAE1E,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { skillSchema } from './skill.schema.js';
|
|
3
|
+
/** A single `installs` row — buyer-side install receipt. */
|
|
4
|
+
export const installSchema = z.object({
|
|
5
|
+
id: z.string().uuid(),
|
|
6
|
+
user_id: z.string().uuid(),
|
|
7
|
+
skill_id: z.string().uuid(),
|
|
8
|
+
version: z.number().int().nullable(),
|
|
9
|
+
installed_at: z.string().datetime(),
|
|
10
|
+
});
|
|
11
|
+
/** Hydrated row used by the Installs tab + CLI list. */
|
|
12
|
+
export const installRowSchema = installSchema.extend({
|
|
13
|
+
skill: skillSchema.pick({
|
|
14
|
+
id: true,
|
|
15
|
+
slug: true,
|
|
16
|
+
name: true,
|
|
17
|
+
description: true,
|
|
18
|
+
visibility: true,
|
|
19
|
+
license: true,
|
|
20
|
+
updated_at: true,
|
|
21
|
+
}),
|
|
22
|
+
/** Latest version from `skill_versions`, attached by the API. */
|
|
23
|
+
latest_version: z.number().int().nullable().optional(),
|
|
24
|
+
});
|
|
25
|
+
export const recordInstallInputSchema = z.object({
|
|
26
|
+
/** Optional version pin — defaults to the latest version of the skill. */
|
|
27
|
+
version: z.number().int().positive().optional(),
|
|
28
|
+
});
|