@nebulr-group/bridge-cli 0.1.0-beta.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 +202 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +6 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +33 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/app.command.d.ts +3 -0
- package/dist/commands/app.command.d.ts.map +1 -0
- package/dist/commands/app.command.js +59 -0
- package/dist/commands/app.command.js.map +1 -0
- package/dist/commands/auth.command.d.ts +3 -0
- package/dist/commands/auth.command.d.ts.map +1 -0
- package/dist/commands/auth.command.js +58 -0
- package/dist/commands/auth.command.js.map +1 -0
- package/dist/commands/branding.command.d.ts +3 -0
- package/dist/commands/branding.command.d.ts.map +1 -0
- package/dist/commands/branding.command.js +42 -0
- package/dist/commands/branding.command.js.map +1 -0
- package/dist/commands/event.command.d.ts +3 -0
- package/dist/commands/event.command.d.ts.map +1 -0
- package/dist/commands/event.command.js +27 -0
- package/dist/commands/event.command.js.map +1 -0
- package/dist/commands/flag.command.d.ts +3 -0
- package/dist/commands/flag.command.d.ts.map +1 -0
- package/dist/commands/flag.command.js +76 -0
- package/dist/commands/flag.command.js.map +1 -0
- package/dist/commands/guide.command.d.ts +3 -0
- package/dist/commands/guide.command.d.ts.map +1 -0
- package/dist/commands/guide.command.js +168 -0
- package/dist/commands/guide.command.js.map +1 -0
- package/dist/commands/info.command.d.ts +3 -0
- package/dist/commands/info.command.d.ts.map +1 -0
- package/dist/commands/info.command.js +70 -0
- package/dist/commands/info.command.js.map +1 -0
- package/dist/commands/integrate.command.d.ts +3 -0
- package/dist/commands/integrate.command.d.ts.map +1 -0
- package/dist/commands/integrate.command.js +49 -0
- package/dist/commands/integrate.command.js.map +1 -0
- package/dist/commands/plan.command.d.ts +3 -0
- package/dist/commands/plan.command.d.ts.map +1 -0
- package/dist/commands/plan.command.js +52 -0
- package/dist/commands/plan.command.js.map +1 -0
- package/dist/commands/role.command.d.ts +3 -0
- package/dist/commands/role.command.d.ts.map +1 -0
- package/dist/commands/role.command.js +65 -0
- package/dist/commands/role.command.js.map +1 -0
- package/dist/commands/setup.command.d.ts +3 -0
- package/dist/commands/setup.command.d.ts.map +1 -0
- package/dist/commands/setup.command.js +65 -0
- package/dist/commands/setup.command.js.map +1 -0
- package/dist/commands/tenant.command.d.ts +3 -0
- package/dist/commands/tenant.command.d.ts.map +1 -0
- package/dist/commands/tenant.command.js +74 -0
- package/dist/commands/tenant.command.js.map +1 -0
- package/dist/commands/token.command.d.ts +3 -0
- package/dist/commands/token.command.d.ts.map +1 -0
- package/dist/commands/token.command.js +45 -0
- package/dist/commands/token.command.js.map +1 -0
- package/dist/commands/user.command.d.ts +3 -0
- package/dist/commands/user.command.d.ts.map +1 -0
- package/dist/commands/user.command.js +83 -0
- package/dist/commands/user.command.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +30 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +3 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +34 -0
- package/dist/output.js.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# @nebulr-group/bridge-cli
|
|
2
|
+
|
|
3
|
+
CLI for the Bridge platform — optimized for AI coding agents (Claude Code, Cursor, Copilot) and developers.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @nebulr-group/bridge-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or run directly with npx:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @nebulr-group/bridge-cli tenant list
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Authentication
|
|
18
|
+
|
|
19
|
+
Set your Bridge API key as an environment variable:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
export BRIDGE_API_KEY=<your-api-token>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Optional configuration:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
export BRIDGE_BASE_URL=https://account-api.thebridge.dev # default
|
|
29
|
+
export BRIDGE_TENANT_ID=<tenant-id> # for user commands
|
|
30
|
+
export BRIDGE_DEBUG=true # enable debug logging
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
All output is JSON by default. AI agents parse it directly; humans can pipe through `jq`.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bridge <command> <subcommand> [options]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### App
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bridge app get
|
|
45
|
+
bridge app update --name "My App" --mfa-enabled true
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Tenants
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bridge tenant list
|
|
52
|
+
bridge tenant get --id <tenant-id>
|
|
53
|
+
bridge tenant create --owner-email admin@acme.com --name "Acme Corp" --plan enterprise
|
|
54
|
+
bridge tenant update --id <tenant-id> --name "Acme Corp Updated"
|
|
55
|
+
bridge tenant delete --id <tenant-id>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Users
|
|
59
|
+
|
|
60
|
+
Requires tenant context via `--tenant-id` or `BRIDGE_TENANT_ID`.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
bridge user list --tenant-id <tenant-id>
|
|
64
|
+
bridge user get --user-id <user-id> --tenant-id <tenant-id>
|
|
65
|
+
bridge user invite --email alice@acme.com --role ADMIN --tenant-id <tenant-id>
|
|
66
|
+
bridge user update --user-id <user-id> --role OWNER --tenant-id <tenant-id>
|
|
67
|
+
bridge user remove --user-id <user-id> --tenant-id <tenant-id>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Access Roles
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
bridge role list
|
|
74
|
+
bridge role create --name Editor --key editor --privileges READ,WRITE
|
|
75
|
+
bridge role update --id <role-id> --privileges READ,WRITE,DELETE
|
|
76
|
+
bridge role delete --id <role-id>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Feature Flags
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bridge flag list
|
|
83
|
+
bridge flag create --key dark-mode --description "Dark mode UI" --enabled
|
|
84
|
+
bridge flag update --id <flag-id> --enabled true
|
|
85
|
+
bridge flag toggle --id <flag-id> --enabled true
|
|
86
|
+
bridge flag delete --id <flag-id>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Auth Configuration
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
bridge auth config
|
|
93
|
+
bridge auth mfa --enabled true
|
|
94
|
+
bridge auth password-policy --access-token-ttl 3600
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Branding
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
bridge branding get
|
|
101
|
+
bridge branding update --bg-color "#ffffff" --text-color "#000000"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Subscription Plans
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
bridge plan list
|
|
108
|
+
bridge plan create --key pro --name "Pro Plan"
|
|
109
|
+
bridge plan update --key pro --name "Pro Plan v2"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### API Tokens
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bridge token list
|
|
116
|
+
bridge token create --name "CI Token" --privileges USER_READ,TENANT_READ
|
|
117
|
+
bridge token revoke --id <token-id>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Events
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
bridge event list
|
|
124
|
+
bridge event list --type USER_CREATED --since 24h --limit 50
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Setup Workflows (multi-step)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
bridge setup sso --provider google --client-id <id> --client-secret <secret>
|
|
131
|
+
bridge setup payments --stripe-key sk_test_xxx
|
|
132
|
+
bridge setup communication --provider sendgrid --api-key <key> --from-address noreply@acme.com
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Info (context for AI agents)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
bridge info app
|
|
139
|
+
bridge info auth-config
|
|
140
|
+
bridge info flags
|
|
141
|
+
bridge info plans
|
|
142
|
+
bridge info roles
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Integration Guides
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
bridge guide list
|
|
149
|
+
bridge guide react
|
|
150
|
+
bridge guide nextjs
|
|
151
|
+
bridge guide express
|
|
152
|
+
bridge guide custom
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Output Format
|
|
156
|
+
|
|
157
|
+
**Success:**
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"success": true,
|
|
162
|
+
"data": { ... }
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Error:**
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"success": false,
|
|
171
|
+
"error": {
|
|
172
|
+
"code": "TENANT_HAS_ACTIVE_SUBSCRIPTION",
|
|
173
|
+
"message": "Cannot delete tenant with active subscription.",
|
|
174
|
+
"details": { ... }
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## Exit Codes
|
|
180
|
+
|
|
181
|
+
| Code | Meaning |
|
|
182
|
+
|------|---------|
|
|
183
|
+
| 0 | Success |
|
|
184
|
+
| 1 | Client error (4xx) |
|
|
185
|
+
| 2 | Server error (5xx) |
|
|
186
|
+
| 3 | Configuration error (missing API key, etc.) |
|
|
187
|
+
|
|
188
|
+
## Development
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Install dependencies
|
|
192
|
+
npm install
|
|
193
|
+
|
|
194
|
+
# Build
|
|
195
|
+
npm run build
|
|
196
|
+
|
|
197
|
+
# Run locally
|
|
198
|
+
node bridge-cli/dist/bin.js --help
|
|
199
|
+
|
|
200
|
+
# Package
|
|
201
|
+
npm run package
|
|
202
|
+
```
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;IAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { registerAppCommands } from './commands/app.command.js';
|
|
3
|
+
import { registerTenantCommands } from './commands/tenant.command.js';
|
|
4
|
+
import { registerUserCommands } from './commands/user.command.js';
|
|
5
|
+
import { registerRoleCommands } from './commands/role.command.js';
|
|
6
|
+
import { registerFlagCommands } from './commands/flag.command.js';
|
|
7
|
+
import { registerAuthCommands } from './commands/auth.command.js';
|
|
8
|
+
import { registerBrandingCommands } from './commands/branding.command.js';
|
|
9
|
+
import { registerPlanCommands } from './commands/plan.command.js';
|
|
10
|
+
import { registerTokenCommands } from './commands/token.command.js';
|
|
11
|
+
import { registerEventCommands } from './commands/event.command.js';
|
|
12
|
+
import { registerSetupCommands } from './commands/setup.command.js';
|
|
13
|
+
import { registerInfoCommands } from './commands/info.command.js';
|
|
14
|
+
import { registerGuideCommands } from './commands/guide.command.js';
|
|
15
|
+
export const program = new Command();
|
|
16
|
+
program
|
|
17
|
+
.name('bridge')
|
|
18
|
+
.description('Bridge platform CLI — optimized for AI coding agents')
|
|
19
|
+
.version('0.1.0-alpha.1');
|
|
20
|
+
registerAppCommands(program);
|
|
21
|
+
registerTenantCommands(program);
|
|
22
|
+
registerUserCommands(program);
|
|
23
|
+
registerRoleCommands(program);
|
|
24
|
+
registerFlagCommands(program);
|
|
25
|
+
registerAuthCommands(program);
|
|
26
|
+
registerBrandingCommands(program);
|
|
27
|
+
registerPlanCommands(program);
|
|
28
|
+
registerTokenCommands(program);
|
|
29
|
+
registerEventCommands(program);
|
|
30
|
+
registerSetupCommands(program);
|
|
31
|
+
registerInfoCommands(program);
|
|
32
|
+
registerGuideCommands(program);
|
|
33
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACt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,qBAAqB,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.command.d.ts","sourceRoot":"","sources":["../../src/commands/app.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyC1D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getManagementClient } from '../config.js';
|
|
2
|
+
import { outputSuccess, outputError } from '../output.js';
|
|
3
|
+
export function registerAppCommands(program) {
|
|
4
|
+
const app = program.command('app').description('Manage app configuration');
|
|
5
|
+
app.command('get')
|
|
6
|
+
.description('Get current app configuration')
|
|
7
|
+
.action(async () => {
|
|
8
|
+
try {
|
|
9
|
+
outputSuccess(await getManagementClient().app.get());
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
outputError(err);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
app.command('update')
|
|
16
|
+
.description('Update app settings')
|
|
17
|
+
.option('--name <name>', 'App name')
|
|
18
|
+
.option('--api-url <url>', 'API URL')
|
|
19
|
+
.option('--ui-url <url>', 'UI URL')
|
|
20
|
+
.option('--webhook-url <url>', 'Webhook URL')
|
|
21
|
+
.option('--tenant-self-signup <bool>', 'Allow tenant self-signup', parseBool)
|
|
22
|
+
.option('--mfa-enabled <bool>', 'Enable MFA', parseBool)
|
|
23
|
+
.option('--passkeys-enabled <bool>', 'Enable passkeys', parseBool)
|
|
24
|
+
.option('--magic-link-enabled <bool>', 'Enable magic links', parseBool)
|
|
25
|
+
.option('--redirect-uris <uris>', 'Comma-separated list of allowed OAuth callback URIs', parseList)
|
|
26
|
+
.option('--allowed-origins <origins>', 'Comma-separated list of allowed CORS origins', parseList)
|
|
27
|
+
.option('--default-callback-uri <uri>', 'Default OAuth callback URI')
|
|
28
|
+
.action(async (opts) => {
|
|
29
|
+
try {
|
|
30
|
+
const data = stripUndefined({
|
|
31
|
+
name: opts.name,
|
|
32
|
+
apiUrl: opts.apiUrl,
|
|
33
|
+
uiUrl: opts.uiUrl,
|
|
34
|
+
webhookUrl: opts.webhookUrl,
|
|
35
|
+
tenantSelfSignup: opts.tenantSelfSignup,
|
|
36
|
+
mfaEnabled: opts.mfaEnabled,
|
|
37
|
+
passkeysEnabled: opts.passkeysEnabled,
|
|
38
|
+
magicLinkEnabled: opts.magicLinkEnabled,
|
|
39
|
+
redirectUris: opts.redirectUris,
|
|
40
|
+
allowedOrigins: opts.allowedOrigins,
|
|
41
|
+
defaultCallbackUri: opts.defaultCallbackUri,
|
|
42
|
+
});
|
|
43
|
+
outputSuccess(await getManagementClient().app.update(data));
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
outputError(err);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function parseBool(val) {
|
|
51
|
+
return val === 'true';
|
|
52
|
+
}
|
|
53
|
+
function parseList(val) {
|
|
54
|
+
return val.split(',').map((s) => s.trim()).filter(Boolean);
|
|
55
|
+
}
|
|
56
|
+
function stripUndefined(obj) {
|
|
57
|
+
return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=app.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.command.js","sourceRoot":"","sources":["../../src/commands/app.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAE3E,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC;SACf,W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
import { getManagementClient } from '../config.js';
|
|
2
|
+
import { outputSuccess, outputError } from '../output.js';
|
|
3
|
+
export function registerAuthCommands(program) {
|
|
4
|
+
const auth = program.command('auth').description('Manage authentication configuration');
|
|
5
|
+
auth.command('config')
|
|
6
|
+
.description('Get current auth configuration')
|
|
7
|
+
.action(async () => {
|
|
8
|
+
try {
|
|
9
|
+
const app = await getManagementClient().app.get();
|
|
10
|
+
outputSuccess({
|
|
11
|
+
mfaEnabled: app.mfaEnabled,
|
|
12
|
+
passkeysEnabled: app.passkeysEnabled,
|
|
13
|
+
magicLinkEnabled: app.magicLinkEnabled,
|
|
14
|
+
googleSsoEnabled: app.googleSsoEnabled,
|
|
15
|
+
azureAdSsoEnabled: app.azureAdSsoEnabled,
|
|
16
|
+
githubSsoEnabled: app.githubSsoEnabled,
|
|
17
|
+
linkedinSsoEnabled: app.linkedinSsoEnabled,
|
|
18
|
+
facebookSsoEnabled: app.facebookSsoEnabled,
|
|
19
|
+
appleSsoEnabled: app.appleSsoEnabled,
|
|
20
|
+
onboardingFlow: app.onboardingFlow,
|
|
21
|
+
tenantSelfSignup: app.tenantSelfSignup,
|
|
22
|
+
accessTokenTTL: app.accessTokenTTL,
|
|
23
|
+
refreshTokenTTL: app.refreshTokenTTL,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
outputError(err);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
auth.command('mfa')
|
|
31
|
+
.description('Enable or disable MFA')
|
|
32
|
+
.requiredOption('--enabled <bool>', 'true or false', (v) => v === 'true')
|
|
33
|
+
.action(async (opts) => {
|
|
34
|
+
try {
|
|
35
|
+
outputSuccess(await getManagementClient().app.update({ mfaEnabled: opts.enabled }));
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
outputError(err);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
auth.command('password-policy')
|
|
42
|
+
.description('Update access token TTL')
|
|
43
|
+
.option('--access-token-ttl <seconds>', 'Access token TTL in seconds', parseInt)
|
|
44
|
+
.option('--refresh-token-ttl <seconds>', 'Refresh token TTL in seconds', parseInt)
|
|
45
|
+
.action(async (opts) => {
|
|
46
|
+
try {
|
|
47
|
+
const data = Object.fromEntries(Object.entries({
|
|
48
|
+
accessTokenTTL: opts.accessTokenTtl,
|
|
49
|
+
refreshTokenTTL: opts.refreshTokenTtl,
|
|
50
|
+
}).filter(([, v]) => v !== undefined));
|
|
51
|
+
outputSuccess(await getManagementClient().app.update(data));
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
outputError(err);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=auth.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.command.js","sourceRoot":"","sources":["../../src/commands/auth.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC;IAExF,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;SACnB,WAAW,CAAC,gCAAgC,CAAC;SAC7C,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,mBAAmB,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;YAClD,aAAa,CAAC;gBACZ,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,eAAe,EAAE,GAAG,CAAC,eAAe;gBACpC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;gBACtC,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;gBACtC,iBAAiB,EAAE,G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AAI,GAAG,MAAM,CAAC,WAAW,CAC7B,MAAM,CAAC,OAAO,CAAC;gBACb,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,eAAe,EAAE,IAAI,CAAC,eAAe;aACtC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CACtC,CAAC;YACF,aAAa,CAAC,MAAM,mBAAmB,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branding.command.d.ts","sourceRoot":"","sources":["../../src/commands/branding.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmC/D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getManagementClient } from '../config.js';
|
|
2
|
+
import { outputSuccess, outputError } from '../output.js';
|
|
3
|
+
export function registerBrandingCommands(program) {
|
|
4
|
+
const branding = program.command('branding').description('Manage branding');
|
|
5
|
+
branding.command('get')
|
|
6
|
+
.description('Get current branding configuration')
|
|
7
|
+
.action(async () => {
|
|
8
|
+
try {
|
|
9
|
+
outputSuccess(await getManagementClient().branding.get());
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
outputError(err);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
branding.command('update')
|
|
16
|
+
.description('Update branding')
|
|
17
|
+
.option('--bg-color <color>', 'Background color')
|
|
18
|
+
.option('--text-color <color>', 'Text color')
|
|
19
|
+
.option('--link-color <color>', 'Link color')
|
|
20
|
+
.option('--primary-btn-bg <color>', 'Primary button background')
|
|
21
|
+
.option('--primary-btn-text <color>', 'Primary button text')
|
|
22
|
+
.option('--font-family <font>', 'Font family')
|
|
23
|
+
.option('--border-radius <radius>', 'Border radius')
|
|
24
|
+
.action(async (opts) => {
|
|
25
|
+
try {
|
|
26
|
+
const data = Object.fromEntries(Object.entries({
|
|
27
|
+
bgColor: opts.bgColor,
|
|
28
|
+
textColor: opts.textColor,
|
|
29
|
+
linkColor: opts.linkColor,
|
|
30
|
+
primaryButtonBgColor: opts.primaryBtnBg,
|
|
31
|
+
primaryButtonTextColor: opts.primaryBtnText,
|
|
32
|
+
fontFamily: opts.fontFamily,
|
|
33
|
+
borderRadius: opts.borderRadius,
|
|
34
|
+
}).filter(([, v]) => v !== undefined));
|
|
35
|
+
outputSuccess(await getManagementClient().branding.update(data));
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
outputError(err);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=branding.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branding.command.js","sourceRoot":"","sources":["../../src/commands/branding.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,UAAU,wBAAwB,CAAC,OAAgB;IACvD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAE5E,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;SACpB,WAAW,CAAC,oCAAoC,CAAC;SACjD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YAAC,aAAa,CAAC,MAAM,mBAAmB,EAAE,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;QAAC,CAAC;QACl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P,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.command.d.ts","sourceRoot":"","sources":["../../src/commands/event.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqB5D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getManagementClient } from '../config.js';
|
|
2
|
+
import { outputSuccess, outputError } from '../output.js';
|
|
3
|
+
export function registerEventCommands(program) {
|
|
4
|
+
const event = program.command('event').description('Query event log');
|
|
5
|
+
event.command('list')
|
|
6
|
+
.description('Query events')
|
|
7
|
+
.option('--type <type>', 'Event type filter')
|
|
8
|
+
.option('--tenant-id <id>', 'Filter by tenant')
|
|
9
|
+
.option('--user-id <id>', 'Filter by user')
|
|
10
|
+
.option('--since <duration>', 'Time filter (e.g., "24h", "7d", ISO date)')
|
|
11
|
+
.option('--limit <n>', 'Max results', parseInt)
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
try {
|
|
14
|
+
outputSuccess(await getManagementClient().events.query({
|
|
15
|
+
type: opts.type,
|
|
16
|
+
tenantId: opts.tenantId,
|
|
17
|
+
userId: opts.userId,
|
|
18
|
+
since: opts.since,
|
|
19
|
+
limit: opts.limit,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
outputError(err);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=event.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event.command.js","sourceRoot":"","sources":["../../src/commands/event.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAEtE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;SAClB,WAAW,CAAC,cAAc,CAAC;SAC3B,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC;SAC5C,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;SAC9C,MAAM,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;SAC1C,MAAM,CAAC,oBAAoB,EAAE,2CAA2C,CAAC;SACzE,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,QAAQ,CAAC;SAC9C,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,IAAI,CAAC;YACH,aAAa,CAAC,MAAM,mBAAmB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;gBACrD,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB,CAAC,CAAC,CAAC;QACN,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag.command.d.ts","sourceRoot":"","sources":["../../src/commands/flag.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4D3D"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { getManagementClient } from '../config.js';
|
|
2
|
+
import { outputSuccess, outputError } from '../output.js';
|
|
3
|
+
export function registerFlagCommands(program) {
|
|
4
|
+
const flag = program.command('flag').description('Manage feature flags');
|
|
5
|
+
flag.command('list')
|
|
6
|
+
.description('List all feature flags')
|
|
7
|
+
.action(async () => {
|
|
8
|
+
try {
|
|
9
|
+
outputSuccess(await getManagementClient().flags.list());
|
|
10
|
+
}
|
|
11
|
+
catch (err) {
|
|
12
|
+
outputError(err);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
flag.command('create')
|
|
16
|
+
.description('Create a new feature flag')
|
|
17
|
+
.requiredOption('--key <key>', 'Flag key')
|
|
18
|
+
.option('--description <desc>', 'Description')
|
|
19
|
+
.option('--enabled', 'Enable the flag', false)
|
|
20
|
+
.option('--default-value', 'Default value when no segment matches', false)
|
|
21
|
+
.action(async (opts) => {
|
|
22
|
+
try {
|
|
23
|
+
outputSuccess(await getManagementClient().flags.create({
|
|
24
|
+
key: opts.key,
|
|
25
|
+
description: opts.description,
|
|
26
|
+
enabled: opts.enabled,
|
|
27
|
+
defaultValue: opts.defaultValue,
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
outputError(err);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
flag.command('update')
|
|
35
|
+
.description('Update a feature flag')
|
|
36
|
+
.requiredOption('--id <id>', 'Flag ID')
|
|
37
|
+
.option('--key <key>', 'Flag key')
|
|
38
|
+
.option('--description <desc>', 'Description')
|
|
39
|
+
.option('--enabled <bool>', 'Enable/disable', (v) => v === 'true')
|
|
40
|
+
.option('--default-value <bool>', 'Default value', (v) => v === 'true')
|
|
41
|
+
.action(async (opts) => {
|
|
42
|
+
try {
|
|
43
|
+
const { id, ...data } = opts;
|
|
44
|
+
const cleaned = Object.fromEntries(Object.entries(data).filter(([, v]) => v !== undefined));
|
|
45
|
+
outputSuccess(await getManagementClient().flags.update(id, cleaned));
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
outputError(err);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
flag.command('toggle')
|
|
52
|
+
.description('Toggle a feature flag on/off')
|
|
53
|
+
.requiredOption('--id <id>', 'Flag ID')
|
|
54
|
+
.requiredOption('--enabled <bool>', 'true or false', (v) => v === 'true')
|
|
55
|
+
.action(async (opts) => {
|
|
56
|
+
try {
|
|
57
|
+
outputSuccess(await getManagementClient().flags.toggle(opts.id, opts.enabled));
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
outputError(err);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
flag.command('delete')
|
|
64
|
+
.description('Delete a feature flag')
|
|
65
|
+
.requiredOption('--id <id>', 'Flag ID')
|
|
66
|
+
.action(async (opts) => {
|
|
67
|
+
try {
|
|
68
|
+
await getManagementClient().flags.delete(opts.id);
|
|
69
|
+
outputSuccess({ deleted: true, id: opts.id });
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
outputError(err);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=flag.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flag.command.js","sourceRoot":"","sources":["../../src/commands/flag.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAEzE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;SACjB,WAAW,CAAC,wBAAwB,CAAC;SACrC,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,IAAI,CAAC;YAAC,aAAa,CAAC,MAAM,mBAAmB,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAA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