@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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @xata.io/client@0.23.3 add-version /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.23.5 add-version /home/runner/work/client-ts/client-ts/packages/client
3
3
  > node ../../scripts/add-version-file.mjs
4
4
 
@@ -1,13 +1,13 @@
1
1
 
2
- > @xata.io/client@0.23.3 build /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.23.5 build /home/runner/work/client-ts/client-ts/packages/client
3
3
  > rimraf dist && rollup -c
4
4
 
5
5
  
6
6
  src/index.ts → dist/index.cjs...
7
- created dist/index.cjs in 1.1s
7
+ created dist/index.cjs in 1.8s
8
8
  
9
9
  src/index.ts → dist/index.mjs...
10
- created dist/index.mjs in 906ms
10
+ created dist/index.mjs in 1.2s
11
11
  
12
12
  src/index.ts → dist/index.d.ts...
13
- created dist/index.d.ts in 5.7s
13
+ created dist/index.d.ts in 8s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.23.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#970](https://github.com/xataio/client-ts/pull/970) [`20cc8c43`](https://github.com/xataio/client-ts/commit/20cc8c43e1659bf112ae2642948c84bfcf46a6ba) Thanks [@xata-bot](https://github.com/xata-bot)! - Add delete file endpoint
8
+
9
+ - [#976](https://github.com/xataio/client-ts/pull/976) [`5099cbbd`](https://github.com/xataio/client-ts/commit/5099cbbd3065a60dcee2f1699afa1ee8ed5edb1c) Thanks [@SferaDev](https://github.com/SferaDev)! - Re-export JSONData helper type
10
+
11
+ - [#972](https://github.com/xataio/client-ts/pull/972) [`89375e76`](https://github.com/xataio/client-ts/commit/89375e76b790fed7e6a26bf3ac4ea9eaed1aecae) Thanks [@SferaDev](https://github.com/SferaDev)! - Add types to exports
12
+
13
+ - [#979](https://github.com/xataio/client-ts/pull/979) [`5eaee932`](https://github.com/xataio/client-ts/commit/5eaee932b828907ae352d7c0d0584e860845434b) Thanks [@SferaDev](https://github.com/SferaDev)! - Add `size` to pagination meta
14
+
15
+ - [#974](https://github.com/xataio/client-ts/pull/974) [`109b8790`](https://github.com/xataio/client-ts/commit/109b8790849532d9c442e7c03c67792aeafebd88) Thanks [@xata-bot](https://github.com/xata-bot)! - Make checksum mandatory
16
+
17
+ ## 0.23.4
18
+
19
+ ### Patch Changes
20
+
21
+ - [#951](https://github.com/xataio/client-ts/pull/951) [`470cc71f`](https://github.com/xataio/client-ts/commit/470cc71f7c5c8b9fd50f789e157d2b2eecd0b3e8) Thanks [@SferaDev](https://github.com/SferaDev)! - Add random sorting
22
+
3
23
  ## 0.23.3
4
24
 
5
25
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -492,7 +492,7 @@ function defaultOnOpen(response) {
492
492
  }
493
493
  }
494
494
 
495
- const VERSION = "0.23.3";
495
+ const VERSION = "0.23.5";
496
496
 
497
497
  class ErrorWithCause extends Error {
498
498
  constructor(message, options) {
@@ -834,6 +834,36 @@ const deleteColumn = (variables, signal) => dataPlaneFetch({
834
834
  });
835
835
  const branchTransaction = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/transaction", method: "post", ...variables, signal });
836
836
  const insertRecord = (variables, signal) => dataPlaneFetch({ url: "/db/{dbBranchName}/tables/{tableName}/data", method: "post", ...variables, signal });
837
+ const getFileItem = (variables, signal) => dataPlaneFetch({
838
+ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",
839
+ method: "get",
840
+ ...variables,
841
+ signal
842
+ });
843
+ const putFileItem = (variables, signal) => dataPlaneFetch({
844
+ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",
845
+ method: "put",
846
+ ...variables,
847
+ signal
848
+ });
849
+ const deleteFileItem = (variables, signal) => dataPlaneFetch({
850
+ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file/{fileId}",
851
+ method: "delete",
852
+ ...variables,
853
+ signal
854
+ });
855
+ const getFile = (variables, signal) => dataPlaneFetch({
856
+ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",
857
+ method: "get",
858
+ ...variables,
859
+ signal
860
+ });
861
+ const putFile = (variables, signal) => dataPlaneFetch({
862
+ url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}/column/{columnName}/file",
863
+ method: "put",
864
+ ...variables,
865
+ signal
866
+ });
837
867
  const getRecord = (variables, signal) => dataPlaneFetch({
838
868
  url: "/db/{dbBranchName}/tables/{tableName}/data/{recordId}",
839
869
  method: "get",
@@ -937,6 +967,7 @@ const operationsByTag$2 = {
937
967
  deleteRecord,
938
968
  bulkInsertTableRecords
939
969
  },
970
+ files: { getFileItem, putFileItem, deleteFileItem, getFile, putFile },
940
971
  searchAndFilter: {
941
972
  queryTable,
942
973
  searchBranch,
@@ -1045,6 +1076,7 @@ const deleteDatabase = (variables, signal) => controlPlaneFetch({
1045
1076
  });
1046
1077
  const getDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "get", ...variables, signal });
1047
1078
  const updateDatabaseMetadata = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}", method: "patch", ...variables, signal });
1079
+ const renameDatabase = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/rename", method: "post", ...variables, signal });
1048
1080
  const getDatabaseGithubSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/github", method: "get", ...variables, signal });
1049
1081
  const updateDatabaseGithubSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/github", method: "put", ...variables, signal });
1050
1082
  const deleteDatabaseGithubSettings = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/dbs/{dbName}/github", method: "delete", ...variables, signal });
@@ -1080,6 +1112,7 @@ const operationsByTag$1 = {
1080
1112
  deleteDatabase,
1081
1113
  getDatabaseMetadata,
1082
1114
  updateDatabaseMetadata,
1115
+ renameDatabase,
1083
1116
  getDatabaseGithubSettings,
1084
1117
  updateDatabaseGithubSettings,
1085
1118
  deleteDatabaseGithubSettings,
@@ -1235,6 +1268,11 @@ class XataApiClient {
1235
1268
  __privateGet$7(this, _namespaces).records = new RecordsApi(__privateGet$7(this, _extraProps));
1236
1269
  return __privateGet$7(this, _namespaces).records;
1237
1270
  }
1271
+ get files() {
1272
+ if (!__privateGet$7(this, _namespaces).files)
1273
+ __privateGet$7(this, _namespaces).files = new FilesApi(__privateGet$7(this, _extraProps));
1274
+ return __privateGet$7(this, _namespaces).files;
1275
+ }
1238
1276
  get searchAndFilter() {
1239
1277
  if (!__privateGet$7(this, _namespaces).searchAndFilter)
1240
1278
  __privateGet$7(this, _namespaces).searchAndFilter = new SearchAndFilterApi(__privateGet$7(this, _extraProps));
@@ -1812,6 +1850,126 @@ class RecordsApi {
1812
1850
  });
1813
1851
  }
1814
1852
  }
1853
+ class FilesApi {
1854
+ constructor(extraProps) {
1855
+ this.extraProps = extraProps;
1856
+ }
1857
+ getFileItem({
1858
+ workspace,
1859
+ region,
1860
+ database,
1861
+ branch,
1862
+ table,
1863
+ record,
1864
+ column,
1865
+ fileId
1866
+ }) {
1867
+ return operationsByTag.files.getFileItem({
1868
+ pathParams: {
1869
+ workspace,
1870
+ region,
1871
+ dbBranchName: `${database}:${branch}`,
1872
+ tableName: table,
1873
+ recordId: record,
1874
+ columnName: column,
1875
+ fileId
1876
+ },
1877
+ ...this.extraProps
1878
+ });
1879
+ }
1880
+ putFileItem({
1881
+ workspace,
1882
+ region,
1883
+ database,
1884
+ branch,
1885
+ table,
1886
+ record,
1887
+ column,
1888
+ fileId,
1889
+ file
1890
+ }) {
1891
+ return operationsByTag.files.putFileItem({
1892
+ pathParams: {
1893
+ workspace,
1894
+ region,
1895
+ dbBranchName: `${database}:${branch}`,
1896
+ tableName: table,
1897
+ recordId: record,
1898
+ columnName: column,
1899
+ fileId
1900
+ },
1901
+ body: file,
1902
+ ...this.extraProps
1903
+ });
1904
+ }
1905
+ deleteFileItem({
1906
+ workspace,
1907
+ region,
1908
+ database,
1909
+ branch,
1910
+ table,
1911
+ record,
1912
+ column,
1913
+ fileId
1914
+ }) {
1915
+ return operationsByTag.files.deleteFileItem({
1916
+ pathParams: {
1917
+ workspace,
1918
+ region,
1919
+ dbBranchName: `${database}:${branch}`,
1920
+ tableName: table,
1921
+ recordId: record,
1922
+ columnName: column,
1923
+ fileId
1924
+ },
1925
+ ...this.extraProps
1926
+ });
1927
+ }
1928
+ getFile({
1929
+ workspace,
1930
+ region,
1931
+ database,
1932
+ branch,
1933
+ table,
1934
+ record,
1935
+ column
1936
+ }) {
1937
+ return operationsByTag.files.getFile({
1938
+ pathParams: {
1939
+ workspace,
1940
+ region,
1941
+ dbBranchName: `${database}:${branch}`,
1942
+ tableName: table,
1943
+ recordId: record,
1944
+ columnName: column
1945
+ },
1946
+ ...this.extraProps
1947
+ });
1948
+ }
1949
+ putFile({
1950
+ workspace,
1951
+ region,
1952
+ database,
1953
+ branch,
1954
+ table,
1955
+ record,
1956
+ column,
1957
+ file
1958
+ }) {
1959
+ return operationsByTag.files.putFile({
1960
+ pathParams: {
1961
+ workspace,
1962
+ region,
1963
+ dbBranchName: `${database}:${branch}`,
1964
+ tableName: table,
1965
+ recordId: record,
1966
+ columnName: column
1967
+ },
1968
+ body: file,
1969
+ ...this.extraProps
1970
+ });
1971
+ }
1972
+ }
1815
1973
  class SearchAndFilterApi {
1816
1974
  constructor(extraProps) {
1817
1975
  this.extraProps = extraProps;
@@ -2231,6 +2389,17 @@ class DatabaseApi {
2231
2389
  ...this.extraProps
2232
2390
  });
2233
2391
  }
2392
+ renameDatabase({
2393
+ workspace,
2394
+ database,
2395
+ newName
2396
+ }) {
2397
+ return operationsByTag.databases.renameDatabase({
2398
+ pathParams: { workspaceId: workspace, dbName: database },
2399
+ body: { newName },
2400
+ ...this.extraProps
2401
+ });
2402
+ }
2234
2403
  getDatabaseGithubSettings({
2235
2404
  workspace,
2236
2405
  database
@@ -2414,7 +2583,7 @@ const _Query = class {
2414
2583
  __privateAdd$5(this, _table$1, void 0);
2415
2584
  __privateAdd$5(this, _repository, void 0);
2416
2585
  __privateAdd$5(this, _data, { filter: {} });
2417
- this.meta = { page: { cursor: "start", more: true } };
2586
+ this.meta = { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } };
2418
2587
  this.records = new RecordArray(this, []);
2419
2588
  __privateSet$5(this, _table$1, table);
2420
2589
  if (repository) {
@@ -2611,7 +2780,11 @@ function isSortFilterString(value) {
2611
2780
  return isString(value);
2612
2781
  }
2613
2782
  function isSortFilterBase(filter) {
2614
- return isObject(filter) && Object.values(filter).every((value) => value === "asc" || value === "desc");
2783
+ return isObject(filter) && Object.entries(filter).every(([key, value]) => {
2784
+ if (key === "*")
2785
+ return value === "random";
2786
+ return value === "asc" || value === "desc";
2787
+ });
2615
2788
  }
2616
2789
  function isSortFilterObject(filter) {
2617
2790
  return isObject(filter) && !isSortFilterBase(filter) && filter.column !== void 0;
@@ -3889,6 +4062,7 @@ exports.deleteBranch = deleteBranch;
3889
4062
  exports.deleteColumn = deleteColumn;
3890
4063
  exports.deleteDatabase = deleteDatabase;
3891
4064
  exports.deleteDatabaseGithubSettings = deleteDatabaseGithubSettings;
4065
+ exports.deleteFileItem = deleteFileItem;
3892
4066
  exports.deleteRecord = deleteRecord;
3893
4067
  exports.deleteTable = deleteTable;
3894
4068
  exports.deleteUser = deleteUser;
@@ -3914,6 +4088,8 @@ exports.getDatabaseGithubSettings = getDatabaseGithubSettings;
3914
4088
  exports.getDatabaseList = getDatabaseList;
3915
4089
  exports.getDatabaseMetadata = getDatabaseMetadata;
3916
4090
  exports.getDatabaseURL = getDatabaseURL;
4091
+ exports.getFile = getFile;
4092
+ exports.getFileItem = getFileItem;
3917
4093
  exports.getGitBranchesMapping = getGitBranchesMapping;
3918
4094
  exports.getHostUrl = getHostUrl;
3919
4095
  exports.getMigrationRequest = getMigrationRequest;
@@ -3962,10 +4138,13 @@ exports.parseWorkspacesUrlParts = parseWorkspacesUrlParts;
3962
4138
  exports.pattern = pattern;
3963
4139
  exports.previewBranchSchemaEdit = previewBranchSchemaEdit;
3964
4140
  exports.pushBranchMigrations = pushBranchMigrations;
4141
+ exports.putFile = putFile;
4142
+ exports.putFileItem = putFileItem;
3965
4143
  exports.queryMigrationRequests = queryMigrationRequests;
3966
4144
  exports.queryTable = queryTable;
3967
4145
  exports.removeGitBranchesEntry = removeGitBranchesEntry;
3968
4146
  exports.removeWorkspaceMember = removeWorkspaceMember;
4147
+ exports.renameDatabase = renameDatabase;
3969
4148
  exports.resendWorkspaceMemberInvite = resendWorkspaceMemberInvite;
3970
4149
  exports.resolveBranch = resolveBranch;
3971
4150
  exports.searchBranch = searchBranch;