@samebase/alchemy-convex 0.20.0 → 0.21.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/README.md +5 -0
- package/lib/{HubClient-Dzw8uZNy.js → HubClient-B6hjkbjW.js} +9 -9
- package/lib/{HubClient-Dzw8uZNy.js.map → HubClient-B6hjkbjW.js.map} +1 -1
- package/lib/cli.js +7 -5
- package/lib/cli.js.map +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/src/HubClient.ts +10 -5
- package/src/cli.ts +5 -4
package/README.md
CHANGED
|
@@ -333,6 +333,11 @@ of the app, before the first push: it registers the deployment of that directory
|
|
|
333
333
|
npx alchemy-convex hub-client --team my-team --app scout --callback-path /auth/hub/callback
|
|
334
334
|
```
|
|
335
335
|
|
|
336
|
+
For a separate API-connection callback, register another client with
|
|
337
|
+
`--callback-path /oauth/hub/callback --env-prefix RESOURCE_HUB`. This writes `RESOURCE_HUB_ISSUER`,
|
|
338
|
+
`RESOURCE_HUB_CLIENT_ID`, and `RESOURCE_HUB_CLIENT_SECRET`, preserving the sign-in client's
|
|
339
|
+
variables. Each callback remains one exact registered URI.
|
|
340
|
+
|
|
336
341
|
## Pull request comment
|
|
337
342
|
|
|
338
343
|
`alchemy-convex stack-comment` keeps one comment on a pull request. The comment has a card for each
|
|
@@ -1910,12 +1910,6 @@ const HubClientProvider = () => Provider.effect(HubClient, Effect.gen(function*
|
|
|
1910
1910
|
delete: ({ olds, output }) => unregister(api, olds.team, output.clientId).pipe(Effect.asVoid)
|
|
1911
1911
|
};
|
|
1912
1912
|
}));
|
|
1913
|
-
/** The variables that a deployment reads to sign in through the hub. */
|
|
1914
|
-
const HUB_VARIABLES = [
|
|
1915
|
-
"HUB_ISSUER",
|
|
1916
|
-
"HUB_CLIENT_ID",
|
|
1917
|
-
"HUB_CLIENT_SECRET"
|
|
1918
|
-
];
|
|
1919
1913
|
/**
|
|
1920
1914
|
* `alchemy-convex hub-client`: a stack deploys production and previews, and this covers the
|
|
1921
1915
|
* development deployment, which no stack deploys. A deployment with all three variables keeps
|
|
@@ -1924,12 +1918,18 @@ const HUB_VARIABLES = [
|
|
|
1924
1918
|
*/
|
|
1925
1919
|
const registerDevelopmentClient = (options) => Effect.gen(function* () {
|
|
1926
1920
|
const { convex } = options;
|
|
1921
|
+
const envPrefix = options.envPrefix ?? "HUB";
|
|
1922
|
+
const variables = [
|
|
1923
|
+
`${envPrefix}_ISSUER`,
|
|
1924
|
+
`${envPrefix}_CLIENT_ID`,
|
|
1925
|
+
`${envPrefix}_CLIENT_SECRET`
|
|
1926
|
+
];
|
|
1927
1927
|
const names = convex([
|
|
1928
1928
|
"env",
|
|
1929
1929
|
"list",
|
|
1930
1930
|
"--names-only"
|
|
1931
1931
|
]).split("\n");
|
|
1932
|
-
if (
|
|
1932
|
+
if (variables.every((name) => names.includes(name))) return void 0;
|
|
1933
1933
|
const siteUrl = yield* Schema.decodeUnknownEffect(Schema.fromJsonString(Schema.String))(convex([
|
|
1934
1934
|
"run",
|
|
1935
1935
|
"--inline-query",
|
|
@@ -1951,10 +1951,10 @@ const registerDevelopmentClient = (options) => Effect.gen(function* () {
|
|
|
1951
1951
|
"env",
|
|
1952
1952
|
"set",
|
|
1953
1953
|
"--force"
|
|
1954
|
-
],
|
|
1954
|
+
], `${envPrefix}_ISSUER='${client.issuer}'\n${envPrefix}_CLIENT_ID='${client.clientId}'\n${envPrefix}_CLIENT_SECRET='${Redacted.value(client.clientSecret)}'\n`);
|
|
1955
1955
|
return callbackUrl;
|
|
1956
1956
|
});
|
|
1957
1957
|
//#endregion
|
|
1958
1958
|
export { PushTargetMismatch as A, DEPLOY_KEY_ENV as B, DeploymentProvider as C, ConvexAppNotFound as D, CodePushFailed as E, ManagementApi as F, fromValues as H, ManagementApiLive as I, ACCESS_TOKEN_ENV as L, installedCli as M, parseDeployOutput as N, ConvexCliNotFound as O, ConvexApiError as P, Credentials as R, DeploymentIdentityChange as S, ProductionDeploymentNotFound as T, fromConfig as V, ProjectProvider as _, registerDevelopmentClient as a, AmbiguousDeployment as b, RUN_RECORD_KEY as c, withRunRecord as d, AmbiguousProject as f, ProjectNotFound as g, ProjectDeploymentChange as h, HubClientProvider as i, VariablesOwnedBySomeoneElse as j, EnvironmentNeedsDeployKey as k, RunRecordError as l, Project as m, HubClient as n, STORE_PROJECT_NAME as o, CreatedProjectNotFound as p, HubClientFailed as r, state as s, HUB_PROJECT_NAME as t, runRecord as u, ProjectTeamChange as v, DeploymentResource as w, Deployment as x, AbsoluteRootDir as y, CredentialsError as z };
|
|
1959
1959
|
|
|
1960
|
-
//# sourceMappingURL=HubClient-
|
|
1960
|
+
//# sourceMappingURL=HubClient-B6hjkbjW.js.map
|