@gaganref/confect-alchemy 0.0.0-stage → 10.3.1-fork.2

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 (113) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +22 -2
  3. package/dist/Backend.d.ts +45 -0
  4. package/dist/Backend.d.ts.map +1 -0
  5. package/dist/Backend.js +38 -0
  6. package/dist/Backend.js.map +1 -0
  7. package/dist/Code.d.ts +80 -0
  8. package/dist/Code.d.ts.map +1 -0
  9. package/dist/Code.js +29 -0
  10. package/dist/Code.js.map +1 -0
  11. package/dist/Confect.d.ts +2 -0
  12. package/dist/Confect.d.ts.map +1 -0
  13. package/dist/Confect.js +8 -0
  14. package/dist/Confect.js.map +1 -0
  15. package/dist/Convex.d.ts +7 -0
  16. package/dist/Convex.d.ts.map +1 -0
  17. package/dist/Convex.js +21 -0
  18. package/dist/Convex.js.map +1 -0
  19. package/dist/ConvexClient.d.ts +215 -0
  20. package/dist/ConvexClient.d.ts.map +1 -0
  21. package/dist/ConvexClient.js +224 -0
  22. package/dist/ConvexClient.js.map +1 -0
  23. package/dist/DeployKey.d.ts +120 -0
  24. package/dist/DeployKey.d.ts.map +1 -0
  25. package/dist/DeployKey.js +151 -0
  26. package/dist/DeployKey.js.map +1 -0
  27. package/dist/Deployment.d.ts +113 -0
  28. package/dist/Deployment.d.ts.map +1 -0
  29. package/dist/Deployment.js +160 -0
  30. package/dist/Deployment.js.map +1 -0
  31. package/dist/EnvironmentVariables.d.ts +155 -0
  32. package/dist/EnvironmentVariables.d.ts.map +1 -0
  33. package/dist/EnvironmentVariables.js +135 -0
  34. package/dist/EnvironmentVariables.js.map +1 -0
  35. package/dist/Project.d.ts +100 -0
  36. package/dist/Project.d.ts.map +1 -0
  37. package/dist/Project.js +123 -0
  38. package/dist/Project.js.map +1 -0
  39. package/dist/Providers.d.ts +17 -0
  40. package/dist/Providers.d.ts.map +1 -0
  41. package/dist/Providers.js +46 -0
  42. package/dist/Providers.js.map +1 -0
  43. package/dist/_virtual/_rolldown/runtime.js +13 -0
  44. package/dist/index.d.ts +3 -0
  45. package/dist/index.d.ts.map +1 -0
  46. package/dist/index.js +3 -0
  47. package/dist/internal/CodeDeployment.d.ts +17 -0
  48. package/dist/internal/CodeDeployment.d.ts.map +1 -0
  49. package/dist/internal/CodeDeployment.js +53 -0
  50. package/dist/internal/CodeDeployment.js.map +1 -0
  51. package/dist/internal/CommandRunner.d.ts +55 -0
  52. package/dist/internal/CommandRunner.d.ts.map +1 -0
  53. package/dist/internal/CommandRunner.js +126 -0
  54. package/dist/internal/CommandRunner.js.map +1 -0
  55. package/dist/internal/FileLock.d.ts +30 -0
  56. package/dist/internal/FileLock.d.ts.map +1 -0
  57. package/dist/internal/FileLock.js +83 -0
  58. package/dist/internal/FileLock.js.map +1 -0
  59. package/dist/internal/Lifecycle.d.ts +11 -0
  60. package/dist/internal/Lifecycle.d.ts.map +1 -0
  61. package/dist/internal/Lifecycle.js +45 -0
  62. package/dist/internal/Lifecycle.js.map +1 -0
  63. package/dist/internal/LocalBackend.d.ts +63 -0
  64. package/dist/internal/LocalBackend.d.ts.map +1 -0
  65. package/dist/internal/LocalBackend.js +333 -0
  66. package/dist/internal/LocalBackend.js.map +1 -0
  67. package/dist/internal/LocalSidecar.d.ts +3 -0
  68. package/dist/internal/LocalSidecar.d.ts.map +1 -0
  69. package/dist/internal/LocalSidecar.js +7 -0
  70. package/dist/internal/LocalSidecar.js.map +1 -0
  71. package/dist/internal/Loopback.d.ts +18 -0
  72. package/dist/internal/Loopback.d.ts.map +1 -0
  73. package/dist/internal/Loopback.js +31 -0
  74. package/dist/internal/Loopback.js.map +1 -0
  75. package/dist/internal/PushLock.d.ts +36 -0
  76. package/dist/internal/PushLock.d.ts.map +1 -0
  77. package/dist/internal/PushLock.js +61 -0
  78. package/dist/internal/PushLock.js.map +1 -0
  79. package/dist/internal/ResourceIdentity.d.ts +3 -0
  80. package/dist/internal/ResourceIdentity.d.ts.map +1 -0
  81. package/dist/internal/ResourceIdentity.js +10 -0
  82. package/dist/internal/ResourceIdentity.js.map +1 -0
  83. package/dist/internal/UserCache.d.ts +12 -0
  84. package/dist/internal/UserCache.d.ts.map +1 -0
  85. package/dist/internal/UserCache.js +25 -0
  86. package/dist/internal/UserCache.js.map +1 -0
  87. package/dist/internal/Zip.d.ts +15 -0
  88. package/dist/internal/Zip.d.ts.map +1 -0
  89. package/dist/internal/Zip.js +65 -0
  90. package/dist/internal/Zip.js.map +1 -0
  91. package/package.json +65 -3
  92. package/src/Backend.ts +101 -0
  93. package/src/Code.ts +55 -0
  94. package/src/Confect.ts +1 -0
  95. package/src/Convex.ts +18 -0
  96. package/src/ConvexClient.ts +544 -0
  97. package/src/DeployKey.ts +256 -0
  98. package/src/Deployment.ts +277 -0
  99. package/src/EnvironmentVariables.ts +254 -0
  100. package/src/Project.ts +205 -0
  101. package/src/Providers.ts +67 -0
  102. package/src/index.ts +2 -0
  103. package/src/internal/CodeDeployment.ts +81 -0
  104. package/src/internal/CommandRunner.ts +251 -0
  105. package/src/internal/FileLock.ts +136 -0
  106. package/src/internal/Lifecycle.ts +49 -0
  107. package/src/internal/LocalBackend.ts +492 -0
  108. package/src/internal/LocalSidecar.ts +9 -0
  109. package/src/internal/Loopback.ts +34 -0
  110. package/src/internal/PushLock.ts +99 -0
  111. package/src/internal/ResourceIdentity.ts +20 -0
  112. package/src/internal/UserCache.ts +25 -0
  113. package/src/internal/Zip.ts +108 -0
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ ISC License
2
+
3
+ Copyright 2024 RJ Dellecese
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,23 @@
1
- # Temporary Holding Version
1
+ # @confect/alchemy
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Alchemy resources for Convex cloud projects, deployments, deploy keys, environment variables, and code deployments. `Confect.Backend` runs Confect codegen before deploying an existing application.
4
+
5
+ ```ts
6
+ import { Confect, Convex } from "@confect/alchemy";
7
+ ```
8
+
9
+ Use `Convex.providers()` in your Alchemy stack. The integration targets Alchemy `2.0.0-beta.82` and Effect v4; it does not add Alchemy dependencies to Confect's runtime packages. Plain Convex applications can use `Convex.Code` without the Confect CLI.
10
+
11
+ See the [deployment guide](https://confect.dev/guides/alchemy) for complete examples, credentials, ownership, and deletion policies.
12
+
13
+ Projects and deployments are retained by default. Treat your Alchemy state as a secret store: it contains deployment credentials and managed environment values. Code deployment runs on every apply and never deletes data when removed from a stack. Pushes to one deployment from processes that share a user cache directory never overlap.
14
+
15
+ Under `alchemy dev`, the same resources run against a local Convex backend that the integration downloads, starts, and stops with the dev session. Its data and credentials live in `.alchemy/convex/<stack>/<stage>/<deployment>`.
16
+
17
+ ## Tests
18
+
19
+ Unit suites are per-module under `test/`. Cross-module lifecycle tests live under `test/integration/` and exercise Alchemy's engine with controlled API/process boundaries; they do not provision cloud resources. `test/integration/RealLocalBackend.test.ts` runs the pinned local backend: it downloads the release once into a cache under the OS temp directory, binds ports 3300-3399, and is skipped on Windows.
20
+
21
+ ```sh
22
+ pnpm exec vitest run --project @confect/alchemy
23
+ ```
@@ -0,0 +1,45 @@
1
+ import type * as Manifest from "@confect/core/Manifest";
2
+ import type { Input } from "alchemy/Input";
3
+ import * as Output from "alchemy/Output";
4
+ import * as Effect from "effect/Effect";
5
+ import type * as Redacted from "effect/Redacted";
6
+ import { Code } from "./Code";
7
+ import { EnvironmentVariables } from "./EnvironmentVariables";
8
+ interface CommonProps {
9
+ readonly deployment: {
10
+ readonly name: Input<string>;
11
+ readonly url: Input<string>;
12
+ };
13
+ readonly deployKey: Input<Redacted.Redacted<string>>;
14
+ readonly cwd?: string;
15
+ }
16
+ type Environment<M extends Manifest.Manifest> = {
17
+ readonly [K in keyof Manifest.Values<M>]: Input<Exclude<Manifest.Values<M>[K], undefined>>;
18
+ };
19
+ export type BackendProps<M extends Manifest.Manifest | undefined = undefined> = CommonProps & (M extends Manifest.Manifest ? {
20
+ readonly manifest: M;
21
+ } & ({} extends Manifest.Values<M> ? {
22
+ readonly env?: Environment<NoInfer<M>>;
23
+ } : {
24
+ readonly env: Environment<NoInfer<M>>;
25
+ }) : {
26
+ readonly manifest?: never;
27
+ readonly env?: Readonly<Record<string, Input<string | Redacted.Redacted<string>>>>;
28
+ });
29
+ /**
30
+ * Deploy a declared backend with env typed by its generated manifest.
31
+ */
32
+ export declare function Backend<const M extends Manifest.Manifest, const E extends Environment<NoInfer<M>> = Environment<NoInfer<M>>>(id: string, props: BackendProps<M> & {
33
+ readonly env?: E & Readonly<Record<Exclude<keyof E, keyof M["env"]>, never>>;
34
+ }): ReturnType<typeof backend>;
35
+ export declare function Backend(id: string, props: BackendProps): ReturnType<typeof backend>;
36
+ declare const backend: (id: string, props: CommonProps & {
37
+ readonly env?: Readonly<Record<string, Input<string | Redacted.Redacted<string>>>>;
38
+ }) => Effect.Effect<{
39
+ code: Code;
40
+ environment: EnvironmentVariables | undefined;
41
+ name: Output.Output<string, never>;
42
+ url: Output.Output<string, never>;
43
+ }, never, import("./Providers").Providers>;
44
+ export {};
45
+ //# sourceMappingURL=Backend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"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QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAC1D,CAAC;CACH;;;;;0CA6BA,CAAC"}
@@ -0,0 +1,38 @@
1
+ import { Code } from "./Code.js";
2
+ import { EnvironmentVariables } from "./EnvironmentVariables.js";
3
+ import * as Namespace from "alchemy/Namespace";
4
+ import * as Output from "alchemy/Output";
5
+ import * as Effect from "effect/Effect";
6
+ //#region src/Backend.ts
7
+ function Backend(id, props) {
8
+ return backend(id, props);
9
+ }
10
+ const backend = (id, props) => Namespace.push(id, Effect.gen(function* () {
11
+ const environment = props.env === void 0 ? void 0 : yield* EnvironmentVariables("Environment", {
12
+ url: props.deployment.url,
13
+ deployKey: props.deployKey,
14
+ variables: props.env
15
+ });
16
+ const code = yield* Code("Code", {
17
+ deployment: {
18
+ name: props.deployment.name,
19
+ url: environment ? Output.map(Output.all(environment.variables, environment.url), ([, url]) => url) : props.deployment.url
20
+ },
21
+ deployKey: props.deployKey,
22
+ ...props.cwd === void 0 ? {} : { cwd: props.cwd },
23
+ prepare: {
24
+ command: "confect",
25
+ args: ["codegen"]
26
+ }
27
+ });
28
+ return {
29
+ code,
30
+ environment,
31
+ name: code.name,
32
+ url: code.url
33
+ };
34
+ }));
35
+ //#endregion
36
+ export { Backend };
37
+
38
+ //# sourceMappingURL=Backend.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Backend.js","names":[],"sources":["../src/Backend.ts"],"sourcesContent":["import type * as Manifest from \"@confect/core/Manifest\";\nimport type { Input } from \"alchemy/Input\";\nimport * as Namespace from \"alchemy/Namespace\";\nimport * as Output from \"alchemy/Output\";\nimport * as Effect from \"effect/Effect\";\nimport type * as Redacted from \"effect/Redacted\";\nimport { Code } from \"./Code\";\nimport { EnvironmentVariables } from \"./EnvironmentVariables\";\n\ninterface CommonProps {\n readonly deployment: {\n readonly name: Input<string>;\n readonly url: Input<string>;\n };\n readonly deployKey: Input<Redacted.Redacted<string>>;\n readonly cwd?: string;\n}\n\ntype Environment<M extends Manifest.Manifest> = {\n readonly [K in keyof Manifest.Values<M>]: Input<\n Exclude<Manifest.Values<M>[K], undefined>\n >;\n};\n\nexport type BackendProps<M extends Manifest.Manifest | undefined = undefined> =\n CommonProps &\n (M extends Manifest.Manifest\n ? { readonly manifest: M } & ({} extends Manifest.Values<M>\n ? { readonly env?: Environment<NoInfer<M>> }\n : { readonly env: Environment<NoInfer<M>> })\n : {\n readonly manifest?: never;\n readonly env?: Readonly<\n Record<string, Input<string | Redacted.Redacted<string>>>\n >;\n });\n\n/**\n * Deploy a declared backend with env typed by its generated manifest.\n */\nexport function Backend<\n const M extends Manifest.Manifest,\n const E extends Environment<NoInfer<M>> = Environment<NoInfer<M>>,\n>(\n id: string,\n props: BackendProps<M> & {\n readonly env?: E &\n Readonly<Record<Exclude<keyof E, keyof M[\"env\"]>, never>>;\n },\n): ReturnType<typeof backend>;\nexport function Backend(\n id: string,\n props: BackendProps,\n): ReturnType<typeof backend>;\nexport function Backend(\n id: string,\n props: CommonProps & {\n readonly env?: Readonly<\n Record<string, Input<string | Redacted.Redacted<string>>>\n >;\n },\n): ReturnType<typeof backend> {\n return backend(id, props);\n}\n\nconst backend = (\n id: string,\n props: CommonProps & {\n readonly env?: Readonly<\n Record<string, Input<string | Redacted.Redacted<string>>>\n >;\n },\n) =>\n Namespace.push(\n id,\n Effect.gen(function* () {\n const environment =\n props.env === undefined\n ? undefined\n : yield* EnvironmentVariables(\"Environment\", {\n url: props.deployment.url,\n deployKey: props.deployKey,\n variables: props.env,\n });\n const code = yield* Code(\"Code\", {\n deployment: {\n name: props.deployment.name,\n url: environment\n ? Output.map(\n Output.all(environment.variables, environment.url),\n ([, url]) => url,\n )\n : props.deployment.url,\n },\n deployKey: props.deployKey,\n ...(props.cwd === undefined ? {} : { cwd: props.cwd }),\n prepare: { command: \"confect\", args: [\"codegen\"] },\n });\n return { code, environment, name: code.name, url: code.url };\n }),\n );\n"],"mappings":";;;;;;AAsDA,SAAgB,QACd,IACA,OAK4B;CAC5B,OAAO,QAAQ,IAAI,KAAK;AAC1B;AAEA,MAAM,WACJ,IACA,UAMA,UAAU,KACR,IACA,OAAO,IAAI,aAAa;CACtB,MAAM,cACJ,MAAM,QAAQ,KAAA,IACV,KAAA,IACA,OAAO,qBAAqB,eAAe;EACzC,KAAK,MAAM,WAAW;EACtB,WAAW,MAAM;EACjB,WAAW,MAAM;CACnB,CAAC;CACP,MAAM,OAAO,OAAO,KAAK,QAAQ;EAC/B,YAAY;GACV,MAAM,MAAM,WAAW;GACvB,KAAK,cACD,OAAO,IACL,OAAO,IAAI,YAAY,WAAW,YAAY,GAAG,IAChD,GAAG,SAAS,GACf,IACA,MAAM,WAAW;EACvB;EACA,WAAW,MAAM;EACjB,GAAI,MAAM,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,KAAK,MAAM,IAAI;EACpD,SAAS;GAAE,SAAS;GAAW,MAAM,CAAC,SAAS;EAAE;CACnD,CAAC;CACD,OAAO;EAAE;EAAM;EAAa,MAAM,KAAK;EAAM,KAAK,KAAK;CAAI;AAC7D,CAAC,CACH"}
package/dist/Code.d.ts ADDED
@@ -0,0 +1,80 @@
1
+ import * as Provider from "alchemy/Provider";
2
+ import { Resource } from "alchemy/Resource";
3
+ import * as Effect from "effect/Effect";
4
+ import type * as Redacted from "effect/Redacted";
5
+ import type { Providers } from "./Providers";
6
+ import { CommandRunner, type PrepareCommand } from "./internal/CommandRunner";
7
+ import { PushLock } from "./internal/PushLock";
8
+ export interface CodeProps {
9
+ readonly deployment: {
10
+ readonly name: string;
11
+ readonly url: string;
12
+ };
13
+ readonly deployKey: Redacted.Redacted<string>;
14
+ readonly cwd?: string;
15
+ readonly prepare?: PrepareCommand;
16
+ }
17
+ export interface CodeAttributes {
18
+ readonly name: string;
19
+ readonly url: string;
20
+ }
21
+ export type Code = Resource<"Convex.Code", CodeProps, CodeAttributes, never, Providers>;
22
+ export declare const Code: import("alchemy/Resource").ResourceClass<Code>;
23
+ export declare const provider: Effect.Effect<{
24
+ read: ({ output }: {
25
+ id: string;
26
+ fqn: string;
27
+ instanceId: string;
28
+ olds: CodeProps;
29
+ output: CodeAttributes | undefined;
30
+ }) => Effect.Effect<CodeAttributes | undefined, never, never>;
31
+ diff: () => Effect.Effect<{
32
+ action: "update";
33
+ }, never, never>;
34
+ reconcile: ({ news }: {
35
+ id: string;
36
+ fqn: string;
37
+ instanceId: string;
38
+ news: CodeProps;
39
+ olds: CodeProps | undefined;
40
+ output: CodeAttributes | undefined;
41
+ session: import("alchemy/Report").ScopedPlanStatusSession;
42
+ bindings: import("alchemy/Resource").ResourceBinding<never>[];
43
+ }) => Effect.Effect<{
44
+ name: string;
45
+ url: string;
46
+ }, import("./internal/CommandRunner").CommandError | import("./internal/CodeDeployment").InvalidDeploymentTarget | import("./internal/PushLock").PushLockError, never>;
47
+ delete: () => Effect.Effect<void, never, never>;
48
+ }, never, CommandRunner | PushLock>;
49
+ /**
50
+ * Under `alchemy dev`, pushes go to the local backend's self-hosted target.
51
+ */
52
+ export declare const localProvider: Effect.Effect<{
53
+ read: ({ output }: {
54
+ id: string;
55
+ fqn: string;
56
+ instanceId: string;
57
+ olds: CodeProps;
58
+ output: CodeAttributes | undefined;
59
+ }) => Effect.Effect<CodeAttributes | undefined, never, never>;
60
+ diff: () => Effect.Effect<{
61
+ action: "update";
62
+ }, never, never>;
63
+ reconcile: ({ news }: {
64
+ id: string;
65
+ fqn: string;
66
+ instanceId: string;
67
+ news: CodeProps;
68
+ olds: CodeProps | undefined;
69
+ output: CodeAttributes | undefined;
70
+ session: import("alchemy/Report").ScopedPlanStatusSession;
71
+ bindings: import("alchemy/Resource").ResourceBinding<never>[];
72
+ }) => Effect.Effect<{
73
+ name: string;
74
+ url: string;
75
+ }, import("./internal/CommandRunner").CommandError | import("./internal/CodeDeployment").InvalidDeploymentTarget | import("./internal/PushLock").PushLockError, never>;
76
+ delete: () => Effect.Effect<void, never, never>;
77
+ }, never, CommandRunner | PushLock>;
78
+ export declare const layer: import("effect/Layer").Layer<Provider.Provider<Code>, never, CommandRunner | PushLock>;
79
+ export declare const localLayer: import("effect/Layer").Layer<Provider.Provider<Code>, never, CommandRunner | PushLock>;
80
+ //# sourceMappingURL=Code.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../src/Code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,UAAU,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;CACnC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,IAAI,GAAG,QAAQ,CACzB,aAAa,EACb,SAAS,EACT,cAAc,EACd,KAAK,EACL,SAAS,CACV,CAAC;AACF,eAAO,MAAM,IAAI,gDAAgC,CAAC;AAkBlD,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;mCAAe,CAAC;AACrC;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;mCAAgB,CAAC;AAE3C,eAAO,MAAM,KAAK,wFAAkC,CAAC;AACrD,eAAO,MAAM,UAAU,wFAAuC,CAAC"}
package/dist/Code.js ADDED
@@ -0,0 +1,29 @@
1
+ import { CommandRunner } from "./internal/CommandRunner.js";
2
+ import { PushLock } from "./internal/PushLock.js";
3
+ import { deploy } from "./internal/CodeDeployment.js";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Provider from "alchemy/Provider";
6
+ import { Resource } from "alchemy/Resource";
7
+ //#region src/Code.ts
8
+ const Code = Resource("Convex.Code");
9
+ const make = (mode) => Effect.gen(function* () {
10
+ const runner = yield* CommandRunner;
11
+ const lock = yield* PushLock;
12
+ return {
13
+ read: ({ output }) => Effect.succeed(output),
14
+ diff: () => Effect.succeed({ action: "update" }),
15
+ reconcile: ({ news }) => deploy(news, mode).pipe(Effect.provideService(CommandRunner, runner), Effect.provideService(PushLock, lock)),
16
+ delete: () => Effect.void
17
+ };
18
+ });
19
+ const provider = make("live");
20
+ /**
21
+ * Under `alchemy dev`, pushes go to the local backend's self-hosted target.
22
+ */
23
+ const localProvider = make("local");
24
+ const layer = Provider.effect(Code, provider);
25
+ const localLayer = Provider.effect(Code, localProvider);
26
+ //#endregion
27
+ export { Code, layer, localLayer, localProvider, provider };
28
+
29
+ //# sourceMappingURL=Code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Code.js","names":[],"sources":["../src/Code.ts"],"sourcesContent":["import * as Provider from \"alchemy/Provider\";\nimport type { ProviderMode } from \"alchemy/ProviderMode\";\nimport { Resource } from \"alchemy/Resource\";\nimport * as Effect from \"effect/Effect\";\nimport type * as Redacted from \"effect/Redacted\";\nimport type { Providers } from \"./Providers\";\nimport { deploy } from \"./internal/CodeDeployment\";\nimport { CommandRunner, type PrepareCommand } from \"./internal/CommandRunner\";\nimport { PushLock } from \"./internal/PushLock\";\n\nexport interface CodeProps {\n readonly deployment: { readonly name: string; readonly url: string };\n readonly deployKey: Redacted.Redacted<string>;\n readonly cwd?: string;\n readonly prepare?: PrepareCommand;\n}\n\nexport interface CodeAttributes {\n readonly name: string;\n readonly url: string;\n}\n\nexport type Code = Resource<\n \"Convex.Code\",\n CodeProps,\n CodeAttributes,\n never,\n Providers\n>;\nexport const Code = Resource<Code>(\"Convex.Code\");\n\nconst make = (mode: ProviderMode) =>\n Effect.gen(function* () {\n const runner = yield* CommandRunner;\n const lock = yield* PushLock;\n return {\n read: ({ output }) => Effect.succeed(output),\n diff: () => Effect.succeed({ action: \"update\" }),\n reconcile: ({ news }) =>\n deploy(news, mode).pipe(\n Effect.provideService(CommandRunner, runner),\n Effect.provideService(PushLock, lock),\n ),\n delete: () => Effect.void,\n } satisfies Provider.ProviderServiceInput<Code>;\n });\n\nexport const provider = make(\"live\");\n/**\n * Under `alchemy dev`, pushes go to the local backend's self-hosted target.\n */\nexport const localProvider = make(\"local\");\n\nexport const layer = Provider.effect(Code, provider);\nexport const localLayer = Provider.effect(Code, localProvider);\n"],"mappings":";;;;;;;AA6BA,MAAa,OAAO,SAAe,aAAa;AAEhD,MAAM,QAAQ,SACZ,OAAO,IAAI,aAAa;CACtB,MAAM,SAAS,OAAO;CACtB,MAAM,OAAO,OAAO;CACpB,OAAO;EACL,OAAO,EAAE,aAAa,OAAO,QAAQ,MAAM;EAC3C,YAAY,OAAO,QAAQ,EAAE,QAAQ,SAAS,CAAC;EAC/C,YAAY,EAAE,WACZ,OAAO,MAAM,IAAI,CAAC,CAAC,KACjB,OAAO,eAAe,eAAe,MAAM,GAC3C,OAAO,eAAe,UAAU,IAAI,CACtC;EACF,cAAc,OAAO;CACvB;AACF,CAAC;AAEH,MAAa,WAAW,KAAK,MAAM;;;;AAInC,MAAa,gBAAgB,KAAK,OAAO;AAEzC,MAAa,QAAQ,SAAS,OAAO,MAAM,QAAQ;AACnD,MAAa,aAAa,SAAS,OAAO,MAAM,aAAa"}
@@ -0,0 +1,2 @@
1
+ export { Backend, type BackendProps } from "./Backend";
2
+ //# sourceMappingURL=Confect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Confect.d.ts","sourceRoot":"","sources":["../src/Confect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import { Backend } from "./Backend.js";
3
+ //#region src/Confect.ts
4
+ var Confect_exports = /* @__PURE__ */ __exportAll({ Backend: () => Backend });
5
+ //#endregion
6
+ export { Backend, Confect_exports };
7
+
8
+ //# sourceMappingURL=Confect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Confect.js","names":[],"sources":["../src/Confect.ts"],"sourcesContent":["export { Backend, type BackendProps } from \"./Backend\";\n"],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export { Project, type ProjectProps, type ProjectAttributes } from "./Project";
2
+ export { Deployment, type DeploymentProps, type DeploymentAttributes, } from "./Deployment";
3
+ export { DeployKey, type DeployKeyProps, type DeployKeyAttributes, } from "./DeployKey";
4
+ export { EnvironmentVariables, type EnvironmentVariablesProps, type EnvironmentVariablesAttributes, } from "./EnvironmentVariables";
5
+ export { Code, type CodeProps, type CodeAttributes } from "./Code";
6
+ export { providers, Providers } from "./Providers";
7
+ //# sourceMappingURL=Convex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Convex.d.ts","sourceRoot":"","sources":["../src/Convex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EACL,UAAU,EACV,KAAK,eAAe,EACpB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,GACpC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
package/dist/Convex.js ADDED
@@ -0,0 +1,21 @@
1
+ import { __exportAll } from "./_virtual/_rolldown/runtime.js";
2
+ import { Code } from "./Code.js";
3
+ import { EnvironmentVariables } from "./EnvironmentVariables.js";
4
+ import { Project } from "./Project.js";
5
+ import { Deployment } from "./Deployment.js";
6
+ import { DeployKey } from "./DeployKey.js";
7
+ import { Providers, providers } from "./Providers.js";
8
+ //#region src/Convex.ts
9
+ var Convex_exports = /* @__PURE__ */ __exportAll({
10
+ Code: () => Code,
11
+ DeployKey: () => DeployKey,
12
+ Deployment: () => Deployment,
13
+ EnvironmentVariables: () => EnvironmentVariables,
14
+ Project: () => Project,
15
+ Providers: () => Providers,
16
+ providers: () => providers
17
+ });
18
+ //#endregion
19
+ export { Code, Convex_exports, DeployKey, Deployment, EnvironmentVariables, Project, Providers, providers };
20
+
21
+ //# sourceMappingURL=Convex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Convex.js","names":[],"sources":["../src/Convex.ts"],"sourcesContent":["export { Project, type ProjectProps, type ProjectAttributes } from \"./Project\";\nexport {\n Deployment,\n type DeploymentProps,\n type DeploymentAttributes,\n} from \"./Deployment\";\nexport {\n DeployKey,\n type DeployKeyProps,\n type DeployKeyAttributes,\n} from \"./DeployKey\";\nexport {\n EnvironmentVariables,\n type EnvironmentVariablesProps,\n type EnvironmentVariablesAttributes,\n} from \"./EnvironmentVariables\";\nexport { Code, type CodeProps, type CodeAttributes } from \"./Code\";\nexport { providers, Providers } from \"./Providers\";\n"],"mappings":""}
@@ -0,0 +1,215 @@
1
+ import type * as DeploymentApi from "@convex-dev/platform/deploymentApi";
2
+ import type * as ManagementApi from "@convex-dev/platform/managementApi";
3
+ import type { ProviderMode } from "alchemy/ProviderMode";
4
+ import * as Context from "effect/Context";
5
+ import * as Effect from "effect/Effect";
6
+ import * as Layer from "effect/Layer";
7
+ import * as Redacted from "effect/Redacted";
8
+ import * as Schema from "effect/Schema";
9
+ import * as HttpClient from "effect/http/HttpClient";
10
+ export type Project = ManagementApi.ProjectResponse;
11
+ export type CreatedProject = ManagementApi.PlatformCreateProjectResponse;
12
+ export type Deployment = ManagementApi.PlatformDeploymentResponse;
13
+ export type DeployKey = Omit<ManagementApi.PlatformDeployKeyResponse, "allowedActions"> & {
14
+ readonly allowedActions: readonly string[];
15
+ };
16
+ export type CreateProjectInput = Pick<ManagementApi.PlatformCreateProjectArgs, "projectName">;
17
+ export type UpdateProjectInput = Pick<ManagementApi.PlatformUpdateProjectArgs, "name">;
18
+ export type CreateDeploymentInput = Pick<ManagementApi.PlatformCreateDeploymentArgs, "type" | "region" | "class"> & {
19
+ readonly reference: string;
20
+ };
21
+ export type UpdateDeploymentInput = Pick<ManagementApi.PlatformUpdateDeploymentArgs, "reference" | "expiresAt" | "sendLogsToClient">;
22
+ export type CreateDeployKeyInput = ManagementApi.PlatformCreateDeployKeyArgs;
23
+ export type CreatedDeployKey = {
24
+ readonly deployKey: Redacted.Redacted<ManagementApi.PlatformCreateDeployKeyResponse["deployKey"]>;
25
+ };
26
+ export type EnvironmentVariableChange = Omit<DeploymentApi.UpdateEnvVarRequest, "value"> & {
27
+ readonly value?: Exclude<DeploymentApi.UpdateEnvVarRequest["value"], undefined> | Redacted.Redacted<string>;
28
+ };
29
+ export type EnvironmentVariables = Readonly<Record<string, Redacted.Redacted<DeploymentApi.ListEnvVarsResponse["environmentVariables"][string]>>>;
30
+ declare const ConvexApiError_base: Schema.Class<ConvexApiError, Schema.TaggedStruct<"ConvexApiError", {
31
+ operation: Schema.String;
32
+ status: Schema.optionalKey<Schema.Finite>;
33
+ code: Schema.Literals<readonly ["HttpError", "TransportError", "InvalidResponse", "InvalidRequest", "InvalidPagination", "InvalidConfiguration"]>;
34
+ }>, import("effect/Cause").YieldableError>;
35
+ export declare class ConvexApiError extends ConvexApiError_base {
36
+ }
37
+ declare const ConvexNotFound_base: Schema.Class<ConvexNotFound, Schema.TaggedStruct<"ConvexNotFound", {
38
+ operation: Schema.String;
39
+ status: Schema.optionalKey<Schema.Finite>;
40
+ code: Schema.Literals<readonly ["HttpError", "TransportError", "InvalidResponse", "InvalidRequest", "InvalidPagination", "InvalidConfiguration"]>;
41
+ }>, import("effect/Cause").YieldableError>;
42
+ export declare class ConvexNotFound extends ConvexNotFound_base {
43
+ }
44
+ declare const ConvexConflict_base: Schema.Class<ConvexConflict, Schema.TaggedStruct<"ConvexConflict", {
45
+ operation: Schema.String;
46
+ status: Schema.optionalKey<Schema.Finite>;
47
+ code: Schema.Literals<readonly ["HttpError", "TransportError", "InvalidResponse", "InvalidRequest", "InvalidPagination", "InvalidConfiguration"]>;
48
+ }>, import("effect/Cause").YieldableError>;
49
+ export declare class ConvexConflict extends ConvexConflict_base {
50
+ }
51
+ export type ConvexClientError = ConvexApiError | ConvexNotFound | ConvexConflict;
52
+ declare const ConvexClient_base: Context.ServiceClass<ConvexClient, "@confect/alchemy/ConvexClient", {
53
+ listProjects: (teamId: number) => Effect.Effect<{
54
+ id: ManagementApi.components["schemas"]["ProjectId"];
55
+ name: ManagementApi.components["schemas"]["ProjectName"];
56
+ slug: ManagementApi.components["schemas"]["ProjectSlug"];
57
+ teamId: ManagementApi.components["schemas"]["TeamId"];
58
+ teamSlug: ManagementApi.components["schemas"]["TeamSlug"];
59
+ createTime: number;
60
+ prodDeploymentName?: string | null;
61
+ devDeploymentName?: string | null;
62
+ }[], ConvexApiError | ConvexConflict | ConvexNotFound, never>;
63
+ getProject: (projectId: number) => Effect.Effect<{
64
+ readonly id: number;
65
+ readonly name: string;
66
+ readonly slug: string;
67
+ readonly teamId: number;
68
+ readonly teamSlug: string;
69
+ readonly createTime: number;
70
+ readonly prodDeploymentName?: string | null;
71
+ readonly devDeploymentName?: string | null;
72
+ }, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
73
+ createProject: (teamId: number, input: CreateProjectInput) => Effect.Effect<{
74
+ readonly id: number;
75
+ readonly projectId: number;
76
+ readonly slug: string;
77
+ readonly deploymentName?: string | null;
78
+ readonly deploymentUrl?: string | null;
79
+ }, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
80
+ updateProject: (projectId: number, input: UpdateProjectInput) => Effect.Effect<{
81
+ readonly id: number;
82
+ readonly name: string;
83
+ readonly slug: string;
84
+ readonly teamId: number;
85
+ readonly teamSlug: string;
86
+ readonly createTime: number;
87
+ readonly prodDeploymentName?: string | null;
88
+ readonly devDeploymentName?: string | null;
89
+ }, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
90
+ deleteProject: (projectId: number) => Effect.Effect<void, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
91
+ listDeployments: (projectId: number) => Effect.Effect<readonly ({
92
+ readonly name: string;
93
+ readonly createTime: number;
94
+ readonly deploymentType: "custom" | "dev" | "preview" | "prod";
95
+ readonly projectId: number;
96
+ readonly previewIdentifier?: string | null;
97
+ readonly kind: "cloud";
98
+ readonly id: number;
99
+ readonly lastDeployTime?: number | null;
100
+ readonly creator?: number | null;
101
+ readonly region: "aws-ap-southeast-2" | "aws-ca-central-1" | "aws-eu-west-1" | "aws-us-east-1";
102
+ readonly isDefault: boolean;
103
+ readonly reference: string;
104
+ readonly dashboardEditConfirmation?: boolean | null;
105
+ readonly deploymentUrl: string;
106
+ readonly expiresAt?: number | null;
107
+ readonly class: string;
108
+ readonly sendLogsToClient?: boolean | null;
109
+ } | {
110
+ readonly name: string;
111
+ readonly createTime: number;
112
+ readonly deploymentType: "custom" | "dev" | "preview" | "prod";
113
+ readonly projectId: number;
114
+ readonly previewIdentifier?: string | null;
115
+ readonly kind: "local";
116
+ readonly creator: number;
117
+ readonly port: number;
118
+ readonly deviceName: string;
119
+ readonly isActive: boolean;
120
+ })[], ConvexApiError | ConvexConflict | ConvexNotFound, never>;
121
+ getDeployment: (name: string) => Effect.Effect<{
122
+ readonly name: string;
123
+ readonly createTime: number;
124
+ readonly deploymentType: "custom" | "dev" | "preview" | "prod";
125
+ readonly projectId: number;
126
+ readonly previewIdentifier?: string | null;
127
+ readonly kind: "cloud";
128
+ readonly id: number;
129
+ readonly lastDeployTime?: number | null;
130
+ readonly creator?: number | null;
131
+ readonly region: "aws-ap-southeast-2" | "aws-ca-central-1" | "aws-eu-west-1" | "aws-us-east-1";
132
+ readonly isDefault: boolean;
133
+ readonly reference: string;
134
+ readonly dashboardEditConfirmation?: boolean | null;
135
+ readonly deploymentUrl: string;
136
+ readonly expiresAt?: number | null;
137
+ readonly class: string;
138
+ readonly sendLogsToClient?: boolean | null;
139
+ } | {
140
+ readonly name: string;
141
+ readonly createTime: number;
142
+ readonly deploymentType: "custom" | "dev" | "preview" | "prod";
143
+ readonly projectId: number;
144
+ readonly previewIdentifier?: string | null;
145
+ readonly kind: "local";
146
+ readonly creator: number;
147
+ readonly port: number;
148
+ readonly deviceName: string;
149
+ readonly isActive: boolean;
150
+ }, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
151
+ createDeployment: (projectId: number, input: CreateDeploymentInput) => Effect.Effect<{
152
+ readonly name: string;
153
+ readonly createTime: number;
154
+ readonly deploymentType: "custom" | "dev" | "preview" | "prod";
155
+ readonly projectId: number;
156
+ readonly previewIdentifier?: string | null;
157
+ readonly kind: "cloud";
158
+ readonly id: number;
159
+ readonly lastDeployTime?: number | null;
160
+ readonly creator?: number | null;
161
+ readonly region: "aws-ap-southeast-2" | "aws-ca-central-1" | "aws-eu-west-1" | "aws-us-east-1";
162
+ readonly isDefault: boolean;
163
+ readonly reference: string;
164
+ readonly dashboardEditConfirmation?: boolean | null;
165
+ readonly deploymentUrl: string;
166
+ readonly expiresAt?: number | null;
167
+ readonly class: string;
168
+ readonly sendLogsToClient?: boolean | null;
169
+ } | {
170
+ readonly name: string;
171
+ readonly createTime: number;
172
+ readonly deploymentType: "custom" | "dev" | "preview" | "prod";
173
+ readonly projectId: number;
174
+ readonly previewIdentifier?: string | null;
175
+ readonly kind: "local";
176
+ readonly creator: number;
177
+ readonly port: number;
178
+ readonly deviceName: string;
179
+ readonly isActive: boolean;
180
+ }, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
181
+ updateDeployment: (name: string, input: UpdateDeploymentInput) => Effect.Effect<void, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
182
+ deleteDeployment: (name: string) => Effect.Effect<void, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
183
+ createDeployKey: (name: string, input: {
184
+ name: string;
185
+ allowedActions?: ("deployment:deploy" | "deployment:env:view" | "deployment:env:write" | "deployment:pause" | "deployment:unpause" | "deployment:logs:view" | "deployment:metrics:view" | "deployment:integrations:view" | "deployment:integrations:write" | "deployment:data:view" | "deployment:data:write" | "deployment:backups:view" | "deployment:backups:create" | "deployment:backups:download" | "deployment:backups:delete" | "deployment:backups:import" | "deployment:functions:actAsUser" | "deployment:functions:runInternalQueries" | "deployment:functions:runInternalMutations" | "deployment:functions:runInternalActions" | "deployment:functions:runTestQuery" | "deployment:auditLog:view" | "deployment:usageLimits:view" | "deployment:usageLimits:write" | "deployment:usage:view" | "deployment:aiGateway:use")[];
186
+ expiresAt?: number | null;
187
+ }) => Effect.Effect<CreatedDeployKey, ConvexClientError, never>;
188
+ listDeployKeys: (name: string) => Effect.Effect<readonly {
189
+ readonly id: number;
190
+ readonly name: string;
191
+ readonly creationTime: number;
192
+ readonly lastUsedTime?: number | null;
193
+ readonly expiresAt?: number | null;
194
+ readonly creator?: number | null;
195
+ readonly managedBy?: "vercel" | {
196
+ readonly oauthApp: string;
197
+ } | null;
198
+ readonly allowedActions: readonly string[];
199
+ }[], ConvexApiError | ConvexConflict | ConvexNotFound, never>;
200
+ deleteDeployKey: (name: string, id: string | Redacted.Redacted<string>) => Effect.Effect<void, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
201
+ listEnvironmentVariables: (url: string, key: Redacted.Redacted<string>) => Effect.Effect<Readonly<Record<string, Redacted.Redacted<string>>>, ConvexClientError, never>;
202
+ updateEnvironmentVariables: (url: string, key: Redacted.Redacted<string>, changes: readonly EnvironmentVariableChange[]) => Effect.Effect<void, ConvexApiError | ConvexConflict | ConvexNotFound, never>;
203
+ }>;
204
+ export declare class ConvexClient extends ConvexClient_base {
205
+ }
206
+ /**
207
+ * `mode: "local"` sends deployment requests only to a loopback backend over
208
+ * HTTP; the default accepts only Convex cloud HTTPS origins.
209
+ */
210
+ export declare const layer: (options?: {
211
+ readonly token?: Redacted.Redacted<string>;
212
+ readonly mode?: ProviderMode;
213
+ }) => Layer.Layer<ConvexClient, never, HttpClient.HttpClient>;
214
+ export {};
215
+ //# sourceMappingURL=ConvexClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConvexClient.d.ts","sourceRoot":"","sources":["../src/ConvexClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,KAAK,aAAa,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAKrD,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,eAAe,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC,6BAA6B,CAAC;AACzE,MAAM,MAAM,UAAU,GAAG,aAAa,CA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