@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/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
- declare const Credentials_base: Context.ServiceClass<Credentials, "@samebase/alchemy-convex/Credentials", Effect.Effect<ResolvedCredentials, never, never>>;
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: `CONVEX_ACCESS_TOKEN` from the stack ConfigProvider
29
- * (process env, `.env`, stack secrets), then the Convex CLI login on this
30
- * machine. CI sets the variable; a developer who ran `npx convex login` needs
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 token, for tests or callers that already hold a value. */
35
- declare const fromToken: (accessToken: Redacted.Redacted<string>) => Layer.Layer<Credentials>;
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
- * All Convex resource providers. Pass a credentials layer to override the
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/DefaultEnvironmentVariable.d.ts
89
- /** Deployment types a default can target, from the generated schema. */
90
- type DeploymentType = components["schemas"]["DeploymentType"];
91
- interface DefaultEnvironmentVariableProps {
92
- /** Numeric project id, such as `project.projectId`. */
93
- readonly projectId: number;
94
- readonly name: string;
95
- readonly value: string | Redacted.Redacted<string>;
96
- /** Deployments of this type that Convex creates from now on get the variable. */
97
- readonly deploymentType: DeploymentType;
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
- * More `convex deploy` flags, added after the preview flags. Alchemy splits
132
- * the command on whitespace, so an argument cannot contain whitespace: use
133
- * `--typecheck=disable`, not `--typecheck disable` as one argument.
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 extraArgs?: readonly string[];
125
+ readonly command?: readonly [string, ...string[]];
136
126
  /**
137
- * Files hashed to skip an unchanged push. By default every non-gitignored
138
- * file under `cwd` and the nearest lockfile. Use
139
- * `{ include: ["convex/**"], lockfile: true }` to ignore frontend changes,
140
- * or `false` to push on every deploy. A preview deploy (`previewName` or
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 memo?: MemoOptions | boolean;
146
- }
147
- interface DeployAttributes {
148
- /** Client URL of the deployment that received the push, such as `https://happy-otter-123.convex.cloud`. */
149
- readonly url: string;
150
- /** First label of the URL host, such as `happy-otter-123`. */
151
- readonly deploymentName: string;
152
- /** Hash of the memoized input files after the push, or `undefined` when `memo` is `false`. */
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
- type Deploy = Resource<"Convex.Deploy", DeployProps, DeployAttributes, never, Providers>;
156
- declare const Deploy: import("alchemy").ResourceClass<Deploy>;
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
- /** A `convex deploy` argument contains whitespace, which Alchemy's command runner splits on. */
168
- declare class DeployArgumentError extends DeployArgumentError_base {
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 DeployOutputError_base: Schema.Class<DeployOutputError, Schema.TaggedStruct<"DeployOutputError", {
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
- /** `npx convex deploy` exited 0 but did not print the deployment URL. */
175
- declare class DeployOutputError extends DeployOutputError_base {
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
- //#endregion
179
- //#region src/DeployKey.d.ts
180
- /** Actions a deploy key can be limited to, from the generated schema. */
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
- * A key cannot be tied to one resource: before the create, listed keys
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 DeployKeyIsCredential_base: Schema.Class<DeployKeyIsCredential, Schema.TaggedStruct<"DeployKeyIsCredential", {
203
- readonly target: Schema.String;
204
- readonly name: Schema.String;
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
- * Convex returned the Management API credential itself as the new key. This
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
- interface DeployKeyProps {
215
- /** Deployment name, such as `project.prodDeploymentName`. */
216
- readonly deployment: string;
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
- * Key name. The provider requests this name, a dash, and a hash of the
219
- * resource identity, so two resources with one `name` get different keys.
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 name: string;
222
- /** Limits the key to these actions. Convex grants every deployment action when omitted. */
223
- readonly allowedActions?: readonly DeployKeyAction[];
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
- interface DeployKeyAttributes {
226
- /** The name Convex lists the key under, such as "ci-3f2a1b0c9d8e". */
227
- readonly uniqueName: string;
228
- /** Numeric id of the key in the listing. Undefined in state written by 0.1.x. */
229
- readonly keyId: number | undefined;
230
- readonly deployment: string;
231
- /** The secret, such as `prod:<deployment>|<token>`. Convex returns it only at creation. */
232
- readonly deployKey: Redacted.Redacted<string>;
233
- }
234
- type DeployKey = Resource<"Convex.DeployKey", DeployKeyProps, DeployKeyAttributes, never, Providers>;
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
- readonly value: string | Redacted.Redacted<string>;
245
- }
246
- interface EnvironmentVariableAttributes {
247
- readonly deployment: string;
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
- /** Deploy key for `deployment`, for read and delete. Undefined in state from 0.1.x. */
250
- readonly deployKey: Redacted.Redacted<string> | undefined;
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
- type EnvironmentVariable = Resource<"Convex.EnvironmentVariable", EnvironmentVariableProps, EnvironmentVariableAttributes, never, Providers>;
253
- declare const EnvironmentVariable: import("alchemy").ResourceClass<EnvironmentVariable>;
254
- declare const VariableIdentityChange_base: Schema.Class<VariableIdentityChange, Schema.TaggedStruct<"VariableIdentityChange", {
255
- readonly resourceType: Schema.String;
256
- readonly field: Schema.Literals<readonly ["name", "deployment", "projectId", "deploymentType"]>;
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
- * The props name another variable than the one in state. Used by
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
- //#endregion
268
- //#region src/PreviewDeployKey.d.ts
269
- interface PreviewDeployKeyProps {
270
- /** Numeric project id, such as `project.projectId`. */
271
- readonly projectId: number;
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
- interface PreviewDeployKeyAttributes {
279
- /** The name Convex lists the key under, such as "ci-3f2a1b0c9d8e". */
280
- readonly uniqueName: string;
281
- /** Numeric id of the key in the listing. Undefined in state written by 0.1.x. */
282
- readonly keyId: number | undefined;
283
- readonly projectId: number;
284
- /** The secret, such as `preview:<team>:<project>|<token>`. Convex returns it only at creation. */
285
- readonly previewDeployKey: Redacted.Redacted<string>;
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
- interface ProjectProps {
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, AmbiguousProject, ConvexApiError, CreatedProjectNotFound, Credentials, CredentialsError, DefaultEnvironmentVariable, type DefaultEnvironmentVariableAttributes, type DefaultEnvironmentVariableProps, Deploy, DeployArgumentError, type DeployAttributes, DeployKey, type DeployKeyAction, type DeployKeyAttributes, DeployKeyIsCredential, type DeployKeyProps, DeployKeyRecoveryRequired, DeployOutputError, type DeployProps, type DeploymentRegion, type DeploymentType, EnvironmentVariable, type EnvironmentVariableAttributes, type EnvironmentVariableProps, ManagementApi, PreviewDeployKey, type PreviewDeployKeyAttributes, type PreviewDeployKeyProps, Project, type ProjectAttributes, ProjectDeploymentChange, type ProjectProps, ProjectTeamChange, Providers, VariableIdentityChange, deployArgs, fromConfig, fromToken, parseDeployOutput, providers };
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/Credentials.ts","../src/ManagementApi.ts","../src/Providers.ts","../src/DefaultEnvironmentVariable.ts","../src/Deploy.ts","../src/DeployKey.ts","../src/EnvironmentVariable.ts","../src/PreviewDeployKey.ts","../src/Project.ts"],"mappings":";;;;;;;;;;;;UAgBiB;;WAEN,aAAa,SAAS;;WAEtB;;;cAGE,oBAAoB;;cAKpB;;;;cAyBA,yBAAyB;;;;;;;cAUzB,kBAAiB,MAAM,MAAM;;cAa7B,YAAa,aAAa,SAAS,qBAAmB,MAAM,MAAM;;;KC7DnE,mBAAmB,kBAAkB;KACrC,mBAAmB,kBAAkB;;UAGhC,YAAY;WAClB,OAAO;WACP;WACA,UAAU;;;;;;;;;;;;;cAQR,uBAAuB;UAuBnB;;WAEN,UAAU,GACjB,mBACA,MAAM,QAAQ,qBAAqB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B,sBAAsB,uCAEhC,0BACA,sCAEA;cAEW,uCAAmB,cAAA;;;;;;;;;;;cAMnB,+BAA+B;MAS7B;;;;UCpHE;;WAEN;;;;;WAKA;;UAGM;;WAEN;;WAEA;WACA;;WAEA,kBAAkB,SAAS;;KAG1B,mBAAmB,oCAE7B,uBACA,mCAEA;cAEW,oCAAgB,cAAA;;;;KChCjB,mBAAmB;UAEd;;WAEN;;WAEA;;WAEA,mBAAmB;;WAEnB;;UAGM;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"}
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,6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