@nebulr-group/bridge-cli 0.6.6 → 1.0.0-alpha.1
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 +98 -458
- package/dist/api/accounts.d.ts +105 -0
- package/dist/api/accounts.d.ts.map +1 -0
- package/dist/api/accounts.js +58 -0
- package/dist/api/accounts.js.map +1 -0
- package/dist/api/apps.d.ts +50 -0
- package/dist/api/apps.d.ts.map +1 -0
- package/dist/api/apps.js +62 -0
- package/dist/api/apps.js.map +1 -0
- package/dist/api/billing.d.ts +131 -0
- package/dist/api/billing.d.ts.map +1 -0
- package/dist/api/billing.js +42 -0
- package/dist/api/billing.js.map +1 -0
- package/dist/api/flags.d.ts +73 -0
- package/dist/api/flags.d.ts.map +1 -0
- package/dist/api/flags.js +108 -0
- package/dist/api/flags.js.map +1 -0
- package/dist/api/keys.d.ts +48 -0
- package/dist/api/keys.d.ts.map +1 -0
- package/dist/api/keys.js +87 -0
- package/dist/api/keys.js.map +1 -0
- package/dist/auth/browser-open.d.ts +21 -4
- package/dist/auth/browser-open.d.ts.map +1 -1
- package/dist/auth/browser-open.js +45 -65
- package/dist/auth/browser-open.js.map +1 -1
- package/dist/auth/lock.d.ts +8 -0
- package/dist/auth/lock.d.ts.map +1 -0
- package/dist/auth/lock.js +43 -0
- package/dist/auth/lock.js.map +1 -0
- package/dist/auth/loopback.d.ts +8 -12
- package/dist/auth/loopback.d.ts.map +1 -1
- package/dist/auth/loopback.js +40 -45
- package/dist/auth/loopback.js.map +1 -1
- package/dist/auth/session.d.ts +61 -0
- package/dist/auth/session.d.ts.map +1 -0
- package/dist/auth/session.js +142 -0
- package/dist/auth/session.js.map +1 -0
- package/dist/auth/sign-in.d.ts +67 -0
- package/dist/auth/sign-in.d.ts.map +1 -0
- package/dist/auth/sign-in.js +113 -0
- package/dist/auth/sign-in.js.map +1 -0
- package/dist/auth/store.d.ts +89 -0
- package/dist/auth/store.d.ts.map +1 -0
- package/dist/auth/store.js +214 -0
- package/dist/auth/store.js.map +1 -0
- package/dist/bin.js +0 -2
- package/dist/bin.js.map +1 -1
- package/dist/cli.d.ts +1 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +13 -17
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +31 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +67 -0
- package/dist/client.js.map +1 -0
- package/dist/commands/accounts.command.d.ts +4 -0
- package/dist/commands/accounts.command.d.ts.map +1 -0
- package/dist/commands/accounts.command.js +166 -0
- package/dist/commands/accounts.command.js.map +1 -0
- package/dist/commands/app.command.d.ts +3 -2
- package/dist/commands/app.command.d.ts.map +1 -1
- package/dist/commands/app.command.js +132 -233
- package/dist/commands/app.command.js.map +1 -1
- package/dist/commands/auth.command.d.ts +2 -12
- package/dist/commands/auth.command.d.ts.map +1 -1
- package/dist/commands/auth.command.js +147 -20
- package/dist/commands/auth.command.js.map +1 -1
- package/dist/commands/billing.command.d.ts +4 -0
- package/dist/commands/billing.command.d.ts.map +1 -0
- package/dist/commands/billing.command.js +185 -0
- package/dist/commands/billing.command.js.map +1 -0
- package/dist/commands/check.command.d.ts +2 -1
- package/dist/commands/check.command.d.ts.map +1 -1
- package/dist/commands/check.command.js +11 -14
- package/dist/commands/check.command.js.map +1 -1
- package/dist/commands/context.d.ts +58 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +78 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/flag.command.d.ts +3 -62
- package/dist/commands/flag.command.d.ts.map +1 -1
- package/dist/commands/flag.command.js +181 -864
- package/dist/commands/flag.command.js.map +1 -1
- package/dist/commands/key.command.d.ts +4 -0
- package/dist/commands/key.command.d.ts.map +1 -0
- package/dist/commands/key.command.js +44 -0
- package/dist/commands/key.command.js.map +1 -0
- package/dist/commands/plan.command.d.ts +3 -203
- package/dist/commands/plan.command.d.ts.map +1 -1
- package/dist/commands/plan.command.js +200 -759
- package/dist/commands/plan.command.js.map +1 -1
- package/dist/config.d.ts +19 -101
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +51 -364
- package/dist/config.js.map +1 -1
- package/dist/core/discovery.d.ts +27 -0
- package/dist/core/discovery.d.ts.map +1 -0
- package/dist/core/discovery.js +97 -0
- package/dist/core/discovery.js.map +1 -0
- package/dist/core/errors.d.ts +26 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/http.d.ts +23 -0
- package/dist/core/http.d.ts.map +1 -0
- package/dist/core/http.js +153 -0
- package/dist/core/http.js.map +1 -0
- package/dist/core/private-files.d.ts +6 -0
- package/dist/core/private-files.d.ts.map +1 -0
- package/dist/core/private-files.js +96 -0
- package/dist/core/private-files.js.map +1 -0
- package/dist/core/routes.d.ts +100 -0
- package/dist/core/routes.d.ts.map +1 -0
- package/dist/core/routes.js +99 -0
- package/dist/core/routes.js.map +1 -0
- package/dist/core/urls.d.ts +15 -0
- package/dist/core/urls.d.ts.map +1 -0
- package/dist/core/urls.js +55 -0
- package/dist/core/urls.js.map +1 -0
- package/dist/gate-rules.d.ts +1 -2
- package/dist/gate-rules.d.ts.map +1 -1
- package/dist/gate-rules.js +4 -5
- package/dist/gate-rules.js.map +1 -1
- package/dist/index.d.ts +24 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/dist/io.d.ts +21 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +59 -0
- package/dist/io.js.map +1 -0
- package/dist/money.d.ts +42 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +112 -0
- package/dist/money.js.map +1 -0
- package/dist/program.d.ts +5 -24
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +25 -113
- package/dist/program.js.map +1 -1
- package/package.json +7 -8
- package/dist/auth/api-client.d.ts +0 -50
- package/dist/auth/api-client.d.ts.map +0 -1
- package/dist/auth/api-client.js +0 -109
- package/dist/auth/api-client.js.map +0 -1
- package/dist/auth/relative-time.d.ts +0 -2
- package/dist/auth/relative-time.d.ts.map +0 -1
- package/dist/auth/relative-time.js +0 -27
- package/dist/auth/relative-time.js.map +0 -1
- package/dist/auth/scopes.d.ts +0 -30
- package/dist/auth/scopes.d.ts.map +0 -1
- package/dist/auth/scopes.js +0 -39
- package/dist/auth/scopes.js.map +0 -1
- package/dist/auth/workspace-client.d.ts +0 -70
- package/dist/auth/workspace-client.d.ts.map +0 -1
- package/dist/auth/workspace-client.js +0 -105
- package/dist/auth/workspace-client.js.map +0 -1
- package/dist/commands/auth/config.command.d.ts +0 -8
- package/dist/commands/auth/config.command.d.ts.map +0 -1
- package/dist/commands/auth/config.command.js +0 -60
- package/dist/commands/auth/config.command.js.map +0 -1
- package/dist/commands/auth/login.command.d.ts +0 -46
- package/dist/commands/auth/login.command.d.ts.map +0 -1
- package/dist/commands/auth/login.command.js +0 -166
- package/dist/commands/auth/login.command.js.map +0 -1
- package/dist/commands/auth/logout.command.d.ts +0 -21
- package/dist/commands/auth/logout.command.d.ts.map +0 -1
- package/dist/commands/auth/logout.command.js +0 -97
- package/dist/commands/auth/logout.command.js.map +0 -1
- package/dist/commands/auth/methods.command.d.ts +0 -68
- package/dist/commands/auth/methods.command.d.ts.map +0 -1
- package/dist/commands/auth/methods.command.js +0 -91
- package/dist/commands/auth/methods.command.js.map +0 -1
- package/dist/commands/auth/status.command.d.ts +0 -18
- package/dist/commands/auth/status.command.d.ts.map +0 -1
- package/dist/commands/auth/status.command.js +0 -104
- package/dist/commands/auth/status.command.js.map +0 -1
- package/dist/commands/auth/use.command.d.ts +0 -17
- package/dist/commands/auth/use.command.d.ts.map +0 -1
- package/dist/commands/auth/use.command.js +0 -47
- package/dist/commands/auth/use.command.js.map +0 -1
- package/dist/commands/branding.command.d.ts +0 -3
- package/dist/commands/branding.command.d.ts.map +0 -1
- package/dist/commands/branding.command.js +0 -42
- package/dist/commands/branding.command.js.map +0 -1
- package/dist/commands/event.command.d.ts +0 -3
- package/dist/commands/event.command.d.ts.map +0 -1
- package/dist/commands/event.command.js +0 -27
- package/dist/commands/event.command.js.map +0 -1
- package/dist/commands/flag-init.command.d.ts +0 -13
- package/dist/commands/flag-init.command.d.ts.map +0 -1
- package/dist/commands/flag-init.command.js +0 -463
- package/dist/commands/flag-init.command.js.map +0 -1
- package/dist/commands/guide.command.d.ts +0 -61
- package/dist/commands/guide.command.d.ts.map +0 -1
- package/dist/commands/guide.command.js +0 -655
- package/dist/commands/guide.command.js.map +0 -1
- package/dist/commands/info.command.d.ts +0 -3
- package/dist/commands/info.command.d.ts.map +0 -1
- package/dist/commands/info.command.js +0 -70
- package/dist/commands/info.command.js.map +0 -1
- package/dist/commands/integration.command.d.ts +0 -35
- package/dist/commands/integration.command.d.ts.map +0 -1
- package/dist/commands/integration.command.js +0 -290
- package/dist/commands/integration.command.js.map +0 -1
- package/dist/commands/journeys.d.ts +0 -43
- package/dist/commands/journeys.d.ts.map +0 -1
- package/dist/commands/journeys.js +0 -221
- package/dist/commands/journeys.js.map +0 -1
- package/dist/commands/ops.command.d.ts +0 -17
- package/dist/commands/ops.command.d.ts.map +0 -1
- package/dist/commands/ops.command.js +0 -129
- package/dist/commands/ops.command.js.map +0 -1
- package/dist/commands/privilege.command.d.ts +0 -16
- package/dist/commands/privilege.command.d.ts.map +0 -1
- package/dist/commands/privilege.command.js +0 -86
- package/dist/commands/privilege.command.js.map +0 -1
- package/dist/commands/role.command.d.ts +0 -3
- package/dist/commands/role.command.d.ts.map +0 -1
- package/dist/commands/role.command.js +0 -101
- package/dist/commands/role.command.js.map +0 -1
- package/dist/commands/runtime-dir.d.ts +0 -16
- package/dist/commands/runtime-dir.d.ts.map +0 -1
- package/dist/commands/runtime-dir.js +0 -18
- package/dist/commands/runtime-dir.js.map +0 -1
- package/dist/commands/setup.command.d.ts +0 -63
- package/dist/commands/setup.command.d.ts.map +0 -1
- package/dist/commands/setup.command.js +0 -148
- package/dist/commands/setup.command.js.map +0 -1
- package/dist/commands/stripe.command.d.ts +0 -29
- package/dist/commands/stripe.command.d.ts.map +0 -1
- package/dist/commands/stripe.command.js +0 -99
- package/dist/commands/stripe.command.js.map +0 -1
- package/dist/commands/tenant.command.d.ts +0 -3
- package/dist/commands/tenant.command.d.ts.map +0 -1
- package/dist/commands/tenant.command.js +0 -135
- package/dist/commands/tenant.command.js.map +0 -1
- package/dist/commands/token.command.d.ts +0 -3
- package/dist/commands/token.command.d.ts.map +0 -1
- package/dist/commands/token.command.js +0 -54
- package/dist/commands/token.command.js.map +0 -1
- package/dist/commands/user.command.d.ts +0 -3
- package/dist/commands/user.command.d.ts.map +0 -1
- package/dist/commands/user.command.js +0 -117
- package/dist/commands/user.command.js.map +0 -1
- package/dist/credentials.d.ts +0 -141
- package/dist/credentials.d.ts.map +0 -1
- package/dist/credentials.js +0 -348
- package/dist/credentials.js.map +0 -1
- package/dist/flag-coherence.d.ts +0 -42
- package/dist/flag-coherence.d.ts.map +0 -1
- package/dist/flag-coherence.js +0 -103
- package/dist/flag-coherence.js.map +0 -1
- package/dist/output.d.ts +0 -17
- package/dist/output.d.ts.map +0 -1
- package/dist/output.js +0 -107
- package/dist/output.js.map +0 -1
- package/dist/preview.d.ts +0 -9
- package/dist/preview.d.ts.map +0 -1
- package/dist/preview.js +0 -63
- package/dist/preview.js.map +0 -1
- package/dist/product-decisions.d.ts +0 -40
- package/dist/product-decisions.d.ts.map +0 -1
- package/dist/product-decisions.js +0 -52
- package/dist/product-decisions.js.map +0 -1
- package/dist/prompt-urls.d.ts +0 -31
- package/dist/prompt-urls.d.ts.map +0 -1
- package/dist/prompt-urls.js +0 -35
- package/dist/prompt-urls.js.map +0 -1
- package/dist/prompts/auth-master-integration-prompt.md +0 -255
- package/dist/prompts/billing/master.md +0 -332
- package/dist/prompts/decisions/feature-control.md +0 -131
- package/dist/prompts/decisions/going-live.md +0 -60
- package/dist/prompts/decisions/login.md +0 -71
- package/dist/prompts/decisions/look-and-feel.md +0 -68
- package/dist/prompts/decisions/payments.md +0 -97
- package/dist/prompts/decisions/roles.md +0 -78
- package/dist/prompts/decisions/teams.md +0 -61
- package/dist/prompts/fit-together.md +0 -97
- package/dist/prompts/flags/master.md +0 -220
- package/dist/prompts/guide-coverage.json +0 -17
- package/dist/prompts/integration-success.md +0 -106
- package/dist/prompts/mcp-tools.json +0 -90
- package/dist/prompts/mechanisms.md +0 -304
- package/dist/prompts/orientation.md +0 -42
- package/dist/prompts/product-decisions.json +0 -338
- package/dist/resolve.d.ts +0 -110
- package/dist/resolve.d.ts.map +0 -1
- package/dist/resolve.js +0 -260
- package/dist/resolve.js.map +0 -1
- package/dist/shape.d.ts +0 -25
- package/dist/shape.d.ts.map +0 -1
- package/dist/shape.js +0 -74
- package/dist/shape.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.command.js","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"check.command.js","sourceRoot":"","sources":["../../src/commands/check.command.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,uCAAuC;AACvC,EAAE;AACF,2EAA2E;AAG3E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE;QAC3B,KAAK,MAAM,IAAI,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,MAAM,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4B,CAAC;SAC9C,MAAM,CAAC,CAAC,IAAqC,EAAE,EAAE;QAChD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YAC/C,IAAI,IAAI,CAAC,IAAI;gBAAE,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;;gBAChD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;YACvD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Sessions } from '../auth/session.js';
|
|
2
|
+
import { type SessionStore } from '../auth/store.js';
|
|
3
|
+
import { BridgeClient } from '../client.js';
|
|
4
|
+
import { Config, type Settings } from '../config.js';
|
|
5
|
+
import { type Discovery } from '../core/discovery.js';
|
|
6
|
+
import type { Fetch } from '../core/http.js';
|
|
7
|
+
import type { Io } from '../io.js';
|
|
8
|
+
/** What the commands run with. Real ones in `cli.ts`; tests pass fakes. */
|
|
9
|
+
export interface Deps {
|
|
10
|
+
readonly fetch: Fetch;
|
|
11
|
+
readonly env: NodeJS.ProcessEnv;
|
|
12
|
+
readonly io: Io;
|
|
13
|
+
readonly openBrowser: (url: string) => Promise<{
|
|
14
|
+
ok: boolean;
|
|
15
|
+
reason?: string;
|
|
16
|
+
}>;
|
|
17
|
+
/** The session store for a config dir; by default the keychain, else a 0600 file. */
|
|
18
|
+
readonly store?: (dir: string) => SessionStore;
|
|
19
|
+
readonly now?: () => number;
|
|
20
|
+
/** How long browser sign-in waits for the page, in ms. */
|
|
21
|
+
readonly signInTimeoutMs?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface GlobalOptions {
|
|
24
|
+
readonly issuer?: string;
|
|
25
|
+
readonly app?: string;
|
|
26
|
+
}
|
|
27
|
+
/** One command's view of the CLI: settings, the issuer, the session, the client. Each is worked out once. */
|
|
28
|
+
export declare class Context {
|
|
29
|
+
readonly deps: Deps;
|
|
30
|
+
readonly options: GlobalOptions;
|
|
31
|
+
readonly config: Config;
|
|
32
|
+
private settingsRead?;
|
|
33
|
+
private discovered?;
|
|
34
|
+
private sessionsMade?;
|
|
35
|
+
constructor(deps: Deps, options: GlobalOptions);
|
|
36
|
+
get io(): Io;
|
|
37
|
+
get env(): NodeJS.ProcessEnv;
|
|
38
|
+
settings(): Promise<Settings>;
|
|
39
|
+
issuer(): Promise<string>;
|
|
40
|
+
discovery(): Promise<Discovery>;
|
|
41
|
+
sessions(): Sessions;
|
|
42
|
+
client(): Promise<BridgeClient>;
|
|
43
|
+
/** The app commands act on. */
|
|
44
|
+
appId(): Promise<string>;
|
|
45
|
+
/** The app and a client, for the commands that act on one app. */
|
|
46
|
+
forApp(): Promise<{
|
|
47
|
+
c: BridgeClient;
|
|
48
|
+
appId: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The action wrapper every command uses: builds the context from the global
|
|
53
|
+
* options, runs the command, and reports any error the one way.
|
|
54
|
+
*/
|
|
55
|
+
export declare function action<A extends unknown[]>(deps: Deps, fn: (ctx: Context, ...args: A) => Promise<void>): (...args: unknown[]) => Promise<void>;
|
|
56
|
+
/** Repeated options (`--use a --use b`). */
|
|
57
|
+
export declare function collect(value: string, previous?: string[]): string[];
|
|
58
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|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;IACnB,QAAQ,CAAC,OAAO,EAAE,aAAa;IAPjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,YAAY,CAAC,CAAW;IAChC,OAAO,CAAC,UAAU,CAAC,CAAqB;IACxC,OAAO,CAAC,YAAY,CAAC,CAAW;gBAGrB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa;IAKjC,IAAI,EAAE,IAAI,EAAE,CAEX;IAED,IAAI,GAAG,IAAI,MAAM,CAAC,UAAU,CAE3B;IAEK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IAK7B,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;IAI/B,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC;IAK/B,QAAQ,IAAI,QAAQ;IAUd,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;IAIrC,+BAA+B;IACzB,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;IAI9B,kEAAkE;IAC5D,MAAM,IAAI,OAAO,CAAC;QAAE,CAAC,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAI5D;AAED;;;GAGG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,IACvF,GAAG,MAAM,OAAO,EAAE,mBASjC;AAED,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAExE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Sessions } from '../auth/session.js';
|
|
2
|
+
import { chooseStore } from '../auth/store.js';
|
|
3
|
+
import { BridgeClient } from '../client.js';
|
|
4
|
+
import { Config, configDir, resolveApp, resolveIssuer } from '../config.js';
|
|
5
|
+
import { discover } from '../core/discovery.js';
|
|
6
|
+
/** One command's view of the CLI: settings, the issuer, the session, the client. Each is worked out once. */
|
|
7
|
+
export class Context {
|
|
8
|
+
deps;
|
|
9
|
+
options;
|
|
10
|
+
config;
|
|
11
|
+
settingsRead;
|
|
12
|
+
discovered;
|
|
13
|
+
sessionsMade;
|
|
14
|
+
constructor(deps, options) {
|
|
15
|
+
this.deps = deps;
|
|
16
|
+
this.options = options;
|
|
17
|
+
this.config = new Config(configDir(deps.env));
|
|
18
|
+
}
|
|
19
|
+
get io() {
|
|
20
|
+
return this.deps.io;
|
|
21
|
+
}
|
|
22
|
+
get env() {
|
|
23
|
+
return this.deps.env;
|
|
24
|
+
}
|
|
25
|
+
async settings() {
|
|
26
|
+
this.settingsRead ??= await this.config.read();
|
|
27
|
+
return this.settingsRead;
|
|
28
|
+
}
|
|
29
|
+
async issuer() {
|
|
30
|
+
return resolveIssuer(this.options.issuer, this.env, await this.settings());
|
|
31
|
+
}
|
|
32
|
+
discovery() {
|
|
33
|
+
this.discovered ??= this.issuer().then((issuer) => discover(this.deps.fetch, issuer));
|
|
34
|
+
return this.discovered;
|
|
35
|
+
}
|
|
36
|
+
sessions() {
|
|
37
|
+
this.sessionsMade ??= new Sessions({
|
|
38
|
+
fetch: this.deps.fetch,
|
|
39
|
+
store: (this.deps.store ?? ((dir) => chooseStore({ dir, env: this.env, warn: (m) => this.io.info(m) })))(this.config.dir),
|
|
40
|
+
lockDir: this.config.dir,
|
|
41
|
+
now: this.deps.now,
|
|
42
|
+
});
|
|
43
|
+
return this.sessionsMade;
|
|
44
|
+
}
|
|
45
|
+
async client() {
|
|
46
|
+
return new BridgeClient(await this.discovery(), this.deps.fetch, this.sessions());
|
|
47
|
+
}
|
|
48
|
+
/** The app commands act on. */
|
|
49
|
+
async appId() {
|
|
50
|
+
return resolveApp(this.options.app, this.env, await this.settings(), await this.issuer());
|
|
51
|
+
}
|
|
52
|
+
/** The app and a client, for the commands that act on one app. */
|
|
53
|
+
async forApp() {
|
|
54
|
+
const [c, appId] = await Promise.all([this.client(), this.appId()]);
|
|
55
|
+
return { c, appId };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The action wrapper every command uses: builds the context from the global
|
|
60
|
+
* options, runs the command, and reports any error the one way.
|
|
61
|
+
*/
|
|
62
|
+
export function action(deps, fn) {
|
|
63
|
+
return async (...args) => {
|
|
64
|
+
const command = args[args.length - 1];
|
|
65
|
+
const ctx = new Context(deps, command.optsWithGlobals());
|
|
66
|
+
try {
|
|
67
|
+
await fn(ctx, ...args.slice(0, -1));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
deps.io.error(error);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Repeated options (`--use a --use b`). */
|
|
75
|
+
export function collect(value, previous = []) {
|
|
76
|
+
return [...previous, value];
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/commands/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAqB,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAiB,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,QAAQ,EAAkB,MAAM,sBAAsB,CAAC;AAsBhE,6GAA6G;AAC7G,MAAM,OAAO,OAAO;IAOP;IACA;IAPF,MAAM,CAAS;IAChB,YAAY,CAAY;IACxB,UAAU,CAAsB;IAChC,YAAY,CAAY;IAEhC,YACW,IAAU,EACV,OAAsB;QADtB,SAAI,GAAJ,IAAI,CAAM;QACV,YAAO,GAAP,OAAO,CAAe;QAE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AC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED,4CAA4C;AAC5C,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,WAAqB,EAAE;IAC5D,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,63 +1,4 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { validateRule };
|
|
5
|
-
export declare function registerFlagCommands(program: Command): void;
|
|
6
|
-
interface FlagDoc {
|
|
7
|
-
key: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
state: FlagState;
|
|
10
|
-
valueType: FlagValueType;
|
|
11
|
-
offValue?: unknown;
|
|
12
|
-
onValue?: unknown;
|
|
13
|
-
rule?: Rule | null;
|
|
14
|
-
schedule?: unknown;
|
|
15
|
-
}
|
|
16
|
-
/** Build the canonical, portable doc from a remote flag record. Pure. */
|
|
17
|
-
export declare function toFlagDoc(f: Record<string, unknown>): FlagDoc;
|
|
18
|
-
/** Build a create/update write payload from a doc. Pure. */
|
|
19
|
-
export declare function buildWritePayloadFromDoc(doc: FlagDoc): Record<string, unknown>;
|
|
20
|
-
/** Validate + normalize a doc parsed from a file. Throws on the first problem. */
|
|
21
|
-
export declare function validateFlagDoc(input: unknown, index: number): FlagDoc;
|
|
22
|
-
interface FlagDiff {
|
|
23
|
-
create: FlagDoc[];
|
|
24
|
-
update: {
|
|
25
|
-
id: string;
|
|
26
|
-
doc: FlagDoc;
|
|
27
|
-
changes: string[];
|
|
28
|
-
}[];
|
|
29
|
-
prune: {
|
|
30
|
-
id: string;
|
|
31
|
-
key: string;
|
|
32
|
-
}[];
|
|
33
|
-
unchanged: string[];
|
|
34
|
-
}
|
|
35
|
-
/** Diff file docs against remote flags (matched by key). Pure. */
|
|
36
|
-
export declare function diffFlags(remote: Record<string, unknown>[], docs: FlagDoc[], opts?: {
|
|
37
|
-
prune?: boolean;
|
|
38
|
-
}): FlagDiff;
|
|
39
|
-
interface FlagWriteOpts {
|
|
40
|
-
key?: string;
|
|
41
|
-
description?: string;
|
|
42
|
-
state?: string;
|
|
43
|
-
valueType?: string;
|
|
44
|
-
onValue?: string;
|
|
45
|
-
offValue?: string;
|
|
46
|
-
rule?: string;
|
|
47
|
-
enabled?: boolean;
|
|
48
|
-
defaultValue?: boolean;
|
|
49
|
-
}
|
|
50
|
-
export declare function buildFlagWritePayload(opts: FlagWriteOpts, { partial }?: {
|
|
51
|
-
partial?: boolean;
|
|
52
|
-
}): Record<string, unknown>;
|
|
53
|
-
export declare function coerceValue(raw: string, type: FlagValueType): unknown;
|
|
54
|
-
export declare function parseRuleArg(raw: string): Rule;
|
|
55
|
-
/**
|
|
56
|
-
* Normalize untrusted rule input (from --rule JSON or a flags file) to the
|
|
57
|
-
* canonical auth-core `Rule` shape. Throws on structural problems; operator
|
|
58
|
-
* validity is left to `validateRule` on the returned rule.
|
|
59
|
-
*/
|
|
60
|
-
export declare function normalizeRuleInput(input: unknown): Rule;
|
|
61
|
-
export declare function parseAttributes(pairs: string[]): Record<string, unknown>;
|
|
62
|
-
export declare function evaluateLocally(cached: CachedFlag, ctx: EvalContext): EvalResult;
|
|
1
|
+
import { type Command } from 'commander';
|
|
2
|
+
import { type Deps } from './context.js';
|
|
3
|
+
export declare function registerFlagCommands(program: Command, deps: Deps): void;
|
|
63
4
|
//# sourceMappingURL=flag.command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flag.command.d.ts","sourceRoot":"","sources":["../../src/commands/flag.command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flag.command.d.ts","sourceRoot":"","sources":["../../src/commands/flag.command.ts"],"names":[],"mappings":"AACA,OAAO,EAAwB,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAG/D,OAAO,EAAiC,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AA0ExE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CA4JvE"}
|