@samebase/alchemy-convex 0.2.0 → 0.4.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.
- package/NOTICE +24 -0
- package/README.md +135 -164
- package/lib/index.d.ts +175 -185
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +800 -502
- package/lib/index.js.map +1 -1
- package/package.json +4 -3
- package/src/Credentials.ts +85 -27
- package/src/Deployment.ts +748 -0
- package/src/ManagementApi.ts +84 -64
- package/src/Project.ts +133 -16
- package/src/Providers.ts +6 -34
- package/src/Push.ts +646 -0
- package/src/index.ts +22 -35
- package/src/DefaultEnvironmentVariable.ts +0 -263
- package/src/Deploy.ts +0 -193
- package/src/DeployKey.ts +0 -332
- package/src/EnvironmentVariable.ts +0 -262
- package/src/PreviewDeployKey.ts +0 -153
package/lib/index.d.ts
CHANGED
|
@@ -5,9 +5,8 @@ import * as Redacted from "effect/Redacted";
|
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
import { Resource } from "alchemy";
|
|
7
7
|
import * as Provider from "alchemy/Provider";
|
|
8
|
+
import "effect/process/ChildProcessSpawner";
|
|
8
9
|
import { createDeploymentClient, createManagementClient } from "@convex-dev/platform";
|
|
9
|
-
import { CommandExecutor, CommandRunProps } from "alchemy/Command";
|
|
10
|
-
import { MemoOptions } from "alchemy/Command/Memo";
|
|
11
10
|
import { components } from "@convex-dev/platform/managementApi";
|
|
12
11
|
//#region src/Credentials.d.ts
|
|
13
12
|
interface ResolvedCredentials {
|
|
@@ -16,23 +15,38 @@ interface ResolvedCredentials {
|
|
|
16
15
|
/** Where the token came from, for error messages only. */
|
|
17
16
|
readonly source: "env" | "explicit" | "convex-cli-login";
|
|
18
17
|
}
|
|
19
|
-
|
|
18
|
+
interface CredentialsService {
|
|
19
|
+
/** The Management API token. Dies when there is none. */
|
|
20
|
+
readonly accessToken: Effect.Effect<ResolvedCredentials>;
|
|
21
|
+
/** True when there is a Management API token. */
|
|
22
|
+
readonly hasAccessToken: Effect.Effect<boolean>;
|
|
23
|
+
/** A deploy key or a preview deploy key, or undefined. */
|
|
24
|
+
readonly deployKey: Effect.Effect<Redacted.Redacted<string> | undefined>;
|
|
25
|
+
}
|
|
26
|
+
declare const Credentials_base: Context.ServiceClass<Credentials, "@samebase/alchemy-convex/Credentials", CredentialsService>;
|
|
20
27
|
declare class Credentials extends Credentials_base {}
|
|
21
|
-
/** Environment variable read by {@link fromConfig}. */
|
|
28
|
+
/** Environment variable for the access token, read by {@link fromConfig}. */
|
|
22
29
|
declare const ACCESS_TOKEN_ENV = "CONVEX_ACCESS_TOKEN";
|
|
30
|
+
/** Environment variable for the deploy key, read by {@link fromConfig}. The Convex CLI reads the same name. */
|
|
31
|
+
declare const DEPLOY_KEY_ENV = "CONVEX_DEPLOY_KEY";
|
|
23
32
|
declare const CredentialsError_base: Schema.Class<CredentialsError, Schema.TaggedStruct<"CredentialsError", {
|
|
24
33
|
readonly reason: Schema.String;
|
|
25
34
|
}>, import("effect/Cause").YieldableError>;
|
|
26
35
|
declare class CredentialsError extends CredentialsError_base {}
|
|
27
36
|
/**
|
|
28
|
-
* Default resolution
|
|
29
|
-
*
|
|
30
|
-
* machine
|
|
31
|
-
* nothing.
|
|
37
|
+
* Default resolution through the stack ConfigProvider (process env, `.env`,
|
|
38
|
+
* stack secrets): `CONVEX_ACCESS_TOKEN`, then the Convex CLI login on this
|
|
39
|
+
* machine, for the access token; `CONVEX_DEPLOY_KEY` for the deploy key. A
|
|
40
|
+
* developer who ran `npx convex login` needs nothing. CI sets only the
|
|
41
|
+
* deploy key when the stack pushes to deployments that exist, and the access
|
|
42
|
+
* token when the stack also creates projects or deployments.
|
|
32
43
|
*/
|
|
33
44
|
declare const fromConfig: () => Layer.Layer<Credentials>;
|
|
34
|
-
/** Explicit
|
|
35
|
-
declare const
|
|
45
|
+
/** Explicit values, for tests or callers that already hold them. */
|
|
46
|
+
declare const fromValues: (values: {
|
|
47
|
+
readonly accessToken?: Redacted.Redacted<string>;
|
|
48
|
+
readonly deployKey?: Redacted.Redacted<string>;
|
|
49
|
+
}) => Layer.Layer<Credentials>;
|
|
36
50
|
//#endregion
|
|
37
51
|
//#region src/ManagementApi.d.ts
|
|
38
52
|
type ManagementClient = ReturnType<typeof createManagementClient>;
|
|
@@ -72,6 +86,11 @@ interface ManagementApiService {
|
|
|
72
86
|
* that key would revoke the credential.
|
|
73
87
|
*/
|
|
74
88
|
readonly isCredentialToken: (secret: string) => Effect.Effect<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* The same calls with another bearer token, such as a preview deploy key,
|
|
91
|
+
* which the Management API takes for the preview deployments of its project.
|
|
92
|
+
*/
|
|
93
|
+
readonly withToken: (token: Redacted.Redacted<string>) => ManagementApiService;
|
|
75
94
|
}
|
|
76
95
|
declare const ManagementApi_base: Context.ServiceClass<ManagementApi, "@samebase/alchemy-convex/ManagementApi", ManagementApiService>;
|
|
77
96
|
declare class ManagementApi extends ManagementApi_base {}
|
|
@@ -80,217 +99,175 @@ declare class ManagementApi extends ManagementApi_base {}
|
|
|
80
99
|
declare const Providers_base: Provider.ProviderCollection<Providers, "Convex">;
|
|
81
100
|
declare class Providers extends Providers_base {}
|
|
82
101
|
/**
|
|
83
|
-
*
|
|
84
|
-
* default lookup (`CONVEX_ACCESS_TOKEN`, then the Convex CLI login
|
|
102
|
+
* The Convex resource providers. Pass a credentials layer to override the
|
|
103
|
+
* default lookup (`CONVEX_ACCESS_TOKEN`, then the Convex CLI login, and
|
|
104
|
+
* `CONVEX_DEPLOY_KEY`).
|
|
85
105
|
*/
|
|
86
106
|
declare const providers: (credentials?: Layer.Layer<Credentials>) => Layer.Layer<Providers, never, import("effect/process/ChildProcessSpawner").ChildProcessSpawner | import("effect/FileSystem").FileSystem | import("effect/Path").Path>;
|
|
87
107
|
//#endregion
|
|
88
|
-
//#region src/
|
|
89
|
-
/**
|
|
90
|
-
type
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
readonly
|
|
98
|
-
}
|
|
99
|
-
interface DefaultEnvironmentVariableAttributes {
|
|
100
|
-
readonly projectId: number;
|
|
101
|
-
readonly name: string;
|
|
102
|
-
readonly deploymentType: DeploymentType;
|
|
103
|
-
}
|
|
104
|
-
type DefaultEnvironmentVariable = Resource<"Convex.DefaultEnvironmentVariable", DefaultEnvironmentVariableProps, DefaultEnvironmentVariableAttributes, never, Providers>;
|
|
105
|
-
declare const DefaultEnvironmentVariable: import("alchemy").ResourceClass<DefaultEnvironmentVariable>;
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/Deploy.d.ts
|
|
108
|
-
interface DeployProps extends Pick<CommandRunProps, "cwd" | "env" | "timeout"> {
|
|
109
|
-
/**
|
|
110
|
-
* Deploy key that selects the target deployment: a production, development,
|
|
111
|
-
* project, or preview deploy key. The CLI receives it as `CONVEX_DEPLOY_KEY`,
|
|
112
|
-
* and Alchemy removes its value from the logged output.
|
|
113
|
-
*/
|
|
114
|
-
readonly deployKey: Redacted.Redacted<string>;
|
|
115
|
-
/**
|
|
116
|
-
* Preview deployment name for a preview deploy key. The CLI reuses an
|
|
117
|
-
* existing preview deployment with this name.
|
|
118
|
-
*/
|
|
119
|
-
readonly previewName?: string;
|
|
120
|
-
/**
|
|
121
|
-
* Like {@link previewName}, but the CLI deletes and recreates an existing
|
|
122
|
-
* preview deployment with this name, so every run gets a new URL.
|
|
123
|
-
*/
|
|
124
|
-
readonly previewCreate?: string;
|
|
125
|
-
/**
|
|
126
|
-
* Function to run after the push, such as `init:seed`. The CLI runs it only
|
|
127
|
-
* when the push created a new preview deployment.
|
|
128
|
-
*/
|
|
129
|
-
readonly previewRun?: string;
|
|
108
|
+
//#region src/Push.d.ts
|
|
109
|
+
/** A value of the `env` prop: a string, or a secret such as `Config.Redacted("AUTH_SECRET")`. */
|
|
110
|
+
type EnvValue = string | Redacted.Redacted<string>;
|
|
111
|
+
/**
|
|
112
|
+
* The `source` prop: the Convex functions directory, such as `./convex`, or
|
|
113
|
+
* that directory with a push command and more files for the content identity.
|
|
114
|
+
*/
|
|
115
|
+
type Source = string | {
|
|
116
|
+
/** The Convex functions directory, such as `./convex`. */
|
|
117
|
+
readonly path: string;
|
|
130
118
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
119
|
+
* Replaces `convex deploy`: a program and its arguments, run in the app
|
|
120
|
+
* directory with CONVEX_DEPLOY_KEY in its environment, such as
|
|
121
|
+
* `["pnpm", "exec", "convex-hosting", "deploy", "--build", "pnpm run build", "--dist", "dist"]`.
|
|
122
|
+
* It must push with `convex deploy`, such as through `--cmd`, so that
|
|
123
|
+
* its output has the CLI's "Deployed Convex functions to" line.
|
|
134
124
|
*/
|
|
135
|
-
readonly
|
|
125
|
+
readonly command?: readonly [string, ...string[]];
|
|
136
126
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* `previewCreate`) pushes on every deploy: Convex can delete an expired
|
|
142
|
-
* preview deployment, and the hash cannot show that.
|
|
143
|
-
* @default true
|
|
127
|
+
* The files of the content identity, as globs relative to the app
|
|
128
|
+
* directory, next to `path`, package.json, convex.json, and the
|
|
129
|
+
* lockfile, such as the build inputs `["src/**", "vite.config.ts"]`.
|
|
130
|
+
* By default, every file of the app that git does not ignore.
|
|
144
131
|
*/
|
|
145
|
-
readonly
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
readonly hash: string | undefined;
|
|
132
|
+
readonly include?: readonly string[];
|
|
133
|
+
};
|
|
134
|
+
declare const ConvexCliNotFound_base: Schema.Class<ConvexCliNotFound, Schema.TaggedStruct<"ConvexCliNotFound", {
|
|
135
|
+
readonly cwd: Schema.String;
|
|
136
|
+
}>, import("effect/Cause").YieldableError>;
|
|
137
|
+
/** No `convex` package resolves from the app directory. */
|
|
138
|
+
declare class ConvexCliNotFound extends ConvexCliNotFound_base {
|
|
139
|
+
get message(): string;
|
|
154
140
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/** Reads the deployment URL from `convex deploy` output. ANSI escape codes are removed first. */
|
|
158
|
-
declare const parseDeployOutput: (text: string) => {
|
|
159
|
-
url: string;
|
|
160
|
-
deploymentName: string;
|
|
161
|
-
} | undefined;
|
|
162
|
-
/** The `convex deploy` argv, starting with `npx`. */
|
|
163
|
-
declare const deployArgs: (props: Pick<DeployProps, "previewName" | "previewCreate" | "previewRun" | "extraArgs">) => readonly string[];
|
|
164
|
-
declare const DeployArgumentError_base: Schema.Class<DeployArgumentError, Schema.TaggedStruct<"DeployArgumentError", {
|
|
165
|
-
readonly argument: Schema.String;
|
|
141
|
+
declare const ConvexAppNotFound_base: Schema.Class<ConvexAppNotFound, Schema.TaggedStruct<"ConvexAppNotFound", {
|
|
142
|
+
readonly source: Schema.String;
|
|
166
143
|
}>, import("effect/Cause").YieldableError>;
|
|
167
|
-
/**
|
|
168
|
-
declare class
|
|
144
|
+
/** No directory at or above the parent of `source` has a package.json. */
|
|
145
|
+
declare class ConvexAppNotFound extends ConvexAppNotFound_base {
|
|
169
146
|
get message(): string;
|
|
170
147
|
}
|
|
171
|
-
declare const
|
|
148
|
+
declare const CodePushFailed_base: Schema.Class<CodePushFailed, Schema.TaggedStruct<"CodePushFailed", {
|
|
149
|
+
/** Exit code of the CLI. Undefined when it did not start or a signal stopped it. */
|
|
150
|
+
readonly exitCode: Schema.UndefinedOr<Schema.Number>;
|
|
151
|
+
/** The last lines of the CLI output, with the deploy key removed. */
|
|
172
152
|
readonly outputTail: Schema.String;
|
|
173
153
|
}>, import("effect/Cause").YieldableError>;
|
|
174
|
-
/**
|
|
175
|
-
declare class
|
|
154
|
+
/** The Convex CLI failed, or exited 0 without the deployment URL. The output tail never contains the key. */
|
|
155
|
+
declare class CodePushFailed extends CodePushFailed_base {
|
|
176
156
|
get message(): string;
|
|
177
157
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
type DeployKeyAction = NonNullable<components["schemas"]["PlatformCreateDeployKeyArgs"]["allowedActions"]>[number];
|
|
182
|
-
declare const DeployKeyRecoveryRequired_base: Schema.Class<DeployKeyRecoveryRequired, Schema.TaggedStruct<"DeployKeyRecoveryRequired", {
|
|
183
|
-
/** Where the keys live, such as `deployment happy-otter-123` or `project 3145389`. */
|
|
184
|
-
readonly target: Schema.String;
|
|
185
|
-
/** The requested name. */
|
|
186
|
-
readonly name: Schema.String;
|
|
187
|
-
/** The listed keys with the requested name. */
|
|
188
|
-
readonly keys: Schema.$Array<Schema.Struct<{
|
|
189
|
-
readonly id: Schema.Number;
|
|
190
|
-
readonly name: Schema.String;
|
|
191
|
-
}>>;
|
|
192
|
-
/** True when this run created a key before the listing check failed. */
|
|
193
|
-
readonly afterCreate: Schema.Boolean;
|
|
158
|
+
declare const PushTargetMismatch_base: Schema.Class<PushTargetMismatch, Schema.TaggedStruct<"PushTargetMismatch", {
|
|
159
|
+
readonly expected: Schema.String;
|
|
160
|
+
readonly actual: Schema.String;
|
|
194
161
|
}>, import("effect/Cause").YieldableError>;
|
|
195
|
-
/**
|
|
196
|
-
|
|
197
|
-
* already have the requested name, or after the create, not exactly one has it.
|
|
198
|
-
*/
|
|
199
|
-
declare class DeployKeyRecoveryRequired extends DeployKeyRecoveryRequired_base {
|
|
162
|
+
/** The CLI pushed to another deployment than the one of the resource. Checked after the push. */
|
|
163
|
+
declare class PushTargetMismatch extends PushTargetMismatch_base {
|
|
200
164
|
get message(): string;
|
|
201
165
|
}
|
|
202
|
-
declare const
|
|
203
|
-
readonly
|
|
204
|
-
readonly
|
|
166
|
+
declare const VariablesOwnedBySomeoneElse_base: Schema.Class<VariablesOwnedBySomeoneElse, Schema.TaggedStruct<"VariablesOwnedBySomeoneElse", {
|
|
167
|
+
readonly deployment: Schema.String;
|
|
168
|
+
readonly names: Schema.$Array<Schema.String>;
|
|
205
169
|
}>, import("effect/Cause").YieldableError>;
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
* happens with an OAuth token: Convex creates no key. A delete of the
|
|
209
|
-
* returned secret would revoke the credential, so the resource does not keep it.
|
|
210
|
-
*/
|
|
211
|
-
declare class DeployKeyIsCredential extends DeployKeyIsCredential_base {
|
|
170
|
+
/** Variables in `env` exist on the deployment with other values, and adoption is off. */
|
|
171
|
+
declare class VariablesOwnedBySomeoneElse extends VariablesOwnedBySomeoneElse_base {
|
|
212
172
|
get message(): string;
|
|
213
173
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
174
|
+
declare const EnvironmentNeedsDeployKey_base: Schema.Class<EnvironmentNeedsDeployKey, Schema.TaggedStruct<"EnvironmentNeedsDeployKey", {
|
|
175
|
+
readonly deployment: Schema.String;
|
|
176
|
+
}>, import("effect/Cause").YieldableError>;
|
|
177
|
+
/** A preview deploy key cannot set variables: the deployment API takes only a deploy key of the deployment. */
|
|
178
|
+
declare class EnvironmentNeedsDeployKey extends EnvironmentNeedsDeployKey_base {
|
|
179
|
+
get message(): string;
|
|
180
|
+
}
|
|
181
|
+
/** Reads the deployment URL from `convex deploy` output. ANSI escape codes are removed first. */
|
|
182
|
+
declare const parseDeployOutput: (text: string) => {
|
|
183
|
+
url: string;
|
|
184
|
+
deploymentName: string;
|
|
185
|
+
} | undefined;
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/Deployment.d.ts
|
|
188
|
+
interface DeploymentInputs {
|
|
189
|
+
/** The project: a Convex.Project resource, or `{ projectId }`. Cannot change. */
|
|
190
|
+
readonly project: {
|
|
191
|
+
readonly projectId: number;
|
|
192
|
+
};
|
|
217
193
|
/**
|
|
218
|
-
*
|
|
219
|
-
*
|
|
194
|
+
* The Convex functions directory, such as `./convex`, or that directory
|
|
195
|
+
* with a push command and more hashed files. The push runs in the nearest
|
|
196
|
+
* directory above it with a package.json. Without `source`, the resource
|
|
197
|
+
* pushes nothing.
|
|
220
198
|
*/
|
|
221
|
-
readonly
|
|
222
|
-
/**
|
|
223
|
-
readonly
|
|
199
|
+
readonly source?: Source;
|
|
200
|
+
/** Environment variables to set on the deployment before the push. */
|
|
201
|
+
readonly env?: Readonly<Record<string, EnvValue>>;
|
|
224
202
|
}
|
|
225
|
-
|
|
226
|
-
/** The
|
|
227
|
-
readonly
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
readonly
|
|
231
|
-
/**
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
declare const DeployKey: import("alchemy").ResourceClass<DeployKey>;
|
|
236
|
-
//#endregion
|
|
237
|
-
//#region src/EnvironmentVariable.d.ts
|
|
238
|
-
interface EnvironmentVariableProps {
|
|
239
|
-
/** Deployment name, or its URL for deployments outside US East. */
|
|
240
|
-
readonly deployment: string;
|
|
241
|
-
/** Deploy key for `deployment`, such as `deployKey.deployKey`. */
|
|
242
|
-
readonly deployKey: Redacted.Redacted<string>;
|
|
203
|
+
type DeploymentProps = (DeploymentInputs & {
|
|
204
|
+
/** The project's default production deployment. Cannot change. */
|
|
205
|
+
readonly type: "prod";
|
|
206
|
+
}) | (DeploymentInputs & {
|
|
207
|
+
/** A dev deployment or a preview deployment that this resource creates. Cannot change. */
|
|
208
|
+
readonly type: "dev" | "preview";
|
|
209
|
+
/**
|
|
210
|
+
* The dev reference, such as `staging`, or the preview name, such as
|
|
211
|
+
* the stage name. Unique in the project. Cannot change.
|
|
212
|
+
*/
|
|
243
213
|
readonly name: string;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
interface
|
|
247
|
-
readonly
|
|
214
|
+
});
|
|
215
|
+
/** The deployment itself, without the state of the push. */
|
|
216
|
+
interface DeploymentTarget {
|
|
217
|
+
readonly projectId: number;
|
|
218
|
+
readonly type: DeploymentProps["type"];
|
|
219
|
+
/** Deployment name, such as `happy-animal-123`. */
|
|
248
220
|
readonly name: string;
|
|
249
|
-
/**
|
|
250
|
-
readonly
|
|
221
|
+
/** The reference that Convex lists, such as `production`, `staging`, or `preview/pr-42`. */
|
|
222
|
+
readonly reference: string;
|
|
223
|
+
/** The preview name of a preview deployment. Undefined for prod and dev. */
|
|
224
|
+
readonly previewName: string | undefined;
|
|
225
|
+
/** Client URL, such as `https://happy-animal-123.convex.cloud`. */
|
|
226
|
+
readonly url: string;
|
|
227
|
+
/** HTTP actions URL, such as `https://happy-animal-123.convex.site`. */
|
|
228
|
+
readonly siteUrl: string;
|
|
251
229
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
readonly
|
|
230
|
+
interface DeploymentAttributes extends DeploymentTarget {
|
|
231
|
+
/** Content identity of the last push and `env`. Undefined when the resource pushed nothing. */
|
|
232
|
+
readonly hash: string | undefined;
|
|
233
|
+
/** The names of the `env` variables that this resource set on the deployment, sorted. */
|
|
234
|
+
readonly envNames: readonly string[];
|
|
235
|
+
}
|
|
236
|
+
type Deployment = Resource<"Convex.Deployment", DeploymentProps, DeploymentAttributes, never, Providers>;
|
|
237
|
+
declare const Deployment: import("alchemy").ResourceClass<Deployment>;
|
|
238
|
+
declare const DeploymentIdentityChange_base: Schema.Class<DeploymentIdentityChange, Schema.TaggedStruct<"DeploymentIdentityChange", {
|
|
239
|
+
/** Name of the deployment in state, such as `happy-animal-123`. */
|
|
240
|
+
readonly deployment: Schema.String;
|
|
241
|
+
readonly field: Schema.Literals<readonly ["projectId", "type", "name"]>;
|
|
257
242
|
readonly current: Schema.String;
|
|
258
243
|
readonly requested: Schema.String;
|
|
259
244
|
}>, import("effect/Cause").YieldableError>;
|
|
260
|
-
/**
|
|
261
|
-
|
|
262
|
-
* Convex.EnvironmentVariable and Convex.DefaultEnvironmentVariable.
|
|
263
|
-
*/
|
|
264
|
-
declare class VariableIdentityChange extends VariableIdentityChange_base {
|
|
245
|
+
/** The props name another deployment than the one in state. */
|
|
246
|
+
declare class DeploymentIdentityChange extends DeploymentIdentityChange_base {
|
|
265
247
|
get message(): string;
|
|
266
248
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
* Key name. The provider requests this name, a dash, and a hash of the
|
|
274
|
-
* resource identity, so two resources with one `name` get different keys.
|
|
275
|
-
*/
|
|
276
|
-
readonly name: string;
|
|
249
|
+
declare const ProductionDeploymentNotFound_base: Schema.Class<ProductionDeploymentNotFound, Schema.TaggedStruct<"ProductionDeploymentNotFound", {
|
|
250
|
+
readonly projectId: Schema.Number;
|
|
251
|
+
}>, import("effect/Cause").YieldableError>;
|
|
252
|
+
/** The project has no default production deployment for a `prod` resource to take over. */
|
|
253
|
+
declare class ProductionDeploymentNotFound extends ProductionDeploymentNotFound_base {
|
|
254
|
+
get message(): string;
|
|
277
255
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
readonly
|
|
281
|
-
|
|
282
|
-
readonly
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
256
|
+
declare const AmbiguousDeployment_base: Schema.Class<AmbiguousDeployment, Schema.TaggedStruct<"AmbiguousDeployment", {
|
|
257
|
+
readonly projectId: Schema.Number;
|
|
258
|
+
readonly type: Schema.Literals<readonly ["dev", "preview"]>;
|
|
259
|
+
readonly name: Schema.String;
|
|
260
|
+
readonly deployments: Schema.$Array<Schema.String>;
|
|
261
|
+
}>, import("effect/Cause").YieldableError>;
|
|
262
|
+
/** More than one deployment of the project has the name, so the lookup cannot choose one. */
|
|
263
|
+
declare class AmbiguousDeployment extends AmbiguousDeployment_base {
|
|
264
|
+
get message(): string;
|
|
286
265
|
}
|
|
287
|
-
type PreviewDeployKey = Resource<"Convex.PreviewDeployKey", PreviewDeployKeyProps, PreviewDeployKeyAttributes, never, Providers>;
|
|
288
|
-
declare const PreviewDeployKey: import("alchemy").ResourceClass<PreviewDeployKey>;
|
|
289
266
|
//#endregion
|
|
290
267
|
//#region src/Project.d.ts
|
|
291
268
|
/** Region names the Management API accepts, from the generated schema. */
|
|
292
269
|
type DeploymentRegion = components["schemas"]["RegionName"];
|
|
293
|
-
|
|
270
|
+
type ProjectProps = {
|
|
294
271
|
/** Team slug or numeric team id. A slug costs one extra lookup per run. Cannot change. */
|
|
295
272
|
readonly team: string | number;
|
|
296
273
|
/** Display name. Convex derives the slug from it at creation. A change renames the project. */
|
|
@@ -299,7 +276,12 @@ interface ProjectProps {
|
|
|
299
276
|
readonly deploymentRegion?: DeploymentRegion;
|
|
300
277
|
/** Deployment created with the project. Defaults to `prod`. Cannot change. */
|
|
301
278
|
readonly deploymentType?: "prod" | "dev";
|
|
302
|
-
}
|
|
279
|
+
} | {
|
|
280
|
+
/** Team slug or numeric team id. Cannot change. */
|
|
281
|
+
readonly team: string | number;
|
|
282
|
+
/** Slug of an existing project, such as `score-four`. The resource never creates a project. Cannot change. */
|
|
283
|
+
readonly slug: string;
|
|
284
|
+
};
|
|
303
285
|
interface ProjectAttributes {
|
|
304
286
|
readonly projectId: number;
|
|
305
287
|
readonly slug: string;
|
|
@@ -348,6 +330,14 @@ declare const CreatedProjectNotFound_base: Schema.Class<CreatedProjectNotFound,
|
|
|
348
330
|
declare class CreatedProjectNotFound extends CreatedProjectNotFound_base {
|
|
349
331
|
get message(): string;
|
|
350
332
|
}
|
|
333
|
+
declare const ProjectNotFound_base: Schema.Class<ProjectNotFound, Schema.TaggedStruct<"ProjectNotFound", {
|
|
334
|
+
readonly team: Schema.String;
|
|
335
|
+
readonly slug: Schema.String;
|
|
336
|
+
}>, import("effect/Cause").YieldableError>;
|
|
337
|
+
/** No project in the team has the slug. A `slug` resource never creates one. */
|
|
338
|
+
declare class ProjectNotFound extends ProjectNotFound_base {
|
|
339
|
+
get message(): string;
|
|
340
|
+
}
|
|
351
341
|
//#endregion
|
|
352
|
-
export { ACCESS_TOKEN_ENV,
|
|
342
|
+
export { ACCESS_TOKEN_ENV, AmbiguousDeployment, AmbiguousProject, CodePushFailed, ConvexApiError, ConvexAppNotFound, ConvexCliNotFound, CreatedProjectNotFound, Credentials, CredentialsError, DEPLOY_KEY_ENV, Deployment, type DeploymentAttributes, DeploymentIdentityChange, type DeploymentProps, type DeploymentRegion, type EnvValue, EnvironmentNeedsDeployKey, ManagementApi, ProductionDeploymentNotFound, Project, type ProjectAttributes, ProjectDeploymentChange, ProjectNotFound, type ProjectProps, ProjectTeamChange, Providers, PushTargetMismatch, type Source, VariablesOwnedBySomeoneElse, fromConfig, fromValues, parseDeployOutput, providers };
|
|
353
343
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/Push.ts","../src/Deployment.ts","../src/Project.ts"],"mappings":";;;;;;;;;;;UA6BiB;;WAEN,aAAa,SAAS;;WAEtB;;UAGM;;WAEN,aAAa,OAAO,OAAO;;WAE3B,gBAAgB,OAAO;;WAEvB,WAAW,OAAO,OAAO,SAAS;;;cAGhC,oBAAoB;;cAKpB;;cAGA;;;;cAOA,yBAAyB;;;;;;;;;cAiCzB,kBAAiB,MAAM,MAAM;;cA0B7B,aAAc;WAChB,cAAc,SAAS;WACvB,YAAY,SAAS;MAC5B,MAAM,MAAM;;;KC3GJ,mBAAmB,kBAAkB;KACrC,mBAAmB,kBAAkB;;UAGhC,YAAY;WAClB,OAAO;WACP;WACA,UAAU;;;;;;;;;;;;;cAQR,uBAAuB;UAuBnB;;WAEN,UAAU,GACjB,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO,OAAO,GAAG;;WAEb,cACP,mBACA,MAAM,QAAQ,qBAAqB,QAAQ,0BACxC,OAAO,aAAa;;WAEhB,oBAAoB,GAC3B,mBACA,6BACA,WAAW,SAAS,kBACpB,MAAM,QAAQ,qBAAqB,QAAQ,YAAY,QACpD,OAAO,OAAO,GAAG;;WAEb,gBAAgB,0BAA0B,OAAO,eAAe;;;;;;;;WAQhE,oBAAoB,mBAAmB,OAAO;;;;;WAK9C,YAAY,OAAO,SAAS,qBAAqB;;;cAM/C,sBAAsB;;;;cClFtB,kBAAkB;;;;;;cAOlB,YAAa,cAAa,MAAM,MAAM,iBAA2B,MAAA,MAAA,+DAAA,kDAAA,mCAAA;;;;KC8BlE,oBAAoB,SAAS;;;;;KAM7B;;WAIG;;;;;;;;WAQA;;;;;;;WAOA;;;;;;cA2BF,0BAA0B;MAIxB;;;;;;cAMF,0BAA0B;MAIxB;;;;;;;;;cAMF,uBAAuB;MAMrB;;;;;;;cAQF,2BAA2B;MAIzB;;;;;;;cAMF,oCAAoC;MAIlC;;;;;;cAMF,kCAAkC;MAIhC;;;cAuCF,oBACX;EACG;EAAa;;;;UCzHR;;WAEC;aAAoB;;;;;;;;WAOpB,SAAS;;WAET,MAAM,SAAS,eAAe;;KAG7B,mBACP;;WAEU;MAEV;;WAEU;;;;;WAKA;;;UAIL;WACC;WACA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA;;WAEA;;UAGM,6BAA6B;;WAEnC;;WAEA;;KAGC,aAAa,8BAEvB,iBACA,6BAEA;cAEW,8BAAU,cAAA;;;;;;;;;cAKV,iCAAiC;MAU/B;;;;;;cAMF,qCAAqC;MAInC;;;;;;;;;cAMF,4BAA4B;MAS1B;;;;;KChJH,mBAAmB;KAEnB;;WAGG;;WAEA;;WAEA,mBAAmB;;WAEnB;;;WAIA;;WAEA;;UAGE;WACN;WACA;WACA;WACA;WACA;WACA;;KAGC,UAAU,2BAA2B,cAAc,0BAA0B;cAC5E,2BAAO,cAAA;;;;;;;cAGP,0BAA0B;MAIxB;;;;;;;;;;;;cASF,gCAAgC;MAS9B;;;;;;;;cAOF,yBAAyB;MAKvB;;;;;;cAMF,+BAA+B;MAI7B;;;;;;;cAMF,wBAAwB;MAItB"}
|