@fonderie/client 0.30.0 → 1.0.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/brain/signatures.md +24 -2
- package/dist/index.cjs +22 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.js +22 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/brain/signatures.md
CHANGED
|
@@ -279,12 +279,14 @@ new AdminClient(opts: IAdminClientOptions): AdminClient
|
|
|
279
279
|
.attention(): Promise<IApiResponse<IAdminAttention>>
|
|
280
280
|
.manifest(): Promise<IApiResponse<IAdminManifest>>
|
|
281
281
|
.doctor(): Promise<IApiResponse<IAdminDoctorReport>>
|
|
282
|
-
.
|
|
282
|
+
.environment(): Promise<IApiResponse<IAdminEnvironmentReport>>
|
|
283
283
|
.routes(): Promise<IApiResponse<IAdminRoutesReport>>
|
|
284
284
|
.tokens(): Promise<IApiResponse<IAdminTokensReport>>
|
|
285
285
|
.adminLog(query?: IAdminLogQuery): Promise<IApiResponse<IAdminLogPage>>
|
|
286
286
|
.issueToken(input: IAdminIssueTokenInput): Promise<IApiResponse<IAdminIssuedToken>>
|
|
287
287
|
.revokeToken(id: string): Promise<IApiResponse<undefined>>
|
|
288
|
+
.migrations(): Promise<IApiResponse<IAdminMigrationsReport>>
|
|
289
|
+
.applyMigrations(module: string, expect: readonly string[]): Promise<IApiResponse<IAdminMigrationModule>>
|
|
288
290
|
|
|
289
291
|
interface IAuthAdminClientOptions {
|
|
290
292
|
baseUrl: string;
|
|
@@ -743,7 +745,7 @@ interface IAdminCheckResult {
|
|
|
743
745
|
durationMs: number;
|
|
744
746
|
}
|
|
745
747
|
|
|
746
|
-
interface
|
|
748
|
+
interface IAdminEnvironmentReport {
|
|
747
749
|
generatedAt: string;
|
|
748
750
|
readiness: IAdminReadiness;
|
|
749
751
|
modules: Array<{
|
|
@@ -861,6 +863,26 @@ interface IAdminIssuedToken extends IAdminTokenRecord {
|
|
|
861
863
|
token: string;
|
|
862
864
|
}
|
|
863
865
|
|
|
866
|
+
type MigrationImpact = 'additive' | 'destructive';
|
|
867
|
+
|
|
868
|
+
interface IAdminPendingMigration {
|
|
869
|
+
file: string;
|
|
870
|
+
impact: MigrationImpact;
|
|
871
|
+
destructive: string[];
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
interface IAdminMigrationModule {
|
|
875
|
+
name: string;
|
|
876
|
+
pending: IAdminPendingMigration[];
|
|
877
|
+
blockedBy: string | null;
|
|
878
|
+
appliable: boolean;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
interface IAdminMigrationsReport {
|
|
882
|
+
everApplied: boolean;
|
|
883
|
+
modules: IAdminMigrationModule[];
|
|
884
|
+
}
|
|
885
|
+
|
|
864
886
|
interface IAdminUserDTO extends IUserDTO {
|
|
865
887
|
deletedAt: string | null;
|
|
866
888
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1804,8 +1804,8 @@ var AdminClient = class {
|
|
|
1804
1804
|
doctor() {
|
|
1805
1805
|
return this.get("/doctor");
|
|
1806
1806
|
}
|
|
1807
|
-
|
|
1808
|
-
return this.get("/
|
|
1807
|
+
environment() {
|
|
1808
|
+
return this.get("/environment");
|
|
1809
1809
|
}
|
|
1810
1810
|
routes() {
|
|
1811
1811
|
return this.get("/routes");
|
|
@@ -1828,6 +1828,26 @@ var AdminClient = class {
|
|
|
1828
1828
|
revokeToken(id) {
|
|
1829
1829
|
return this.call("DELETE", `/access/tokens/${encodeURIComponent(id)}`);
|
|
1830
1830
|
}
|
|
1831
|
+
// What each module is waiting on, with every pending file's impact. Empty
|
|
1832
|
+
// when the deployment did not hand its migration sequence to the surface.
|
|
1833
|
+
migrations() {
|
|
1834
|
+
return this.get("/migrations");
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* Apply one module's pending migrations — all of them, or none.
|
|
1838
|
+
*
|
|
1839
|
+
* `expect` is the pending list you were shown, in order. If it no longer
|
|
1840
|
+
* matches, the server refuses with 409 MIGRATIONS_CHANGED rather than
|
|
1841
|
+
* applying something nobody reviewed. Also refuses 409 when an earlier
|
|
1842
|
+
* module is behind, and 422 when any pending file deletes data.
|
|
1843
|
+
*/
|
|
1844
|
+
applyMigrations(module2, expect) {
|
|
1845
|
+
return this.call(
|
|
1846
|
+
"POST",
|
|
1847
|
+
`/migrations/${encodeURIComponent(module2)}/apply`,
|
|
1848
|
+
{ expect }
|
|
1849
|
+
);
|
|
1850
|
+
}
|
|
1831
1851
|
};
|
|
1832
1852
|
|
|
1833
1853
|
// src/modules/auth-admin.ts
|