@xata.io/client 0.0.0-alpha.ved00a04 → 0.0.0-alpha.vef05610

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#246](https://github.com/xataio/client-ts/pull/246) [`2848894`](https://github.com/xataio/client-ts/commit/284889446bbac5d6737086bf01a588d97b841730) Thanks [@SferaDev](https://github.com/SferaDev)! - Rename getOne to getFirst
8
+
9
+ ### Patch Changes
10
+
11
+ - [#254](https://github.com/xataio/client-ts/pull/254) [`2fc2788`](https://github.com/xataio/client-ts/commit/2fc2788e583c047ffb2cd693f053f60ce608149c) Thanks [@SferaDev](https://github.com/SferaDev)! - Deprecate XataApiClient
12
+
13
+ * [#230](https://github.com/xataio/client-ts/pull/230) [`a96da7c`](https://github.com/xataio/client-ts/commit/a96da7c8b548604ed25001390992531537675a44) Thanks [@SferaDev](https://github.com/SferaDev)! - Include tables in Proxy target for object introspection (shell)
14
+
15
+ - [#222](https://github.com/xataio/client-ts/pull/222) [`e8d595f`](https://github.com/xataio/client-ts/commit/e8d595f54efe126b39c78cc771a5d69c551f4fba) Thanks [@SferaDev](https://github.com/SferaDev)! - Add cache strategies
16
+
17
+ * [#244](https://github.com/xataio/client-ts/pull/244) [`c4dcd11`](https://github.com/xataio/client-ts/commit/c4dcd110d8f9dc3a7e4510f2f00257c9109e51fa) Thanks [@gimenete](https://github.com/gimenete)! - getCurrentBranchName never returns a Promise that resolves to undefined
18
+
3
19
  ## 0.8.4
4
20
 
5
21
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -38,7 +38,10 @@ function getEnvVariable(name) {
38
38
  }
39
39
  async function getGitBranch() {
40
40
  try {
41
- return require("child_process").execSync("git branch --show-current", { encoding: "utf-8" }).trim();
41
+ if (typeof require === "function") {
42
+ const req = require;
43
+ return req("child_process").execSync("git branch --show-current", { encoding: "utf-8" }).trim();
44
+ }
42
45
  } catch (err) {
43
46
  }
44
47
  try {
@@ -252,6 +255,14 @@ const deleteDatabase = (variables) => fetch$1({
252
255
  method: "delete",
253
256
  ...variables
254
257
  });
258
+ const getGitBranchesMapping = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "get", ...variables });
259
+ const addGitBranchesEntry = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "post", ...variables });
260
+ const removeGitBranchesEntry = (variables) => fetch$1({ url: "/dbs/{dbName}/gitBranches", method: "delete", ...variables });
261
+ const resolveBranch = (variables) => fetch$1({
262
+ url: "/dbs/{dbName}/resolveBranch",
263
+ method: "get",
264
+ ...variables
265
+ });
255
266
  const getBranchDetails = (variables) => fetch$1({
256
267
  url: "/db/{dbBranchName}",
257
268
  method: "get",
@@ -280,17 +291,6 @@ const getBranchMetadata = (variables) => fetch$1({
280
291
  const getBranchMigrationHistory = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations", method: "get", ...variables });
281
292
  const executeBranchMigrationPlan = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations/execute", method: "post", ...variables });
282
293
  const getBranchMigrationPlan = (variables) => fetch$1({ url: "/db/{dbBranchName}/migrations/plan", method: "post", ...variables });
283
- const compareBranchSchema = (variables) => fetch$1({
284
- url: "/db/{dbBranchName}/schema/compare/{branchName}",
285
- method: "post",
286
- ...variables
287
- });
288
- const updateBranchSchema = (variables) => fetch$1({
289
- url: "/db/{dbBranchName}/schema/update",
290
- method: "post",
291
- ...variables
292
- });
293
- const getBranchSchemaHistory = (variables) => fetch$1({ url: "/db/{dbBranchName}/schema/history", method: "post", ...variables });
294
294
  const getBranchStats = (variables) => fetch$1({
295
295
  url: "/db/{dbBranchName}/stats",
296
296
  method: "get",
@@ -391,7 +391,15 @@ const operationsByTag = {
391
391
  resendWorkspaceMemberInvite,
392
392
  acceptWorkspaceMemberInvite
393
393
  },
394
- database: { getDatabaseList, createDatabase, deleteDatabase },
394
+ database: {
395
+ getDatabaseList,
396
+ createDatabase,
397
+ deleteDatabase,
398
+ getGitBranchesMapping,
399
+ addGitBranchesEntry,
400
+ removeGitBranchesEntry,
401
+ resolveBranch
402
+ },
395
403
  branch: {
396
404
  getBranchList,
397
405
  getBranchDetails,
@@ -402,9 +410,6 @@ const operationsByTag = {
402
410
  getBranchMigrationHistory,
403
411
  executeBranchMigrationPlan,
404
412
  getBranchMigrationPlan,
405
- compareBranchSchema,
406
- updateBranchSchema,
407
- getBranchSchemaHistory,
408
413
  getBranchStats
409
414
  },
410
415
  table: {
@@ -654,6 +659,33 @@ class DatabaseApi {
654
659
  ...this.extraProps
655
660
  });
656
661
  }
662
+ getGitBranchesMapping(workspace, dbName) {
663
+ return operationsByTag.database.getGitBranchesMapping({
664
+ pathParams: { workspace, dbName },
665
+ ...this.extraProps
666
+ });
667
+ }
668
+ addGitBranchesEntry(workspace, dbName, body) {
669
+ return operationsByTag.database.addGitBranchesEntry({
670
+ pathParams: { workspace, dbName },
671
+ body,
672
+ ...this.extraProps
673
+ });
674
+ }
675
+ removeGitBranchesEntry(workspace, dbName, gitBranch) {
676
+ return operationsByTag.database.removeGitBranchesEntry({
677
+ pathParams: { workspace, dbName },
678
+ queryParams: { gitBranch },
679
+ ...this.extraProps
680
+ });
681
+ }
682
+ resolveBranch(workspace, dbName, gitBranch) {
683
+ return operationsByTag.database.resolveBranch({
684
+ pathParams: { workspace, dbName },
685
+ queryParams: { gitBranch },
686
+ ...this.extraProps
687
+ });
688
+ }
657
689
  }
658
690
  class BranchApi {
659
691
  constructor(extraProps) {
@@ -1839,11 +1871,11 @@ exports.XataApiPlugin = XataApiPlugin;
1839
1871
  exports.XataError = XataError;
1840
1872
  exports.XataPlugin = XataPlugin;
1841
1873
  exports.acceptWorkspaceMemberInvite = acceptWorkspaceMemberInvite;
1874
+ exports.addGitBranchesEntry = addGitBranchesEntry;
1842
1875
  exports.addTableColumn = addTableColumn;
1843
1876
  exports.buildClient = buildClient;
1844
1877
  exports.bulkInsertTableRecords = bulkInsertTableRecords;
1845
1878
  exports.cancelWorkspaceMemberInvite = cancelWorkspaceMemberInvite;
1846
- exports.compareBranchSchema = compareBranchSchema;
1847
1879
  exports.contains = contains;
1848
1880
  exports.createBranch = createBranch;
1849
1881
  exports.createDatabase = createDatabase;
@@ -1868,13 +1900,13 @@ exports.getBranchList = getBranchList;
1868
1900
  exports.getBranchMetadata = getBranchMetadata;
1869
1901
  exports.getBranchMigrationHistory = getBranchMigrationHistory;
1870
1902
  exports.getBranchMigrationPlan = getBranchMigrationPlan;
1871
- exports.getBranchSchemaHistory = getBranchSchemaHistory;
1872
1903
  exports.getBranchStats = getBranchStats;
1873
1904
  exports.getColumn = getColumn;
1874
1905
  exports.getCurrentBranchDetails = getCurrentBranchDetails;
1875
1906
  exports.getCurrentBranchName = getCurrentBranchName;
1876
1907
  exports.getDatabaseList = getDatabaseList;
1877
1908
  exports.getDatabaseURL = getDatabaseURL;
1909
+ exports.getGitBranchesMapping = getGitBranchesMapping;
1878
1910
  exports.getRecord = getRecord;
1879
1911
  exports.getTableColumns = getTableColumns;
1880
1912
  exports.getTableSchema = getTableSchema;
@@ -1903,13 +1935,14 @@ exports.notExists = notExists;
1903
1935
  exports.operationsByTag = operationsByTag;
1904
1936
  exports.pattern = pattern;
1905
1937
  exports.queryTable = queryTable;
1938
+ exports.removeGitBranchesEntry = removeGitBranchesEntry;
1906
1939
  exports.removeWorkspaceMember = removeWorkspaceMember;
1907
1940
  exports.resendWorkspaceMemberInvite = resendWorkspaceMemberInvite;
1941
+ exports.resolveBranch = resolveBranch;
1908
1942
  exports.searchBranch = searchBranch;
1909
1943
  exports.setTableSchema = setTableSchema;
1910
1944
  exports.startsWith = startsWith;
1911
1945
  exports.updateBranchMetadata = updateBranchMetadata;
1912
- exports.updateBranchSchema = updateBranchSchema;
1913
1946
  exports.updateColumn = updateColumn;
1914
1947
  exports.updateRecordWithID = updateRecordWithID;
1915
1948
  exports.updateTable = updateTable;