@atlasauth/cli 0.6.0 → 0.8.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/CHANGELOG.md +21 -0
- package/README.md +5 -0
- package/dist/args.d.ts +34 -0
- package/dist/args.js +14 -0
- package/dist/args.js.map +1 -1
- package/dist/commands/actions-gallery.d.ts +8 -0
- package/dist/commands/actions-gallery.js +197 -0
- package/dist/commands/actions-gallery.js.map +1 -0
- package/dist/commands/actions.d.ts +2 -0
- package/dist/commands/actions.js +17 -2
- package/dist/commands/actions.js.map +1 -1
- package/dist/commands/config.d.ts +41 -1
- package/dist/commands/config.js +115 -26
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/import-better-auth.d.ts +3 -0
- package/dist/commands/import-better-auth.js +164 -0
- package/dist/commands/import-better-auth.js.map +1 -0
- package/dist/commands/import.js +7 -0
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/info.d.ts +75 -0
- package/dist/commands/info.js +362 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/migrate.d.ts +12 -0
- package/dist/commands/migrate.js +104 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/context.d.ts +9 -1
- package/dist/context.js.map +1 -1
- package/dist/help.d.ts +1 -1
- package/dist/help.js +102 -2
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/migrate/better-auth/integration.d.ts +59 -0
- package/dist/migrate/better-auth/integration.js +81 -0
- package/dist/migrate/better-auth/integration.js.map +1 -0
- package/dist/migrate/better-auth/orchestrator.d.ts +43 -0
- package/dist/migrate/better-auth/orchestrator.js +525 -0
- package/dist/migrate/better-auth/orchestrator.js.map +1 -0
- package/dist/migrate/better-auth/output.d.ts +20 -0
- package/dist/migrate/better-auth/output.js +146 -0
- package/dist/migrate/better-auth/output.js.map +1 -0
- package/dist/migrate/better-auth/translate.d.ts +77 -0
- package/dist/migrate/better-auth/translate.js +1989 -0
- package/dist/migrate/better-auth/translate.js.map +1 -0
- package/dist/run.js +4 -0
- package/dist/run.js.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlasauth/cli changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0 — 2026-10-24
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `atlas migrate better-auth [path]`: moves a Better Auth app to Atlas end to end in resumable steps (preflight, translate, apply, export, import, bridge, code, verify), saved in `atlas-migrate/state.json`. Supports `--dry-run`, `--yes`, `--resume`, `--force`, `--skip <step,...>`, `--json`, `--entry`, `--bundle`, `--run-export` and `--bridge-days`. Placeholders are filled from the environment and the app's `.env` files, and the values are only sent to Atlas.
|
|
8
|
+
- `atlas migrate better-auth config [path]`: reads the app's `betterAuth({...})` options without running it and writes `atlas config import` files plus `better-auth-report.md` / `.json`. The report sorts every option into maps 1:1, maps with a difference, and needs a manual step, each with its file and line. Secrets become `${ENV}` placeholders; a secret hard-coded in source is flagged and never copied.
|
|
9
|
+
- `atlas config import` / `export`: new `permissions` (applied before `roles`) and `custom_oauth_providers` resource files. Provider settings (Microsoft tenant, Okta domain, Apple team and key ids, SIWE domain) are passed through.
|
|
10
|
+
- `atlas import --from better-auth --bundle <file>`: uploads the encrypted bundle from `npx atlas-better-auth-export`, prints the dry-run report (per-model counts, conflicts, action items), asks, then imports with live progress. `--import <id>` applies an uploaded import or resumes one that stopped; `--dry-run`, `--confirm-conflicts`, `--options <json|@file>`, `--yes`, `--json`. With no bundle it prints the instance import key and the export command.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `atlas config import`: an `instance` file without `allowed_origins` now leaves the live origins as they are, instead of clearing them.
|
|
15
|
+
|
|
16
|
+
## 0.7.0 — 2026-10-24
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `atlas migrate code --from <clerk|authjs|supabase|auth0|better-auth> [path]`: rewrites an app's auth code onto Atlas. A dry run with a diff unless `--yes`; prints what needs a manual look with file and line, the packages to add and remove, and the env vars to set; `--json`.
|
|
21
|
+
- `atlas info [path]`: CLI, Node and OS versions, the framework and Atlas SDK packages with update-available from npm, the configured instance (key prefixes only) and whether the app's publishable key belongs to it, API reachability and latency, and the preflight summary; `--json`; secrets redacted.
|
|
22
|
+
- `atlas actions gallery | show | install | installs | update | publish`: the Actions gallery. Secret values come from `--secrets-file` (dotenv), never argv.
|
|
23
|
+
|
|
3
24
|
## 0.6.0 — 2026-10-23
|
|
4
25
|
|
|
5
26
|
### Added
|
package/README.md
CHANGED
|
@@ -48,6 +48,11 @@ atlas init --product <name> [--domain <d>] [--instance-env development|produ
|
|
|
48
48
|
atlas preflight [--instance <id> | --product <name>] [--fail-on error|warning]
|
|
49
49
|
atlas env --product <name> --format dotenv|coolify|vercel
|
|
50
50
|
atlas client rotate <client-id> [--now | --overlap <seconds>]
|
|
51
|
+
atlas import --from <vendor> <export-file> [--dry-run]
|
|
52
|
+
atlas migrate code --from <clerk|authjs|supabase|auth0|better-auth> [path] [--yes]
|
|
53
|
+
atlas info [path]
|
|
54
|
+
atlas actions list | deploy <file> | test <file> | gallery [query] | show <slug>
|
|
55
|
+
| install <slug> [--secrets-file f] | installs | update <id> | publish <template.json>
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
Every command takes `--json` for raw JSON (otherwise a human table). Paginated
|
package/dist/args.d.ts
CHANGED
|
@@ -67,6 +67,12 @@ declare const OPTIONS: {
|
|
|
67
67
|
readonly trigger: {
|
|
68
68
|
readonly type: "string";
|
|
69
69
|
};
|
|
70
|
+
readonly 'secrets-file': {
|
|
71
|
+
readonly type: "string";
|
|
72
|
+
};
|
|
73
|
+
readonly draft: {
|
|
74
|
+
readonly type: "boolean";
|
|
75
|
+
};
|
|
70
76
|
readonly product: {
|
|
71
77
|
readonly type: "string";
|
|
72
78
|
};
|
|
@@ -195,6 +201,34 @@ declare const OPTIONS: {
|
|
|
195
201
|
readonly 'create-orgs': {
|
|
196
202
|
readonly type: "boolean";
|
|
197
203
|
};
|
|
204
|
+
readonly bundle: {
|
|
205
|
+
readonly type: "string";
|
|
206
|
+
};
|
|
207
|
+
readonly import: {
|
|
208
|
+
readonly type: "string";
|
|
209
|
+
};
|
|
210
|
+
readonly 'confirm-conflicts': {
|
|
211
|
+
readonly type: "boolean";
|
|
212
|
+
};
|
|
213
|
+
readonly options: {
|
|
214
|
+
readonly type: "string";
|
|
215
|
+
};
|
|
216
|
+
readonly entry: {
|
|
217
|
+
readonly type: "string";
|
|
218
|
+
};
|
|
219
|
+
readonly 'run-export': {
|
|
220
|
+
readonly type: "boolean";
|
|
221
|
+
};
|
|
222
|
+
readonly 'bridge-days': {
|
|
223
|
+
readonly type: "string";
|
|
224
|
+
};
|
|
225
|
+
readonly resume: {
|
|
226
|
+
readonly type: "boolean";
|
|
227
|
+
};
|
|
228
|
+
readonly skip: {
|
|
229
|
+
readonly type: "string";
|
|
230
|
+
readonly multiple: true;
|
|
231
|
+
};
|
|
198
232
|
readonly cursor: {
|
|
199
233
|
readonly type: "boolean";
|
|
200
234
|
};
|
package/dist/args.js
CHANGED
|
@@ -39,6 +39,10 @@ const OPTIONS = {
|
|
|
39
39
|
prune: { type: 'boolean' },
|
|
40
40
|
// actions.
|
|
41
41
|
trigger: { type: 'string' },
|
|
42
|
+
// actions install / update: secret values from a dotenv file, never argv.
|
|
43
|
+
'secrets-file': { type: 'string' },
|
|
44
|
+
// actions publish: keep the new version a draft instead of submitting it.
|
|
45
|
+
draft: { type: 'boolean' },
|
|
42
46
|
// init / preflight / env / client rotate.
|
|
43
47
|
product: { type: 'string' },
|
|
44
48
|
domain: { type: 'string' },
|
|
@@ -87,6 +91,16 @@ const OPTIONS = {
|
|
|
87
91
|
'hash-config': { type: 'string' },
|
|
88
92
|
hashes: { type: 'string' },
|
|
89
93
|
'create-orgs': { type: 'boolean' },
|
|
94
|
+
// import --from better-auth --bundle <file> | --import <id>; migrate better-auth.
|
|
95
|
+
bundle: { type: 'string' },
|
|
96
|
+
import: { type: 'string' },
|
|
97
|
+
'confirm-conflicts': { type: 'boolean' },
|
|
98
|
+
options: { type: 'string' },
|
|
99
|
+
entry: { type: 'string' },
|
|
100
|
+
'run-export': { type: 'boolean' },
|
|
101
|
+
'bridge-days': { type: 'string' },
|
|
102
|
+
resume: { type: 'boolean' },
|
|
103
|
+
skip: { type: 'string', multiple: true },
|
|
90
104
|
// mcp install.
|
|
91
105
|
cursor: { type: 'boolean' },
|
|
92
106
|
'claude-code': { type: 'boolean' },
|
package/dist/args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":";;AA0HA,sBAeC;AAGD,kBAGC;AAGD,oBAOC;AAGD,sBAQC;AApKD,yCAAsC;AACtC,qCAAoC;AAEpC;;;;;GAKG;AACH,MAAM,OAAO,GAAG;IACd,UAAU;IACV,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;IACzB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,gBAAgB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACpC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACrC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE;IACxC,qDAAqD;IACrD,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACvB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,gBAAgB;IAChB,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC;AAED,yFAAyF;AACzF,SAAgB,KAAK,CAAC,MAAc;IAClC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,iBAAQ,CAAC,4CAA4C,GAAG,IAAI,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ParsedArgs } from '../args';
|
|
2
|
+
import type { RunContext } from '../context';
|
|
3
|
+
export declare function gallery(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
4
|
+
export declare function show(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
5
|
+
export declare function install(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
6
|
+
export declare function installs(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
7
|
+
export declare function update(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
8
|
+
export declare function publish(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gallery = gallery;
|
|
4
|
+
exports.show = show;
|
|
5
|
+
exports.install = install;
|
|
6
|
+
exports.installs = installs;
|
|
7
|
+
exports.update = update;
|
|
8
|
+
exports.publish = publish;
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
|
+
const args_1 = require("../args");
|
|
11
|
+
const errors_1 = require("../errors");
|
|
12
|
+
const output_1 = require("../output");
|
|
13
|
+
const secrets_1 = require("../secrets");
|
|
14
|
+
const shared_1 = require("./shared");
|
|
15
|
+
/**
|
|
16
|
+
* The gallery half of `atlas actions`:
|
|
17
|
+
*
|
|
18
|
+
* gallery [query] [--trigger t] browse first-party and community templates
|
|
19
|
+
* show <slug> a template's description, secrets and code
|
|
20
|
+
* install <slug> [--secrets-file f] install as a DISABLED action (secrets from a dotenv file)
|
|
21
|
+
* installs actions from the gallery, with update status
|
|
22
|
+
* update <action-id> [--secrets-file f]
|
|
23
|
+
* move an installed action to the latest version
|
|
24
|
+
* publish <template.json> [--draft] create or version your own template and submit it
|
|
25
|
+
*
|
|
26
|
+
* Secret VALUES come from a dotenv file, never from argv (shell history).
|
|
27
|
+
*/
|
|
28
|
+
const GALLERY_COLUMNS = [
|
|
29
|
+
{ header: 'SLUG', get: (t) => t.slug },
|
|
30
|
+
{ header: 'NAME', get: (t) => t.name },
|
|
31
|
+
{ header: 'TRIGGER', get: (t) => t.trigger },
|
|
32
|
+
{ header: 'BY', get: (t) => (t.author.first_party ? 'Atlas' : `${t.author.name}${t.verified ? ' ✓' : ''}`) },
|
|
33
|
+
{ header: 'VERSION', get: (t) => t.latest_version },
|
|
34
|
+
{ header: 'INSTALLS', get: (t) => t.install_count },
|
|
35
|
+
{ header: 'CALLS OUT', get: (t) => (t.uses_http ? 'yes' : '') },
|
|
36
|
+
];
|
|
37
|
+
const INSTALL_COLUMNS = [
|
|
38
|
+
{ header: 'ACTION', get: (i) => i.action_id },
|
|
39
|
+
{ header: 'NAME', get: (i) => i.action_name },
|
|
40
|
+
{ header: 'TEMPLATE', get: (i) => i.template_slug },
|
|
41
|
+
{ header: 'VERSION', get: (i) => i.installed_version },
|
|
42
|
+
{ header: 'LATEST', get: (i) => i.latest_version ?? 'removed' },
|
|
43
|
+
{ header: 'UPDATE', get: (i) => (i.update_available ? 'available' : '') },
|
|
44
|
+
{ header: 'ENABLED', get: (i) => i.enabled },
|
|
45
|
+
{ header: 'MISSING SECRETS', get: (i) => i.missing_secrets },
|
|
46
|
+
];
|
|
47
|
+
function secretsFrom(ctx, args) {
|
|
48
|
+
const file = (0, args_1.str)(args.values, 'secrets-file');
|
|
49
|
+
if (!file)
|
|
50
|
+
return undefined;
|
|
51
|
+
return (0, secrets_1.parseDotenv)(ctx.readFile(file));
|
|
52
|
+
}
|
|
53
|
+
async function gallery(ctx, args) {
|
|
54
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
55
|
+
const q = args.positionals.slice(2).join(' ').trim() || undefined;
|
|
56
|
+
const trigger = (0, args_1.str)(args.values, 'trigger');
|
|
57
|
+
const page = await client.actionGallery.list({ q, trigger });
|
|
58
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
59
|
+
(0, output_1.printJson)(ctx.io, page);
|
|
60
|
+
else {
|
|
61
|
+
ctx.io.out((0, output_1.renderTable)(GALLERY_COLUMNS, page.data));
|
|
62
|
+
ctx.io.out('');
|
|
63
|
+
ctx.io.out("Details: 'atlas actions show <slug>'. Install: 'atlas actions install <slug> [--secrets-file .env.action]'.");
|
|
64
|
+
}
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
async function show(ctx, args) {
|
|
68
|
+
const slug = (0, shared_1.requireArg)(args.positionals, 2, 'slug');
|
|
69
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
70
|
+
const t = await client.actionGallery.get(slug);
|
|
71
|
+
if ((0, shared_1.wantsJson)(args.values)) {
|
|
72
|
+
(0, output_1.printJson)(ctx.io, t);
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
ctx.io.out(`${t.name} (${t.slug} ${t.latest_version}, ${t.trigger})`);
|
|
76
|
+
ctx.io.out(`By ${t.author.first_party ? 'Atlas' : t.author.name}${t.verified && !t.author.first_party ? ' (verified)' : ''} · ${t.license} · ${t.install_count} install(s)`);
|
|
77
|
+
ctx.io.out('');
|
|
78
|
+
ctx.io.out(t.summary);
|
|
79
|
+
if (t.uses_http)
|
|
80
|
+
ctx.io.out('Sends outbound HTTPS requests (after the sign-in completes).');
|
|
81
|
+
ctx.io.out('');
|
|
82
|
+
ctx.io.out('Secrets:');
|
|
83
|
+
if (t.secrets.length === 0)
|
|
84
|
+
ctx.io.out(' (none)');
|
|
85
|
+
for (const s of t.secrets)
|
|
86
|
+
ctx.io.out(` ${s.name}${s.required ? ' (required)' : ''} ${s.description}`);
|
|
87
|
+
ctx.io.out('');
|
|
88
|
+
ctx.io.out('Code:');
|
|
89
|
+
ctx.io.out(t.code.replace(/^/gm, ' '));
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
async function install(ctx, args) {
|
|
93
|
+
const slug = (0, shared_1.requireArg)(args.positionals, 2, 'slug');
|
|
94
|
+
const secrets = secretsFrom(ctx, args);
|
|
95
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
96
|
+
const res = await client.actionGallery.install(slug, {
|
|
97
|
+
...((0, args_1.str)(args.values, 'name') ? { name: (0, args_1.str)(args.values, 'name') } : {}),
|
|
98
|
+
...(secrets ? { secrets } : {}),
|
|
99
|
+
});
|
|
100
|
+
if ((0, shared_1.wantsJson)(args.values)) {
|
|
101
|
+
(0, output_1.printJson)(ctx.io, res);
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
ctx.io.out(`Installed ${res.template.slug} ${res.template.version} as action ${res.action.id} (${res.action.name}), DISABLED.`);
|
|
105
|
+
if (res.missing_secrets.length > 0) {
|
|
106
|
+
ctx.io.out(`Still needs: ${res.missing_secrets.join(', ')}. Set them with 'atlas actions update ${res.action.id} --secrets-file <file>' or in the dashboard.`);
|
|
107
|
+
}
|
|
108
|
+
ctx.io.out(`Next: bind it to the ${res.action.trigger} flow and enable it (dashboard → Actions), after a dry run.`);
|
|
109
|
+
return 0;
|
|
110
|
+
}
|
|
111
|
+
async function installs(ctx, args) {
|
|
112
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
113
|
+
const page = await client.actionGallery.installs();
|
|
114
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
115
|
+
(0, output_1.printJson)(ctx.io, page);
|
|
116
|
+
else
|
|
117
|
+
ctx.io.out((0, output_1.renderTable)(INSTALL_COLUMNS, page.data));
|
|
118
|
+
return 0;
|
|
119
|
+
}
|
|
120
|
+
async function update(ctx, args) {
|
|
121
|
+
const id = (0, shared_1.requireArg)(args.positionals, 2, 'action-id');
|
|
122
|
+
const secrets = secretsFrom(ctx, args);
|
|
123
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
124
|
+
const res = await client.actionGallery.update(id, secrets ? { secrets } : {});
|
|
125
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
126
|
+
(0, output_1.printJson)(ctx.io, res);
|
|
127
|
+
else if (res.updated)
|
|
128
|
+
ctx.io.out(`Updated ${id} from ${res.from_version} to ${res.version}.`);
|
|
129
|
+
else
|
|
130
|
+
ctx.io.out(`${id} already runs the latest version (${res.version}).`);
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
async function publish(ctx, args) {
|
|
134
|
+
const file = (0, shared_1.requireArg)(args.positionals, 2, 'template.json');
|
|
135
|
+
let manifest;
|
|
136
|
+
try {
|
|
137
|
+
manifest = JSON.parse(ctx.readFile(file));
|
|
138
|
+
}
|
|
139
|
+
catch (err) {
|
|
140
|
+
throw new errors_1.CliError(`${file} is not valid JSON (${err.message}).`);
|
|
141
|
+
}
|
|
142
|
+
for (const key of ['slug', 'name', 'trigger', 'version']) {
|
|
143
|
+
if (!manifest[key])
|
|
144
|
+
throw new errors_1.CliError(`${file} needs "${key}".`);
|
|
145
|
+
}
|
|
146
|
+
const code = manifest.code ?? (manifest.code_file ? ctx.readFile((0, node_path_1.resolve)((0, node_path_1.dirname)(file), manifest.code_file)) : undefined);
|
|
147
|
+
if (!code?.trim())
|
|
148
|
+
throw new errors_1.CliError(`${file} needs "code" or "code_file".`);
|
|
149
|
+
const submit = args.values.draft !== true;
|
|
150
|
+
const { client } = (0, shared_1.requireClient)(ctx, args.values);
|
|
151
|
+
const mine = await client.actionTemplates.list();
|
|
152
|
+
const existing = mine.data.find((t) => t.slug === manifest.slug);
|
|
153
|
+
const version = { version: manifest.version, code, secrets: manifest.secrets ?? [], changelog: manifest.changelog, submit };
|
|
154
|
+
let result;
|
|
155
|
+
if (existing) {
|
|
156
|
+
const listing = {
|
|
157
|
+
name: manifest.name,
|
|
158
|
+
summary: manifest.summary,
|
|
159
|
+
description: manifest.description,
|
|
160
|
+
category: manifest.category,
|
|
161
|
+
tags: manifest.tags,
|
|
162
|
+
license: manifest.license,
|
|
163
|
+
repository_url: manifest.repository_url,
|
|
164
|
+
...(manifest.author_name ? { author_name: manifest.author_name } : {}),
|
|
165
|
+
};
|
|
166
|
+
await client.actionTemplates.update(existing.id, listing);
|
|
167
|
+
result = await client.actionTemplates.addVersion(existing.id, version);
|
|
168
|
+
if (!(0, shared_1.wantsJson)(args.values))
|
|
169
|
+
ctx.io.out(`Added ${manifest.slug} ${manifest.version}${submit ? ' and submitted it for review' : ' as a draft'}.`);
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
if (!manifest.author_name)
|
|
173
|
+
throw new errors_1.CliError(`${file} needs "author_name" (shown as the author) for a new template.`);
|
|
174
|
+
const body = {
|
|
175
|
+
slug: manifest.slug,
|
|
176
|
+
name: manifest.name,
|
|
177
|
+
author_name: manifest.author_name,
|
|
178
|
+
trigger: manifest.trigger,
|
|
179
|
+
summary: manifest.summary,
|
|
180
|
+
description: manifest.description,
|
|
181
|
+
category: manifest.category,
|
|
182
|
+
tags: manifest.tags,
|
|
183
|
+
license: manifest.license,
|
|
184
|
+
repository_url: manifest.repository_url,
|
|
185
|
+
...version,
|
|
186
|
+
};
|
|
187
|
+
result = await client.actionTemplates.create(body);
|
|
188
|
+
if (!(0, shared_1.wantsJson)(args.values))
|
|
189
|
+
ctx.io.out(`Created ${manifest.slug} ${manifest.version}${submit ? ' and submitted it for review' : ' as a draft'}.`);
|
|
190
|
+
}
|
|
191
|
+
if ((0, shared_1.wantsJson)(args.values))
|
|
192
|
+
(0, output_1.printJson)(ctx.io, result);
|
|
193
|
+
else if (submit)
|
|
194
|
+
ctx.io.out('It is listed in the gallery once approved; follow its status with --json or in the dashboard.');
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=actions-gallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-gallery.js","sourceRoot":"","sources":["../../src/commands/actions-gallery.ts"],"names":[],"mappings":";;AAwDA,0BAYC;AAED,oBAqBC;AAED,0BAkBC;AAED,4BAMC;AAED,wBASC;AAqBD,0BAuDC;AA9MD,yCAA6C;AAQ7C,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAgE;AAChE,wCAAyC;AACzC,qCAAgE;AAEhE;;;;;;;;;;;;GAYG;AAEH,MAAM,eAAe,GAAiC;IACpD,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;IACtC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;IACtC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE;IAC5C,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;IAC5G,EAAE,M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AC;QACvH,MAAM,IAAI,GAA6B;YACrC,IAAI,EAAE,QAAQ,CAAC,IAAK;YACpB,IAAI,EAAE,QAAQ,CAAC,IAAK;YACpB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,OAAO,EAAE,QAAQ,CAAC,OAAQ;YAC1B,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,cAAc,EAAE,QAAQ,CAAC,cAAc;YACvC,GAAG,OAAO;SACX,CAAC;QACF,MAAM,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,IAAA,kBAAS,EAAC,IAAI,CAAC,MAAM,CAAC;YAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC,aAAa,GAAG,CAAC,CAAC;IACrJ,CAAC;IACD,IAAI,IAAA,kBAAS,EAAC,IAAI,CAAC,MAAM,CAAC;QAAE,IAAA,kBAAS,EAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;SACjD,IAAI,MAAM;QAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,+FAA+F,CAAC,CAAC;IAC7H,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -7,5 +7,7 @@ import type { RunContext } from '../context';
|
|
|
7
7
|
* deploy <file> --trigger <t> upload a file's code as a new action
|
|
8
8
|
* test <file> [--trigger <t>] dry-run the file OFFLINE through @atlasauth/actions
|
|
9
9
|
* logs <id> where to find an action's execution history
|
|
10
|
+
* gallery | show | install | installs | update | publish
|
|
11
|
+
* the Actions gallery (see ./actions-gallery.ts)
|
|
10
12
|
*/
|
|
11
13
|
export declare function actions(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
package/dist/commands/actions.js
CHANGED
|
@@ -7,6 +7,7 @@ const args_1 = require("../args");
|
|
|
7
7
|
const errors_1 = require("../errors");
|
|
8
8
|
const output_1 = require("../output");
|
|
9
9
|
const shared_1 = require("./shared");
|
|
10
|
+
const actions_gallery_1 = require("./actions-gallery");
|
|
10
11
|
const COLUMNS = [
|
|
11
12
|
{ header: 'ID', get: (a) => a.id },
|
|
12
13
|
{ header: 'NAME', get: (a) => a.name },
|
|
@@ -32,6 +33,8 @@ function parseTrigger(raw) {
|
|
|
32
33
|
* deploy <file> --trigger <t> upload a file's code as a new action
|
|
33
34
|
* test <file> [--trigger <t>] dry-run the file OFFLINE through @atlasauth/actions
|
|
34
35
|
* logs <id> where to find an action's execution history
|
|
36
|
+
* gallery | show | install | installs | update | publish
|
|
37
|
+
* the Actions gallery (see ./actions-gallery.ts)
|
|
35
38
|
*/
|
|
36
39
|
async function actions(ctx, args) {
|
|
37
40
|
const sub = args.positionals[1];
|
|
@@ -111,10 +114,22 @@ async function actions(ctx, args) {
|
|
|
111
114
|
ctx.io.out(lines.join('\n'));
|
|
112
115
|
return 0;
|
|
113
116
|
}
|
|
117
|
+
case 'gallery':
|
|
118
|
+
return (0, actions_gallery_1.gallery)(ctx, args);
|
|
119
|
+
case 'show':
|
|
120
|
+
return (0, actions_gallery_1.show)(ctx, args);
|
|
121
|
+
case 'install':
|
|
122
|
+
return (0, actions_gallery_1.install)(ctx, args);
|
|
123
|
+
case 'installs':
|
|
124
|
+
return (0, actions_gallery_1.installs)(ctx, args);
|
|
125
|
+
case 'update':
|
|
126
|
+
return (0, actions_gallery_1.update)(ctx, args);
|
|
127
|
+
case 'publish':
|
|
128
|
+
return (0, actions_gallery_1.publish)(ctx, args);
|
|
114
129
|
default:
|
|
115
130
|
throw new errors_1.CliError(sub
|
|
116
|
-
? `Unknown subcommand 'actions ${sub}'. Try: list, deploy, test, logs.`
|
|
117
|
-
: 'actions needs a subcommand: list, deploy, test, logs.');
|
|
131
|
+
? `Unknown subcommand 'actions ${sub}'. Try: list, deploy, test, logs, gallery, show, install, installs, update, publish.`
|
|
132
|
+
: 'actions needs a subcommand: list, deploy, test, logs, gallery, show, install, installs, update, publish.');
|
|
118
133
|
}
|
|
119
134
|
}
|
|
120
135
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/commands/actions.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/commands/actions.ts"],"names":[],"mappings":";;AAwCA,0BAiGC;AAzID,yCAAqC;AAErC,gDAAiF;AACjF,kCAA+C;AAE/C,sCAAqC;AACrC,sCAAyE;AACzE,qCAAgE;AAChE,uDAAsF;AAEtF,MAAM,OAAO,GAAqB;IAChC,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IAClC,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE;IACtC,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE;IAC5C,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE;IAC5C,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE;IACjD,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,gBAAO,EAAC,CAAC,CAAC,UAAU,CAAC,EAAE;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AE,IAAI,CAAC,CAAC;QAC5B,KAAK,UAAU;YACb,OAAO,IAAA,0BAAQ,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,IAAA,wBAAM,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,IAAA,yBAAO,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAE5B;YACE,MAAM,IAAI,iBAAQ,CAChB,GAAG;gBACD,CAAC,CAAC,+BAA+B,GAAG,sFAAsF;gBAC1H,CAAC,CAAC,0GAA0G,CAC/G,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,44 @@
|
|
|
1
|
-
import { type ParsedArgs } from '../args';
|
|
1
|
+
import { type ParsedArgs, type Values } from '../args';
|
|
2
|
+
import { type ConfigHttp } from '../config-http';
|
|
2
3
|
import type { RunContext } from '../context';
|
|
4
|
+
import { type Format, type Json } from '../serialize';
|
|
3
5
|
/** `atlas config export|import` — Auth0 `deploy-cli`-style config-as-code. */
|
|
4
6
|
export declare function config(ctx: RunContext, args: ParsedArgs): Promise<number>;
|
|
7
|
+
export declare function resolveFormat(values: Values): Format;
|
|
8
|
+
export interface Change {
|
|
9
|
+
type: string;
|
|
10
|
+
action: 'create' | 'update' | 'delete';
|
|
11
|
+
key: string;
|
|
12
|
+
}
|
|
13
|
+
/** A planned change and the call that applies it. */
|
|
14
|
+
export interface PlannedChange extends Change {
|
|
15
|
+
apply: () => Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/** What `atlas config import` would do: the changes, the unchanged count and the skipped deletes. */
|
|
18
|
+
export interface ConfigPlan {
|
|
19
|
+
changes: PlannedChange[];
|
|
20
|
+
unchanged: number;
|
|
21
|
+
skippedDeletes: Change[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Diff a config directory against the live instance. Nothing is written: the
|
|
25
|
+
* returned changes carry their own `apply`. Used by `atlas config import` and by
|
|
26
|
+
* `atlas migrate better-auth` (which shows the plan before applying it).
|
|
27
|
+
*/
|
|
28
|
+
export declare function planConfigImport(http: ConfigHttp, opts: {
|
|
29
|
+
dir: string;
|
|
30
|
+
format: Format;
|
|
31
|
+
env: NodeJS.ProcessEnv;
|
|
32
|
+
prune: boolean;
|
|
33
|
+
}): Promise<ConfigPlan>;
|
|
34
|
+
export declare function printPlan(ctx: RunContext, changes: Change[], unchanged: number, skippedDeletes: Change[], opts: {
|
|
35
|
+
dryRun: boolean;
|
|
36
|
+
prune: boolean;
|
|
37
|
+
}): void;
|
|
38
|
+
/**
|
|
39
|
+
* Replace `${ENV_VAR}` placeholders inside any string with the environment's
|
|
40
|
+
* value — the one sanctioned way a secret enters an import without ever living
|
|
41
|
+
* on disk. An unset variable is left verbatim so the plan surfaces it rather
|
|
42
|
+
* than silently blanking a credential.
|
|
43
|
+
*/
|
|
44
|
+
export declare function interpolate(value: Json, env: NodeJS.ProcessEnv): Json;
|