@xata.io/client 0.29.1 → 0.29.2
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/.turbo/turbo-add-version.log +1 -1
- package/.turbo/turbo-build.log +3 -3
- package/CHANGELOG.md +6 -0
- package/dist/index.cjs +48 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +283 -74
- package/dist/index.mjs +43 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -526,7 +526,7 @@ function defaultOnOpen(response) {
|
|
526
526
|
}
|
527
527
|
}
|
528
528
|
|
529
|
-
const VERSION = "0.29.
|
529
|
+
const VERSION = "0.29.2";
|
530
530
|
|
531
531
|
class ErrorWithCause extends Error {
|
532
532
|
constructor(message, options) {
|
@@ -845,26 +845,29 @@ function parseUrl(url) {
|
|
845
845
|
|
846
846
|
const dataPlaneFetch = async (options) => fetch$1({ ...options, endpoint: "dataPlane" });
|
847
847
|
|
848
|
-
const applyMigration = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/
|
849
|
-
const
|
850
|
-
url: "/db/{dbBranchName}/
|
851
|
-
method: "
|
848
|
+
const applyMigration = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/apply", method: "post", ...variables, signal });
|
849
|
+
const adaptTable = (variables, signal) => dataPlaneFetch({
|
850
|
+
url: "/db/{dbBranchName}/migrations/adapt/{tableName}",
|
851
|
+
method: "post",
|
852
852
|
...variables,
|
853
853
|
signal
|
854
854
|
});
|
855
|
-
const
|
856
|
-
|
855
|
+
const getBranchMigrationJobStatus = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/status", method: "get", ...variables, signal });
|
856
|
+
const getMigrationJobStatus = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/jobs/{jobId}", method: "get", ...variables, signal });
|
857
|
+
const getMigrationHistory = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/migrations/history", method: "get", ...variables, signal });
|
858
|
+
const getBranchList = (variables, signal) => dataPlaneFetch({
|
859
|
+
url: "/dbs/{dbName}",
|
857
860
|
method: "get",
|
858
861
|
...variables,
|
859
862
|
signal
|
860
863
|
});
|
861
|
-
const
|
862
|
-
|
863
|
-
url: "/dbs/{dbName}",
|
864
|
+
const getDatabaseSettings = (variables, signal) => dataPlaneFetch({
|
865
|
+
url: "/dbs/{dbName}/settings",
|
864
866
|
method: "get",
|
865
867
|
...variables,
|
866
868
|
signal
|
867
869
|
});
|
870
|
+
const updateDatabaseSettings = (variables, signal) => dataPlaneFetch({ url: "/dbs/{dbName}/settings", method: "patch", ...variables, signal });
|
868
871
|
const getBranchDetails = (variables, signal) => dataPlaneFetch({
|
869
872
|
url: "/db/{dbBranchName}",
|
870
873
|
method: "get",
|
@@ -1078,11 +1081,25 @@ const sqlQuery = (variables, signal) => dataPlaneFetch({
|
|
1078
1081
|
signal
|
1079
1082
|
});
|
1080
1083
|
const operationsByTag$2 = {
|
1081
|
-
|
1084
|
+
migrations: {
|
1082
1085
|
applyMigration,
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
+
adaptTable,
|
1087
|
+
getBranchMigrationJobStatus,
|
1088
|
+
getMigrationJobStatus,
|
1089
|
+
getMigrationHistory,
|
1090
|
+
getSchema,
|
1091
|
+
getBranchMigrationHistory,
|
1092
|
+
getBranchMigrationPlan,
|
1093
|
+
executeBranchMigrationPlan,
|
1094
|
+
getBranchSchemaHistory,
|
1095
|
+
compareBranchWithUserSchema,
|
1096
|
+
compareBranchSchemas,
|
1097
|
+
updateBranchSchema,
|
1098
|
+
previewBranchSchemaEdit,
|
1099
|
+
applyBranchSchemaEdit,
|
1100
|
+
pushBranchMigrations
|
1101
|
+
},
|
1102
|
+
branch: {
|
1086
1103
|
getBranchList,
|
1087
1104
|
getBranchDetails,
|
1088
1105
|
createBranch,
|
@@ -1096,19 +1113,7 @@ const operationsByTag$2 = {
|
|
1096
1113
|
removeGitBranchesEntry,
|
1097
1114
|
resolveBranch
|
1098
1115
|
},
|
1099
|
-
|
1100
|
-
getSchema,
|
1101
|
-
getBranchMigrationHistory,
|
1102
|
-
getBranchMigrationPlan,
|
1103
|
-
executeBranchMigrationPlan,
|
1104
|
-
getBranchSchemaHistory,
|
1105
|
-
compareBranchWithUserSchema,
|
1106
|
-
compareBranchSchemas,
|
1107
|
-
updateBranchSchema,
|
1108
|
-
previewBranchSchemaEdit,
|
1109
|
-
applyBranchSchemaEdit,
|
1110
|
-
pushBranchMigrations
|
1111
|
-
},
|
1116
|
+
database: { getDatabaseSettings, updateDatabaseSettings },
|
1112
1117
|
migrationRequests: {
|
1113
1118
|
queryMigrationRequests,
|
1114
1119
|
createMigrationRequest,
|
@@ -1750,7 +1755,7 @@ class BranchApi {
|
|
1750
1755
|
database,
|
1751
1756
|
branch
|
1752
1757
|
}) {
|
1753
|
-
return operationsByTag.
|
1758
|
+
return operationsByTag.migrations.getMigrationHistory({
|
1754
1759
|
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1755
1760
|
...this.extraProps
|
1756
1761
|
});
|
@@ -1762,7 +1767,7 @@ class BranchApi {
|
|
1762
1767
|
branch,
|
1763
1768
|
migration
|
1764
1769
|
}) {
|
1765
|
-
return operationsByTag.
|
1770
|
+
return operationsByTag.migrations.applyMigration({
|
1766
1771
|
pathParams: { workspace, region, dbBranchName: `${database}:${branch}` },
|
1767
1772
|
body: migration,
|
1768
1773
|
...this.extraProps
|
@@ -4595,12 +4600,17 @@ class SQLPlugin extends XataPlugin {
|
|
4595
4600
|
throw new Error("Invalid usage of `xata.sql`. Please use it as a tagged template or with an object.");
|
4596
4601
|
}
|
4597
4602
|
const { statement, params, consistency } = prepareParams(query, parameters);
|
4598
|
-
const {
|
4603
|
+
const {
|
4604
|
+
records,
|
4605
|
+
rows,
|
4606
|
+
warning,
|
4607
|
+
columns = []
|
4608
|
+
} = await sqlQuery({
|
4599
4609
|
pathParams: { workspace: "{workspaceId}", dbBranchName: "{dbBranch}", region: "{region}" },
|
4600
4610
|
body: { statement, params, consistency },
|
4601
4611
|
...pluginOptions
|
4602
4612
|
});
|
4603
|
-
return { records, warning, columns };
|
4613
|
+
return { records, rows, warning, columns };
|
4604
4614
|
};
|
4605
4615
|
}
|
4606
4616
|
}
|
@@ -4690,7 +4700,7 @@ const buildClient = (plugins) => {
|
|
4690
4700
|
const isBrowser = typeof window !== "undefined" && typeof Deno === "undefined";
|
4691
4701
|
if (isBrowser && !enableBrowser) {
|
4692
4702
|
throw new Error(
|
4693
|
-
"You are trying to use Xata from the browser, which is potentially a non-secure environment.
|
4703
|
+
"You are trying to use Xata from the browser, which is potentially a non-secure environment. How to fix: https://xata.io/docs/messages/api-key-browser-error"
|
4694
4704
|
);
|
4695
4705
|
}
|
4696
4706
|
const fetch = getFetchImplementation(options?.fetch);
|
@@ -4844,5 +4854,5 @@ class XataError extends Error {
|
|
4844
4854
|
}
|
4845
4855
|
}
|
4846
4856
|
|
4847
|
-
export { BaseClient, FetcherError, FilesPlugin, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, PageRecordArray, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SQLPlugin, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, TransactionPlugin, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, applyMigration, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createCluster, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, fileUpload, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getCluster, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getSchema, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, iContains, iPattern, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isValidExpandedColumn, isValidSelectableColumns, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listClusters, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern,
|
4857
|
+
export { BaseClient, FetcherError, FilesPlugin, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, PageRecordArray, Query, RecordArray, RecordColumnTypes, Repository, RestRepository, SQLPlugin, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, TransactionPlugin, XataApiClient, XataApiPlugin, XataError, XataFile, XataPlugin, acceptWorkspaceMemberInvite, adaptTable, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, applyMigration, askTable, askTableSession, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createCluster, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFile, deleteFileItem, deleteOAuthAccessToken, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteUserOAuthClient, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, fileAccess, fileUpload, ge, getAPIKey, getAuthorizationCode, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationJobStatus, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getCluster, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseSettings, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationHistory, getMigrationJobStatus, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getSchema, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getUserOAuthAccessTokens, getUserOAuthClients, getWorkspace, getWorkspaceMembersList, getWorkspacesList, grantAuthorizationCode, greaterEquals, greaterThan, greaterThanEquals, gt, gte, iContains, iPattern, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isValidExpandedColumn, isValidSelectableColumns, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listClusters, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, putFile, putFileItem, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, renameDatabase, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, transformImage, updateBranchMetadata, updateBranchSchema, updateCluster, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateDatabaseSettings, updateMigrationRequest, updateOAuthAccessToken, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
4848
4858
|
//# sourceMappingURL=index.mjs.map
|