@formigio/fazemos-cli 0.10.88 → 0.10.90
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/api.d.ts +37 -8
- package/dist/api.js +89 -16
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +270 -77
- package/dist/index.js.map +1 -1
- package/dist/runbook/checks.d.ts +22 -0
- package/dist/runbook/checks.js +28 -3
- package/dist/runbook/checks.js.map +1 -1
- package/dist/tpl/diff.d.ts +14 -0
- package/dist/tpl/diff.js +71 -0
- package/dist/tpl/diff.js.map +1 -0
- package/dist/tpl/drift.d.ts +62 -0
- package/dist/tpl/drift.js +198 -0
- package/dist/tpl/drift.js.map +1 -0
- package/dist/tpl/normalize.d.ts +33 -0
- package/dist/tpl/normalize.js +40 -0
- package/dist/tpl/normalize.js.map +1 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AuthMeResponse } from './config.js';
|
|
1
|
+
import { type AuthMeResponse, type CachedProject } from './config.js';
|
|
2
2
|
/**
|
|
3
3
|
* Error thrown when an API request returns a non-2xx response. Carries the
|
|
4
4
|
* `code` field from the API's error envelope (when present) so command
|
|
@@ -38,20 +38,49 @@ export interface ApiOptions {
|
|
|
38
38
|
*/
|
|
39
39
|
headers?: Record<string, string>;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* BUG242 — options for the shared slug resolver.
|
|
43
|
+
*
|
|
44
|
+
* - `orgId` — resolve against this org instead of the active org. Several
|
|
45
|
+
* open-coded sites (e.g. `fazemos use`) validate a slug against a
|
|
46
|
+
* `resolvedOrgId` that differs from the active org.
|
|
47
|
+
* - `includeArchived` — tier 3's org-projects-list fallback defaults to
|
|
48
|
+
* `status=active`, matching /auth/me's own `p.status='active'` cache
|
|
49
|
+
* semantics. Only `projects show` passes `includeArchived: true`
|
|
50
|
+
* (`status=all`), per Marco's ruling (sizing brief §5.1, Risk 1): every
|
|
51
|
+
* other `--project <slug>` site must NOT make archived projects
|
|
52
|
+
* addressable (`rul_project_archived_scope_gate`,
|
|
53
|
+
* `rul_cross_org_archived_projects_excluded`).
|
|
54
|
+
* - `allowAgentListFallback` — BUG242-R2: opts an agent credential INTO tier
|
|
55
|
+
* 3. Default (unset/false) keeps every existing `--project <slug>` site
|
|
56
|
+
* byte-identical to the original §5.1 agent-skip behaviour. `projects
|
|
57
|
+
* show` is the only site that passes `true` — see the guard note below.
|
|
58
|
+
*/
|
|
59
|
+
export interface ResolveProjectSlugOptions {
|
|
60
|
+
orgId?: string;
|
|
61
|
+
includeArchived?: boolean;
|
|
62
|
+
allowAgentListFallback?: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* BUG242 — sibling of `resolveProjectIdBySlug` that returns the full cached
|
|
66
|
+
* project record (name/slug/colorIndex/status), for sites that render more
|
|
67
|
+
* than the id. Shares the exact same three-tier body above.
|
|
68
|
+
*/
|
|
69
|
+
export declare function resolveProjectBySlug(slug: string, opts?: ResolveProjectSlugOptions): Promise<CachedProject | null>;
|
|
41
70
|
/**
|
|
42
71
|
* Resolve the project id to send as X-Fazemos-Project-Id on a scoped call.
|
|
43
72
|
*
|
|
44
|
-
* Resolution order:
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
73
|
+
* Resolution order: see `resolveProjectRecordBySlug` above (cache → refresh
|
|
74
|
+
* → org-projects-list fallback). Existing positional callers
|
|
75
|
+
* (`resolveProjectIdBySlug(slug)` / `resolveProjectIdBySlug()`) are
|
|
76
|
+
* unaffected — `opts` is optional and defaults to the active org,
|
|
77
|
+
* `status=active`.
|
|
49
78
|
*
|
|
50
|
-
* On a slug that refuses to resolve after
|
|
79
|
+
* On a slug that refuses to resolve after all tiers → throws ApiError with
|
|
51
80
|
* code UNKNOWN_PROJECT. The outer command handler prints the standard
|
|
52
81
|
* "unknown project: <slug>" and exits 1.
|
|
53
82
|
*/
|
|
54
|
-
export declare function resolveProjectIdBySlug(slugOverride?: string): Promise<string | null>;
|
|
83
|
+
export declare function resolveProjectIdBySlug(slugOverride?: string, opts?: ResolveProjectSlugOptions): Promise<string | null>;
|
|
55
84
|
/**
|
|
56
85
|
* Resolve an org identifier that may be a UUID or a slug.
|
|
57
86
|
*
|
package/dist/api.js
CHANGED
|
@@ -21,32 +21,105 @@ export class ApiError extends Error {
|
|
|
21
21
|
this.body = body;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* BUG242 — shared body for project-slug resolution. Three tiers:
|
|
26
|
+
*
|
|
27
|
+
* 1. Cache — `findProjectBySlug` against the cached /auth/me response.
|
|
28
|
+
* 2. Refresh — one forced /auth/me refresh + retry (covers "just created
|
|
29
|
+
* on another host" / stale cache).
|
|
30
|
+
* 3. Fallback — `GET /api/organizations/:orgId/projects` (NEW), matched on
|
|
31
|
+
* exact slug. This is the fix: `/auth/me` only returns projects the
|
|
32
|
+
* caller has a `project_members` row for, but an owner/admin without
|
|
33
|
+
* one (or hitting a swallowed refresh error) sees the project in
|
|
34
|
+
* `projects list` yet gets "Unknown project" everywhere else. The
|
|
35
|
+
* list endpoint already serves owners/admins org-wide
|
|
36
|
+
* (`rul_project_detail_membership_check`), so it's a safe fallback.
|
|
37
|
+
*
|
|
38
|
+
* Tier 3 is skipped for agent credentials (`isAgentCredential()`) UNLESS the
|
|
39
|
+
* caller opts in with `allowAgentListFallback: true`
|
|
40
|
+
* (BUG242-R2 — the original §5.1 "agent path stays byte-identical" ruling
|
|
41
|
+
* missed that `GET /api/organizations/:orgId/projects` is already
|
|
42
|
+
* agent-reachable with no role gate, same as `projects list`. Routing
|
|
43
|
+
* `projects show` through it widens no machine-caller surface — it just
|
|
44
|
+
* lets the one read command whose entire job is "look up this slug"
|
|
45
|
+
* actually do that for an agent seat). Every other `--project <slug>` site
|
|
46
|
+
* leaves the option unset and keeps the original behaviour: agents resolve
|
|
47
|
+
* scope through `fetchCredentialScope`, not /auth/me, and the fallback
|
|
48
|
+
* would add an unexpected network call plus risk a 403 on a 404-shaped miss
|
|
49
|
+
* (sizing brief §5.1, Risk 2/3).
|
|
50
|
+
*
|
|
51
|
+
* Returns `null` when every tier misses (never throws for a genuine miss —
|
|
52
|
+
* that's the caller's job, so each call site keeps its own message/exit
|
|
53
|
+
* behaviour). Throws `ApiError` (code `UNKNOWN_PROJECT`, with the HTTP
|
|
54
|
+
* status folded into the message) only when the tier-3 network call itself
|
|
55
|
+
* fails — this must never be swallowed silently and never throw unhandled.
|
|
56
|
+
*/
|
|
57
|
+
async function resolveProjectRecordBySlug(slug, opts = {}) {
|
|
58
|
+
const orgId = opts.orgId ?? getActiveOrgId();
|
|
59
|
+
if (!orgId)
|
|
60
|
+
return null;
|
|
61
|
+
let project = findProjectBySlug(orgId, slug);
|
|
62
|
+
// F3 (BUG242-R2): skip the doomed /auth/me refresh under an agent
|
|
63
|
+
// credential — it always 403s (WRONG_ENDPOINT_FOR_AGENT) and
|
|
64
|
+
// refreshAuthMeCache() swallows the error, so this only tidies a noisy,
|
|
65
|
+
// guaranteed-to-fail round trip. Behaviour is unchanged either way.
|
|
66
|
+
if (!project && !isAgentCredential()) {
|
|
67
|
+
await refreshAuthMeCache();
|
|
68
|
+
project = findProjectBySlug(orgId, slug);
|
|
69
|
+
}
|
|
70
|
+
if (project)
|
|
71
|
+
return project;
|
|
72
|
+
// Tier 3 — human callers, or an agent credential that explicitly opted in
|
|
73
|
+
// via allowAgentListFallback (BUG242-R2; see option doc above).
|
|
74
|
+
if (isAgentCredential() && !opts.allowAgentListFallback)
|
|
75
|
+
return null;
|
|
76
|
+
const status = opts.includeArchived ? 'all' : 'active';
|
|
77
|
+
let listResult;
|
|
78
|
+
try {
|
|
79
|
+
listResult = (await api('GET', `/api/organizations/${orgId}/projects?status=${status}`, undefined, { noProjectHeader: true }));
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
const code = err instanceof ApiError ? err.status : 'unknown';
|
|
83
|
+
throw new ApiError(`unknown project: ${slug} (project list fallback failed: ${code})`, 400, 'UNKNOWN_PROJECT');
|
|
84
|
+
}
|
|
85
|
+
const match = listResult.projects?.find((p) => p.slug === slug);
|
|
86
|
+
if (!match)
|
|
87
|
+
return null;
|
|
88
|
+
return {
|
|
89
|
+
id: match.id,
|
|
90
|
+
slug: match.slug,
|
|
91
|
+
name: match.name,
|
|
92
|
+
colorIndex: match.colorIndex,
|
|
93
|
+
status: match.status,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* BUG242 — sibling of `resolveProjectIdBySlug` that returns the full cached
|
|
98
|
+
* project record (name/slug/colorIndex/status), for sites that render more
|
|
99
|
+
* than the id. Shares the exact same three-tier body above.
|
|
100
|
+
*/
|
|
101
|
+
export async function resolveProjectBySlug(slug, opts = {}) {
|
|
102
|
+
return resolveProjectRecordBySlug(slug, opts);
|
|
103
|
+
}
|
|
24
104
|
/**
|
|
25
105
|
* Resolve the project id to send as X-Fazemos-Project-Id on a scoped call.
|
|
26
106
|
*
|
|
27
|
-
* Resolution order:
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
107
|
+
* Resolution order: see `resolveProjectRecordBySlug` above (cache → refresh
|
|
108
|
+
* → org-projects-list fallback). Existing positional callers
|
|
109
|
+
* (`resolveProjectIdBySlug(slug)` / `resolveProjectIdBySlug()`) are
|
|
110
|
+
* unaffected — `opts` is optional and defaults to the active org,
|
|
111
|
+
* `status=active`.
|
|
32
112
|
*
|
|
33
|
-
* On a slug that refuses to resolve after
|
|
113
|
+
* On a slug that refuses to resolve after all tiers → throws ApiError with
|
|
34
114
|
* code UNKNOWN_PROJECT. The outer command handler prints the standard
|
|
35
115
|
* "unknown project: <slug>" and exits 1.
|
|
36
116
|
*/
|
|
37
|
-
export async function resolveProjectIdBySlug(slugOverride) {
|
|
38
|
-
const orgId = getActiveOrgId();
|
|
117
|
+
export async function resolveProjectIdBySlug(slugOverride, opts = {}) {
|
|
118
|
+
const orgId = opts.orgId ?? getActiveOrgId();
|
|
39
119
|
if (!orgId)
|
|
40
120
|
return null;
|
|
41
121
|
if (slugOverride) {
|
|
42
|
-
|
|
43
|
-
if (!project) {
|
|
44
|
-
// Force-refresh the /auth/me cache. A slug miss is cheap to verify
|
|
45
|
-
// and catches the common "created via another host or via the web
|
|
46
|
-
// UI and not yet cached here" path.
|
|
47
|
-
await refreshAuthMeCache();
|
|
48
|
-
project = findProjectBySlug(orgId, slugOverride);
|
|
49
|
-
}
|
|
122
|
+
const project = await resolveProjectRecordBySlug(slugOverride, { ...opts, orgId });
|
|
50
123
|
if (!project) {
|
|
51
124
|
throw new ApiError(`unknown project: ${slugOverride}`, 400, 'UNKNOWN_PROJECT');
|
|
52
125
|
}
|
package/dist/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,cAAc,EACd,gBAAgB,
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,cAAc,EACd,gBAAgB,GAGjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjC,MAAM,CAAS;IACf,IAAI,CAAU;IACd,IAAI,CAAW;IACf,YAAY,OAAe,EAAE,MAAc,EAAE,IAAa,EAAE,IA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+DAA+D;QAC/D,8DAA8D;QAC9D,IAAI,IAAI,KAAK,yBAAyB,EAAE,CAAC;YACvC,MAAM,IAAI,QAAQ,CAChB,8BAA8B,EAC9B,QAAQ,CAAC,MAAM,EACf,IAAI,EACJ,IAAI,CACL,CAAC;QACJ,CAAC;QAED,MAAM,IAAI,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,gBAAgB,EAAE,CAAC;AACrB,CAAC;AAED,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAa,EACb,SAAiB,EACjB,IAAkD;IAElD,OAAO,GAAG,CACR,OAAO,EACP,sBAAsB,KAAK,aAAa,SAAS,EAAE,EACnD,IAAI,EACJ,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAa,EACb,IAAmF;IAEnF,OAAO,GAAG,CACR,OAAO,EACP,sBAAsB,KAAK,EAAE,EAC7B,IAAI,EACJ,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -42,4 +42,15 @@ export declare function formatProviderLabel(provider: string | null | undefined)
|
|
|
42
42
|
* Returns 'github' or 'bitbucket'. Repeats on invalid input.
|
|
43
43
|
*/
|
|
44
44
|
export declare function promptProviderChoice(): Promise<'github' | 'bitbucket'>;
|
|
45
|
+
/**
|
|
46
|
+
* BUG261: `step.sections` is typed as `string` on the API contract, but some
|
|
47
|
+
* stored template definitions (older imports, hand-edited JSON) persist it as
|
|
48
|
+
* an array or object instead. Rendering code used to `as string` cast the raw
|
|
49
|
+
* value and call `.split('\n')` on it directly, which threw
|
|
50
|
+
* "full.split is not a function" at runtime for any non-string value. Render
|
|
51
|
+
* sites should call this helper instead of touching `step.sections` directly:
|
|
52
|
+
* a string passes through unchanged; anything else is pretty-printed as JSON
|
|
53
|
+
* so it can still be truncated/split like text.
|
|
54
|
+
*/
|
|
55
|
+
export declare function normalizeSectionsForDisplay(sections: unknown): string;
|
|
45
56
|
export { program };
|