@alpic-ai/api 0.0.0-dev.ge4a400f → 0.0.0-dev.ge52b305

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
@@ -938,6 +938,17 @@ declare const contract: {
938
938
  type RouterInput = InferContractRouterInputs<typeof contract>;
939
939
  type RouterOutput = InferContractRouterOutputs<typeof contract>;
940
940
  //#endregion
941
+ //#region src/auth-scope.d.ts
942
+ /** Credential scope required by an API route. */
943
+ type AuthScope = "any" | "user";
944
+ /** Accepts an API key or OAuth access token (default for most routes). */
945
+ declare const AUTH_SCOPE_ANY = "any";
946
+ /** Requires a user OAuth access token; API keys are not accepted. */
947
+ declare const AUTH_SCOPE_USER = "user";
948
+ type RouteAuthMeta = {
949
+ authScope?: AuthScope;
950
+ };
951
+ //#endregion
941
952
  //#region ../domains/src/platforms/schemas.d.ts
942
953
  declare const platformSchema: z.ZodEnum<{
943
954
  chatgpt: "chatgpt";
@@ -1017,4 +1028,4 @@ declare const serverFieldsSchema: z.ZodObject<{
1017
1028
  }, z.core.$strip>>>;
1018
1029
  }, z.core.$strip>;
1019
1030
  //#endregion
1020
- export { ApiContext, PLATFORM_LABELS, type Platform, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
1031
+ export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, ApiContext, AuthScope, PLATFORM_LABELS, type Platform, RouteAuthMeta, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
package/dist/index.mjs CHANGED
@@ -369,6 +369,12 @@ const environmentSchema$1 = z.object({
369
369
  updatedAt: z.coerce.date()
370
370
  });
371
371
  const environmentWithDomainsSchema = environmentSchema$1.extend({ domains: z.array(environmentDomainSchema) });
372
+ z.object({
373
+ sessionReplayEnabled: z.boolean(),
374
+ collectRequestPayload: z.boolean(),
375
+ collectResponsePayload: z.boolean(),
376
+ collectErrorMessage: z.boolean()
377
+ });
372
378
  z.object({
373
379
  id: z.string(),
374
380
  createdAt: z.coerce.date(),
@@ -1195,6 +1201,12 @@ z.object({
1195
1201
  partnerDiscount: partnerDiscountSchema.nullable()
1196
1202
  });
1197
1203
  //#endregion
1204
+ //#region src/auth-scope.ts
1205
+ /** Accepts an API key or OAuth access token (default for most routes). */
1206
+ const AUTH_SCOPE_ANY = "any";
1207
+ /** Requires a user OAuth access token; API keys are not accepted. */
1208
+ const AUTH_SCOPE_USER = "user";
1209
+ //#endregion
1198
1210
  //#region src/schemas.ts
1199
1211
  const RESERVED_KEYS = [
1200
1212
  "_HANDLER",
@@ -1732,7 +1744,7 @@ const getTunnelTicketContractV1 = oc.route({
1732
1744
  description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
1733
1745
  tags: ["tunnels"],
1734
1746
  successDescription: "The tunnel ticket"
1735
- }).errors({ FORBIDDEN: {} }).output(z.object({
1747
+ }).meta({ authScope: AUTH_SCOPE_USER }).errors({ FORBIDDEN: {} }).output(z.object({
1736
1748
  subdomain: z.string().describe("The subdomain assigned to the user"),
1737
1749
  ticket: z.string().describe("The signed tunnel ticket"),
1738
1750
  tunnelHost: z.string().describe("The tunnel host to connect to")
@@ -1886,4 +1898,4 @@ const contract = {
1886
1898
  }
1887
1899
  };
1888
1900
  //#endregion
1889
- export { PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
1901
+ export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alpic-ai/api",
3
- "version": "0.0.0-dev.ge4a400f",
3
+ "version": "0.0.0-dev.ge52b305",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -17,19 +17,19 @@
17
17
  "author": "Alpic",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@orpc/contract": "^1.14.4",
20
+ "@orpc/contract": "^1.14.6",
21
21
  "ms": "^2.1.3",
22
22
  "zod": "^4.4.3"
23
23
  },
24
24
  "devDependencies": {
25
- "@orpc/openapi": "^1.14.4",
26
- "@orpc/zod": "^1.14.4",
25
+ "@orpc/openapi": "^1.14.6",
26
+ "@orpc/zod": "^1.14.6",
27
27
  "@total-typescript/tsconfig": "^1.0.4",
28
28
  "@types/ms": "^2.1.0",
29
29
  "shx": "^0.4.0",
30
- "tsdown": "^0.22.1",
30
+ "tsdown": "^0.22.3",
31
31
  "typescript": "^6.0.3",
32
- "vitest": "^4.1.8",
32
+ "vitest": "^4.1.9",
33
33
  "@alpic-ai/domains": "0.0.0"
34
34
  },
35
35
  "scripts": {