@alpic-ai/api 0.0.0-staging.g074e540 → 0.0.0-staging.g07a9dac
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.mts +1 -1
- package/dist/index.mjs +97 -1
- package/package.json +1 -10
package/dist/index.d.mts
CHANGED
|
@@ -212,7 +212,7 @@ declare const contract: {
|
|
|
212
212
|
name: z.ZodString;
|
|
213
213
|
sourceBranch: z.ZodNullable<z.ZodString>;
|
|
214
214
|
mcpServerUrl: z.ZodString;
|
|
215
|
-
domains: z.ZodArray<z.
|
|
215
|
+
domains: z.ZodArray<z.ZodCustomStringFormat<"hostname">>;
|
|
216
216
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
217
217
|
projectId: z.ZodString;
|
|
218
218
|
}, z.core.$strip>, _$_orpc_contract0.MergedErrorMap<Record<never, never>, {
|
package/dist/index.mjs
CHANGED
|
@@ -92,6 +92,86 @@ z.object({
|
|
|
92
92
|
content: z.string(),
|
|
93
93
|
source: z.enum(["model", "user"])
|
|
94
94
|
});
|
|
95
|
+
const intentCategoryColorSchema = z.enum([
|
|
96
|
+
"red",
|
|
97
|
+
"orange",
|
|
98
|
+
"yellow",
|
|
99
|
+
"green",
|
|
100
|
+
"blue",
|
|
101
|
+
"purple",
|
|
102
|
+
"pink",
|
|
103
|
+
"gray"
|
|
104
|
+
]);
|
|
105
|
+
intentCategoryColorSchema.options;
|
|
106
|
+
const intentCategorySchema = z.object({
|
|
107
|
+
id: z.string(),
|
|
108
|
+
createdAt: z.coerce.date(),
|
|
109
|
+
environmentId: z.string(),
|
|
110
|
+
name: z.string(),
|
|
111
|
+
color: intentCategoryColorSchema
|
|
112
|
+
});
|
|
113
|
+
z.object({
|
|
114
|
+
id: z.string(),
|
|
115
|
+
name: z.string(),
|
|
116
|
+
color: intentCategoryColorSchema,
|
|
117
|
+
intentCount: z.number().int().nonnegative()
|
|
118
|
+
});
|
|
119
|
+
z.object({
|
|
120
|
+
id: z.string(),
|
|
121
|
+
createdAt: z.coerce.date(),
|
|
122
|
+
environmentId: z.string(),
|
|
123
|
+
toolName: z.string(),
|
|
124
|
+
message: z.string(),
|
|
125
|
+
categories: z.array(intentCategorySchema)
|
|
126
|
+
});
|
|
127
|
+
const signalCategorySchema = z.object({
|
|
128
|
+
id: z.string(),
|
|
129
|
+
name: z.string(),
|
|
130
|
+
color: intentCategoryColorSchema
|
|
131
|
+
});
|
|
132
|
+
z.discriminatedUnion("kind", [
|
|
133
|
+
z.object({
|
|
134
|
+
kind: z.literal("new"),
|
|
135
|
+
category: signalCategorySchema,
|
|
136
|
+
currentCount: z.number().int().nonnegative(),
|
|
137
|
+
currentShare: z.number()
|
|
138
|
+
}),
|
|
139
|
+
z.object({
|
|
140
|
+
kind: z.literal("resurging"),
|
|
141
|
+
category: signalCategorySchema,
|
|
142
|
+
currentCount: z.number().int().nonnegative(),
|
|
143
|
+
daysQuiet: z.number(),
|
|
144
|
+
currentShare: z.number()
|
|
145
|
+
}),
|
|
146
|
+
z.object({
|
|
147
|
+
kind: z.literal("spike"),
|
|
148
|
+
category: signalCategorySchema,
|
|
149
|
+
currentCount: z.number().int().nonnegative(),
|
|
150
|
+
previousCount: z.number().int().nonnegative(),
|
|
151
|
+
currentShare: z.number(),
|
|
152
|
+
previousShare: z.number(),
|
|
153
|
+
changeRatio: z.number()
|
|
154
|
+
}),
|
|
155
|
+
z.object({
|
|
156
|
+
kind: z.literal("declining"),
|
|
157
|
+
category: signalCategorySchema,
|
|
158
|
+
currentCount: z.number().int().nonnegative(),
|
|
159
|
+
previousCount: z.number().int().nonnegative(),
|
|
160
|
+
currentShare: z.number(),
|
|
161
|
+
previousShare: z.number(),
|
|
162
|
+
changeRatio: z.number()
|
|
163
|
+
})
|
|
164
|
+
]);
|
|
165
|
+
z.discriminatedUnion("kind", [z.object({
|
|
166
|
+
kind: z.literal("existing"),
|
|
167
|
+
categoryId: z.string(),
|
|
168
|
+
categoryName: z.string(),
|
|
169
|
+
intentIds: z.array(z.string())
|
|
170
|
+
}), z.object({
|
|
171
|
+
kind: z.literal("new"),
|
|
172
|
+
categoryName: z.string(),
|
|
173
|
+
intentIds: z.array(z.string())
|
|
174
|
+
})]);
|
|
95
175
|
z.object({
|
|
96
176
|
id: z.string(),
|
|
97
177
|
teamId: z.string(),
|
|
@@ -427,6 +507,22 @@ const subscriptionPlanSchema = z.enum([
|
|
|
427
507
|
"enterprise"
|
|
428
508
|
]);
|
|
429
509
|
z.object({ plan: subscriptionPlanSchema.nullable() });
|
|
510
|
+
const customerCreditsSchema = z.object({
|
|
511
|
+
balanceInCents: z.number(),
|
|
512
|
+
expiresAt: z.number().nullable(),
|
|
513
|
+
currency: z.string()
|
|
514
|
+
});
|
|
515
|
+
const customerUsageSchema = z.object({
|
|
516
|
+
amountInCents: z.number(),
|
|
517
|
+
currency: z.string(),
|
|
518
|
+
periodEnd: z.number()
|
|
519
|
+
});
|
|
520
|
+
const partnerDiscountSchema = z.object({ endsAt: z.number() });
|
|
521
|
+
z.object({
|
|
522
|
+
customerCredits: customerCreditsSchema.nullable(),
|
|
523
|
+
customerUsage: customerUsageSchema.nullable(),
|
|
524
|
+
partnerDiscount: partnerDiscountSchema.nullable()
|
|
525
|
+
});
|
|
430
526
|
//#endregion
|
|
431
527
|
//#region src/schemas.ts
|
|
432
528
|
const RESERVED_KEYS = [
|
|
@@ -583,7 +679,7 @@ const getEnvironmentContractV1 = oc.route({
|
|
|
583
679
|
name: z.string(),
|
|
584
680
|
sourceBranch: z.string().nullable(),
|
|
585
681
|
mcpServerUrl: z.string(),
|
|
586
|
-
domains: z.array(z.
|
|
682
|
+
domains: z.array(z.hostname()),
|
|
587
683
|
createdAt: z.coerce.date(),
|
|
588
684
|
projectId: z.string()
|
|
589
685
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-staging.
|
|
3
|
+
"version": "0.0.0-staging.g07a9dac",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -14,15 +14,6 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
-
"nx": {
|
|
18
|
-
"targets": {
|
|
19
|
-
"build": {
|
|
20
|
-
"dependsOn": [
|
|
21
|
-
"^build"
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
17
|
"author": "Alpic",
|
|
27
18
|
"license": "ISC",
|
|
28
19
|
"dependencies": {
|