@fusebase/fusebase-gate-sdk 2.2.2-sdk.21 → 2.2.2-sdk.23
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/apis/IsolatedStoresApi.d.ts +33 -4
- package/dist/apis/IsolatedStoresApi.js +34 -3
- package/dist/types/isolated-store/isolated-store.d.ts +47 -0
- package/package.json +1 -1
- package/release-notes/2.2.2-sdk.23.md +9 -0
- package/release-notes/latest.md +3 -3
- package/release-notes/2.2.2-sdk.21.md +0 -9
|
@@ -5,10 +5,23 @@
|
|
|
5
5
|
* Domain: isolated-stores
|
|
6
6
|
*/
|
|
7
7
|
import type { Client } from "../runtime/transport";
|
|
8
|
-
import type { CountIsolatedStoreNoSqlDocumentsRequestContract, CountIsolatedStoreNoSqlDocumentsResponseContract, CreateIsolatedStoreCheckpointRequestContract, CreateIsolatedStoreCheckpointResponseContract, CreateIsolatedStoreNoSqlCollectionRequestContract, CreateIsolatedStoreNoSqlCollectionResponseContract, CreateIsolatedStoreRequestContract, CreateIsolatedStoreResponseContract, DeleteIsolatedStoreNoSqlDocumentResponseContract, DeleteIsolatedStoreStageResponseContract, ImportIsolatedStoreNoSqlDocumentsRequestContract, ImportIsolatedStoreNoSqlDocumentsResponseContract, InitIsolatedStoreStageRequestContract, InitIsolatedStoreStageResponseContract, IsolatedStoreIdInPathRequired, IsolatedStoreListResponseContract, IsolatedStoreNoSqlCollectionNameInPathRequired, IsolatedStoreNoSqlDocumentIdInPathRequired, IsolatedStoreNoSqlDocumentResponseContract, IsolatedStoreNoSqlListCollectionsResponseContract, IsolatedStoreNoSqlStatsResponseContract, IsolatedStoreResponseContract, IsolatedStoreRevisionIdInPathRequired, IsolatedStoreRevisionListResponseContract, IsolatedStoreSqlBatchInsertRequestContract, IsolatedStoreSqlBatchInsertResponseContract, IsolatedStoreSqlCountRequestContract, IsolatedStoreSqlCountResponseContract, IsolatedStoreSqlDeleteRequestContract, IsolatedStoreSqlDeleteResponseContract, IsolatedStoreSqlDescribeTableResponseContract, IsolatedStoreSqlExecuteRequestContract, IsolatedStoreSqlExecuteResponseContract, IsolatedStoreSqlImportRequestContract, IsolatedStoreSqlImportResponseContract, IsolatedStoreSqlInsertRequestContract, IsolatedStoreSqlInsertResponseContract, IsolatedStoreSqlListTablesResponseContract, IsolatedStoreSqlQueryRequestContract, IsolatedStoreSqlQueryResponseContract, IsolatedStoreSqlSchemaNameInQueryOptional, IsolatedStoreSqlSelectRequestContract, IsolatedStoreSqlSelectResponseContract, IsolatedStoreSqlStatsResponseContract, IsolatedStoreSqlTableNameInPathRequired, IsolatedStoreSqlUpdateRequestContract, IsolatedStoreSqlUpdateResponseContract, IsolatedStoreStageInPathRequired, IsolatedStoreStageListResponseContract, orgIdInPathRequired, PutIsolatedStoreNoSqlDocumentRequestContract, PutIsolatedStoreNoSqlDocumentResponseContract, QueryIsolatedStoreNoSqlDocumentsRequestContract, QueryIsolatedStoreNoSqlDocumentsResponseContract, RestoreIsolatedStoreRevisionResponseContract } from "../types";
|
|
8
|
+
import type { ApplyIsolatedStoreSqlMigrationsRequestContract, ApplyIsolatedStoreSqlMigrationsResponseContract, CountIsolatedStoreNoSqlDocumentsRequestContract, CountIsolatedStoreNoSqlDocumentsResponseContract, CreateIsolatedStoreCheckpointRequestContract, CreateIsolatedStoreCheckpointResponseContract, CreateIsolatedStoreNoSqlCollectionRequestContract, CreateIsolatedStoreNoSqlCollectionResponseContract, CreateIsolatedStoreRequestContract, CreateIsolatedStoreResponseContract, DeleteIsolatedStoreNoSqlDocumentResponseContract, DeleteIsolatedStoreStageResponseContract, GetIsolatedStoreSqlMigrationStatusRequestContract, ImportIsolatedStoreNoSqlDocumentsRequestContract, ImportIsolatedStoreNoSqlDocumentsResponseContract, InitIsolatedStoreStageRequestContract, InitIsolatedStoreStageResponseContract, IsolatedStoreIdInPathRequired, IsolatedStoreListResponseContract, IsolatedStoreNoSqlCollectionNameInPathRequired, IsolatedStoreNoSqlDocumentIdInPathRequired, IsolatedStoreNoSqlDocumentResponseContract, IsolatedStoreNoSqlListCollectionsResponseContract, IsolatedStoreNoSqlStatsResponseContract, IsolatedStoreResponseContract, IsolatedStoreRevisionIdInPathRequired, IsolatedStoreRevisionListResponseContract, IsolatedStoreSqlBatchInsertRequestContract, IsolatedStoreSqlBatchInsertResponseContract, IsolatedStoreSqlCountRequestContract, IsolatedStoreSqlCountResponseContract, IsolatedStoreSqlDeleteRequestContract, IsolatedStoreSqlDeleteResponseContract, IsolatedStoreSqlDescribeTableResponseContract, IsolatedStoreSqlExecuteRequestContract, IsolatedStoreSqlExecuteResponseContract, IsolatedStoreSqlImportRequestContract, IsolatedStoreSqlImportResponseContract, IsolatedStoreSqlInsertRequestContract, IsolatedStoreSqlInsertResponseContract, IsolatedStoreSqlListTablesResponseContract, IsolatedStoreSqlMigrationStatusContract, IsolatedStoreSqlQueryRequestContract, IsolatedStoreSqlQueryResponseContract, IsolatedStoreSqlSchemaNameInQueryOptional, IsolatedStoreSqlSelectRequestContract, IsolatedStoreSqlSelectResponseContract, IsolatedStoreSqlStatsResponseContract, IsolatedStoreSqlTableNameInPathRequired, IsolatedStoreSqlUpdateRequestContract, IsolatedStoreSqlUpdateResponseContract, IsolatedStoreStageInPathRequired, IsolatedStoreStageListResponseContract, ListIsolatedStoresClientIdInQueryOptional, orgIdInPathRequired, PutIsolatedStoreNoSqlDocumentRequestContract, PutIsolatedStoreNoSqlDocumentResponseContract, QueryIsolatedStoreNoSqlDocumentsRequestContract, QueryIsolatedStoreNoSqlDocumentsResponseContract, RestoreIsolatedStoreRevisionResponseContract } from "../types";
|
|
9
9
|
export declare class IsolatedStoresApi {
|
|
10
10
|
private client;
|
|
11
11
|
constructor(client: Client);
|
|
12
|
+
/**
|
|
13
|
+
* Apply SQL migrations
|
|
14
|
+
* Applies pending postgres migrations from an ordered migration bundle into the selected stage database. For prod, gate creates a checkpoint automatically before applying pending migrations. Applied history must match the bundle prefix exactly; drifted stages are rejected. MCP clients often cap tool_call JSON body size (on the order of a few thousand characters); the request includes full SQL text for every bundle version cumulatively, so large bundles may fail or truncate in chat-only MCP. For schema work under tight limits prefer executeIsolatedStoreSql with one statement per call and keep canonical SQL plus a manifest for apply from SDK or non-MCP callers.
|
|
15
|
+
*/
|
|
16
|
+
applyIsolatedStoreSqlMigrations(params: {
|
|
17
|
+
path: {
|
|
18
|
+
orgId: orgIdInPathRequired;
|
|
19
|
+
storeId: IsolatedStoreIdInPathRequired;
|
|
20
|
+
stage: IsolatedStoreStageInPathRequired;
|
|
21
|
+
};
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
body: ApplyIsolatedStoreSqlMigrationsRequestContract;
|
|
24
|
+
}): Promise<ApplyIsolatedStoreSqlMigrationsResponseContract>;
|
|
12
25
|
/**
|
|
13
26
|
* Batch insert rows
|
|
14
27
|
* Inserts multiple rows into a postgres table with a shared column set. Row cap per request is floor(65535 / columnCount) (Postgres bind-parameter limit). For very large loads use importIsolatedStoreSqlRows (COPY FROM STDIN).
|
|
@@ -114,7 +127,7 @@ export declare class IsolatedStoresApi {
|
|
|
114
127
|
}): Promise<IsolatedStoreSqlDeleteResponseContract>;
|
|
115
128
|
/**
|
|
116
129
|
* Delete isolated store stage
|
|
117
|
-
* Removes the stage instance and its revisions. When the stage was auto-provisioned on the isolated Postgres or isolated Mongo server, gate also drops the provisioned database after registry rows are removed.
|
|
130
|
+
* Removes the stage instance and its revisions. When the stage was auto-provisioned on the isolated Postgres or isolated Mongo server, gate also drops the provisioned database after registry rows are removed. After deletion the stage no longer appears in listIsolatedStoreStages; recreate it with initIsolatedStoreStage using the same stage name.
|
|
118
131
|
*/
|
|
119
132
|
deleteIsolatedStoreStage(params: {
|
|
120
133
|
path: {
|
|
@@ -142,7 +155,7 @@ export declare class IsolatedStoresApi {
|
|
|
142
155
|
}): Promise<IsolatedStoreSqlDescribeTableResponseContract>;
|
|
143
156
|
/**
|
|
144
157
|
* Run writable SQL statement
|
|
145
|
-
* Runs a single SQL statement with execute access against the postgres binding of the selected isolated store stage instance.
|
|
158
|
+
* Runs a single SQL statement with execute access against the postgres binding of the selected isolated store stage instance. Unlike applyIsolatedStoreSqlMigrations, this does not record entries in the stage migration journal (fusebase_schema_migrations); after DDL applied only via execute, that table may be absent until a proper migration apply runs.
|
|
146
159
|
*/
|
|
147
160
|
executeIsolatedStoreSql(params: {
|
|
148
161
|
path: {
|
|
@@ -190,6 +203,19 @@ export declare class IsolatedStoresApi {
|
|
|
190
203
|
};
|
|
191
204
|
headers?: Record<string, string>;
|
|
192
205
|
}): Promise<IsolatedStoreNoSqlStatsResponseContract>;
|
|
206
|
+
/**
|
|
207
|
+
* Get SQL migration status
|
|
208
|
+
* Compares an ordered SQL migration bundle with the migration journal stored inside the selected postgres stage database. Returns applied migrations, pending migrations, and drift issues when the applied history no longer matches the bundle prefix.
|
|
209
|
+
*/
|
|
210
|
+
getIsolatedStoreSqlMigrationStatus(params: {
|
|
211
|
+
path: {
|
|
212
|
+
orgId: orgIdInPathRequired;
|
|
213
|
+
storeId: IsolatedStoreIdInPathRequired;
|
|
214
|
+
stage: IsolatedStoreStageInPathRequired;
|
|
215
|
+
};
|
|
216
|
+
headers?: Record<string, string>;
|
|
217
|
+
body: GetIsolatedStoreSqlMigrationStatusRequestContract;
|
|
218
|
+
}): Promise<IsolatedStoreSqlMigrationStatusContract>;
|
|
193
219
|
/**
|
|
194
220
|
* Get SQL stats
|
|
195
221
|
* Returns table-level stats for the selected isolated postgres stage, including tables, columns, row counts, and relation-size hints.
|
|
@@ -279,12 +305,15 @@ export declare class IsolatedStoresApi {
|
|
|
279
305
|
}): Promise<IsolatedStoreRevisionListResponseContract>;
|
|
280
306
|
/**
|
|
281
307
|
* List isolated stores
|
|
282
|
-
* Returns the isolated store registry for the organization. This is a control-plane endpoint behind FEATURE_FLAGS=isolated_stores.
|
|
308
|
+
* Returns the isolated store registry for the organization. Optional query `clientId` limits results to stores whose `app` source scope `sourceId` matches (same identifier as the token `client` scope for app-owned stores). Omit or leave empty to list all org stores. This is a control-plane endpoint behind FEATURE_FLAGS=isolated_stores.
|
|
283
309
|
*/
|
|
284
310
|
listIsolatedStores(params: {
|
|
285
311
|
path: {
|
|
286
312
|
orgId: orgIdInPathRequired;
|
|
287
313
|
};
|
|
314
|
+
query?: {
|
|
315
|
+
clientId?: ListIsolatedStoresClientIdInQueryOptional;
|
|
316
|
+
};
|
|
288
317
|
headers?: Record<string, string>;
|
|
289
318
|
}): Promise<IsolatedStoreListResponseContract>;
|
|
290
319
|
/**
|
|
@@ -11,6 +11,21 @@ class IsolatedStoresApi {
|
|
|
11
11
|
constructor(client) {
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Apply SQL migrations
|
|
16
|
+
* Applies pending postgres migrations from an ordered migration bundle into the selected stage database. For prod, gate creates a checkpoint automatically before applying pending migrations. Applied history must match the bundle prefix exactly; drifted stages are rejected. MCP clients often cap tool_call JSON body size (on the order of a few thousand characters); the request includes full SQL text for every bundle version cumulatively, so large bundles may fail or truncate in chat-only MCP. For schema work under tight limits prefer executeIsolatedStoreSql with one statement per call and keep canonical SQL plus a manifest for apply from SDK or non-MCP callers.
|
|
17
|
+
*/
|
|
18
|
+
async applyIsolatedStoreSqlMigrations(params) {
|
|
19
|
+
return this.client.request({
|
|
20
|
+
method: "POST",
|
|
21
|
+
path: "/:orgId/isolated-stores/:storeId/stages/:stage/sql/migrations/apply",
|
|
22
|
+
pathParams: params.path,
|
|
23
|
+
headers: params.headers,
|
|
24
|
+
body: params.body,
|
|
25
|
+
opId: "applyIsolatedStoreSqlMigrations",
|
|
26
|
+
expectedContentType: "application/json",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
14
29
|
/**
|
|
15
30
|
* Batch insert rows
|
|
16
31
|
* Inserts multiple rows into a postgres table with a shared column set. Row cap per request is floor(65535 / columnCount) (Postgres bind-parameter limit). For very large loads use importIsolatedStoreSqlRows (COPY FROM STDIN).
|
|
@@ -132,7 +147,7 @@ class IsolatedStoresApi {
|
|
|
132
147
|
}
|
|
133
148
|
/**
|
|
134
149
|
* Delete isolated store stage
|
|
135
|
-
* Removes the stage instance and its revisions. When the stage was auto-provisioned on the isolated Postgres or isolated Mongo server, gate also drops the provisioned database after registry rows are removed.
|
|
150
|
+
* Removes the stage instance and its revisions. When the stage was auto-provisioned on the isolated Postgres or isolated Mongo server, gate also drops the provisioned database after registry rows are removed. After deletion the stage no longer appears in listIsolatedStoreStages; recreate it with initIsolatedStoreStage using the same stage name.
|
|
136
151
|
*/
|
|
137
152
|
async deleteIsolatedStoreStage(params) {
|
|
138
153
|
return this.client.request({
|
|
@@ -161,7 +176,7 @@ class IsolatedStoresApi {
|
|
|
161
176
|
}
|
|
162
177
|
/**
|
|
163
178
|
* Run writable SQL statement
|
|
164
|
-
* Runs a single SQL statement with execute access against the postgres binding of the selected isolated store stage instance.
|
|
179
|
+
* Runs a single SQL statement with execute access against the postgres binding of the selected isolated store stage instance. Unlike applyIsolatedStoreSqlMigrations, this does not record entries in the stage migration journal (fusebase_schema_migrations); after DDL applied only via execute, that table may be absent until a proper migration apply runs.
|
|
165
180
|
*/
|
|
166
181
|
async executeIsolatedStoreSql(params) {
|
|
167
182
|
return this.client.request({
|
|
@@ -216,6 +231,21 @@ class IsolatedStoresApi {
|
|
|
216
231
|
expectedContentType: "application/json",
|
|
217
232
|
});
|
|
218
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* Get SQL migration status
|
|
236
|
+
* Compares an ordered SQL migration bundle with the migration journal stored inside the selected postgres stage database. Returns applied migrations, pending migrations, and drift issues when the applied history no longer matches the bundle prefix.
|
|
237
|
+
*/
|
|
238
|
+
async getIsolatedStoreSqlMigrationStatus(params) {
|
|
239
|
+
return this.client.request({
|
|
240
|
+
method: "POST",
|
|
241
|
+
path: "/:orgId/isolated-stores/:storeId/stages/:stage/sql/migrations/status",
|
|
242
|
+
pathParams: params.path,
|
|
243
|
+
headers: params.headers,
|
|
244
|
+
body: params.body,
|
|
245
|
+
opId: "getIsolatedStoreSqlMigrationStatus",
|
|
246
|
+
expectedContentType: "application/json",
|
|
247
|
+
});
|
|
248
|
+
}
|
|
219
249
|
/**
|
|
220
250
|
* Get SQL stats
|
|
221
251
|
* Returns table-level stats for the selected isolated postgres stage, including tables, columns, row counts, and relation-size hints.
|
|
@@ -320,13 +350,14 @@ class IsolatedStoresApi {
|
|
|
320
350
|
}
|
|
321
351
|
/**
|
|
322
352
|
* List isolated stores
|
|
323
|
-
* Returns the isolated store registry for the organization. This is a control-plane endpoint behind FEATURE_FLAGS=isolated_stores.
|
|
353
|
+
* Returns the isolated store registry for the organization. Optional query `clientId` limits results to stores whose `app` source scope `sourceId` matches (same identifier as the token `client` scope for app-owned stores). Omit or leave empty to list all org stores. This is a control-plane endpoint behind FEATURE_FLAGS=isolated_stores.
|
|
324
354
|
*/
|
|
325
355
|
async listIsolatedStores(params) {
|
|
326
356
|
return this.client.request({
|
|
327
357
|
method: "GET",
|
|
328
358
|
path: "/:orgId/isolated-stores",
|
|
329
359
|
pathParams: params.path,
|
|
360
|
+
query: params.query,
|
|
330
361
|
headers: params.headers,
|
|
331
362
|
opId: "listIsolatedStores",
|
|
332
363
|
expectedContentType: "application/json",
|
|
@@ -115,6 +115,51 @@ export interface IsolatedStoreSqlStatsResponseContract {
|
|
|
115
115
|
totalBytes?: number | null;
|
|
116
116
|
tables: IsolatedStoreSqlTableStatsContract[];
|
|
117
117
|
}
|
|
118
|
+
export interface IsolatedStoreSqlMigrationBundleEntryContract {
|
|
119
|
+
version: number;
|
|
120
|
+
name: string;
|
|
121
|
+
checksum: string;
|
|
122
|
+
sql: string;
|
|
123
|
+
}
|
|
124
|
+
export interface IsolatedStoreSqlMigrationBundleContract {
|
|
125
|
+
bundleVersion?: string | null;
|
|
126
|
+
migrations: IsolatedStoreSqlMigrationBundleEntryContract[];
|
|
127
|
+
}
|
|
128
|
+
export interface IsolatedStoreSqlAppliedMigrationContract {
|
|
129
|
+
version: number;
|
|
130
|
+
name: string;
|
|
131
|
+
checksum: string;
|
|
132
|
+
bundleVersion?: string | null;
|
|
133
|
+
appliedAt: string;
|
|
134
|
+
appliedBy: string;
|
|
135
|
+
}
|
|
136
|
+
export interface IsolatedStoreSqlMigrationStatusContract {
|
|
137
|
+
databaseName: string;
|
|
138
|
+
schemaName: string;
|
|
139
|
+
journalTableName: string;
|
|
140
|
+
currentVersion?: number | null;
|
|
141
|
+
bundleHeadVersion?: number | null;
|
|
142
|
+
appliedCount: number;
|
|
143
|
+
pendingCount: number;
|
|
144
|
+
isDrifted: boolean;
|
|
145
|
+
issues: string[];
|
|
146
|
+
appliedMigrations: IsolatedStoreSqlAppliedMigrationContract[];
|
|
147
|
+
pendingMigrations: IsolatedStoreSqlMigrationBundleEntryContract[];
|
|
148
|
+
}
|
|
149
|
+
export interface GetIsolatedStoreSqlMigrationStatusRequestContract {
|
|
150
|
+
schemaName?: IsolatedStoreSqlSchemaNameInQueryOptional;
|
|
151
|
+
bundle: IsolatedStoreSqlMigrationBundleContract;
|
|
152
|
+
}
|
|
153
|
+
export interface ApplyIsolatedStoreSqlMigrationsRequestContract {
|
|
154
|
+
schemaName?: IsolatedStoreSqlSchemaNameInQueryOptional;
|
|
155
|
+
bundle: IsolatedStoreSqlMigrationBundleContract;
|
|
156
|
+
}
|
|
157
|
+
export interface ApplyIsolatedStoreSqlMigrationsResponseContract {
|
|
158
|
+
appliedCount: number;
|
|
159
|
+
appliedVersions: number[];
|
|
160
|
+
checkpointRevision?: IsolatedStoreRevisionContract | null;
|
|
161
|
+
status: IsolatedStoreSqlMigrationStatusContract;
|
|
162
|
+
}
|
|
118
163
|
export interface IsolatedStoreSqlListTablesResponseContract {
|
|
119
164
|
tables: IsolatedStoreSqlTableContract[];
|
|
120
165
|
}
|
|
@@ -247,6 +292,8 @@ export interface CreateIsolatedStoreResponseContract {
|
|
|
247
292
|
export interface IsolatedStoreListResponseContract {
|
|
248
293
|
stores: IsolatedStoreContract[];
|
|
249
294
|
}
|
|
295
|
+
/** Optional `clientId` query for `listIsolatedStores`; matches `app` source scope `sourceId`. */
|
|
296
|
+
export type ListIsolatedStoresClientIdInQueryOptional = string | null;
|
|
250
297
|
export interface IsolatedStoreResponseContract {
|
|
251
298
|
store: IsolatedStoreContract;
|
|
252
299
|
}
|
package/package.json
CHANGED
package/release-notes/latest.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Release Notes 2.2.2-sdk.
|
|
1
|
+
# Release Notes 2.2.2-sdk.23
|
|
2
2
|
|
|
3
3
|
- Current ref: `HEAD`
|
|
4
|
-
- Previous tag: `v2.2.2-sdk.
|
|
5
|
-
- Generated at: 2026-04-
|
|
4
|
+
- Previous tag: `v2.2.2-sdk.23`
|
|
5
|
+
- Generated at: 2026-04-04T20:19:21.907Z
|
|
6
6
|
|
|
7
7
|
## Included Drafts
|
|
8
8
|
|