@alpic-ai/api 0.0.0-staging.g736bf98 → 0.0.0-staging.g73c439e

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
@@ -940,6 +940,17 @@ declare const contract: {
940
940
  type RouterInput = InferContractRouterInputs<typeof contract>;
941
941
  type RouterOutput = InferContractRouterOutputs<typeof contract>;
942
942
  //#endregion
943
+ //#region src/auth-scope.d.ts
944
+ /** Credential scope required by an API route. */
945
+ type AuthScope = "any" | "user";
946
+ /** Accepts an API key or OAuth access token (default for most routes). */
947
+ declare const AUTH_SCOPE_ANY = "any";
948
+ /** Requires a user OAuth access token; API keys are not accepted. */
949
+ declare const AUTH_SCOPE_USER = "user";
950
+ type RouteAuthMeta = {
951
+ authScope?: AuthScope;
952
+ };
953
+ //#endregion
943
954
  //#region ../domains/src/platforms/schemas.d.ts
944
955
  declare const platformSchema: z.ZodEnum<{
945
956
  chatgpt: "chatgpt";
@@ -1019,4 +1030,4 @@ declare const serverFieldsSchema: z.ZodObject<{
1019
1030
  }, z.core.$strip>>>;
1020
1031
  }, z.core.$strip>;
1021
1032
  //#endregion
1022
- export { ApiContext, PLATFORM_LABELS, type Platform, RouterInput, RouterOutput, Runtime, Transport, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
1033
+ 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
@@ -1203,6 +1203,12 @@ z.object({
1203
1203
  partnerDiscount: partnerDiscountSchema.nullable()
1204
1204
  });
1205
1205
  //#endregion
1206
+ //#region src/auth-scope.ts
1207
+ /** Accepts an API key or OAuth access token (default for most routes). */
1208
+ const AUTH_SCOPE_ANY = "any";
1209
+ /** Requires a user OAuth access token; API keys are not accepted. */
1210
+ const AUTH_SCOPE_USER = "user";
1211
+ //#endregion
1206
1212
  //#region src/schemas.ts
1207
1213
  const RESERVED_KEYS = [
1208
1214
  "_HANDLER",
@@ -1742,7 +1748,7 @@ const getTunnelTicketContractV1 = oc.route({
1742
1748
  description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
1743
1749
  tags: ["tunnels"],
1744
1750
  successDescription: "The tunnel ticket"
1745
- }).errors({ FORBIDDEN: {} }).output(z.object({
1751
+ }).meta({ authScope: AUTH_SCOPE_USER }).errors({ FORBIDDEN: {} }).output(z.object({
1746
1752
  subdomain: z.string().describe("The subdomain assigned to the user"),
1747
1753
  ticket: z.string().describe("The signed tunnel ticket"),
1748
1754
  tunnelHost: z.string().describe("The tunnel host to connect to")
@@ -1896,4 +1902,4 @@ const contract = {
1896
1902
  }
1897
1903
  };
1898
1904
  //#endregion
1899
- export { PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
1905
+ 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-staging.g736bf98",
3
+ "version": "0.0.0-staging.g73c439e",
4
4
  "description": "Contract for the Alpic API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",