@nebulr-group/bridge-cli 0.6.0-beta.3 → 0.6.0-beta.5
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/dist/commands/flag.command.d.ts.map +1 -1
- package/dist/commands/flag.command.js +19 -6
- package/dist/commands/flag.command.js.map +1 -1
- package/dist/commands/guide.command.d.ts +12 -0
- package/dist/commands/guide.command.d.ts.map +1 -1
- package/dist/commands/guide.command.js +96 -6
- package/dist/commands/guide.command.js.map +1 -1
- package/dist/commands/integration.command.d.ts +8 -0
- package/dist/commands/integration.command.d.ts.map +1 -1
- package/dist/commands/integration.command.js +92 -3
- package/dist/commands/integration.command.js.map +1 -1
- package/dist/commands/journeys.d.ts +2 -1
- package/dist/commands/journeys.d.ts.map +1 -1
- package/dist/commands/journeys.js +15 -1
- package/dist/commands/journeys.js.map +1 -1
- package/dist/commands/plan.command.d.ts +39 -0
- package/dist/commands/plan.command.d.ts.map +1 -1
- package/dist/commands/plan.command.js +134 -10
- package/dist/commands/plan.command.js.map +1 -1
- package/dist/commands/role.command.d.ts.map +1 -1
- package/dist/commands/role.command.js +2 -1
- package/dist/commands/role.command.js.map +1 -1
- package/dist/commands/tenant.command.d.ts.map +1 -1
- package/dist/commands/tenant.command.js +12 -5
- package/dist/commands/tenant.command.js.map +1 -1
- package/dist/commands/token.command.d.ts.map +1 -1
- package/dist/commands/token.command.js +6 -0
- package/dist/commands/token.command.js.map +1 -1
- package/dist/commands/user.command.d.ts.map +1 -1
- package/dist/commands/user.command.js +6 -0
- package/dist/commands/user.command.js.map +1 -1
- package/dist/flag-coherence.d.ts +42 -0
- package/dist/flag-coherence.d.ts.map +1 -0
- package/dist/flag-coherence.js +103 -0
- package/dist/flag-coherence.js.map +1 -0
- package/dist/preview.d.ts +9 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +63 -0
- package/dist/preview.js.map +1 -0
- package/dist/prompts/auth-master-integration-prompt.md +15 -0
- package/dist/prompts/billing/master.md +20 -1
- package/dist/prompts/decisions/feature-control.md +105 -0
- package/dist/prompts/decisions/going-live.md +59 -0
- package/dist/prompts/decisions/login.md +68 -0
- package/dist/prompts/decisions/look-and-feel.md +62 -0
- package/dist/prompts/decisions/payments.md +81 -0
- package/dist/prompts/decisions/roles.md +72 -0
- package/dist/prompts/decisions/teams.md +56 -0
- package/dist/prompts/mcp-tools.json +78 -0
- package/dist/prompts/orientation.md +40 -0
- package/dist/shape.d.ts +25 -0
- package/dist/shape.d.ts.map +1 -0
- package/dist/shape.js +74 -0
- package/dist/shape.js.map +1 -0
- package/package.json +1 -1
package/dist/shape.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tenant metadata keys the platform writes for its own conversion-pixel
|
|
3
|
+
* bookkeeping (tracking.service.ts, tenant.service.ts). Never app data.
|
|
4
|
+
*/
|
|
5
|
+
export declare const INTERNAL_TENANT_METADATA_KEYS: string[];
|
|
6
|
+
/** A tenant without the platform's pixel bookkeeping in `metadata`. */
|
|
7
|
+
export declare function shapeTenant<T>(tenant: T): T;
|
|
8
|
+
/**
|
|
9
|
+
* A plan without the payment provider's ids: each quota's `providerRefs`
|
|
10
|
+
* (Stripe price and meter ids) is dropped. Prices and quotas otherwise stay
|
|
11
|
+
* whole — `create_plan` and friends still return the full plan.
|
|
12
|
+
*/
|
|
13
|
+
export declare function shapePlan<T>(plan: T): T;
|
|
14
|
+
/**
|
|
15
|
+
* Roles with each privilege named once. Every role used to carry the full
|
|
16
|
+
* privilege object (id, key, description) for every privilege it grants, so a
|
|
17
|
+
* five-role app repeated the same descriptions five times. Now each role lists
|
|
18
|
+
* privilege KEYS — what code and create_role/update_role take — and the
|
|
19
|
+
* descriptions appear once, in `privileges`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function shapeRoleList(roles: unknown[]): {
|
|
22
|
+
roles: Array<Record<string, unknown>>;
|
|
23
|
+
privileges: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../src/shape.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,eAAO,MAAM,6BAA6B,UAA+C,CAAC;AAE1F,uEAAuE;AACvE,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAU3C;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAYvC;AAOD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG;IAC/C,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAkBA"}
|
package/dist/shape.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* TBP-709 (D) — what `bridge … list` shows, minus the platform's internals.
|
|
3
|
+
*
|
|
4
|
+
* The REST DTOs these come from also serve the dashboards and the SDKs, so
|
|
5
|
+
* they are left alone; the trimming happens at the presentation layer.
|
|
6
|
+
* Port of bridge-api's MCP `shape.ts` (same functions, same tests) so the
|
|
7
|
+
* CLI lists and the MCP lists cannot drift. Every function is pure and leaves
|
|
8
|
+
* its input untouched.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Tenant metadata keys the platform writes for its own conversion-pixel
|
|
12
|
+
* bookkeeping (tracking.service.ts, tenant.service.ts). Never app data.
|
|
13
|
+
*/
|
|
14
|
+
export const INTERNAL_TENANT_METADATA_KEYS = ['pendingPixelEvents', 'conversionTracking'];
|
|
15
|
+
/** A tenant without the platform's pixel bookkeeping in `metadata`. */
|
|
16
|
+
export function shapeTenant(tenant) {
|
|
17
|
+
if (!tenant || typeof tenant !== 'object')
|
|
18
|
+
return tenant;
|
|
19
|
+
const metadata = tenant.metadata;
|
|
20
|
+
if (!metadata || typeof metadata !== 'object')
|
|
21
|
+
return tenant;
|
|
22
|
+
const kept = Object.fromEntries(Object.entries(metadata).filter(([k]) => !INTERNAL_TENANT_METADATA_KEYS.includes(k)));
|
|
23
|
+
return { ...tenant, metadata: kept };
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A plan without the payment provider's ids: each quota's `providerRefs`
|
|
27
|
+
* (Stripe price and meter ids) is dropped. Prices and quotas otherwise stay
|
|
28
|
+
* whole — `create_plan` and friends still return the full plan.
|
|
29
|
+
*/
|
|
30
|
+
export function shapePlan(plan) {
|
|
31
|
+
if (!plan || typeof plan !== 'object')
|
|
32
|
+
return plan;
|
|
33
|
+
const quotas = plan.quotas;
|
|
34
|
+
if (!Array.isArray(quotas))
|
|
35
|
+
return plan;
|
|
36
|
+
return {
|
|
37
|
+
...plan,
|
|
38
|
+
quotas: quotas.map((q) => {
|
|
39
|
+
if (!q || typeof q !== 'object')
|
|
40
|
+
return q;
|
|
41
|
+
const { providerRefs: _drop, ...rest } = q;
|
|
42
|
+
return rest;
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Roles with each privilege named once. Every role used to carry the full
|
|
48
|
+
* privilege object (id, key, description) for every privilege it grants, so a
|
|
49
|
+
* five-role app repeated the same descriptions five times. Now each role lists
|
|
50
|
+
* privilege KEYS — what code and create_role/update_role take — and the
|
|
51
|
+
* descriptions appear once, in `privileges`.
|
|
52
|
+
*/
|
|
53
|
+
export function shapeRoleList(roles) {
|
|
54
|
+
const privileges = {};
|
|
55
|
+
const shaped = (roles ?? []).map((role) => {
|
|
56
|
+
const r = (role ?? {});
|
|
57
|
+
const granted = Array.isArray(r.privileges) ? r.privileges : [];
|
|
58
|
+
const keys = [];
|
|
59
|
+
for (const p of granted) {
|
|
60
|
+
if (typeof p === 'string') {
|
|
61
|
+
keys.push(p);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (!p || typeof p.key !== 'string')
|
|
65
|
+
continue;
|
|
66
|
+
keys.push(p.key);
|
|
67
|
+
if (!(p.key in privileges))
|
|
68
|
+
privileges[p.key] = p.description ?? '';
|
|
69
|
+
}
|
|
70
|
+
return { ...r, privileges: keys };
|
|
71
|
+
});
|
|
72
|
+
return { roles: shaped, privileges };
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../src/shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;AAE1F,uEAAuE;AACvE,MAAM,UAAU,WAAW,CAAI,MAAS;IACtC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IACzD,MAAM,QAAQ,GAAI,MAAiC,CAAC,QAAQ,CAAC;IAC7D,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAC7B,MAAM,CAAC,OAAO,CAAC,QAAmC,CAAC,CAAC,MAAM,CACxD,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC,CAAC,CACpD,CACF,CAAC;IACF,OAAO,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAO,CAAC;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAI,IAAO;IAClC,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM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