@infracraft/pulumi 0.1.0
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.
Potentially problematic release.
This version of @infracraft/pulumi might be problematic. Click here for more details.
- package/dist/chunk-BVYJZCqc.cjs +44 -0
- package/dist/chunk-OPjESj5l.mjs +9 -0
- package/dist/git-guard.cjs +62 -0
- package/dist/git-guard.cjs.map +1 -0
- package/dist/git-guard.d.cts +13 -0
- package/dist/git-guard.d.cts.map +1 -0
- package/dist/git-guard.d.mts +13 -0
- package/dist/git-guard.d.mts.map +1 -0
- package/dist/git-guard.mjs +56 -0
- package/dist/git-guard.mjs.map +1 -0
- package/dist/hash.cjs +40 -0
- package/dist/hash.cjs.map +1 -0
- package/dist/hash.d.cts +10 -0
- package/dist/hash.d.cts.map +1 -0
- package/dist/hash.d.mts +10 -0
- package/dist/hash.d.mts.map +1 -0
- package/dist/hash.mjs +36 -0
- package/dist/hash.mjs.map +1 -0
- package/dist/neon/branch.cjs +113 -0
- package/dist/neon/branch.cjs.map +1 -0
- package/dist/neon/branch.d.cts +40 -0
- package/dist/neon/branch.d.cts.map +1 -0
- package/dist/neon/branch.d.mts +40 -0
- package/dist/neon/branch.d.mts.map +1 -0
- package/dist/neon/branch.mjs +111 -0
- package/dist/neon/branch.mjs.map +1 -0
- package/dist/neon/client.cjs +85 -0
- package/dist/neon/client.cjs.map +1 -0
- package/dist/neon/client.d.cts +59 -0
- package/dist/neon/client.d.cts.map +1 -0
- package/dist/neon/client.d.mts +59 -0
- package/dist/neon/client.d.mts.map +1 -0
- package/dist/neon/client.mjs +84 -0
- package/dist/neon/client.mjs.map +1 -0
- package/dist/neon/database.cjs +117 -0
- package/dist/neon/database.cjs.map +1 -0
- package/dist/neon/database.d.cts +48 -0
- package/dist/neon/database.d.cts.map +1 -0
- package/dist/neon/database.d.mts +48 -0
- package/dist/neon/database.d.mts.map +1 -0
- package/dist/neon/database.mjs +115 -0
- package/dist/neon/database.mjs.map +1 -0
- package/dist/neon/endpoint.cjs +167 -0
- package/dist/neon/endpoint.cjs.map +1 -0
- package/dist/neon/endpoint.d.cts +57 -0
- package/dist/neon/endpoint.d.cts.map +1 -0
- package/dist/neon/endpoint.d.mts +57 -0
- package/dist/neon/endpoint.d.mts.map +1 -0
- package/dist/neon/endpoint.mjs +165 -0
- package/dist/neon/endpoint.mjs.map +1 -0
- package/dist/neon/index.cjs +14 -0
- package/dist/neon/index.d.cts +7 -0
- package/dist/neon/index.d.mts +7 -0
- package/dist/neon/index.mjs +8 -0
- package/dist/neon/project.cjs +120 -0
- package/dist/neon/project.cjs.map +1 -0
- package/dist/neon/project.d.cts +52 -0
- package/dist/neon/project.d.cts.map +1 -0
- package/dist/neon/project.d.mts +52 -0
- package/dist/neon/project.d.mts.map +1 -0
- package/dist/neon/project.mjs +118 -0
- package/dist/neon/project.mjs.map +1 -0
- package/dist/neon/role.cjs +135 -0
- package/dist/neon/role.cjs.map +1 -0
- package/dist/neon/role.d.cts +49 -0
- package/dist/neon/role.d.cts.map +1 -0
- package/dist/neon/role.d.mts +49 -0
- package/dist/neon/role.d.mts.map +1 -0
- package/dist/neon/role.mjs +133 -0
- package/dist/neon/role.mjs.map +1 -0
- package/dist/railway/client.cjs +59 -0
- package/dist/railway/client.cjs.map +1 -0
- package/dist/railway/client.d.cts +39 -0
- package/dist/railway/client.d.cts.map +1 -0
- package/dist/railway/client.d.mts +39 -0
- package/dist/railway/client.d.mts.map +1 -0
- package/dist/railway/client.mjs +58 -0
- package/dist/railway/client.mjs.map +1 -0
- package/dist/railway/deploy.cjs +40 -0
- package/dist/railway/deploy.cjs.map +1 -0
- package/dist/railway/deploy.d.cts +47 -0
- package/dist/railway/deploy.d.cts.map +1 -0
- package/dist/railway/deploy.d.mts +47 -0
- package/dist/railway/deploy.d.mts.map +1 -0
- package/dist/railway/deploy.mjs +37 -0
- package/dist/railway/deploy.mjs.map +1 -0
- package/dist/railway/domain.cjs +236 -0
- package/dist/railway/domain.cjs.map +1 -0
- package/dist/railway/domain.d.cts +52 -0
- package/dist/railway/domain.d.cts.map +1 -0
- package/dist/railway/domain.d.mts +52 -0
- package/dist/railway/domain.d.mts.map +1 -0
- package/dist/railway/domain.mjs +234 -0
- package/dist/railway/domain.mjs.map +1 -0
- package/dist/railway/index.cjs +16 -0
- package/dist/railway/index.d.cts +8 -0
- package/dist/railway/index.d.mts +8 -0
- package/dist/railway/index.mjs +9 -0
- package/dist/railway/project.cjs +231 -0
- package/dist/railway/project.cjs.map +1 -0
- package/dist/railway/project.d.cts +52 -0
- package/dist/railway/project.d.cts.map +1 -0
- package/dist/railway/project.d.mts +52 -0
- package/dist/railway/project.d.mts.map +1 -0
- package/dist/railway/project.mjs +229 -0
- package/dist/railway/project.mjs.map +1 -0
- package/dist/railway/service.cjs +268 -0
- package/dist/railway/service.cjs.map +1 -0
- package/dist/railway/service.d.cts +88 -0
- package/dist/railway/service.d.cts.map +1 -0
- package/dist/railway/service.d.mts +88 -0
- package/dist/railway/service.d.mts.map +1 -0
- package/dist/railway/service.mjs +266 -0
- package/dist/railway/service.mjs.map +1 -0
- package/dist/railway/variable.cjs +149 -0
- package/dist/railway/variable.cjs.map +1 -0
- package/dist/railway/variable.d.cts +52 -0
- package/dist/railway/variable.d.cts.map +1 -0
- package/dist/railway/variable.d.mts +52 -0
- package/dist/railway/variable.d.mts.map +1 -0
- package/dist/railway/variable.mjs +147 -0
- package/dist/railway/variable.mjs.map +1 -0
- package/dist/railway/volume.cjs +179 -0
- package/dist/railway/volume.cjs.map +1 -0
- package/dist/railway/volume.d.cts +52 -0
- package/dist/railway/volume.d.cts.map +1 -0
- package/dist/railway/volume.d.mts +52 -0
- package/dist/railway/volume.d.mts.map +1 -0
- package/dist/railway/volume.mjs +177 -0
- package/dist/railway/volume.mjs.map +1 -0
- package/dist/vercel/deploy.cjs +65 -0
- package/dist/vercel/deploy.cjs.map +1 -0
- package/dist/vercel/deploy.d.cts +54 -0
- package/dist/vercel/deploy.d.cts.map +1 -0
- package/dist/vercel/deploy.d.mts +54 -0
- package/dist/vercel/deploy.d.mts.map +1 -0
- package/dist/vercel/deploy.mjs +61 -0
- package/dist/vercel/deploy.mjs.map +1 -0
- package/dist/vercel/index.cjs +6 -0
- package/dist/vercel/index.d.cts +3 -0
- package/dist/vercel/index.d.mts +3 -0
- package/dist/vercel/index.mjs +4 -0
- package/dist/vercel/variable.cjs +280 -0
- package/dist/vercel/variable.cjs.map +1 -0
- package/dist/vercel/variable.d.cts +55 -0
- package/dist/vercel/variable.d.cts.map +1 -0
- package/dist/vercel/variable.d.mts +55 -0
- package/dist/vercel/variable.d.mts.map +1 -0
- package/dist/vercel/variable.mjs +278 -0
- package/dist/vercel/variable.mjs.map +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-OPjESj5l.cjs";
|
|
2
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
3
|
+
|
|
4
|
+
//#region src/vercel/variable.d.ts
|
|
5
|
+
/** Resolved inputs for the Vercel variable dynamic provider. */
|
|
6
|
+
interface VercelVariableInputs {
|
|
7
|
+
/** Vercel API bearer token. */
|
|
8
|
+
token: string;
|
|
9
|
+
/** Vercel team/org ID. */
|
|
10
|
+
teamId: string;
|
|
11
|
+
/** Vercel project ID. */
|
|
12
|
+
projectId: string;
|
|
13
|
+
/** Key-value map of environment variable names to their values. */
|
|
14
|
+
variables: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Manages Vercel project environment variables as a batch with drift detection.
|
|
18
|
+
*
|
|
19
|
+
* Unlike `@pulumiverse/vercel`'s `ProjectEnvironmentVariable`, this provider
|
|
20
|
+
* reads decrypted values from Vercel's API during `pulumi refresh`, enabling
|
|
21
|
+
* detection of manually changed env var values.
|
|
22
|
+
*
|
|
23
|
+
* All variables target production, preview, and development environments.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* new VercelVariable("vercel-variable-nexus", {
|
|
28
|
+
* token: vercelConfig.token,
|
|
29
|
+
* teamId: vercelConfig.teamId,
|
|
30
|
+
* projectId: project.id,
|
|
31
|
+
* variables: {
|
|
32
|
+
* NEXT_PUBLIC_API_URL: meshUrl,
|
|
33
|
+
* NEXTAUTH_SECRET: config.requireSecret("nextauthSecret"),
|
|
34
|
+
* },
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare class VercelVariable extends pulumi.dynamic.Resource {
|
|
39
|
+
/** SHA-256 hash of all key-value pairs. Use as a deploy trigger for drift-aware redeployment. */
|
|
40
|
+
readonly contentHash: pulumi.Output<string>;
|
|
41
|
+
/**
|
|
42
|
+
* @param name Pulumi resource name
|
|
43
|
+
* @param args Variable configuration inputs
|
|
44
|
+
* @param opts Standard Pulumi resource options
|
|
45
|
+
*/
|
|
46
|
+
constructor(name: string, args: {
|
|
47
|
+
/** Vercel API bearer token. */token: pulumi.Input<string>; /** Vercel team/org ID. */
|
|
48
|
+
teamId: pulumi.Input<string>; /** Vercel project ID. */
|
|
49
|
+
projectId: pulumi.Input<string>; /** Key-value map of environment variable names to their values. */
|
|
50
|
+
variables: pulumi.Input<Record<string, pulumi.Input<string>>>;
|
|
51
|
+
}, opts?: pulumi.CustomResourceOptions);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { VercelVariable, VercelVariableInputs };
|
|
55
|
+
//# sourceMappingURL=variable.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.d.cts","names":[],"sources":["../../src/vercel/variable.ts"],"mappings":";;;;;UAKiB,oBAAA;;EAEhB,KAAA;EAFoC;EAKpC,MAAA;EAMiB;EAHjB,SAAA;EAHA;EAMA,SAAA,EAAW,MAAM;AAAA;;;AAAA;AA8alB;;;;;;;;;;;;;;;;;;;cAAa,cAAA,SAAuB,MAAA,CAAO,OAAA,CAAQ,QAAA;;WAE1B,WAAA,EAAa,MAAA,CAAO,MAAA;EAW1C;;;;;cAHD,IAAA,UACA,IAAA;IAQC,+BANA,KAAA,EAAO,MAAA,CAAO,KAAA,UAMI;IAHlB,MAAA,EAAQ,MAAA,CAAO,KAAA,UAMJ;IAHX,SAAA,EAAW,MAAA,CAAO,KAAA,UAGM;IAAxB,SAAA,EAAW,MAAA,CAAO,KAAA,CAAM,MAAA,SAAe,MAAA,CAAO,KAAA;EAAA,GAE/C,IAAA,GAAO,MAAA,CAAO,qBAAA;AAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-OPjESj5l.mjs";
|
|
2
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
3
|
+
|
|
4
|
+
//#region src/vercel/variable.d.ts
|
|
5
|
+
/** Resolved inputs for the Vercel variable dynamic provider. */
|
|
6
|
+
interface VercelVariableInputs {
|
|
7
|
+
/** Vercel API bearer token. */
|
|
8
|
+
token: string;
|
|
9
|
+
/** Vercel team/org ID. */
|
|
10
|
+
teamId: string;
|
|
11
|
+
/** Vercel project ID. */
|
|
12
|
+
projectId: string;
|
|
13
|
+
/** Key-value map of environment variable names to their values. */
|
|
14
|
+
variables: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Manages Vercel project environment variables as a batch with drift detection.
|
|
18
|
+
*
|
|
19
|
+
* Unlike `@pulumiverse/vercel`'s `ProjectEnvironmentVariable`, this provider
|
|
20
|
+
* reads decrypted values from Vercel's API during `pulumi refresh`, enabling
|
|
21
|
+
* detection of manually changed env var values.
|
|
22
|
+
*
|
|
23
|
+
* All variables target production, preview, and development environments.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* new VercelVariable("vercel-variable-nexus", {
|
|
28
|
+
* token: vercelConfig.token,
|
|
29
|
+
* teamId: vercelConfig.teamId,
|
|
30
|
+
* projectId: project.id,
|
|
31
|
+
* variables: {
|
|
32
|
+
* NEXT_PUBLIC_API_URL: meshUrl,
|
|
33
|
+
* NEXTAUTH_SECRET: config.requireSecret("nextauthSecret"),
|
|
34
|
+
* },
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare class VercelVariable extends pulumi.dynamic.Resource {
|
|
39
|
+
/** SHA-256 hash of all key-value pairs. Use as a deploy trigger for drift-aware redeployment. */
|
|
40
|
+
readonly contentHash: pulumi.Output<string>;
|
|
41
|
+
/**
|
|
42
|
+
* @param name Pulumi resource name
|
|
43
|
+
* @param args Variable configuration inputs
|
|
44
|
+
* @param opts Standard Pulumi resource options
|
|
45
|
+
*/
|
|
46
|
+
constructor(name: string, args: {
|
|
47
|
+
/** Vercel API bearer token. */token: pulumi.Input<string>; /** Vercel team/org ID. */
|
|
48
|
+
teamId: pulumi.Input<string>; /** Vercel project ID. */
|
|
49
|
+
projectId: pulumi.Input<string>; /** Key-value map of environment variable names to their values. */
|
|
50
|
+
variables: pulumi.Input<Record<string, pulumi.Input<string>>>;
|
|
51
|
+
}, opts?: pulumi.CustomResourceOptions);
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
export { VercelVariable, VercelVariableInputs };
|
|
55
|
+
//# sourceMappingURL=variable.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.d.mts","names":[],"sources":["../../src/vercel/variable.ts"],"mappings":";;;;;UAKiB,oBAAA;;EAEhB,KAAA;EAFoC;EAKpC,MAAA;EAMiB;EAHjB,SAAA;EAHA;EAMA,SAAA,EAAW,MAAM;AAAA;;;AAAA;AA8alB;;;;;;;;;;;;;;;;;;;cAAa,cAAA,SAAuB,MAAA,CAAO,OAAA,CAAQ,QAAA;;WAE1B,WAAA,EAAa,MAAA,CAAO,MAAA;EAW1C;;;;;cAHD,IAAA,UACA,IAAA;IAQC,+BANA,KAAA,EAAO,MAAA,CAAO,KAAA,UAMI;IAHlB,MAAA,EAAQ,MAAA,CAAO,KAAA,UAMJ;IAHX,SAAA,EAAW,MAAA,CAAO,KAAA,UAGM;IAAxB,SAAA,EAAW,MAAA,CAAO,KAAA,CAAM,MAAA,SAAe,MAAA,CAAO,KAAA;EAAA,GAE/C,IAAA,GAAO,MAAA,CAAO,qBAAA;AAAA"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { t as __name } from "../chunk-OPjESj5l.mjs";
|
|
2
|
+
import * as pulumi from "@pulumi/pulumi";
|
|
3
|
+
|
|
4
|
+
//#region src/vercel/variable.ts
|
|
5
|
+
const VERCEL_API_URL = "https://api.vercel.com";
|
|
6
|
+
/**
|
|
7
|
+
* Computes a deterministic content hash of a variables map.
|
|
8
|
+
* Uses dynamic import to avoid capturing `crypto` in the provider closure.
|
|
9
|
+
*
|
|
10
|
+
* @param variables Key-value map of environment variables
|
|
11
|
+
* @returns Hex-encoded SHA-256 hash
|
|
12
|
+
*/
|
|
13
|
+
async function hashVariables(variables) {
|
|
14
|
+
const hash = (await import("node:crypto")).createHash("sha256");
|
|
15
|
+
const sorted = Object.entries(variables).sort(([a], [b]) => a.localeCompare(b));
|
|
16
|
+
for (const [key, value] of sorted) {
|
|
17
|
+
hash.update(key);
|
|
18
|
+
hash.update(value);
|
|
19
|
+
}
|
|
20
|
+
return hash.digest("hex");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Fetches all environment variables for a Vercel project with decrypted values.
|
|
24
|
+
*
|
|
25
|
+
* @param token Vercel API token
|
|
26
|
+
* @param teamId Vercel team ID
|
|
27
|
+
* @param projectId Vercel project ID
|
|
28
|
+
* @returns Array of env vars with decrypted values
|
|
29
|
+
*/
|
|
30
|
+
async function fetchEnvVars(token, teamId, projectId) {
|
|
31
|
+
const listResponse = await fetch(`${VERCEL_API_URL}/v9/projects/${projectId}/env?teamId=${teamId}`, { headers: { Authorization: `Bearer ${token}` } });
|
|
32
|
+
if (!listResponse.ok) throw new Error(`Vercel API error (${listResponse.status}): ${await listResponse.text()}`);
|
|
33
|
+
const list = await listResponse.json();
|
|
34
|
+
const decrypted = [];
|
|
35
|
+
for (const env of list.envs) {
|
|
36
|
+
const response = await fetch(`${VERCEL_API_URL}/v9/projects/${projectId}/env/${env.id}?teamId=${teamId}&decrypt=true`, { headers: { Authorization: `Bearer ${token}` } });
|
|
37
|
+
if (response.ok) decrypted.push(await response.json());
|
|
38
|
+
}
|
|
39
|
+
return decrypted;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a single Vercel env var targeting all environments.
|
|
43
|
+
*
|
|
44
|
+
* @param token Vercel API token
|
|
45
|
+
* @param teamId Vercel team ID
|
|
46
|
+
* @param projectId Vercel project ID
|
|
47
|
+
* @param key Env var name
|
|
48
|
+
* @param value Env var value
|
|
49
|
+
* @returns The created env var with its Vercel-assigned ID
|
|
50
|
+
*/
|
|
51
|
+
async function createEnvVar(token, teamId, projectId, key, value) {
|
|
52
|
+
const response = await fetch(`${VERCEL_API_URL}/v10/projects/${projectId}/env?teamId=${teamId}`, {
|
|
53
|
+
method: "POST",
|
|
54
|
+
headers: {
|
|
55
|
+
Authorization: `Bearer ${token}`,
|
|
56
|
+
"Content-Type": "application/json"
|
|
57
|
+
},
|
|
58
|
+
body: JSON.stringify({
|
|
59
|
+
key,
|
|
60
|
+
value,
|
|
61
|
+
type: "encrypted",
|
|
62
|
+
target: [
|
|
63
|
+
"production",
|
|
64
|
+
"preview",
|
|
65
|
+
"development"
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
if (!response.ok) {
|
|
70
|
+
const errorText = await response.text();
|
|
71
|
+
if (errorText.includes("ENV_CONFLICT")) {
|
|
72
|
+
pulumi.log.info(`Vercel env var "${key}" already exists, will update instead`);
|
|
73
|
+
const match = (await fetchEnvVars(token, teamId, projectId)).find((e) => e.key === key);
|
|
74
|
+
if (match) {
|
|
75
|
+
await updateEnvVar(token, teamId, projectId, match.id, value);
|
|
76
|
+
return {
|
|
77
|
+
...match,
|
|
78
|
+
value
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
throw new Error(`Vercel API error creating "${key}" (${response.status}): ${errorText}`);
|
|
83
|
+
}
|
|
84
|
+
return await response.json();
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Updates a single Vercel env var value.
|
|
88
|
+
*
|
|
89
|
+
* @param token Vercel API token
|
|
90
|
+
* @param teamId Vercel team ID
|
|
91
|
+
* @param projectId Vercel project ID
|
|
92
|
+
* @param envId Vercel-assigned env var ID
|
|
93
|
+
* @param value New value
|
|
94
|
+
*/
|
|
95
|
+
async function updateEnvVar(token, teamId, projectId, envId, value) {
|
|
96
|
+
const response = await fetch(`${VERCEL_API_URL}/v9/projects/${projectId}/env/${envId}?teamId=${teamId}`, {
|
|
97
|
+
method: "PATCH",
|
|
98
|
+
headers: {
|
|
99
|
+
Authorization: `Bearer ${token}`,
|
|
100
|
+
"Content-Type": "application/json"
|
|
101
|
+
},
|
|
102
|
+
body: JSON.stringify({ value })
|
|
103
|
+
});
|
|
104
|
+
if (!response.ok) throw new Error(`Vercel API error updating env var (${response.status}): ${await response.text()}`);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Deletes a single Vercel env var.
|
|
108
|
+
*
|
|
109
|
+
* @param token Vercel API token
|
|
110
|
+
* @param teamId Vercel team ID
|
|
111
|
+
* @param projectId Vercel project ID
|
|
112
|
+
* @param envId Vercel-assigned env var ID
|
|
113
|
+
*/
|
|
114
|
+
async function deleteEnvVar(token, teamId, projectId, envId) {
|
|
115
|
+
const response = await fetch(`${VERCEL_API_URL}/v9/projects/${projectId}/env/${envId}?teamId=${teamId}`, {
|
|
116
|
+
method: "DELETE",
|
|
117
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
118
|
+
});
|
|
119
|
+
if (!response.ok && response.status !== 404) throw new Error(`Vercel API error deleting env var (${response.status}): ${await response.text()}`);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Dynamic provider implementing CRUD for Vercel project environment variables.
|
|
123
|
+
*
|
|
124
|
+
* Manages all env vars for a project as a batch (like RailwayVariable).
|
|
125
|
+
* The `read()` method fetches decrypted values from Vercel's API,
|
|
126
|
+
* enabling drift detection during `pulumi refresh`.
|
|
127
|
+
*/
|
|
128
|
+
var VercelVariableProvider = class {
|
|
129
|
+
/**
|
|
130
|
+
* Creates all env vars on the target Vercel project.
|
|
131
|
+
* Handles ENV_CONFLICT by updating existing vars instead of failing.
|
|
132
|
+
*
|
|
133
|
+
* @param inputs Resolved variable configuration
|
|
134
|
+
* @returns Composite ID in the form `{projectId}:variables`
|
|
135
|
+
*/
|
|
136
|
+
async create(inputs) {
|
|
137
|
+
const envIds = {};
|
|
138
|
+
for (const [key, value] of Object.entries(inputs.variables)) envIds[key] = (await createEnvVar(inputs.token, inputs.teamId, inputs.projectId, key, value)).id;
|
|
139
|
+
return {
|
|
140
|
+
id: `${inputs.projectId}:variables`,
|
|
141
|
+
outs: {
|
|
142
|
+
...inputs,
|
|
143
|
+
envIds,
|
|
144
|
+
contentHash: await hashVariables(inputs.variables)
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Updates variables by deleting removed keys, creating new keys,
|
|
150
|
+
* and patching changed values.
|
|
151
|
+
*
|
|
152
|
+
* @param _id Current resource ID
|
|
153
|
+
* @param olds Previous persisted state
|
|
154
|
+
* @param news New desired configuration
|
|
155
|
+
* @returns Updated outputs with current envIds
|
|
156
|
+
*/
|
|
157
|
+
async update(_id, olds, news) {
|
|
158
|
+
const envIds = { ...olds.envIds };
|
|
159
|
+
const removedKeys = Object.keys(olds.variables).filter((key) => !(key in news.variables));
|
|
160
|
+
for (const key of removedKeys) {
|
|
161
|
+
const envId = envIds[key];
|
|
162
|
+
if (envId) {
|
|
163
|
+
try {
|
|
164
|
+
await deleteEnvVar(news.token, news.teamId, news.projectId, envId);
|
|
165
|
+
} catch {
|
|
166
|
+
pulumi.log.warn(`Failed to delete Vercel env var "${key}" (may already be deleted)`);
|
|
167
|
+
}
|
|
168
|
+
delete envIds[key];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
for (const [key, value] of Object.entries(news.variables)) {
|
|
172
|
+
const existingId = envIds[key];
|
|
173
|
+
if (existingId && olds.variables[key] !== value) await updateEnvVar(news.token, news.teamId, news.projectId, existingId, value);
|
|
174
|
+
else if (!existingId) envIds[key] = (await createEnvVar(news.token, news.teamId, news.projectId, key, value)).id;
|
|
175
|
+
}
|
|
176
|
+
return { outs: {
|
|
177
|
+
...news,
|
|
178
|
+
envIds,
|
|
179
|
+
contentHash: await hashVariables(news.variables)
|
|
180
|
+
} };
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Reads current state from Vercel API with decrypted values.
|
|
184
|
+
* Enables drift detection during `pulumi refresh`.
|
|
185
|
+
*
|
|
186
|
+
* @param id Current resource ID
|
|
187
|
+
* @param props Last known persisted state
|
|
188
|
+
* @returns Refreshed properties with actual values from Vercel
|
|
189
|
+
*/
|
|
190
|
+
async read(id, props) {
|
|
191
|
+
const actual = await fetchEnvVars(props.token, props.teamId, props.projectId);
|
|
192
|
+
const actualVariables = {};
|
|
193
|
+
const actualEnvIds = {};
|
|
194
|
+
for (const [key] of Object.entries(props.variables)) {
|
|
195
|
+
const match = actual.find((e) => e.key === key);
|
|
196
|
+
if (match) {
|
|
197
|
+
actualVariables[key] = match.value;
|
|
198
|
+
actualEnvIds[key] = match.id;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return {
|
|
202
|
+
id,
|
|
203
|
+
props: {
|
|
204
|
+
...props,
|
|
205
|
+
variables: actualVariables,
|
|
206
|
+
envIds: actualEnvIds,
|
|
207
|
+
contentHash: await hashVariables(actualVariables)
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Deletes all managed env vars from Vercel.
|
|
213
|
+
*
|
|
214
|
+
* @param _id Current resource ID
|
|
215
|
+
* @param props Last known persisted state
|
|
216
|
+
*/
|
|
217
|
+
async delete(_id, props) {
|
|
218
|
+
for (const [key, envId] of Object.entries(props.envIds)) try {
|
|
219
|
+
await deleteEnvVar(props.token, props.teamId, props.projectId, envId);
|
|
220
|
+
} catch {
|
|
221
|
+
pulumi.log.warn(`Failed to delete Vercel env var "${key}" (may already be deleted)`);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Compares old and new variable maps by key set and value equality.
|
|
226
|
+
*
|
|
227
|
+
* @param _id Current resource ID
|
|
228
|
+
* @param olds Previous persisted state
|
|
229
|
+
* @param news New desired configuration
|
|
230
|
+
* @returns Whether any keys or values changed
|
|
231
|
+
*/
|
|
232
|
+
async diff(_id, olds, news) {
|
|
233
|
+
const oldKeys = Object.keys(olds.variables).sort().join(",");
|
|
234
|
+
const newKeys = Object.keys(news.variables).sort().join(",");
|
|
235
|
+
const valuesChanged = Object.entries(news.variables).some(([key, value]) => olds.variables[key] !== value);
|
|
236
|
+
return { changes: oldKeys !== newKeys || valuesChanged };
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Manages Vercel project environment variables as a batch with drift detection.
|
|
241
|
+
*
|
|
242
|
+
* Unlike `@pulumiverse/vercel`'s `ProjectEnvironmentVariable`, this provider
|
|
243
|
+
* reads decrypted values from Vercel's API during `pulumi refresh`, enabling
|
|
244
|
+
* detection of manually changed env var values.
|
|
245
|
+
*
|
|
246
|
+
* All variables target production, preview, and development environments.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```typescript
|
|
250
|
+
* new VercelVariable("vercel-variable-nexus", {
|
|
251
|
+
* token: vercelConfig.token,
|
|
252
|
+
* teamId: vercelConfig.teamId,
|
|
253
|
+
* projectId: project.id,
|
|
254
|
+
* variables: {
|
|
255
|
+
* NEXT_PUBLIC_API_URL: meshUrl,
|
|
256
|
+
* NEXTAUTH_SECRET: config.requireSecret("nextauthSecret"),
|
|
257
|
+
* },
|
|
258
|
+
* });
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
var VercelVariable = class extends pulumi.dynamic.Resource {
|
|
262
|
+
/**
|
|
263
|
+
* @param name Pulumi resource name
|
|
264
|
+
* @param args Variable configuration inputs
|
|
265
|
+
* @param opts Standard Pulumi resource options
|
|
266
|
+
*/
|
|
267
|
+
constructor(name, args, opts) {
|
|
268
|
+
super(new VercelVariableProvider(), name, {
|
|
269
|
+
...args,
|
|
270
|
+
envIds: void 0,
|
|
271
|
+
contentHash: void 0
|
|
272
|
+
}, opts);
|
|
273
|
+
}
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
//#endregion
|
|
277
|
+
export { VercelVariable };
|
|
278
|
+
//# sourceMappingURL=variable.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variable.mjs","names":[],"sources":["../../src/vercel/variable.ts"],"sourcesContent":["import * as pulumi from \"@pulumi/pulumi\";\n\nconst VERCEL_API_URL = \"https://api.vercel.com\";\n\n/** Resolved inputs for the Vercel variable dynamic provider. */\nexport interface VercelVariableInputs {\n\t/** Vercel API bearer token. */\n\ttoken: string;\n\n\t/** Vercel team/org ID. */\n\tteamId: string;\n\n\t/** Vercel project ID. */\n\tprojectId: string;\n\n\t/** Key-value map of environment variable names to their values. */\n\tvariables: Record<string, string>;\n}\n\n/** Persisted state for Vercel variables. */\ninterface VercelVariableOutputs extends VercelVariableInputs {\n\t/** Map of env var keys to their Vercel-assigned IDs (for updates and deletes). */\n\tenvIds: Record<string, string>;\n\n\t/** SHA-256 hash of all key-value pairs. Changes when any value is modified (including drift fixes). */\n\tcontentHash: string;\n}\n\n/**\n * Computes a deterministic content hash of a variables map.\n * Uses dynamic import to avoid capturing `crypto` in the provider closure.\n *\n * @param variables Key-value map of environment variables\n * @returns Hex-encoded SHA-256 hash\n */\nasync function hashVariables(\n\tvariables: Record<string, string>,\n): Promise<string> {\n\tconst crypto = await import(\"node:crypto\");\n\tconst hash = crypto.createHash(\"sha256\");\n\n\tconst sorted = Object.entries(variables).sort(([a], [b]) =>\n\t\ta.localeCompare(b),\n\t);\n\n\tfor (const [key, value] of sorted) {\n\t\thash.update(key);\n\t\thash.update(value);\n\t}\n\n\treturn hash.digest(\"hex\");\n}\n\n/** Vercel API response for a single env var. */\ninterface VercelEnvVar {\n\tid: string;\n\tkey: string;\n\tvalue: string;\n\ttype: string;\n\ttarget: string[];\n}\n\n/**\n * Fetches all environment variables for a Vercel project with decrypted values.\n *\n * @param token Vercel API token\n * @param teamId Vercel team ID\n * @param projectId Vercel project ID\n * @returns Array of env vars with decrypted values\n */\nasync function fetchEnvVars(\n\ttoken: string,\n\tteamId: string,\n\tprojectId: string,\n): Promise<VercelEnvVar[]> {\n\tconst listResponse = await fetch(\n\t\t`${VERCEL_API_URL}/v9/projects/${projectId}/env?teamId=${teamId}`,\n\t\t{ headers: { Authorization: `Bearer ${token}` } },\n\t);\n\n\tif (!listResponse.ok) {\n\t\tthrow new Error(\n\t\t\t`Vercel API error (${listResponse.status}): ${await listResponse.text()}`,\n\t\t);\n\t}\n\n\tconst list = (await listResponse.json()) as { envs: VercelEnvVar[] };\n\n\tconst decrypted: VercelEnvVar[] = [];\n\n\tfor (const env of list.envs) {\n\t\tconst response = await fetch(\n\t\t\t`${VERCEL_API_URL}/v9/projects/${projectId}/env/${env.id}?teamId=${teamId}&decrypt=true`,\n\t\t\t{ headers: { Authorization: `Bearer ${token}` } },\n\t\t);\n\n\t\tif (response.ok) {\n\t\t\tdecrypted.push((await response.json()) as VercelEnvVar);\n\t\t}\n\t}\n\n\treturn decrypted;\n}\n\n/**\n * Creates a single Vercel env var targeting all environments.\n *\n * @param token Vercel API token\n * @param teamId Vercel team ID\n * @param projectId Vercel project ID\n * @param key Env var name\n * @param value Env var value\n * @returns The created env var with its Vercel-assigned ID\n */\nasync function createEnvVar(\n\ttoken: string,\n\tteamId: string,\n\tprojectId: string,\n\tkey: string,\n\tvalue: string,\n): Promise<VercelEnvVar> {\n\tconst response = await fetch(\n\t\t`${VERCEL_API_URL}/v10/projects/${projectId}/env?teamId=${teamId}`,\n\t\t{\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t\ttype: \"encrypted\",\n\t\t\t\ttarget: [\"production\", \"preview\", \"development\"],\n\t\t\t}),\n\t\t},\n\t);\n\n\tif (!response.ok) {\n\t\tconst errorText = await response.text();\n\n\t\tif (errorText.includes(\"ENV_CONFLICT\")) {\n\t\t\tpulumi.log.info(\n\t\t\t\t`Vercel env var \"${key}\" already exists, will update instead`,\n\t\t\t);\n\n\t\t\tconst existing = await fetchEnvVars(token, teamId, projectId);\n\t\t\tconst match = existing.find((e) => e.key === key);\n\n\t\t\tif (match) {\n\t\t\t\tawait updateEnvVar(token, teamId, projectId, match.id, value);\n\n\t\t\t\treturn { ...match, value };\n\t\t\t}\n\t\t}\n\n\t\tthrow new Error(\n\t\t\t`Vercel API error creating \"${key}\" (${response.status}): ${errorText}`,\n\t\t);\n\t}\n\n\treturn (await response.json()) as VercelEnvVar;\n}\n\n/**\n * Updates a single Vercel env var value.\n *\n * @param token Vercel API token\n * @param teamId Vercel team ID\n * @param projectId Vercel project ID\n * @param envId Vercel-assigned env var ID\n * @param value New value\n */\nasync function updateEnvVar(\n\ttoken: string,\n\tteamId: string,\n\tprojectId: string,\n\tenvId: string,\n\tvalue: string,\n): Promise<void> {\n\tconst response = await fetch(\n\t\t`${VERCEL_API_URL}/v9/projects/${projectId}/env/${envId}?teamId=${teamId}`,\n\t\t{\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t},\n\t\t\tbody: JSON.stringify({ value }),\n\t\t},\n\t);\n\n\tif (!response.ok) {\n\t\tthrow new Error(\n\t\t\t`Vercel API error updating env var (${response.status}): ${await response.text()}`,\n\t\t);\n\t}\n}\n\n/**\n * Deletes a single Vercel env var.\n *\n * @param token Vercel API token\n * @param teamId Vercel team ID\n * @param projectId Vercel project ID\n * @param envId Vercel-assigned env var ID\n */\nasync function deleteEnvVar(\n\ttoken: string,\n\tteamId: string,\n\tprojectId: string,\n\tenvId: string,\n): Promise<void> {\n\tconst response = await fetch(\n\t\t`${VERCEL_API_URL}/v9/projects/${projectId}/env/${envId}?teamId=${teamId}`,\n\t\t{\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: { Authorization: `Bearer ${token}` },\n\t\t},\n\t);\n\n\tif (!response.ok && response.status !== 404) {\n\t\tthrow new Error(\n\t\t\t`Vercel API error deleting env var (${response.status}): ${await response.text()}`,\n\t\t);\n\t}\n}\n\n/**\n * Dynamic provider implementing CRUD for Vercel project environment variables.\n *\n * Manages all env vars for a project as a batch (like RailwayVariable).\n * The `read()` method fetches decrypted values from Vercel's API,\n * enabling drift detection during `pulumi refresh`.\n */\nclass VercelVariableProvider implements pulumi.dynamic.ResourceProvider {\n\t/**\n\t * Creates all env vars on the target Vercel project.\n\t * Handles ENV_CONFLICT by updating existing vars instead of failing.\n\t *\n\t * @param inputs Resolved variable configuration\n\t * @returns Composite ID in the form `{projectId}:variables`\n\t */\n\tasync create(\n\t\tinputs: VercelVariableInputs,\n\t): Promise<pulumi.dynamic.CreateResult> {\n\t\tconst envIds: Record<string, string> = {};\n\n\t\tfor (const [key, value] of Object.entries(inputs.variables)) {\n\t\t\tconst result = await createEnvVar(\n\t\t\t\tinputs.token,\n\t\t\t\tinputs.teamId,\n\t\t\t\tinputs.projectId,\n\t\t\t\tkey,\n\t\t\t\tvalue,\n\t\t\t);\n\n\t\t\tenvIds[key] = result.id;\n\t\t}\n\n\t\treturn {\n\t\t\tid: `${inputs.projectId}:variables`,\n\t\t\touts: {\n\t\t\t\t...inputs,\n\t\t\t\tenvIds,\n\t\t\t\tcontentHash: await hashVariables(inputs.variables),\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Updates variables by deleting removed keys, creating new keys,\n\t * and patching changed values.\n\t *\n\t * @param _id Current resource ID\n\t * @param olds Previous persisted state\n\t * @param news New desired configuration\n\t * @returns Updated outputs with current envIds\n\t */\n\tasync update(\n\t\t_id: string,\n\t\tolds: VercelVariableOutputs,\n\t\tnews: VercelVariableInputs,\n\t): Promise<pulumi.dynamic.UpdateResult> {\n\t\tconst envIds = { ...olds.envIds };\n\n\t\tconst removedKeys = Object.keys(olds.variables).filter(\n\t\t\t(key) => !(key in news.variables),\n\t\t);\n\n\t\tfor (const key of removedKeys) {\n\t\t\tconst envId = envIds[key];\n\n\t\t\tif (envId) {\n\t\t\t\ttry {\n\t\t\t\t\tawait deleteEnvVar(news.token, news.teamId, news.projectId, envId);\n\t\t\t\t} catch {\n\t\t\t\t\tpulumi.log.warn(\n\t\t\t\t\t\t`Failed to delete Vercel env var \"${key}\" (may already be deleted)`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tdelete envIds[key];\n\t\t\t}\n\t\t}\n\n\t\tfor (const [key, value] of Object.entries(news.variables)) {\n\t\t\tconst existingId = envIds[key];\n\n\t\t\tif (existingId && olds.variables[key] !== value) {\n\t\t\t\tawait updateEnvVar(\n\t\t\t\t\tnews.token,\n\t\t\t\t\tnews.teamId,\n\t\t\t\t\tnews.projectId,\n\t\t\t\t\texistingId,\n\t\t\t\t\tvalue,\n\t\t\t\t);\n\t\t\t} else if (!existingId) {\n\t\t\t\tconst result = await createEnvVar(\n\t\t\t\t\tnews.token,\n\t\t\t\t\tnews.teamId,\n\t\t\t\t\tnews.projectId,\n\t\t\t\t\tkey,\n\t\t\t\t\tvalue,\n\t\t\t\t);\n\n\t\t\t\tenvIds[key] = result.id;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\touts: {\n\t\t\t\t...news,\n\t\t\t\tenvIds,\n\t\t\t\tcontentHash: await hashVariables(news.variables),\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Reads current state from Vercel API with decrypted values.\n\t * Enables drift detection during `pulumi refresh`.\n\t *\n\t * @param id Current resource ID\n\t * @param props Last known persisted state\n\t * @returns Refreshed properties with actual values from Vercel\n\t */\n\tasync read(\n\t\tid: string,\n\t\tprops: VercelVariableOutputs,\n\t): Promise<pulumi.dynamic.ReadResult> {\n\t\tconst actual = await fetchEnvVars(\n\t\t\tprops.token,\n\t\t\tprops.teamId,\n\t\t\tprops.projectId,\n\t\t);\n\n\t\tconst actualVariables: Record<string, string> = {};\n\t\tconst actualEnvIds: Record<string, string> = {};\n\n\t\tfor (const [key] of Object.entries(props.variables)) {\n\t\t\tconst match = actual.find((e) => e.key === key);\n\n\t\t\tif (match) {\n\t\t\t\tactualVariables[key] = match.value;\n\t\t\t\tactualEnvIds[key] = match.id;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tid,\n\t\t\tprops: {\n\t\t\t\t...props,\n\t\t\t\tvariables: actualVariables,\n\t\t\t\tenvIds: actualEnvIds,\n\t\t\t\tcontentHash: await hashVariables(actualVariables),\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Deletes all managed env vars from Vercel.\n\t *\n\t * @param _id Current resource ID\n\t * @param props Last known persisted state\n\t */\n\tasync delete(_id: string, props: VercelVariableOutputs): Promise<void> {\n\t\tfor (const [key, envId] of Object.entries(props.envIds)) {\n\t\t\ttry {\n\t\t\t\tawait deleteEnvVar(props.token, props.teamId, props.projectId, envId);\n\t\t\t} catch {\n\t\t\t\tpulumi.log.warn(\n\t\t\t\t\t`Failed to delete Vercel env var \"${key}\" (may already be deleted)`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Compares old and new variable maps by key set and value equality.\n\t *\n\t * @param _id Current resource ID\n\t * @param olds Previous persisted state\n\t * @param news New desired configuration\n\t * @returns Whether any keys or values changed\n\t */\n\tasync diff(\n\t\t_id: string,\n\t\tolds: VercelVariableOutputs,\n\t\tnews: VercelVariableInputs,\n\t): Promise<pulumi.dynamic.DiffResult> {\n\t\tconst oldKeys = Object.keys(olds.variables).sort().join(\",\");\n\t\tconst newKeys = Object.keys(news.variables).sort().join(\",\");\n\n\t\tconst valuesChanged = Object.entries(news.variables).some(\n\t\t\t([key, value]) => olds.variables[key] !== value,\n\t\t);\n\n\t\treturn {\n\t\t\tchanges: oldKeys !== newKeys || valuesChanged,\n\t\t};\n\t}\n}\n\n/**\n * Manages Vercel project environment variables as a batch with drift detection.\n *\n * Unlike `@pulumiverse/vercel`'s `ProjectEnvironmentVariable`, this provider\n * reads decrypted values from Vercel's API during `pulumi refresh`, enabling\n * detection of manually changed env var values.\n *\n * All variables target production, preview, and development environments.\n *\n * @example\n * ```typescript\n * new VercelVariable(\"vercel-variable-nexus\", {\n * token: vercelConfig.token,\n * teamId: vercelConfig.teamId,\n * projectId: project.id,\n * variables: {\n * NEXT_PUBLIC_API_URL: meshUrl,\n * NEXTAUTH_SECRET: config.requireSecret(\"nextauthSecret\"),\n * },\n * });\n * ```\n */\nexport class VercelVariable extends pulumi.dynamic.Resource {\n\t/** SHA-256 hash of all key-value pairs. Use as a deploy trigger for drift-aware redeployment. */\n\tpublic declare readonly contentHash: pulumi.Output<string>;\n\n\t/**\n\t * @param name Pulumi resource name\n\t * @param args Variable configuration inputs\n\t * @param opts Standard Pulumi resource options\n\t */\n\tconstructor(\n\t\tname: string,\n\t\targs: {\n\t\t\t/** Vercel API bearer token. */\n\t\t\ttoken: pulumi.Input<string>;\n\n\t\t\t/** Vercel team/org ID. */\n\t\t\tteamId: pulumi.Input<string>;\n\n\t\t\t/** Vercel project ID. */\n\t\t\tprojectId: pulumi.Input<string>;\n\n\t\t\t/** Key-value map of environment variable names to their values. */\n\t\t\tvariables: pulumi.Input<Record<string, pulumi.Input<string>>>;\n\t\t},\n\t\topts?: pulumi.CustomResource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
"name": "@infracraft/pulumi",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/andredezzy/infracraft",
|
|
9
|
+
"directory": "packages/pulumi"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
"./railway": {
|
|
13
|
+
"types": "./dist/railway/index.d.mts",
|
|
14
|
+
"default": "./dist/railway/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"./neon": {
|
|
17
|
+
"types": "./dist/neon/index.d.mts",
|
|
18
|
+
"default": "./dist/neon/index.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./vercel": {
|
|
21
|
+
"types": "./dist/vercel/index.d.mts",
|
|
22
|
+
"default": "./dist/vercel/index.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./hash": {
|
|
25
|
+
"types": "./dist/hash.d.mts",
|
|
26
|
+
"default": "./dist/hash.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./git-guard": {
|
|
29
|
+
"types": "./dist/git-guard.d.mts",
|
|
30
|
+
"default": "./dist/git-guard.mjs"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist/**"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsdown",
|
|
38
|
+
"dev": "tsdown --watch",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"test": "vitest run",
|
|
41
|
+
"lint": "biome check --write"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@pulumi/pulumi": "^3",
|
|
45
|
+
"@pulumi/command": "^1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependenciesMeta": {
|
|
48
|
+
"@pulumi/command": {
|
|
49
|
+
"optional": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@infracraft/config-tsdown": "workspace:*",
|
|
54
|
+
"@infracraft/config-test": "workspace:*",
|
|
55
|
+
"@infracraft/typescript-config": "workspace:*",
|
|
56
|
+
"@pulumi/command": "1.2.1",
|
|
57
|
+
"@pulumi/pulumi": "3.243.0",
|
|
58
|
+
"@types/node": "25.9.1",
|
|
59
|
+
"typescript": "6.0.3",
|
|
60
|
+
"vitest": "4.1.7"
|
|
61
|
+
}
|
|
62
|
+
}
|