@gaganref/confect-alchemy 10.6.0-fork.3 → 10.6.0-fork.30

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.
Files changed (99) hide show
  1. package/dist/Backend.d.ts +64 -5
  2. package/dist/Backend.d.ts.map +1 -1
  3. package/dist/Backend.js +187 -3
  4. package/dist/Backend.js.map +1 -1
  5. package/dist/Code.d.ts +14 -2
  6. package/dist/Code.d.ts.map +1 -1
  7. package/dist/Code.js +2 -2
  8. package/dist/Code.js.map +1 -1
  9. package/dist/Confect.d.ts +1 -1
  10. package/dist/Confect.d.ts.map +1 -1
  11. package/dist/Confect.js +8 -3
  12. package/dist/Confect.js.map +1 -1
  13. package/dist/Convex.d.ts +4 -1
  14. package/dist/Convex.d.ts.map +1 -1
  15. package/dist/Convex.js +10 -1
  16. package/dist/Convex.js.map +1 -1
  17. package/dist/ConvexClient.d.ts +92 -3
  18. package/dist/ConvexClient.d.ts.map +1 -1
  19. package/dist/ConvexClient.js +149 -27
  20. package/dist/ConvexClient.js.map +1 -1
  21. package/dist/CustomDomain.d.ts +156 -0
  22. package/dist/CustomDomain.d.ts.map +1 -0
  23. package/dist/CustomDomain.js +255 -0
  24. package/dist/CustomDomain.js.map +1 -0
  25. package/dist/DeployKey.js +3 -3
  26. package/dist/Deployment.d.ts +29 -3
  27. package/dist/Deployment.d.ts.map +1 -1
  28. package/dist/Deployment.js +39 -15
  29. package/dist/Deployment.js.map +1 -1
  30. package/dist/EnvironmentVariables.d.ts +76 -21
  31. package/dist/EnvironmentVariables.d.ts.map +1 -1
  32. package/dist/EnvironmentVariables.js +203 -19
  33. package/dist/EnvironmentVariables.js.map +1 -1
  34. package/dist/LogStream.d.ts +134 -0
  35. package/dist/LogStream.d.ts.map +1 -0
  36. package/dist/LogStream.js +324 -0
  37. package/dist/LogStream.js.map +1 -0
  38. package/dist/Project.js +2 -2
  39. package/dist/Providers.d.ts.map +1 -1
  40. package/dist/Providers.js +30 -15
  41. package/dist/Providers.js.map +1 -1
  42. package/dist/UsageLimit.d.ts +140 -0
  43. package/dist/UsageLimit.d.ts.map +1 -0
  44. package/dist/UsageLimit.js +145 -0
  45. package/dist/UsageLimit.js.map +1 -0
  46. package/dist/internal/CodeDeployment.d.ts +28 -1
  47. package/dist/internal/CodeDeployment.d.ts.map +1 -1
  48. package/dist/internal/CodeDeployment.js +85 -2
  49. package/dist/internal/CodeDeployment.js.map +1 -1
  50. package/dist/internal/CommandRunner.d.ts +4 -0
  51. package/dist/internal/CommandRunner.d.ts.map +1 -1
  52. package/dist/internal/CommandRunner.js +92 -6
  53. package/dist/internal/CommandRunner.js.map +1 -1
  54. package/dist/internal/FileLock.js +1 -1
  55. package/dist/internal/FunctionsDirectory.d.ts +12 -0
  56. package/dist/internal/FunctionsDirectory.d.ts.map +1 -0
  57. package/dist/internal/FunctionsDirectory.js +22 -0
  58. package/dist/internal/FunctionsDirectory.js.map +1 -0
  59. package/dist/internal/Lifecycle.d.ts +1 -0
  60. package/dist/internal/Lifecycle.d.ts.map +1 -1
  61. package/dist/internal/Lifecycle.js +24 -2
  62. package/dist/internal/Lifecycle.js.map +1 -1
  63. package/dist/internal/LocalBackend.d.ts +9 -0
  64. package/dist/internal/LocalBackend.d.ts.map +1 -1
  65. package/dist/internal/LocalBackend.js +14 -5
  66. package/dist/internal/LocalBackend.js.map +1 -1
  67. package/dist/internal/LogStream.d.ts +115 -0
  68. package/dist/internal/LogStream.d.ts.map +1 -0
  69. package/dist/internal/LogStream.js +123 -0
  70. package/dist/internal/LogStream.js.map +1 -0
  71. package/dist/internal/MountInit.d.ts.map +1 -1
  72. package/dist/internal/MountInit.js +4 -6
  73. package/dist/internal/MountInit.js.map +1 -1
  74. package/dist/internal/PushLock.d.ts +1 -0
  75. package/dist/internal/PushLock.d.ts.map +1 -1
  76. package/dist/internal/PushLock.js +4 -3
  77. package/dist/internal/PushLock.js.map +1 -1
  78. package/dist/internal/ResourceIdentity.js +1 -1
  79. package/dist/internal/Zip.js +1 -1
  80. package/package.json +4 -4
  81. package/src/Backend.ts +422 -12
  82. package/src/Code.ts +13 -0
  83. package/src/Confect.ts +7 -1
  84. package/src/Convex.ts +24 -1
  85. package/src/ConvexClient.ts +364 -31
  86. package/src/CustomDomain.ts +453 -0
  87. package/src/Deployment.ts +74 -12
  88. package/src/EnvironmentVariables.ts +505 -19
  89. package/src/LogStream.ts +662 -0
  90. package/src/Providers.ts +18 -0
  91. package/src/UsageLimit.ts +253 -0
  92. package/src/internal/CodeDeployment.ts +115 -0
  93. package/src/internal/CommandRunner.ts +182 -1
  94. package/src/internal/FunctionsDirectory.ts +27 -0
  95. package/src/internal/Lifecycle.ts +21 -1
  96. package/src/internal/LocalBackend.ts +9 -0
  97. package/src/internal/LogStream.ts +154 -0
  98. package/src/internal/MountInit.ts +3 -13
  99. package/src/internal/PushLock.ts +4 -1
@@ -2,12 +2,12 @@ import { ConvexClient } from "./ConvexClient.js";
2
2
  import { resourceName } from "./internal/ResourceIdentity.js";
3
3
  import { checkpointCreate, shouldAdopt } from "./internal/Lifecycle.js";
4
4
  import { boot, dataDirectories, remove } from "./internal/LocalBackend.js";
5
+ import * as Array from "effect/Array";
5
6
  import * as Effect from "effect/Effect";
7
+ import * as Schema from "effect/Schema";
6
8
  import * as Provider from "alchemy/Provider";
7
9
  import { Resource } from "alchemy/Resource";
8
10
  import * as FileSystem from "effect/FileSystem";
9
- import * as Schema from "effect/Schema";
10
- import * as Array from "effect/Array";
11
11
  import { OwnedBySomeoneElse, Unowned } from "alchemy/AdoptPolicy";
12
12
  import { isResolved } from "alchemy/Diff";
13
13
  import * as LocalProvider from "alchemy/Local/LocalProvider";
@@ -25,6 +25,14 @@ var AmbiguousDeployment = class extends Schema.TaggedError()("AmbiguousDeploymen
25
25
  projectId: Schema.Finite,
26
26
  reference: Schema.String
27
27
  }) {};
28
+ var InvalidDeploymentExpiry = class extends Schema.TaggedError()("InvalidDeploymentExpiry", { requested: Schema.String }) {
29
+ get message() {
30
+ return "Deployment expiresAt must be a safe integer timestamp in milliseconds, or null to clear the expiry.";
31
+ }
32
+ };
33
+ const validateExpiry = Effect.fn("Deployment.validateExpiry")(function* ({ expiresAt }) {
34
+ if (expiresAt != null && !Number.isSafeInteger(expiresAt)) return yield* InvalidDeploymentExpiry.make({ requested: String(expiresAt) });
35
+ });
28
36
  const provider = Effect.gen(function* () {
29
37
  const client = yield* ConvexClient;
30
38
  const attributes = Effect.fn("Deployment.attributes")(function* (deployment) {
@@ -35,7 +43,9 @@ const provider = Effect.gen(function* () {
35
43
  reference: deployment.reference,
36
44
  type: deployment.deploymentType,
37
45
  url: deployment.deploymentUrl,
38
- region: deployment.region
46
+ region: deployment.region,
47
+ class: deployment.class,
48
+ expiresAt: deployment.expiresAt ?? null
39
49
  };
40
50
  });
41
51
  const find = Effect.fn("Deployment.find")(function* (projectId, reference) {
@@ -61,13 +71,16 @@ const provider = Effect.gen(function* () {
61
71
  });
62
72
  return {
63
73
  diff: Effect.fn("Deployment.diff")(function* ({ news, output }) {
64
- if (!isResolved(news) || output === void 0) return;
74
+ if (!isResolved(news)) return;
75
+ yield* validateExpiry(news);
76
+ if (output === void 0) return;
77
+ const expiresAt = news.expiresAt;
65
78
  yield* validate(output, news);
66
79
  const deployment = yield* client.getDeployment(output.name).pipe(Effect.catchTag("ConvexNotFound", () => Effect.void));
67
80
  if (deployment === void 0) return { action: "update" };
68
81
  const current = yield* attributes(deployment);
69
82
  yield* validate(current, news);
70
- if ((news.reference ?? output.reference) !== current.reference) return { action: "update" };
83
+ if ((news.reference ?? output.reference) !== current.reference || news.class !== void 0 && news.class !== current.class || expiresAt !== void 0 && expiresAt !== (current.expiresAt ?? null)) return { action: "update" };
71
84
  }),
72
85
  read: Effect.fn("Deployment.read")(function* ({ fqn, instanceId, olds, output }) {
73
86
  if (output !== void 0) {
@@ -79,10 +92,12 @@ const provider = Effect.gen(function* () {
79
92
  return deployment !== void 0 ? yield* Effect.map(attributes(deployment), Unowned) : void 0;
80
93
  }),
81
94
  reconcile: Effect.fn("Deployment.reconcile")(function* ({ fqn, instanceId, news, output }) {
95
+ yield* validateExpiry(news);
82
96
  if (output === void 0) yield* checkpointCreate(fqn, instanceId, news);
83
97
  if (output !== void 0) yield* validate(output, news);
84
98
  let deployment = output !== void 0 ? yield* client.getDeployment(output.name).pipe(Effect.catchTag("ConvexNotFound", () => Effect.void)) : void 0;
85
99
  const reference = news.reference ?? output?.reference ?? (yield* resourceName("deployment", fqn, instanceId));
100
+ const expiresAt = news.expiresAt;
86
101
  if (deployment === void 0) {
87
102
  const existing = yield* find(news.projectId, reference);
88
103
  if (existing !== void 0 && !(yield* shouldAdopt(fqn))) return yield* new OwnedBySomeoneElse({
@@ -98,19 +113,27 @@ const provider = Effect.gen(function* () {
98
113
  } else deployment = yield* client.createDeployment(news.projectId, {
99
114
  type: news.type,
100
115
  reference,
101
- ...news.region === void 0 ? {} : { region: news.region }
116
+ ...news.region === void 0 ? {} : { region: news.region },
117
+ ...news.class === void 0 ? {} : { class: news.class },
118
+ ...expiresAt === void 0 ? {} : { expiresAt }
102
119
  });
103
120
  }
104
121
  const current = yield* attributes(deployment);
105
122
  yield* validate(current, news);
106
- if (current.reference !== reference) {
107
- const existing = yield* find(news.projectId, reference);
108
- if (existing !== void 0 && existing.name !== current.name) return yield* new OwnedBySomeoneElse({
109
- message: "The requested deployment reference is already in use.",
110
- resourceType: Deployment.Type,
111
- physicalName: reference
123
+ if (current.reference !== reference || news.class !== void 0 && news.class !== current.class || expiresAt !== void 0 && expiresAt !== (current.expiresAt ?? null)) {
124
+ if (current.reference !== reference) {
125
+ const existing = yield* find(news.projectId, reference);
126
+ if (existing !== void 0 && existing.name !== current.name) return yield* new OwnedBySomeoneElse({
127
+ message: "The requested deployment reference is already in use.",
128
+ resourceType: Deployment.Type,
129
+ physicalName: reference
130
+ });
131
+ }
132
+ yield* client.updateDeployment(current.name, {
133
+ reference,
134
+ ...news.class === void 0 || news.class === current.class ? {} : { class: news.class },
135
+ ...expiresAt === void 0 || expiresAt === (current.expiresAt ?? null) ? {} : { expiresAt }
112
136
  });
113
- yield* client.updateDeployment(current.name, { reference });
114
137
  deployment = yield* client.getDeployment(current.name);
115
138
  }
116
139
  return yield* attributes(deployment);
@@ -134,9 +157,10 @@ const localLayer = LocalProvider.make(Deployment, new URL(`./internal/LocalSidec
134
157
  const directory = yield* dataDirectories;
135
158
  return {
136
159
  resolveConfig: Effect.fn("Deployment.localConfig")(function* ({ fqn, instanceId, news }) {
160
+ const { class: _class, expiresAt: _expiresAt, ...props } = news;
137
161
  return {
138
162
  name: yield* resourceName("deployment", fqn, instanceId),
139
- props: news
163
+ props
140
164
  };
141
165
  }),
142
166
  start: Effect.fn("Deployment.localStart")(function* ({ config, invalidate }) {
@@ -158,6 +182,6 @@ const localLayer = LocalProvider.make(Deployment, new URL(`./internal/LocalSidec
158
182
  };
159
183
  }));
160
184
  const layer = Provider.effect(Deployment, provider);
161
- export { AmbiguousDeployment, Deployment, DeploymentIdentityChange, UnsupportedLocalDeployment, layer, localLayer, provider };
185
+ export { AmbiguousDeployment, Deployment, DeploymentIdentityChange, InvalidDeploymentExpiry, UnsupportedLocalDeployment, layer, localLayer, provider };
162
186
 
163
187
  //# sourceMappingURL=Deployment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Deployment.js","names":[],"sources":["../src/Deployment.ts"],"sourcesContent":["import type {\n CreateDeploymentType,\n PlatformDeploymentResponse,\n RegionName,\n} from \"@convex-dev/platform/managementApi\";\nimport { OwnedBySomeoneElse, Unowned } from \"alchemy/AdoptPolicy\";\nimport { isResolved } from \"alchemy/Diff\";\nimport * as LocalProvider from \"alchemy/Local/LocalProvider\";\nimport * as Provider from \"alchemy/Provider\";\nimport { Resource } from \"alchemy/Resource\";\nimport { moduleExtension } from \"alchemy/Util/Node\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Schema from \"effect/Schema\";\n\nimport { ConvexClient } from \"./ConvexClient.js\";\nimport type { Providers } from \"./Providers.js\";\nimport { resourceName } from \"./internal/ResourceIdentity.js\";\nimport { checkpointCreate, shouldAdopt } from \"./internal/Lifecycle.js\";\nimport { boot, dataDirectories, remove } from \"./internal/LocalBackend.js\";\nimport * as Array from \"effect/Array\";\n\nexport interface DeploymentProps {\n readonly projectId: number;\n readonly type: CreateDeploymentType;\n readonly reference?: string;\n readonly region?: RegionName;\n}\n\nexport interface DeploymentAttributes {\n readonly projectId: number;\n readonly name: string;\n readonly reference: string;\n readonly type: CreateDeploymentType;\n readonly url: string;\n /**\n * Always set in the cloud; a local deployment echoes the requested region.\n */\n readonly region?: RegionName;\n}\n\nexport type Deployment = Resource<\n \"Convex.Deployment\",\n DeploymentProps,\n DeploymentAttributes,\n never,\n Providers\n>;\nexport const Deployment = Resource<Deployment>(\"Convex.Deployment\", {\n defaultRemovalPolicy: \"retain\",\n});\n\nexport class DeploymentIdentityChange extends Schema.TaggedError<\n DeploymentIdentityChange,\n { readonly brand: unique symbol }\n>()(\"DeploymentIdentityChange\", {\n deploymentName: Schema.String,\n field: Schema.String,\n current: Schema.String,\n requested: Schema.String,\n}) {}\n\nexport class UnsupportedLocalDeployment extends Schema.TaggedError<\n UnsupportedLocalDeployment,\n { readonly brand: unique symbol }\n>()(\"UnsupportedLocalDeployment\", { deploymentName: Schema.String }) {}\n\nexport class AmbiguousDeployment extends Schema.TaggedError<\n AmbiguousDeployment,\n { readonly brand: unique symbol }\n>()(\"AmbiguousDeployment\", {\n projectId: Schema.Finite,\n reference: Schema.String,\n}) {}\n\nexport const provider = Effect.gen(function* () {\n const client = yield* ConvexClient;\n const attributes = Effect.fn(\"Deployment.attributes\")(function* (\n deployment: PlatformDeploymentResponse,\n ) {\n if (deployment.kind !== \"cloud\")\n return yield* UnsupportedLocalDeployment.make({\n deploymentName: deployment.name,\n });\n return {\n projectId: deployment.projectId,\n name: deployment.name,\n reference: deployment.reference,\n type: deployment.deploymentType,\n url: deployment.deploymentUrl,\n region: deployment.region,\n } satisfies DeploymentAttributes;\n });\n const find = Effect.fn(\"Deployment.find\")(function* (\n projectId: number,\n reference: string,\n ) {\n const deployments = yield* client.listDeployments(projectId);\n const matches = Array.filter(\n deployments,\n (deployment) =>\n deployment.kind === \"cloud\" && deployment.reference === reference,\n );\n if (matches.length > 1)\n return yield* AmbiguousDeployment.make({ projectId, reference });\n return matches[0];\n });\n const validate = Effect.fn(\"Deployment.validate\")(function* (\n current: DeploymentAttributes,\n news: DeploymentProps,\n ) {\n for (const field of [\"projectId\", \"type\", \"region\"] as const) {\n if (news[field] !== undefined && current[field] !== news[field])\n return yield* DeploymentIdentityChange.make({\n deploymentName: current.name,\n field,\n current: String(current[field]),\n requested: String(news[field]),\n });\n }\n });\n return {\n diff: Effect.fn(\"Deployment.diff\")(function* ({ news, output }) {\n if (!isResolved(news) || output === undefined) return;\n yield* validate(output, news);\n const deployment = yield* client\n .getDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void));\n if (deployment === undefined) return { action: \"update\" };\n const current = yield* attributes(deployment);\n yield* validate(current, news);\n if ((news.reference ?? output.reference) !== current.reference)\n return { action: \"update\" };\n }),\n read: Effect.fn(\"Deployment.read\")(function* ({\n fqn,\n instanceId,\n olds,\n output,\n }) {\n if (output !== undefined) {\n const deployment = yield* client\n .getDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void));\n return deployment !== undefined\n ? yield* attributes(deployment)\n : undefined;\n }\n if (olds.projectId === undefined) return;\n const deployment = yield* find(\n olds.projectId,\n olds.reference ?? (yield* resourceName(\"deployment\", fqn, instanceId)),\n );\n return deployment !== undefined\n ? yield* Effect.map(attributes(deployment), Unowned)\n : undefined;\n }),\n reconcile: Effect.fn(\"Deployment.reconcile\")(function* ({\n fqn,\n instanceId,\n news,\n output,\n }) {\n if (output === undefined) yield* checkpointCreate(fqn, instanceId, news);\n if (output !== undefined) yield* validate(output, news);\n let deployment =\n output !== undefined\n ? yield* client\n .getDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void))\n : undefined;\n const reference =\n news.reference ??\n output?.reference ??\n (yield* resourceName(\"deployment\", fqn, instanceId));\n if (deployment === undefined) {\n const existing = yield* find(news.projectId, reference);\n if (existing !== undefined && !(yield* shouldAdopt(fqn)))\n return yield* new OwnedBySomeoneElse({\n message: \"An existing deployment requires explicit adoption.\",\n resourceType: Deployment.Type,\n physicalName: reference,\n });\n if (existing !== undefined) {\n const adopted = yield* attributes(existing);\n yield* validate(adopted, news);\n yield* checkpointCreate(fqn, instanceId, news, adopted);\n deployment = existing;\n } else {\n deployment = yield* client.createDeployment(news.projectId, {\n type: news.type,\n reference,\n ...(news.region === undefined ? {} : { region: news.region }),\n });\n }\n }\n const current = yield* attributes(deployment);\n yield* validate(current, news);\n if (current.reference !== reference) {\n const existing = yield* find(news.projectId, reference);\n if (existing !== undefined && existing.name !== current.name)\n return yield* new OwnedBySomeoneElse({\n message: \"The requested deployment reference is already in use.\",\n resourceType: Deployment.Type,\n physicalName: reference,\n });\n yield* client.updateDeployment(current.name, {\n reference,\n });\n deployment = yield* client.getDeployment(current.name);\n }\n return yield* attributes(deployment);\n }),\n delete: Effect.fn(\"Deployment.delete\")(function* ({ output }) {\n yield* client\n .deleteDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void));\n }),\n } satisfies Provider.ProviderServiceInput<Deployment>;\n});\n\ninterface LocalConfig {\n readonly name: string;\n readonly props: DeploymentProps;\n}\n\n/**\n * Under `alchemy dev` a deployment is a local Convex backend this provider\n * owns. Alchemy's dev sidecar hosts it, so the backend keeps running across\n * reloads of the stack and stops when the dev session ends. Its data lives in\n * `.alchemy/convex/<stack>/<stage>/<name>` and is removed only when the\n * deployment is destroyed.\n *\n * @stability unstable\n */\nexport const localLayer = LocalProvider.make(\n Deployment,\n new URL(\n `./internal/LocalSidecar${moduleExtension(import.meta.url)}`,\n import.meta.url,\n ).href,\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const directory = yield* dataDirectories;\n return {\n resolveConfig: Effect.fn(\"Deployment.localConfig\")(function* ({\n fqn,\n instanceId,\n news,\n }) {\n return {\n name: yield* resourceName(\"deployment\", fqn, instanceId),\n props: news,\n } satisfies LocalConfig;\n }),\n start: Effect.fn(\"Deployment.localStart\")(function* ({\n config,\n invalidate,\n }) {\n const backend = yield* boot(config.name, directory(config.name));\n yield* backend.exited.pipe(\n Effect.andThen(invalidate),\n Effect.forkScoped,\n );\n return {\n projectId: config.props.projectId,\n name: config.name,\n reference: config.props.reference ?? config.name,\n type: config.props.type,\n url: backend.url,\n ...(config.props.region === undefined\n ? {}\n : { region: config.props.region }),\n } satisfies DeploymentAttributes;\n }),\n stop: Effect.fn(\"Deployment.localStop\")(function* ({ fqn, instanceId }) {\n const name = yield* resourceName(\"deployment\", fqn, instanceId);\n yield* remove(name, directory(name)).pipe(\n Effect.provideService(FileSystem.FileSystem, fs),\n );\n }),\n } satisfies LocalProvider.LocalProviderSpec<\n Deployment,\n LocalConfig,\n Effect.Services<ReturnType<typeof boot>>\n >;\n }),\n);\n\nexport const layer = Provider.effect(Deployment, provider);\n"],"mappings":";;;;;;;;;;;;;;;AAgDA,MAAa,aAAa,SAAqB,qBAAqB,EAClE,sBAAsB,SACxB,CAAC;AAED,IAAa,2BAAb,cAA8C,OAAO,YAGnD,CAAC,CAAC,4BAA4B;CAC9B,gBAAgB,OAAO;CACvB,OAAO,OAAO;CACd,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,6BAAb,cAAgD,OAAO,YAGrD,CAAC,CAAC,8BAA8B,EAAE,gBAAgB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtE,IAAa,sBAAb,cAAyC,OAAO,YAG9C,CAAC,CAAC,uBAAuB;CACzB,WAAW,OAAO;CAClB,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAa,W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AAe,OAAO,GAAG,wBAAwB,CAAC,CAAC,WAAW,EAC5D,KACA,YACA,QACC;GACD,OAAO;IACL,MAAM,OAAO,aAAa,cAAc,KAAK,UAAU;IACvD,OAAO;GACT;EACF,CAAC;EACD,OAAO,OAAO,GAAG,uBAAuB,CAAC,CAAC,WAAW,EACnD,QACA,cACC;GACD,MAAM,UAAU,OAAO,KAAK,OAAO,MAAM,UAAU,OAAO,IAAI,CAAC;GAC/D,OAAO,QAAQ,OAAO,KACpB,OAAO,QAAQ,UAAU,GACzB,OAAO,UACT;GACA,OAAO;IACL,WAAW,OAAO,MAAM;IACxB,MAAM,OAAO;IACb,WAAW,OAAO,MAAM,aAAa,OAAO;IAC5C,MAAM,OAAO,MAAM;IACnB,KAAK,QAAQ;IACb,GAAI,OAAO,MAAM,WAAW,KAAA,IACxB,CAAC,IACD,EAAE,QAAQ,OAAO,MAAM,OAAO;GACpC;EACF,CAAC;EACD,MAAM,OAAO,GAAG,sBAAsB,CAAC,CAAC,WAAW,EAAE,KAAK,cAAc;GACtE,MAAM,OAAO,OAAO,aAAa,cAAc,KAAK,UAAU;GAC9D,OAAO,OAAO,MAAM,UAAU,IAAI,CAAC,CAAC,CAAC,KACnC,OAAO,eAAe,WAAW,YAAY,EAAE,CACjD;EACF,CAAC;CACH;AAKF,CAAC,CACH;AAEA,MAAa,QAAQ,SAAS,OAAO,YAAY,QAAQ"}
1
+ {"version":3,"file":"Deployment.js","names":[],"sources":["../src/Deployment.ts"],"sourcesContent":["import type {\n CreateDeploymentType,\n DeploymentClass,\n PlatformDeploymentResponse,\n RegionName,\n} from \"@convex-dev/platform/managementApi\";\nimport { OwnedBySomeoneElse, Unowned } from \"alchemy/AdoptPolicy\";\nimport { isResolved } from \"alchemy/Diff\";\nimport * as LocalProvider from \"alchemy/Local/LocalProvider\";\nimport * as Provider from \"alchemy/Provider\";\nimport { Resource } from \"alchemy/Resource\";\nimport { moduleExtension } from \"alchemy/Util/Node\";\nimport * as Effect from \"effect/Effect\";\nimport * as FileSystem from \"effect/FileSystem\";\nimport * as Schema from \"effect/Schema\";\n\nimport { ConvexClient } from \"./ConvexClient.js\";\nimport type { Providers } from \"./Providers.js\";\nimport { resourceName } from \"./internal/ResourceIdentity.js\";\nimport { checkpointCreate, shouldAdopt } from \"./internal/Lifecycle.js\";\nimport { boot, dataDirectories, remove } from \"./internal/LocalBackend.js\";\nimport * as Array from \"effect/Array\";\n\nexport interface DeploymentProps {\n readonly projectId: number;\n readonly type: CreateDeploymentType;\n readonly reference?: string;\n readonly region?: RegionName;\n readonly class?: DeploymentClass;\n /**\n * Safe integer milliseconds since the Unix epoch. Omit to preserve the\n * current cloud expiry; only null clears it.\n */\n readonly expiresAt?: number | null;\n}\n\nexport interface DeploymentAttributes {\n readonly projectId: number;\n readonly name: string;\n readonly reference: string;\n readonly type: CreateDeploymentType;\n readonly url: string;\n /**\n * Always set in the cloud; a local deployment echoes the requested region.\n */\n readonly region?: RegionName;\n /**\n * Always set in the cloud; local deployments do not have a cloud class.\n */\n readonly class?: string;\n /**\n * Cloud expiry in milliseconds since the Unix epoch, or null when unset.\n */\n readonly expiresAt?: number | null;\n}\n\nexport type Deployment = Resource<\n \"Convex.Deployment\",\n DeploymentProps,\n DeploymentAttributes,\n never,\n Providers\n>;\nexport const Deployment = Resource<Deployment>(\"Convex.Deployment\", {\n defaultRemovalPolicy: \"retain\",\n});\n\nexport class DeploymentIdentityChange extends Schema.TaggedError<\n DeploymentIdentityChange,\n { readonly brand: unique symbol }\n>()(\"DeploymentIdentityChange\", {\n deploymentName: Schema.String,\n field: Schema.String,\n current: Schema.String,\n requested: Schema.String,\n}) {}\n\nexport class UnsupportedLocalDeployment extends Schema.TaggedError<\n UnsupportedLocalDeployment,\n { readonly brand: unique symbol }\n>()(\"UnsupportedLocalDeployment\", { deploymentName: Schema.String }) {}\n\nexport class AmbiguousDeployment extends Schema.TaggedError<\n AmbiguousDeployment,\n { readonly brand: unique symbol }\n>()(\"AmbiguousDeployment\", {\n projectId: Schema.Finite,\n reference: Schema.String,\n}) {}\n\nexport class InvalidDeploymentExpiry extends Schema.TaggedError<\n InvalidDeploymentExpiry,\n { readonly brand: unique symbol }\n>()(\"InvalidDeploymentExpiry\", {\n requested: Schema.String,\n}) {\n override get message() {\n return \"Deployment expiresAt must be a safe integer timestamp in milliseconds, or null to clear the expiry.\";\n }\n}\n\nconst validateExpiry = Effect.fn(\"Deployment.validateExpiry\")(function* ({\n expiresAt,\n}: DeploymentProps) {\n if (expiresAt != null && !Number.isSafeInteger(expiresAt))\n return yield* InvalidDeploymentExpiry.make({\n requested: String(expiresAt),\n });\n});\n\nexport const provider = Effect.gen(function* () {\n const client = yield* ConvexClient;\n const attributes = Effect.fn(\"Deployment.attributes\")(function* (\n deployment: PlatformDeploymentResponse,\n ) {\n if (deployment.kind !== \"cloud\")\n return yield* UnsupportedLocalDeployment.make({\n deploymentName: deployment.name,\n });\n return {\n projectId: deployment.projectId,\n name: deployment.name,\n reference: deployment.reference,\n type: deployment.deploymentType,\n url: deployment.deploymentUrl,\n region: deployment.region,\n class: deployment.class,\n expiresAt: deployment.expiresAt ?? null,\n } satisfies DeploymentAttributes;\n });\n const find = Effect.fn(\"Deployment.find\")(function* (\n projectId: number,\n reference: string,\n ) {\n const deployments = yield* client.listDeployments(projectId);\n const matches = Array.filter(\n deployments,\n (deployment) =>\n deployment.kind === \"cloud\" && deployment.reference === reference,\n );\n if (matches.length > 1)\n return yield* AmbiguousDeployment.make({ projectId, reference });\n return matches[0];\n });\n const validate = Effect.fn(\"Deployment.validate\")(function* (\n current: DeploymentAttributes,\n news: DeploymentProps,\n ) {\n for (const field of [\"projectId\", \"type\", \"region\"] as const) {\n if (news[field] !== undefined && current[field] !== news[field])\n return yield* DeploymentIdentityChange.make({\n deploymentName: current.name,\n field,\n current: String(current[field]),\n requested: String(news[field]),\n });\n }\n });\n return {\n diff: Effect.fn(\"Deployment.diff\")(function* ({ news, output }) {\n if (!isResolved(news)) return;\n yield* validateExpiry(news);\n if (output === undefined) return;\n const expiresAt = news.expiresAt;\n yield* validate(output, news);\n const deployment = yield* client\n .getDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void));\n if (deployment === undefined) return { action: \"update\" };\n const current = yield* attributes(deployment);\n yield* validate(current, news);\n if (\n (news.reference ?? output.reference) !== current.reference ||\n (news.class !== undefined && news.class !== current.class) ||\n (expiresAt !== undefined && expiresAt !== (current.expiresAt ?? null))\n )\n return { action: \"update\" };\n }),\n read: Effect.fn(\"Deployment.read\")(function* ({\n fqn,\n instanceId,\n olds,\n output,\n }) {\n if (output !== undefined) {\n const deployment = yield* client\n .getDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void));\n return deployment !== undefined\n ? yield* attributes(deployment)\n : undefined;\n }\n if (olds.projectId === undefined) return;\n const deployment = yield* find(\n olds.projectId,\n olds.reference ?? (yield* resourceName(\"deployment\", fqn, instanceId)),\n );\n return deployment !== undefined\n ? yield* Effect.map(attributes(deployment), Unowned)\n : undefined;\n }),\n reconcile: Effect.fn(\"Deployment.reconcile\")(function* ({\n fqn,\n instanceId,\n news,\n output,\n }) {\n yield* validateExpiry(news);\n if (output === undefined) yield* checkpointCreate(fqn, instanceId, news);\n if (output !== undefined) yield* validate(output, news);\n let deployment =\n output !== undefined\n ? yield* client\n .getDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void))\n : undefined;\n const reference =\n news.reference ??\n output?.reference ??\n (yield* resourceName(\"deployment\", fqn, instanceId));\n const expiresAt = news.expiresAt;\n if (deployment === undefined) {\n const existing = yield* find(news.projectId, reference);\n if (existing !== undefined && !(yield* shouldAdopt(fqn)))\n return yield* new OwnedBySomeoneElse({\n message: \"An existing deployment requires explicit adoption.\",\n resourceType: Deployment.Type,\n physicalName: reference,\n });\n if (existing !== undefined) {\n const adopted = yield* attributes(existing);\n yield* validate(adopted, news);\n yield* checkpointCreate(fqn, instanceId, news, adopted);\n deployment = existing;\n } else {\n deployment = yield* client.createDeployment(news.projectId, {\n type: news.type,\n reference,\n ...(news.region === undefined ? {} : { region: news.region }),\n ...(news.class === undefined ? {} : { class: news.class }),\n ...(expiresAt === undefined ? {} : { expiresAt }),\n });\n }\n }\n const current = yield* attributes(deployment);\n yield* validate(current, news);\n if (\n current.reference !== reference ||\n (news.class !== undefined && news.class !== current.class) ||\n (expiresAt !== undefined && expiresAt !== (current.expiresAt ?? null))\n ) {\n if (current.reference !== reference) {\n const existing = yield* find(news.projectId, reference);\n if (existing !== undefined && existing.name !== current.name)\n return yield* new OwnedBySomeoneElse({\n message: \"The requested deployment reference is already in use.\",\n resourceType: Deployment.Type,\n physicalName: reference,\n });\n }\n yield* client.updateDeployment(current.name, {\n reference,\n ...(news.class === undefined || news.class === current.class\n ? {}\n : { class: news.class }),\n ...(expiresAt === undefined ||\n expiresAt === (current.expiresAt ?? null)\n ? {}\n : { expiresAt }),\n });\n deployment = yield* client.getDeployment(current.name);\n }\n return yield* attributes(deployment);\n }),\n delete: Effect.fn(\"Deployment.delete\")(function* ({ output }) {\n yield* client\n .deleteDeployment(output.name)\n .pipe(Effect.catchTag(\"ConvexNotFound\", () => Effect.void));\n }),\n } satisfies Provider.ProviderServiceInput<Deployment>;\n});\n\ninterface LocalConfig {\n readonly name: string;\n readonly props: Omit<DeploymentProps, \"class\" | \"expiresAt\">;\n}\n\n/**\n * Under `alchemy dev` a deployment is a local Convex backend this provider\n * owns. Alchemy's dev sidecar hosts it, so the backend keeps running across\n * reloads of the stack and stops when the dev session ends. Its data lives in\n * `.alchemy/convex/<stack>/<stage>/<name>` and is removed only when the\n * deployment is destroyed.\n *\n * @stability unstable\n */\nexport const localLayer = LocalProvider.make(\n Deployment,\n new URL(\n `./internal/LocalSidecar${moduleExtension(import.meta.url)}`,\n import.meta.url,\n ).href,\n Effect.gen(function* () {\n const fs = yield* FileSystem.FileSystem;\n const directory = yield* dataDirectories;\n return {\n resolveConfig: Effect.fn(\"Deployment.localConfig\")(function* ({\n fqn,\n instanceId,\n news,\n }) {\n const { class: _class, expiresAt: _expiresAt, ...props } = news;\n return {\n name: yield* resourceName(\"deployment\", fqn, instanceId),\n props,\n } satisfies LocalConfig;\n }),\n start: Effect.fn(\"Deployment.localStart\")(function* ({\n config,\n invalidate,\n }) {\n const backend = yield* boot(config.name, directory(config.name));\n yield* backend.exited.pipe(\n Effect.andThen(invalidate),\n Effect.forkScoped,\n );\n return {\n projectId: config.props.projectId,\n name: config.name,\n reference: config.props.reference ?? config.name,\n type: config.props.type,\n url: backend.url,\n ...(config.props.region === undefined\n ? {}\n : { region: config.props.region }),\n } satisfies DeploymentAttributes;\n }),\n stop: Effect.fn(\"Deployment.localStop\")(function* ({ fqn, instanceId }) {\n const name = yield* resourceName(\"deployment\", fqn, instanceId);\n yield* remove(name, directory(name)).pipe(\n Effect.provideService(FileSystem.FileSystem, fs),\n );\n }),\n } satisfies LocalProvider.LocalProviderSpec<\n Deployment,\n LocalConfig,\n Effect.Services<ReturnType<typeof boot>>\n >;\n }),\n);\n\nexport const layer = Provider.effect(Deployment, provider);\n"],"mappings":";;;;;;;;;;;;;;;AA+DA,MAAa,aAAa,SAAqB,qBAAqB,EAClE,sBAAsB,SACxB,CAAC;AAED,IAAa,2BAAb,cAA8C,OAAO,YAGnD,CAAC,CAAC,4BAA4B;CAC9B,gBAAgB,OAAO;CACvB,OAAO,OAAO;CACd,SAAS,OAAO;CAChB,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,6BAAb,cAAgD,OAAO,YAGrD,CAAC,CAAC,8BAA8B,EAAE,gBAAgB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtE,IAAa,sBAAb,cAAyC,OAAO,YAG9C,CAAC,CAAC,uBAAuB;CACzB,WAAW,OAAO;CAClB,WAAW,OAAO;AACpB,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,0BAAb,cAA6C,OAAO,YAGlD,CAAC,CAAC,2BAA2B,EAC7B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UAAU,OAAO,KAAK,OAAO,MAAM,UAAU,OAAO,IAAI,CAAC;GAC/D,OAAO,QAAQ,OAAO,KACpB,OAAO,QAAQ,UAAU,GACzB,OAAO,UACT;GACA,OAAO;IACL,WAAW,OAAO,MAAM;IACxB,MAAM,OAAO;IACb,WAAW,OAAO,MAAM,aAAa,OAAO;IAC5C,MAAM,OAAO,MAAM;IACnB,KAAK,QAAQ;IACb,GAAI,OAAO,MAAM,WAAW,KAAA,IACxB,CAAC,IACD,EAAE,QAAQ,OAAO,MAAM,OAAO;GACpC;EACF,CAAC;EACD,MAAM,OAAO,GAAG,sBAAsB,CAAC,CAAC,WAAW,EAAE,KAAK,cAAc;GACtE,MAAM,OAAO,OAAO,aAAa,cAAc,KAAK,UAAU;GAC9D,OAAO,OAAO,MAAM,UAAU,IAAI,CAAC,CAAC,CAAC,KACnC,OAAO,eAAe,WAAW,YAAY,EAAE,CACjD;EACF,CAAC;CACH;AAKF,CAAC,CACH;AAEA,MAAa,QAAQ,SAAS,OAAO,YAAY,QAAQ"}
@@ -1,6 +1,9 @@
1
1
  import { OwnedBySomeoneElse } from "alchemy/AdoptPolicy";
2
+ import type { Input } from "alchemy/Input";
2
3
  import * as Provider from "alchemy/Provider";
3
- import { Resource } from "alchemy/Resource";
4
+ import { Resource, type ResourceClass } from "alchemy/Resource";
5
+ import * as Duration from "effect/Duration";
6
+ import { PushLockError } from "./internal/PushLock.js";
4
7
  import * as Effect from "effect/Effect";
5
8
  import * as Layer from "effect/Layer";
6
9
  import * as Redacted from "effect/Redacted";
@@ -8,6 +11,34 @@ import * as Schema from "effect/Schema";
8
11
  import * as ConvexClient from "./ConvexClient.js";
9
12
  import type { Providers } from "./Providers.js";
10
13
  export interface EnvironmentVariablesProps {
14
+ /**
15
+ * Refuse live owned values that differ from both the last write and the
16
+ * desired value. Defaults to `overwrite`.
17
+ */
18
+ readonly driftPolicy?: "overwrite" | "error";
19
+ /**
20
+ * Adopt unowned desired names only when their live values match. Defaults to
21
+ * false.
22
+ */
23
+ readonly adoptMatching?: boolean;
24
+ /**
25
+ * Refuse live names that are neither owned nor desired. Defaults to `ignore`.
26
+ */
27
+ readonly unownedPolicy?: "ignore" | "error";
28
+ /**
29
+ * Share the deployment push lock for checks and writes. Absent by default.
30
+ */
31
+ readonly lock?: {
32
+ readonly deploymentName: string;
33
+ };
34
+ /**
35
+ * Retry write conflicts only, with 1 to 10 attempts and a delay of 1 to 10000
36
+ * ms. Absent means one attempt.
37
+ */
38
+ readonly retry?: {
39
+ readonly maxAttempts: number;
40
+ readonly delay: Duration.Input;
41
+ };
11
42
  readonly url: string;
12
43
  readonly deployKey: Redacted.Redacted<string>;
13
44
  readonly variables: Readonly<Record<string, string | Redacted.Redacted<string>>>;
@@ -20,7 +51,7 @@ export interface EnvironmentVariablesAttributes {
20
51
  readonly originals: Readonly<Record<string, Redacted.Redacted<string>>>;
21
52
  }
22
53
  export type EnvironmentVariables = Resource<"Convex.EnvironmentVariables", EnvironmentVariablesProps, EnvironmentVariablesAttributes, never, Providers>;
23
- export declare const EnvironmentVariables: import("alchemy").ResourceClass<EnvironmentVariables>;
54
+ export declare const EnvironmentVariables: ResourceClass<EnvironmentVariables>;
24
55
  declare const EnvironmentTargetChange_base: Schema.Class<EnvironmentTargetChange, Schema.TaggedStruct<"EnvironmentTargetChange", {
25
56
  readonly url: Schema.String;
26
57
  }>, import("effect/Cause").YieldableError & {
@@ -28,20 +59,44 @@ declare const EnvironmentTargetChange_base: Schema.Class<EnvironmentTargetChange
28
59
  }>;
29
60
  export declare class EnvironmentTargetChange extends EnvironmentTargetChange_base {
30
61
  }
62
+ declare const EnvironmentVariableDrift_base: Schema.Class<EnvironmentVariableDrift, Schema.TaggedStruct<"EnvironmentVariableDrift", {
63
+ readonly variableName: Schema.String;
64
+ }>, import("effect/Cause").YieldableError & {
65
+ readonly brand: unique symbol;
66
+ }>;
67
+ export declare class EnvironmentVariableDrift extends EnvironmentVariableDrift_base {
68
+ get message(): string;
69
+ }
70
+ declare const EnvironmentVariableUnowned_base: Schema.Class<EnvironmentVariableUnowned, Schema.TaggedStruct<"EnvironmentVariableUnowned", {
71
+ readonly variableName: Schema.String;
72
+ }>, import("effect/Cause").YieldableError & {
73
+ readonly brand: unique symbol;
74
+ }>;
75
+ export declare class EnvironmentVariableUnowned extends EnvironmentVariableUnowned_base {
76
+ get message(): string;
77
+ }
78
+ declare const EnvironmentVariablesInvalidOption_base: Schema.Class<EnvironmentVariablesInvalidOption, Schema.TaggedStruct<"EnvironmentVariablesInvalidOption", {
79
+ readonly option: Schema.Literals<readonly ["maxAttempts", "delay", "deploymentName"]>;
80
+ }>, import("effect/Cause").YieldableError & {
81
+ readonly brand: unique symbol;
82
+ }>;
83
+ export declare class EnvironmentVariablesInvalidOption extends EnvironmentVariablesInvalidOption_base {
84
+ get message(): "Environment lock deploymentName must contain lowercase letters or digits separated by single hyphens" | "Environment retry delay must be from 1 to 10000 milliseconds" | "Environment retry maxAttempts must be an integer from 1 to 10";
85
+ }
31
86
  export declare const provider: Effect.Effect<{
32
- diff: (args_0: {
87
+ diff: (input: {
33
88
  id: string;
34
89
  fqn: string;
35
90
  instanceId: string;
36
91
  olds: EnvironmentVariablesProps;
37
- news: import("alchemy").Input<EnvironmentVariablesProps>;
92
+ news: Input<EnvironmentVariablesProps>;
38
93
  oldBindings: import("alchemy").ResourceBinding<never>[];
39
- newBindings: import("alchemy").Input<import("alchemy").ResourceBinding<never>[]>;
94
+ newBindings: Input<import("alchemy").ResourceBinding<never>[]>;
40
95
  output: EnvironmentVariablesAttributes | undefined;
41
96
  }) => Effect.Effect<{
42
97
  action: "update";
43
- } | undefined, EnvironmentTargetChange | ConvexClient.ConvexClientError, never>;
44
- read: (args_0: {
98
+ } | undefined, EnvironmentTargetChange | EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | OwnedBySomeoneElse | PushLockError | ConvexClient.ConvexClientError, never>;
99
+ read: (input: {
45
100
  id: string;
46
101
  fqn: string;
47
102
  instanceId: string;
@@ -54,8 +109,8 @@ export declare const provider: Effect.Effect<{
54
109
  originals: Readonly<Record<string, Redacted.Redacted<string>>>;
55
110
  deployKey: Redacted.Redacted<string>;
56
111
  variables: Record<string, Redacted.Redacted<string>>;
57
- } | undefined, ConvexClient.ConvexClientError, never>;
58
- reconcile: (args_0: {
112
+ } | undefined, EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | OwnedBySomeoneElse | PushLockError | ConvexClient.ConvexClientError, never>;
113
+ reconcile: (input: {
59
114
  id: string;
60
115
  fqn: string;
61
116
  instanceId: string;
@@ -70,8 +125,8 @@ export declare const provider: Effect.Effect<{
70
125
  ownedNames: string[];
71
126
  variables: Record<string, Redacted.Redacted<string>>;
72
127
  originals: Record<string, Redacted.Redacted<string>>;
73
- }, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | ConvexClient.ConvexNotFound | EnvironmentTargetChange | import("./internal/Lifecycle.js").LifecycleStateError | OwnedBySomeoneElse | import("alchemy/State/State").StateStoreError, never>;
74
- delete: (args_0: {
128
+ }, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | ConvexClient.ConvexNotFound | EnvironmentTargetChange | EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | import("./internal/Lifecycle.js").LifecycleStateError | OwnedBySomeoneElse | PushLockError | import("alchemy/State/State").StateStoreError, never>;
129
+ delete: (input: {
75
130
  id: string;
76
131
  fqn: string;
77
132
  instanceId: string;
@@ -80,7 +135,7 @@ export declare const provider: Effect.Effect<{
80
135
  session: import("alchemy/Report").ScopedPlanStatusSession;
81
136
  bindings: import("alchemy").ResourceBinding<never>[];
82
137
  force?: boolean;
83
- }) => Effect.Effect<void, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict, never>;
138
+ }) => Effect.Effect<void, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | PushLockError, never>;
84
139
  }, never, ConvexClient.ConvexClient>;
85
140
  /**
86
141
  * Under `alchemy dev` variables are managed on the local backend. A backend
@@ -88,19 +143,19 @@ export declare const provider: Effect.Effect<{
88
143
  * them is skipped rather than failing the apply.
89
144
  */
90
145
  export declare const localProvider: Effect.Effect<{
91
- diff: (args_0: {
146
+ diff: (input: {
92
147
  id: string;
93
148
  fqn: string;
94
149
  instanceId: string;
95
150
  olds: EnvironmentVariablesProps;
96
- news: import("alchemy").Input<EnvironmentVariablesProps>;
151
+ news: Input<EnvironmentVariablesProps>;
97
152
  oldBindings: import("alchemy").ResourceBinding<never>[];
98
- newBindings: import("alchemy").Input<import("alchemy").ResourceBinding<never>[]>;
153
+ newBindings: Input<import("alchemy").ResourceBinding<never>[]>;
99
154
  output: EnvironmentVariablesAttributes | undefined;
100
155
  }) => Effect.Effect<{
101
156
  action: "update";
102
- } | undefined, EnvironmentTargetChange | ConvexClient.ConvexClientError, never>;
103
- read: (args_0: {
157
+ } | undefined, EnvironmentTargetChange | EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | OwnedBySomeoneElse | PushLockError | ConvexClient.ConvexClientError, never>;
158
+ read: (input: {
104
159
  id: string;
105
160
  fqn: string;
106
161
  instanceId: string;
@@ -113,8 +168,8 @@ export declare const localProvider: Effect.Effect<{
113
168
  originals: Readonly<Record<string, Redacted.Redacted<string>>>;
114
169
  deployKey: Redacted.Redacted<string>;
115
170
  variables: Record<string, Redacted.Redacted<string>>;
116
- } | undefined, ConvexClient.ConvexClientError, never>;
117
- reconcile: (args_0: {
171
+ } | undefined, EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | OwnedBySomeoneElse | PushLockError | ConvexClient.ConvexClientError, never>;
172
+ reconcile: (input: {
118
173
  id: string;
119
174
  fqn: string;
120
175
  instanceId: string;
@@ -129,7 +184,7 @@ export declare const localProvider: Effect.Effect<{
129
184
  ownedNames: string[];
130
185
  variables: Record<string, Redacted.Redacted<string>>;
131
186
  originals: Record<string, Redacted.Redacted<string>>;
132
- }, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | ConvexClient.ConvexNotFound | EnvironmentTargetChange | import("./internal/Lifecycle.js").LifecycleStateError | OwnedBySomeoneElse | import("alchemy/State/State").StateStoreError, never>;
187
+ }, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | ConvexClient.ConvexNotFound | EnvironmentTargetChange | EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | import("./internal/Lifecycle.js").LifecycleStateError | OwnedBySomeoneElse | PushLockError | import("alchemy/State/State").StateStoreError, never>;
133
188
  delete: (input: {
134
189
  id: string;
135
190
  fqn: string;
@@ -139,7 +194,7 @@ export declare const localProvider: Effect.Effect<{
139
194
  session: import("alchemy/Report").ScopedPlanStatusSession;
140
195
  bindings: import("alchemy").ResourceBinding<never>[];
141
196
  force?: boolean;
142
- }) => Effect.Effect<void, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | Provider.ProviderError, never>;
197
+ }) => Effect.Effect<void, ConvexClient.ConvexApiError | ConvexClient.ConvexConflict | EnvironmentVariableDrift | EnvironmentVariableUnowned | EnvironmentVariablesInvalidOption | Provider.ProviderError | PushLockError, never>;
143
198
  }, never, ConvexClient.ConvexClient>;
144
199
  export declare const layer: Layer.Layer<Provider.Provider<EnvironmentVariables>, never, ConvexClient.ConvexClient>;
145
200
  export declare const localLayer: Layer.Layer<Provider.Provider<EnvironmentVariables>, never, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"EnvironmentVariables.d.ts","sources":["../src/EnvironmentVariables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAW,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAA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