alchemy 0.2.2 → 0.2.4
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/lib/ai/ark.d.ts +11 -0
- package/lib/ai/ark.js +86 -0
- package/lib/ai/client.d.ts +51 -0
- package/lib/ai/client.js +29 -0
- package/lib/ai/document.d.ts +97 -0
- package/lib/ai/document.js +82 -0
- package/lib/ai/index.d.ts +2 -0
- package/lib/ai/index.js +2 -0
- package/lib/ai/object.d.ts +101 -0
- package/lib/ai/object.js +70 -0
- package/lib/alchemy.d.ts +84 -2
- package/lib/alchemy.js +114 -10
- package/lib/apply.d.ts +1 -1
- package/lib/apply.js +13 -10
- package/lib/aws/bucket.d.ts +87 -1
- package/lib/aws/bucket.js +48 -1
- package/lib/aws/function.d.ts +186 -1
- package/lib/aws/function.js +62 -8
- package/lib/aws/oidc/github-oidc-provider.d.ts +81 -0
- package/lib/aws/oidc/github-oidc-provider.js +68 -0
- package/lib/aws/oidc/oidc-provider.d.ts +14 -6
- package/lib/aws/oidc/oidc-provider.js +26 -5
- package/lib/aws/policy-attachment.d.ts +44 -1
- package/lib/aws/policy-attachment.js +31 -0
- package/lib/aws/policy.d.ts +160 -1
- package/lib/aws/policy.js +78 -0
- package/lib/aws/queue.d.ts +83 -1
- package/lib/aws/queue.js +39 -0
- package/lib/aws/role.d.ts +162 -1
- package/lib/aws/role.js +114 -0
- package/lib/aws/ses.d.ts +57 -2
- package/lib/aws/ses.js +42 -1
- package/lib/aws/table.d.ts +96 -1
- package/lib/aws/table.js +36 -0
- package/lib/cloudflare/asset-manifest.js +0 -1
- package/lib/cloudflare/bound.js +0 -1
- package/lib/cloudflare/bucket.d.ts +37 -1
- package/lib/cloudflare/bucket.js +36 -0
- package/lib/cloudflare/durable-object-namespace.d.ts +25 -0
- package/lib/cloudflare/durable-object-namespace.js +22 -0
- package/lib/cloudflare/kv-namespace.d.ts +37 -1
- package/lib/cloudflare/kv-namespace.js +36 -0
- package/lib/cloudflare/static-site.d.ts +53 -1
- package/lib/cloudflare/static-site.js +53 -1
- package/lib/cloudflare/worker-metadata.js +0 -1
- package/lib/cloudflare/worker.d.ts +64 -1
- package/lib/cloudflare/worker.js +63 -0
- package/lib/cloudflare/wrangler.json.d.ts +1 -1
- package/lib/cloudflare/zone-settings.js +0 -1
- package/lib/cloudflare/zone.d.ts +56 -1
- package/lib/cloudflare/zone.js +55 -0
- package/lib/context.d.ts +9 -4
- package/lib/context.js +4 -2
- package/lib/destroy.js +9 -8
- package/lib/esbuild/bundle.d.ts +43 -4
- package/lib/esbuild/bundle.js +16 -0
- package/lib/fs/file-collection.d.ts +16 -0
- package/lib/fs/file-collection.js +6 -0
- package/lib/fs/file-ref.d.ts +14 -0
- package/lib/fs/file-ref.js +6 -0
- package/lib/fs/file.d.ts +78 -5
- package/lib/fs/file.js +39 -3
- package/lib/fs/folder.d.ts +37 -5
- package/lib/fs/folder.js +28 -3
- package/lib/fs/index.d.ts +6 -0
- package/lib/fs/index.js +6 -0
- package/lib/fs/json-file.d.ts +16 -0
- package/lib/fs/json-file.js +7 -0
- package/lib/fs/text-file.d.ts +12 -0
- package/lib/fs/text-file.js +7 -0
- package/lib/fs/typescript-file.d.ts +19 -0
- package/lib/fs/typescript-file.js +14 -0
- package/lib/fs/yaml-file.d.ts +19 -0
- package/lib/fs/yaml-file.js +8 -0
- package/lib/github/secret.d.ts +63 -2
- package/lib/github/secret.js +61 -1
- package/lib/internal/docs.d.ts +5 -0
- package/lib/internal/docs.js +324 -0
- package/lib/resource.d.ts +2 -2
- package/lib/resource.js +4 -0
- package/lib/scope.d.ts +1 -1
- package/lib/scope.js +6 -6
- package/lib/secret.d.ts +67 -0
- package/lib/secret.js +67 -0
- package/lib/shadcn/component.d.ts +1 -1
- package/lib/state.d.ts +1 -1
- package/lib/state.js +8 -1
- package/lib/stripe/price.d.ts +51 -1
- package/lib/stripe/price.js +50 -0
- package/lib/stripe/product.d.ts +39 -1
- package/lib/stripe/product.js +38 -0
- package/lib/stripe/webhook.d.ts +46 -1
- package/lib/stripe/webhook.js +45 -0
- package/lib/test/bun.d.ts +64 -0
- package/lib/test/bun.js +35 -3
- package/lib/util/serde.d.ts +3 -1
- package/lib/util/serde.js +20 -4
- package/lib/vite/vite.d.ts +1 -1
- package/lib/vitepress/dependencies.d.ts +12 -0
- package/lib/vitepress/dependencies.js +35 -0
- package/lib/vitepress/home-page.d.ts +133 -0
- package/lib/vitepress/home-page.js +11 -0
- package/lib/vitepress/index.d.ts +2 -0
- package/lib/vitepress/index.js +2 -0
- package/lib/vitepress/vitepress.d.ts +71 -0
- package/lib/vitepress/vitepress.js +266 -0
- package/package.json +22 -10
- package/src/ai/ark.ts +118 -0
- package/src/ai/client.ts +78 -0
- package/src/ai/document.ts +160 -0
- package/src/ai/index.ts +2 -0
- package/src/ai/object.ts +149 -0
- package/src/alchemy.ts +192 -17
- package/src/apply.ts +25 -13
- package/src/aws/bucket.ts +111 -7
- package/src/aws/function.ts +231 -10
- package/src/aws/oidc/github-oidc-provider.ts +83 -0
- package/src/aws/oidc/oidc-provider.ts +39 -7
- package/src/aws/policy-attachment.ts +44 -1
- package/src/aws/policy.ts +177 -2
- package/src/aws/queue.ts +89 -0
- package/src/aws/role.ts +174 -2
- package/src/aws/ses.ts +56 -1
- package/src/aws/table.ts +103 -0
- package/src/cloudflare/bucket.ts +36 -0
- package/src/cloudflare/durable-object-namespace.ts +25 -0
- package/src/cloudflare/kv-namespace.ts +36 -0
- package/src/cloudflare/static-site.ts +53 -1
- package/src/cloudflare/worker.ts +63 -0
- package/src/cloudflare/zone.ts +55 -0
- package/src/context.ts +30 -10
- package/src/destroy.ts +11 -8
- package/src/esbuild/bundle.ts +53 -3
- package/src/fs/file-collection.ts +24 -0
- package/src/fs/file-ref.ts +22 -0
- package/src/fs/file.ts +107 -6
- package/src/fs/folder.ts +45 -5
- package/src/fs/index.ts +6 -0
- package/src/fs/json-file.ts +23 -0
- package/src/fs/text-file.ts +19 -0
- package/src/fs/typescript-file.ts +36 -0
- package/src/fs/yaml-file.ts +26 -0
- package/src/github/secret.ts +65 -2
- package/src/internal/docs.ts +369 -0
- package/src/resource.ts +7 -2
- package/src/scope.ts +9 -9
- package/src/secret.ts +67 -0
- package/src/state.ts +9 -2
- package/src/stripe/price.ts +50 -0
- package/src/stripe/product.ts +38 -0
- package/src/stripe/webhook.ts +45 -0
- package/src/test/bun.ts +83 -3
- package/src/util/serde.ts +30 -4
- package/src/vitepress/dependencies.ts +68 -0
- package/src/vitepress/home-page.ts +166 -0
- package/src/vitepress/index.md +75 -0
- package/src/vitepress/index.ts +2 -0
- package/src/vitepress/vitepress.ts +382 -0
- package/lib/project/vite.d.ts +0 -90
- package/lib/project/vite.js +0 -228
- package/src/project/vite.ts +0 -406
package/lib/fs/folder.d.ts
CHANGED
|
@@ -1,10 +1,42 @@
|
|
|
1
1
|
import type { Context } from "../context";
|
|
2
2
|
import { Resource } from "../resource";
|
|
3
|
+
export interface FolderProps {
|
|
4
|
+
/**
|
|
5
|
+
* The path of the folder
|
|
6
|
+
*/
|
|
7
|
+
path?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to delete the folder during the delete phase
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
delete?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Base folder resource type
|
|
16
|
+
*/
|
|
3
17
|
export interface Folder extends Resource<"fs::Folder"> {
|
|
4
18
|
path: string;
|
|
5
19
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Folder Resource
|
|
22
|
+
*
|
|
23
|
+
* Creates and manages directories in the filesystem with automatic parent
|
|
24
|
+
* directory creation and cleanup on deletion.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Create a directory using id as path
|
|
28
|
+
* const dir = await Folder("uploads");
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Create a directory with explicit path
|
|
32
|
+
* const dir = await Folder("uploads", {
|
|
33
|
+
* path: "uploads"
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Create a nested directory structure
|
|
38
|
+
* const logs = await Folder("var/log/app", {
|
|
39
|
+
* path: "var/log/app"
|
|
40
|
+
* });
|
|
41
|
+
*/
|
|
42
|
+
export declare const Folder: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<Folder>, id: string, props?: FolderProps) => Promise<Folder>);
|
package/lib/fs/folder.js
CHANGED
|
@@ -1,10 +1,35 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import { Resource } from "../resource";
|
|
3
3
|
import { ignore } from "../util/ignore";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Folder Resource
|
|
6
|
+
*
|
|
7
|
+
* Creates and manages directories in the filesystem with automatic parent
|
|
8
|
+
* directory creation and cleanup on deletion.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Create a directory using id as path
|
|
12
|
+
* const dir = await Folder("uploads");
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Create a directory with explicit path
|
|
16
|
+
* const dir = await Folder("uploads", {
|
|
17
|
+
* path: "uploads"
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Create a nested directory structure
|
|
22
|
+
* const logs = await Folder("var/log/app", {
|
|
23
|
+
* path: "var/log/app"
|
|
24
|
+
* });
|
|
25
|
+
*/
|
|
26
|
+
export const Folder = Resource("fs::Folder", async function (id, props) {
|
|
27
|
+
const dirPath = props?.path ?? id;
|
|
5
28
|
if (this.phase === "delete") {
|
|
6
|
-
|
|
7
|
-
|
|
29
|
+
if (props?.delete !== false) {
|
|
30
|
+
// we just do a best effort attempt
|
|
31
|
+
await ignore(["ENOENT", "ENOTEMPTY"], async () => fs.promises.rmdir(dirPath));
|
|
32
|
+
}
|
|
8
33
|
return this.destroy();
|
|
9
34
|
}
|
|
10
35
|
else {
|
package/lib/fs/index.d.ts
CHANGED
package/lib/fs/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a JSON file with formatted content
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a JSON configuration file
|
|
7
|
+
* const config = await JsonFile("config.json", {
|
|
8
|
+
* api: {
|
|
9
|
+
* endpoint: "https://api.example.com",
|
|
10
|
+
* version: "v1"
|
|
11
|
+
* },
|
|
12
|
+
* features: ["auth", "logging"]
|
|
13
|
+
* });
|
|
14
|
+
*/
|
|
15
|
+
export type JsonFile = File;
|
|
16
|
+
export declare function JsonFile(id: string, content: any): Promise<JsonFile>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a plain text file
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a text file with content
|
|
7
|
+
* const readme = await TextFile("README.md",
|
|
8
|
+
* "# Project Name\n\nProject description goes here."
|
|
9
|
+
* );
|
|
10
|
+
*/
|
|
11
|
+
export type TextFile = File;
|
|
12
|
+
export declare function TextFile(id: string, content: string): Promise<TextFile>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a TypeScript file with formatted content using prettier
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a TypeScript file
|
|
7
|
+
* const component = await TypeScriptFile("Component.ts", `
|
|
8
|
+
* interface Props {
|
|
9
|
+
* name: string;
|
|
10
|
+
* age: number;
|
|
11
|
+
* }
|
|
12
|
+
*
|
|
13
|
+
* export function Component({ name, age }: Props) {
|
|
14
|
+
* return <div>Hello {name}, you are {age} years old</div>;
|
|
15
|
+
* }
|
|
16
|
+
* `);
|
|
17
|
+
*/
|
|
18
|
+
export type TypeScriptFile = File;
|
|
19
|
+
export declare function TypeScriptFile(id: string, content: string): Promise<TypeScriptFile>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
export async function TypeScriptFile(id, content) {
|
|
3
|
+
const prettier = await import("prettier");
|
|
4
|
+
return File(id, {
|
|
5
|
+
path: id,
|
|
6
|
+
content: await prettier.format(content, {
|
|
7
|
+
parser: "typescript",
|
|
8
|
+
editor: {
|
|
9
|
+
tabWidth: 2,
|
|
10
|
+
indentWidth: 2,
|
|
11
|
+
},
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { File } from "./file";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a YAML file with formatted content
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* // Create a YAML configuration file
|
|
7
|
+
* const config = await YamlFile("config.yaml", {
|
|
8
|
+
* server:
|
|
9
|
+
* host: "localhost"
|
|
10
|
+
* port: 3000
|
|
11
|
+
* database:
|
|
12
|
+
* url: "postgresql://localhost:5432/db"
|
|
13
|
+
* pool:
|
|
14
|
+
* min: 1
|
|
15
|
+
* max: 10
|
|
16
|
+
* });
|
|
17
|
+
*/
|
|
18
|
+
export type YamlFile = File;
|
|
19
|
+
export declare function YamlFile(id: string, content: any): Promise<YamlFile>;
|
package/lib/github/secret.d.ts
CHANGED
|
@@ -23,8 +23,11 @@ export interface GitHubSecretProps {
|
|
|
23
23
|
value: Secret;
|
|
24
24
|
/**
|
|
25
25
|
* Optional GitHub API token (overrides environment variable)
|
|
26
|
+
* If not provided, will use GITHUB_TOKEN environment variable
|
|
27
|
+
* Token must have 'repo' scope for private repositories
|
|
28
|
+
* or 'public_repo' scope for public repositories
|
|
26
29
|
*/
|
|
27
|
-
token?:
|
|
30
|
+
token?: Secret;
|
|
28
31
|
}
|
|
29
32
|
/**
|
|
30
33
|
* Output returned after Secret creation/update
|
|
@@ -41,5 +44,63 @@ export interface GitHubSecretOutput extends Resource<"github::Secret">, Omit<Git
|
|
|
41
44
|
}
|
|
42
45
|
/**
|
|
43
46
|
* Resource for managing GitHub repository secrets
|
|
47
|
+
*
|
|
48
|
+
* Authentication is handled in the following order:
|
|
49
|
+
* 1. `token` parameter in the resource props (if provided)
|
|
50
|
+
* 2. `GITHUB_TOKEN` environment variable
|
|
51
|
+
*
|
|
52
|
+
* The token must have the following permissions:
|
|
53
|
+
* - 'repo' scope for private repositories
|
|
54
|
+
* - 'public_repo' scope for public repositories
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* // Create a secret using GITHUB_TOKEN environment variable:
|
|
58
|
+
* const secret = await GitHubSecret("my-secret", {
|
|
59
|
+
* owner: "my-github-username",
|
|
60
|
+
* repository: "my-repo",
|
|
61
|
+
* name: "API_KEY",
|
|
62
|
+
* value: alchemy.secret("my-secret-value")
|
|
63
|
+
* });
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Create a secret with a custom GitHub token:
|
|
67
|
+
* const secret = await GitHubSecret("my-secret", {
|
|
68
|
+
* owner: "my-github-username",
|
|
69
|
+
* repository: "my-repo",
|
|
70
|
+
* name: "API_KEY",
|
|
71
|
+
* value: alchemy.secret("my-secret-value"),
|
|
72
|
+
* token: alchemy.secret(process.env.CUSTOM_GITHUB_TOKEN)
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* // Create multiple secrets with environment variables:
|
|
77
|
+
* const secrets = await Promise.all([
|
|
78
|
+
* GitHubSecret("aws-secret", {
|
|
79
|
+
* owner: "my-github-username",
|
|
80
|
+
* repository: "cloud-app",
|
|
81
|
+
* name: "AWS_ROLE_ARN",
|
|
82
|
+
* value: alchemy.secret(process.env.AWS_ROLE_ARN)
|
|
83
|
+
* }),
|
|
84
|
+
* GitHubSecret("cf-secret", {
|
|
85
|
+
* owner: "my-github-username",
|
|
86
|
+
* repository: "cloud-app",
|
|
87
|
+
* name: "CLOUDFLARE_API_KEY",
|
|
88
|
+
* value: alchemy.secret(process.env.CLOUDFLARE_API_KEY)
|
|
89
|
+
* })
|
|
90
|
+
* ]);
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // Create a secret in a secure scope with a password:
|
|
94
|
+
* await alchemy.run("secure-scope", {
|
|
95
|
+
* password: process.env.SECRET_PASSPHRASE
|
|
96
|
+
* }, async () => {
|
|
97
|
+
* const secret = await GitHubSecret("deploy-secret", {
|
|
98
|
+
* owner: "my-github-username",
|
|
99
|
+
* repository: "my-app",
|
|
100
|
+
* name: "DEPLOY_TOKEN",
|
|
101
|
+
* value: alchemy.secret(process.env.DEPLOY_TOKEN),
|
|
102
|
+
* token: alchemy.secret(process.env.GITHUB_TOKEN)
|
|
103
|
+
* });
|
|
104
|
+
* });
|
|
44
105
|
*/
|
|
45
|
-
export declare const GitHubSecret: ((this:
|
|
106
|
+
export declare const GitHubSecret: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<GitHubSecretOutput>, id: string, props: GitHubSecretProps) => Promise<GitHubSecretOutput>);
|
package/lib/github/secret.js
CHANGED
|
@@ -3,11 +3,71 @@ import { Resource } from "../resource";
|
|
|
3
3
|
import { createGitHubClient, verifyGitHubAuth } from "./client";
|
|
4
4
|
/**
|
|
5
5
|
* Resource for managing GitHub repository secrets
|
|
6
|
+
*
|
|
7
|
+
* Authentication is handled in the following order:
|
|
8
|
+
* 1. `token` parameter in the resource props (if provided)
|
|
9
|
+
* 2. `GITHUB_TOKEN` environment variable
|
|
10
|
+
*
|
|
11
|
+
* The token must have the following permissions:
|
|
12
|
+
* - 'repo' scope for private repositories
|
|
13
|
+
* - 'public_repo' scope for public repositories
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Create a secret using GITHUB_TOKEN environment variable:
|
|
17
|
+
* const secret = await GitHubSecret("my-secret", {
|
|
18
|
+
* owner: "my-github-username",
|
|
19
|
+
* repository: "my-repo",
|
|
20
|
+
* name: "API_KEY",
|
|
21
|
+
* value: alchemy.secret("my-secret-value")
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Create a secret with a custom GitHub token:
|
|
26
|
+
* const secret = await GitHubSecret("my-secret", {
|
|
27
|
+
* owner: "my-github-username",
|
|
28
|
+
* repository: "my-repo",
|
|
29
|
+
* name: "API_KEY",
|
|
30
|
+
* value: alchemy.secret("my-secret-value"),
|
|
31
|
+
* token: alchemy.secret(process.env.CUSTOM_GITHUB_TOKEN)
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Create multiple secrets with environment variables:
|
|
36
|
+
* const secrets = await Promise.all([
|
|
37
|
+
* GitHubSecret("aws-secret", {
|
|
38
|
+
* owner: "my-github-username",
|
|
39
|
+
* repository: "cloud-app",
|
|
40
|
+
* name: "AWS_ROLE_ARN",
|
|
41
|
+
* value: alchemy.secret(process.env.AWS_ROLE_ARN)
|
|
42
|
+
* }),
|
|
43
|
+
* GitHubSecret("cf-secret", {
|
|
44
|
+
* owner: "my-github-username",
|
|
45
|
+
* repository: "cloud-app",
|
|
46
|
+
* name: "CLOUDFLARE_API_KEY",
|
|
47
|
+
* value: alchemy.secret(process.env.CLOUDFLARE_API_KEY)
|
|
48
|
+
* })
|
|
49
|
+
* ]);
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // Create a secret in a secure scope with a password:
|
|
53
|
+
* await alchemy.run("secure-scope", {
|
|
54
|
+
* password: process.env.SECRET_PASSPHRASE
|
|
55
|
+
* }, async () => {
|
|
56
|
+
* const secret = await GitHubSecret("deploy-secret", {
|
|
57
|
+
* owner: "my-github-username",
|
|
58
|
+
* repository: "my-app",
|
|
59
|
+
* name: "DEPLOY_TOKEN",
|
|
60
|
+
* value: alchemy.secret(process.env.DEPLOY_TOKEN),
|
|
61
|
+
* token: alchemy.secret(process.env.GITHUB_TOKEN)
|
|
62
|
+
* });
|
|
63
|
+
* });
|
|
6
64
|
*/
|
|
7
65
|
export const GitHubSecret = Resource("github::Secret", async function (id, props) {
|
|
8
66
|
// Create authenticated Octokit client - will automatically handle token resolution
|
|
9
67
|
/// TODO: use fetch
|
|
10
|
-
const octokit = await createGitHubClient({
|
|
68
|
+
const octokit = await createGitHubClient({
|
|
69
|
+
token: props.token?.unencrypted,
|
|
70
|
+
});
|
|
11
71
|
// Verify authentication and permissions
|
|
12
72
|
if (!this.quiet) {
|
|
13
73
|
await verifyGitHubAuth(octokit, props.owner, props.repository);
|