@alpic-ai/api 0.0.0-staging.22149cf → 0.0.0-staging.221f2c7

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 CHANGED
@@ -6,6 +6,7 @@ import { z } from "zod";
6
6
  type ApiContext = {
7
7
  request: Request & {
8
8
  teamIds: string[];
9
+ defaultTeamId: string | undefined;
9
10
  };
10
11
  };
11
12
  declare const createEnvironmentContractV1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -134,6 +135,7 @@ declare const contract: {
134
135
  authorAvatarUrl: z.ZodNullable<z.ZodString>;
135
136
  startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
136
137
  completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
138
+ deploymentPageUrl: z.ZodNullable<z.ZodURL>;
137
139
  }, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
138
140
  NOT_FOUND: {};
139
141
  }>, Record<never, never>>;
@@ -218,6 +220,7 @@ declare const contract: {
218
220
  authorAvatarUrl: z.ZodNullable<z.ZodString>;
219
221
  startedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
220
222
  completedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
223
+ deploymentPageUrl: z.ZodNullable<z.ZodURL>;
221
224
  }, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
222
225
  NOT_FOUND: {};
223
226
  BAD_REQUEST: {};
@@ -228,6 +231,7 @@ declare const contract: {
228
231
  update: {
229
232
  v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
230
233
  projectId: z.ZodString;
234
+ name: z.ZodOptional<z.ZodString>;
231
235
  sourceRepository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
236
  }, z.core.$strip>, z.ZodObject<{
233
237
  id: z.ZodString;
@@ -360,7 +364,9 @@ declare const contract: {
360
364
  }>, Record<never, never>>;
361
365
  };
362
366
  list: {
363
- v1: _orpc_contract0.ContractProcedureBuilderWithOutput<_orpc_contract0.Schema<unknown, unknown>, z.ZodArray<z.ZodObject<{
367
+ v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodOptional<z.ZodObject<{
368
+ teamId: z.ZodOptional<z.ZodString>;
369
+ }, z.core.$strip>>, z.ZodArray<z.ZodObject<{
364
370
  id: z.ZodString;
365
371
  name: z.ZodString;
366
372
  teamId: z.ZodString;
@@ -485,6 +491,15 @@ declare const contract: {
485
491
  BAD_REQUEST: {};
486
492
  }>, Record<never, never>>;
487
493
  };
494
+ delete: {
495
+ v1: _orpc_contract0.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
496
+ projectId: z.ZodString;
497
+ }, z.core.$strip>, z.ZodObject<{
498
+ success: z.ZodLiteral<true>;
499
+ }, z.core.$strip>, _orpc_contract0.MergedErrorMap<Record<never, never>, {
500
+ NOT_FOUND: {};
501
+ }>, Record<never, never>>;
502
+ };
488
503
  };
489
504
  };
490
505
  type RouterInput = InferContractRouterInputs<typeof contract>;
package/dist/index.mjs CHANGED
@@ -82,6 +82,7 @@ const deploymentSchema = z.object({
82
82
  startedAt: z.coerce.date().nullable(),
83
83
  completedAt: z.coerce.date().nullable()
84
84
  });
85
+ const deploymentWithPageUrlSchema = deploymentSchema.extend({ deploymentPageUrl: z.url().nullable() });
85
86
  const createEnvironmentContractV1 = oc.route({
86
87
  path: "/v1/environments",
87
88
  method: "POST",
@@ -167,7 +168,7 @@ const listProjectsContractV1 = oc.route({
167
168
  description: "List all projects for a team",
168
169
  tags: ["projects"],
169
170
  successDescription: "The list of projects"
170
- }).output(z.array(projectOutputSchema));
171
+ }).input(z.object({ teamId: z.string().optional() }).optional()).output(z.array(projectOutputSchema));
171
172
  const createProjectContractV1 = oc.route({
172
173
  path: "/v1/projects",
173
174
  method: "POST",
@@ -180,7 +181,7 @@ const createProjectContractV1 = oc.route({
180
181
  BAD_REQUEST: {}
181
182
  }).input(z.object({
182
183
  teamId: z.string().optional(),
183
- name: z.string().min(1).max(100),
184
+ name: z.string().trim().min(1).max(100),
184
185
  sourceRepository: z.string().optional(),
185
186
  branchName: z.string().min(1).optional(),
186
187
  runtime: runtimeSchema,
@@ -210,6 +211,14 @@ const createProjectContractV1 = oc.route({
210
211
  startCommand: z.string().nullable(),
211
212
  createdAt: z.coerce.date()
212
213
  }));
214
+ const deleteProjectContractV1 = oc.route({
215
+ path: "/v1/projects/:projectId",
216
+ method: "DELETE",
217
+ summary: "Delete a project",
218
+ description: "Delete a project and all its environments",
219
+ tags: ["projects"],
220
+ successDescription: "The project has been deleted successfully"
221
+ }).errors({ NOT_FOUND: {} }).input(z.object({ projectId: z.string().describe("The ID of the project") })).output(z.object({ success: z.literal(true) }));
213
222
  const updateProjectContractV1 = oc.route({
214
223
  path: "/v1/projects/{projectId}",
215
224
  method: "PATCH",
@@ -222,6 +231,7 @@ const updateProjectContractV1 = oc.route({
222
231
  BAD_REQUEST: {}
223
232
  }).input(z.object({
224
233
  projectId: z.string().describe("The ID of the project"),
234
+ name: z.string().min(1).max(100).optional().describe("The new name for the project"),
225
235
  sourceRepository: z.string().nullable().optional().describe("The source repository to connect to the project")
226
236
  })).output(projectOutputSchema);
227
237
  const deployEnvironmentContractV1 = oc.route({
@@ -237,7 +247,7 @@ const deployEnvironmentContractV1 = oc.route({
237
247
  }).input(z.object({
238
248
  environmentId: z.string().describe("The ID of the environment to deploy"),
239
249
  token: z.string().describe("The token to identify the source archive").optional()
240
- })).output(deploymentSchema);
250
+ })).output(deploymentWithPageUrlSchema);
241
251
  const uploadDeploymentArtifactContractV1 = oc.route({
242
252
  path: "/v1/deployments/upload",
243
253
  method: "POST",
@@ -268,7 +278,7 @@ const getDeploymentContractV1 = oc.route({
268
278
  description: "Get a deployment by ID",
269
279
  tags: ["deployments"],
270
280
  successDescription: "The deployment details"
271
- }).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
281
+ }).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentWithPageUrlSchema);
272
282
  const getDeploymentLogsContractV1 = oc.route({
273
283
  path: "/v1/deployments/{deploymentId}/logs",
274
284
  method: "GET",
@@ -353,7 +363,8 @@ const contract = {
353
363
  update: { v1: updateProjectContractV1 },
354
364
  get: { v1: getProjectContractV1 },
355
365
  list: { v1: listProjectsContractV1 },
356
- create: { v1: createProjectContractV1 }
366
+ create: { v1: createProjectContractV1 },
367
+ delete: { v1: deleteProjectContractV1 }
357
368
  }
358
369
  };
359
370
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-staging.22149cf",
3
+ "version": "0.0.0-staging.221f2c7",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -17,12 +17,11 @@
17
17
  "author": "Alpic",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@orpc/contract": "^1.13.4",
20
+ "@orpc/contract": "^1.13.5",
21
21
  "zod": "^4.3.6"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@total-typescript/tsconfig": "^1.0.4",
25
- "biome": "^0.3.3",
26
25
  "shx": "^0.4.0",
27
26
  "tsdown": "^0.20.3",
28
27
  "typescript": "^5.9.3",