@alpic-ai/sdk 0.0.0-dev.g00aa430
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/api/auth-scope.d.ts +2 -0
- package/dist/api/auth-scope.js +7 -0
- package/dist/api/auth-scope.js.map +1 -0
- package/dist/api/client.d.ts +11 -0
- package/dist/api/client.js +25 -0
- package/dist/api/client.js.map +1 -0
- package/dist/auth/constants.d.ts +2 -0
- package/dist/auth/constants.js +3 -0
- package/dist/auth/constants.js.map +1 -0
- package/dist/auth/index.d.ts +25 -0
- package/dist/auth/index.js +45 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/login.d.ts +7 -0
- package/dist/auth/login.js +21 -0
- package/dist/auth/login.js.map +1 -0
- package/dist/auth/oauth-client.d.ts +28 -0
- package/dist/auth/oauth-client.js +116 -0
- package/dist/auth/oauth-client.js.map +1 -0
- package/dist/auth/server/assets/alpic-mountain.png +0 -0
- package/dist/auth/server/assets/authorize.html +234 -0
- package/dist/auth/server/assets/callback.html +88 -0
- package/dist/auth/server/index.d.ts +14 -0
- package/dist/auth/server/index.js +128 -0
- package/dist/auth/server/index.js.map +1 -0
- package/dist/auth/store.d.ts +30 -0
- package/dist/auth/store.js +76 -0
- package/dist/auth/store.js.map +1 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.js +28 -0
- package/dist/client.js.map +1 -0
- package/dist/deploy/archive.d.ts +8 -0
- package/dist/deploy/archive.js +61 -0
- package/dist/deploy/archive.js.map +1 -0
- package/dist/deploy/deployments.d.ts +43 -0
- package/dist/deploy/deployments.js +89 -0
- package/dist/deploy/deployments.js.map +1 -0
- package/dist/deploy/poll.d.ts +2 -0
- package/dist/deploy/poll.js +10 -0
- package/dist/deploy/poll.js.map +1 -0
- package/dist/deploy/upload.d.ts +1 -0
- package/dist/deploy/upload.js +13 -0
- package/dist/deploy/upload.js.map +1 -0
- package/dist/env.d.ts +4 -0
- package/dist/env.js +10 -0
- package/dist/env.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/emitter.d.ts +7 -0
- package/dist/lib/emitter.js +29 -0
- package/dist/lib/emitter.js.map +1 -0
- package/dist/project/config.d.ts +10 -0
- package/dist/project/config.js +29 -0
- package/dist/project/config.js.map +1 -0
- package/dist/project/detect-runtime.d.ts +2 -0
- package/dist/project/detect-runtime.js +25 -0
- package/dist/project/detect-runtime.js.map +1 -0
- package/dist/project/projects.d.ts +21 -0
- package/dist/project/projects.js +52 -0
- package/dist/project/projects.js.map +1 -0
- package/dist/tunnel/tunnel.d.ts +43 -0
- package/dist/tunnel/tunnel.js +127 -0
- package/dist/tunnel/tunnel.js.map +1 -0
- package/dist/vendor/pipenet.d.ts +1 -0
- package/dist/vendor/pipenet.js +16883 -0
- package/dist/vendor/pipenet.js.LEGAL.txt +17 -0
- package/dist/vendor/pipenet.js.map +7 -0
- package/dist/whoami.d.ts +15 -0
- package/dist/whoami.js +12 -0
- package/dist/whoami.js.map +1 -0
- package/package.json +59 -0
package/dist/whoami.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RouterOutput } from "@alpic-ai/api";
|
|
2
|
+
import type { AlpicApi } from "./api/client.js";
|
|
3
|
+
import type { AlpicAuth } from "./auth/index.js";
|
|
4
|
+
export type Team = RouterOutput["teams"]["list"]["v1"][number];
|
|
5
|
+
export type WhoamiInfo = {
|
|
6
|
+
method: "unauthenticated";
|
|
7
|
+
} | {
|
|
8
|
+
method: "api_key";
|
|
9
|
+
team: Team | undefined;
|
|
10
|
+
} | {
|
|
11
|
+
method: "oauth";
|
|
12
|
+
email: string | undefined;
|
|
13
|
+
name: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare function whoami(auth: AlpicAuth, api: AlpicApi): Promise<WhoamiInfo>;
|
package/dist/whoami.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export async function whoami(auth, api) {
|
|
2
|
+
if (process.env.ALPIC_API_KEY !== undefined) {
|
|
3
|
+
const teams = await api.teams.list.v1();
|
|
4
|
+
return { method: "api_key", team: teams[0] };
|
|
5
|
+
}
|
|
6
|
+
const userInfo = await auth.getUserInfo();
|
|
7
|
+
if (!userInfo) {
|
|
8
|
+
return { method: "unauthenticated" };
|
|
9
|
+
}
|
|
10
|
+
return { method: "oauth", email: userInfo.email, name: userInfo.name };
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=whoami.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whoami.js","sourceRoot":"","sources":["../src/whoami.ts"],"names":[],"mappings":"AAYA,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAe,EAAE,GAAa;IACzD,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;QACxC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;AACzE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@alpic-ai/sdk",
|
|
3
|
+
"version": "0.0.0-dev.g00aa430",
|
|
4
|
+
"description": "Programmatic SDK for Alpic (auth, API, tunnel)",
|
|
5
|
+
"homepage": "https://alpic.ai",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/alpic-ai/alpic.git",
|
|
9
|
+
"directory": "packages/sdk"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">= 18.20.8"
|
|
25
|
+
},
|
|
26
|
+
"author": "Alpic",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@orpc/client": "^1.14.6",
|
|
30
|
+
"@orpc/contract": "^1.14.6",
|
|
31
|
+
"@orpc/openapi-client": "^1.14.6",
|
|
32
|
+
"@t3-oss/env-core": "^0.13.11",
|
|
33
|
+
"env-paths": "^4.0.0",
|
|
34
|
+
"open": "^11.0.0",
|
|
35
|
+
"openid-client": "^6.8.4",
|
|
36
|
+
"tar": "^7.5.19",
|
|
37
|
+
"zod": "^4.4.3",
|
|
38
|
+
"@alpic-ai/api": "0.0.0-dev.g00aa430"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@total-typescript/tsconfig": "^1.0.4",
|
|
42
|
+
"@types/node": "^25.9.4",
|
|
43
|
+
"esbuild": "^0.28.1",
|
|
44
|
+
"pipenet": "1.4.2",
|
|
45
|
+
"shx": "^0.4.0",
|
|
46
|
+
"typescript": "^6.0.3",
|
|
47
|
+
"vitest": "^4.1.9"
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "shx rm -rf dist && tsc && pnpm run build:assets && node scripts/bundle-vendor.mjs",
|
|
51
|
+
"build:assets": "shx cp -r src/auth/server/assets dist/auth/server/",
|
|
52
|
+
"format": "biome check --write --error-on-warnings .",
|
|
53
|
+
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
54
|
+
"test:unit": "vitest run",
|
|
55
|
+
"test:format": "biome check --error-on-warnings .",
|
|
56
|
+
"test:type": "tsc --noEmit",
|
|
57
|
+
"publish:npm": "pnpm publish --tag \"${NPM_TAG}\" --access public --no-git-checks"
|
|
58
|
+
}
|
|
59
|
+
}
|