@xata.io/client 0.23.3 → 0.23.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/.turbo/turbo-add-version.log +1 -1
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +20 -0
- package/dist/index.cjs +182 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +538 -53
- package/dist/index.mjs +177 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -3
- package/.eslintrc.cjs +0 -13
- package/rollup.config.mjs +0 -44
- package/tsconfig.json +0 -23
package/dist/index.mjs
CHANGED
@@ -490,7 +490,7 @@ function defaultOnOpen(response) {
|
|
490
490
|
}
|
491
491
|
}
|
492
492
|
|
493
|
-
const VERSION = "0.23.
|
493
|
+
const VERSION = "0.23.5";
|
494
494
|
|
495
495
|
class ErrorWithCause extends Error {
|
496
496
|
constructor(message, options) {
|
@@ -832,6 +832,36 @@ const deleteColumn = (variables, signal) => dataPlaneFetch({
|
|
832
832
|
});
|
833
833
|
const branchTransaction = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/transaction", method: "post", ...variables, signal });
|
834
834
|
const insertRecord = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data", method: "post", ...variables, signal });
|
835
|
+
const getFileItem = (variables, signal) => dataPlaneFetch({
|
836
|
+
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",
|
837
|
+
method: "get",
|
838
|
+
...variables,
|
839
|
+
signal
|
840
|
+
});
|
841
|
+
const putFileItem = (variables, signal) => dataPlaneFetch({
|
842
|
+
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",
|
843
|
+
method: "put",
|
844
|
+
...variables,
|
845
|
+
signal
|
846
|
+
});
|
847
|
+
const deleteFileItem = (variables, signal) => dataPlaneFetch({
|
848
|
+
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",
|
849
|
+
method: "delete",
|
850
|
+
...variables,
|
851
|
+
signal
|
852
|
+
});
|
853
|
+
const getFile = (variables, signal) => dataPlaneFetch({
|
854
|
+
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",
|
855
|
+
method: "get",
|
856
|
+
...variables,
|
857
|
+
signal
|
858
|
+
});
|
859
|
+
const putFile = (variables, signal) => dataPlaneFetch({
|
860
|
+
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",
|
861
|
+
method: "put",
|
862
|
+
...variables,
|
863
|
+
signal
|
864
|
+
});
|
835
865
|
const getRecord = (variables, signal) => dataPlaneFetch({
|
836
866
|
url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}",
|
837
867
|
method: "get",
|
@@ -935,6 +965,7 @@ const operationsByTag$2 = {
|
|
935
965
|
deleteRecord,
|
936
966
|
bulkInsertTableRecords
|
937
967
|
},
|
968
|
+
files: { getFileItem, putFileItem, deleteFileItem, getFile, putFile },
|
938
969
|
searchAndFilter: {
|
939
970
|
queryTable,
|
940
971
|
searchBranch,
|
@@ -1043,6 +1074,7 @@ const deleteDatabase = (variables, signal) => controlPlaneFetch({
|
|
1043
1074
|
});
|
1044
1075
|
const getDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "get", ...variables, signal });
|
1045
1076
|
const updateDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "patch", ...variables, signal });
|
1077
|
+
const renameDatabase = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/rename", method: "post", ...variables, signal });
|
1046
1078
|
const getDatabaseGithubSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/github", method: "get", ...variables, signal });
|
1047
1079
|
const updateDatabaseGithubSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/github", method: "put", ...variables, signal });
|
1048
1080
|
const deleteDatabaseGithubSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/github", method: "delete", ...variables, signal });
|
@@ -1078,6 +1110,7 @@ const operationsByTag$1 = {
|
|
1078
1110
|
deleteDatabase,
|
1079
1111
|
getDatabaseMetadata,
|
1080
1112
|
updateDatabaseMetadata,
|
1113
|
+
renameDatabase,
|
1081
1114
|
getDatabaseGithubSettings,
|
1082
1115
|
updateDatabaseGithubSettings,
|
1083
1116
|
deleteDatabaseGithubSettings,
|
@@ -1233,6 +1266,11 @@ class XataApiClient {
|
|
1233
1266
|
__privateGet$7(this, _namespaces).records = new RecordsApi(__privateGet$7(this, _extraProps));
|
1234
1267
|
return __privateGet$7(this, _namespaces).records;
|
1235
1268
|
}
|
1269
|
+
get files() {
|
1270
|
+
if (!__privateGet$7(this, _namespaces).files)
|
1271
|
+
__privateGet$7(this, _namespaces).files = new FilesApi(__privateGet$7(this, _extraProps));
|
1272
|
+
return __privateGet$7(this, _namespaces).files;
|
1273
|
+
}
|
1236
1274
|
get searchAndFilter() {
|
1237
1275
|
if (!__privateGet$7(this, _namespaces).searchAndFilter)
|
1238
1276
|
__privateGet$7(this, _namespaces).searchAndFilter = new SearchAndFilterApi(__privateGet$7(this, _extraProps));
|
@@ -1810,6 +1848,126 @@ class RecordsApi {
|
|
1810
1848
|
});
|
1811
1849
|
}
|
1812
1850
|
}
|
1851
|
+
class FilesApi {
|
1852
|
+
constructor(extraProps) {
|
1853
|
+
this.extraProps = extraProps;
|
1854
|
+
}
|
1855
|
+
getFileItem({
|
1856
|
+
workspace,
|
1857
|
+
region,
|
1858
|
+
database,
|
1859
|
+
branch,
|
1860
|
+
table,
|
1861
|
+
record,
|
1862
|
+
column,
|
1863
|
+
fileId
|
1864
|
+
}) {
|
1865
|
+
return operationsByTag.files.getFileItem({
|
1866
|
+
pathParams: {
|
1867
|
+
workspace,
|
1868
|
+
region,
|
1869
|
+
dbBranchName: `${database}:${branch}`,
|
1870
|
+
tableName: table,
|
1871
|
+
recordId: record,
|
1872
|
+
columnName: column,
|
1873
|
+
fileId
|
1874
|
+
},
|
1875
|
+
...this.extraProps
|
1876
|
+
});
|
1877
|
+
}
|
1878
|
+
putFileItem({
|
1879
|
+
workspace,
|
1880
|
+
region,
|
1881
|
+
database,
|
1882
|
+
branch,
|
1883
|
+
table,
|
1884
|
+
record,
|
1885
|
+
column,
|
1886
|
+
fileId,
|
1887
|
+
file
|
1888
|
+
}) {
|
1889
|
+
return operationsByTag.files.putFileItem({
|
1890
|
+
pathParams: {
|
1891
|
+
workspace,
|
1892
|
+
region,
|
1893
|
+
dbBranchName: `${database}:${branch}`,
|
1894
|
+
tableName: table,
|
1895
|
+
recordId: record,
|
1896
|
+
columnName: column,
|
1897
|
+
fileId
|
1898
|
+
},
|
1899
|
+
body: file,
|
1900
|
+
...this.extraProps
|
1901
|
+
});
|
1902
|
+
}
|
1903
|
+
deleteFileItem({
|
1904
|
+
workspace,
|
1905
|
+
region,
|
1906
|
+
database,
|
1907
|
+
branch,
|
1908
|
+
table,
|
1909
|
+
record,
|
1910
|
+
column,
|
1911
|
+
fileId
|
1912
|
+
}) {
|
1913
|
+
return operationsByTag.files.deleteFileItem({
|
1914
|
+
pathParams: {
|
1915
|
+
workspace,
|
1916
|
+
region,
|
1917
|
+
dbBranchName: `${database}:${branch}`,
|
1918
|
+
tableName: table,
|
1919
|
+
recordId: record,
|
1920
|
+
columnName: column,
|
1921
|
+
fileId
|
1922
|
+
},
|
1923
|
+
...this.extraProps
|
1924
|
+
});
|
1925
|
+
}
|
1926
|
+
getFile({
|
1927
|
+
workspace,
|
1928
|
+
region,
|
1929
|
+
database,
|
1930
|
+
branch,
|
1931
|
+
table,
|
1932
|
+
record,
|
1933
|
+
column
|
1934
|
+
}) {
|
1935
|
+
return operationsByTag.files.getFile({
|
1936
|
+
pathParams: {
|
1937
|
+
workspace,
|
1938
|
+
region,
|
1939
|
+
dbBranchName: `${database}:${branch}`,
|
1940
|
+
tableName: table,
|
1941
|
+
recordId: record,
|
1942
|
+
columnName: column
|
1943
|
+
},
|
1944
|
+
...this.extraProps
|
1945
|
+
});
|
1946
|
+
}
|
1947
|
+
putFile({
|
1948
|
+
workspace,
|
1949
|
+
region,
|
1950
|
+
database,
|
1951
|
+
branch,
|
1952
|
+
table,
|
1953
|
+
record,
|
1954
|
+
column,
|
1955
|
+
file
|
1956
|
+
}) {
|
1957
|
+
return operationsByTag.files.putFile({
|
1958
|
+
pathParams: {
|
1959
|
+
workspace,
|
1960
|
+
region,
|
1961
|
+
dbBranchName: `${database}:${branch}`,
|
1962
|
+
tableName: table,
|
1963
|
+
recordId: record,
|
1964
|
+
columnName: column
|
1965
|
+
},
|
1966
|
+
body: file,
|
1967
|
+
...this.extraProps
|
1968
|
+
});
|
1969
|
+
}
|
1970
|
+
}
|
1813
1971
|
class SearchAndFilterApi {
|
1814
1972
|
constructor(extraProps) {
|
1815
1973
|
this.extraProps = extraProps;
|
@@ -2229,6 +2387,17 @@ class DatabaseApi {
|
|
2229
2387
|
...this.extraProps
|
2230
2388
|
});
|
2231
2389
|
}
|
2390
|
+
renameDatabase({
|
2391
|
+
workspace,
|
2392
|
+
database,
|
2393
|
+
newName
|
2394
|
+
}) {
|
2395
|
+
return operationsByTag.databases.renameDatabase({
|
2396
|
+
pathParams: { workspaceId: workspace, dbName: database },
|
2397
|
+
body: { newName },
|
2398
|
+
...this.extraProps
|
2399
|
+
});
|
2400
|
+
}
|
2232
2401
|
getDatabaseGithubSettings({
|
2233
2402
|
workspace,
|
2234
2403
|
database
|
@@ -2412,7 +2581,7 @@ const _Query = class {
|
|
2412
2581
|
__privateAdd$5(this, _table$1, void 0);
|
2413
2582
|
__privateAdd$5(this, _repository, void 0);
|
2414
2583
|
__privateAdd$5(this, _data, { filter: {} });
|
2415
|
-
this.meta = { page: { cursor: "start", more: true } };
|
2584
|
+
this.meta = { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } };
|
2416
2585
|
this.records = new RecordArray(this, []);
|
2417
2586
|
__privateSet$5(this, _table$1, table);
|
2418
2587
|
if (repository) {
|
@@ -2609,7 +2778,11 @@ function isSortFilterString(value) {
|
|
2609
2778
|
return isString(value);
|
2610
2779
|
}
|
2611
2780
|
function isSortFilterBase(filter) {
|
2612
|
-
return isObject(filter) && Object.
|
2781
|
+
return isObject(filter) && Object.entries(filter).every(([key, value]) => {
|
2782
|
+
if (key === "*")
|
2783
|
+
return value === "random";
|
2784
|
+
return value === "asc" || value === "desc";
|
2785
|
+
});
|
2613
2786
|
}
|
2614
2787
|
function isSortFilterObject(filter) {
|
2615
2788
|
return isObject(filter) && !isSortFilterBase(filter) && filter.column !== void 0;
|
@@ -3839,5 +4012,5 @@ class XataError extends Error {
|
|
3839
4012
|
}
|
3840
4013
|
}
|
3841
4014
|
|
3842
|
-
export { BaseClient, FetcherError, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, Repository, RestRepository, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, listMigrationRequestsCommits, listRegions, lt, lte, mergeMigrationRequest, notExists, operationsByTag, parseProviderString, parseWorkspacesUrlParts, pattern, previewBranchSchemaEdit, pushBranchMigrations, queryMigrationRequests, queryTable, removeGitBranchesEntry, removeWorkspaceMember, resendWorkspaceMemberInvite, resolveBranch, searchBranch, searchTable, serialize, setTableSchema, sqlQuery, startsWith, summarizeTable, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
4015
|
+
export { BaseClient, FetcherError, operationsByTag as Operations, PAGINATION_DEFAULT_OFFSET, PAGINATION_DEFAULT_SIZE, PAGINATION_MAX_OFFSET, PAGINATION_MAX_SIZE, Page, Query, RecordArray, Repository, RestRepository, SchemaPlugin, SearchPlugin, Serializer, SimpleCache, XataApiClient, XataApiPlugin, XataError, XataPlugin, acceptWorkspaceMemberInvite, addGitBranchesEntry, addTableColumn, aggregateTable, applyBranchSchemaEdit, askTable, branchTransaction, buildClient, buildPreviewBranchName, buildProviderString, buildWorkerRunner, bulkInsertTableRecords, cancelWorkspaceMemberInvite, compareBranchSchemas, compareBranchWithUserSchema, compareMigrationRequest, contains, copyBranch, createBranch, createDatabase, createMigrationRequest, createTable, createUserAPIKey, createWorkspace, deleteBranch, deleteColumn, deleteDatabase, deleteDatabaseGithubSettings, deleteFileItem, deleteRecord, deleteTable, deleteUser, deleteUserAPIKey, deleteWorkspace, deserialize, endsWith, equals, executeBranchMigrationPlan, exists, ge, getAPIKey, getBranch, getBranchDetails, getBranchList, getBranchMetadata, getBranchMigrationHistory, getBranchMigrationPlan, getBranchSchemaHistory, getBranchStats, getColumn, getDatabaseGithubSettings, getDatabaseList, getDatabaseMetadata, getDatabaseURL, getFile, getFileItem, getGitBranchesMapping, getHostUrl, getMigrationRequest, getMigrationRequestIsMerged, getPreviewBranch, getRecord, getTableColumns, getTableSchema, getUser, getUserAPIKeys, getWorkspace, getWorkspaceMembersList, getWorkspacesList, greaterEquals, greaterThan, greaterThanEquals, gt, gte, includes, includesAll, includesAny, includesNone, insertRecord, insertRecordWithID, inviteWorkspaceMember, is, isCursorPaginationOptions, isHostProviderAlias, isHostProviderBuilder, isIdentifiable, isNot, isXataRecord, le, lessEquals, lessThan, lessThanEquals, 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, updateBranchMetadata, updateBranchSchema, updateColumn, updateDatabaseGithubSettings, updateDatabaseMetadata, updateMigrationRequest, updateRecordWithID, updateTable, updateUser, updateWorkspace, updateWorkspaceMemberInvite, updateWorkspaceMemberRole, upsertRecordWithID, vectorSearchTable };
|
3843
4016
|
//# sourceMappingURL=index.mjs.map
|