@alpic-ai/api 0.0.0-dev.ge4c0895 → 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 +12 -1
- package/dist/index.mjs +8 -2
- package/package.json +1 -1
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
|
@@ -1201,6 +1201,12 @@ z.object({
|
|
|
1201
1201
|
partnerDiscount: partnerDiscountSchema.nullable()
|
|
1202
1202
|
});
|
|
1203
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
|
|
1204
1210
|
//#region src/schemas.ts
|
|
1205
1211
|
const RESERVED_KEYS = [
|
|
1206
1212
|
"_HANDLER",
|
|
@@ -1738,7 +1744,7 @@ const getTunnelTicketContractV1 = oc.route({
|
|
|
1738
1744
|
description: "Get a signed ticket for establishing a tunnel connection. Requires user authentication (API keys are not supported).",
|
|
1739
1745
|
tags: ["tunnels"],
|
|
1740
1746
|
successDescription: "The tunnel ticket"
|
|
1741
|
-
}).errors({ FORBIDDEN: {} }).output(z.object({
|
|
1747
|
+
}).meta({ authScope: AUTH_SCOPE_USER }).errors({ FORBIDDEN: {} }).output(z.object({
|
|
1742
1748
|
subdomain: z.string().describe("The subdomain assigned to the user"),
|
|
1743
1749
|
ticket: z.string().describe("The signed tunnel ticket"),
|
|
1744
1750
|
tunnelHost: z.string().describe("The tunnel host to connect to")
|
|
@@ -1892,4 +1898,4 @@ const contract = {
|
|
|
1892
1898
|
}
|
|
1893
1899
|
};
|
|
1894
1900
|
//#endregion
|
|
1895
|
-
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 };
|