@xata.io/client 0.26.6 → 0.26.7

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.26.6 add-version /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.26.7 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.26.6 build /home/runner/work/client-ts/client-ts/packages/client
2
+ > @xata.io/client@0.26.7 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.3s
7
+ created dist/index.cjs in 1.1s
8
8
  
9
9
  src/index.ts → dist/index.mjs...
10
- created dist/index.mjs in 843ms
10
+ created dist/index.mjs in 735ms
11
11
  
12
12
  src/index.ts → dist/index.d.ts...
13
- created dist/index.d.ts in 10.3s
13
+ created dist/index.d.ts in 8.4s
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @xata.io/client
2
2
 
3
+ ## 0.26.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1205](https://github.com/xataio/client-ts/pull/1205) [`0e1c50de`](https://github.com/xataio/client-ts/commit/0e1c50de5850db2dfbbdfff9d66eda3bf1322836) Thanks [@eemmiillyy](https://github.com/eemmiillyy)! - Add optional mediaType override to binary file API
8
+
9
+ - [#1203](https://github.com/xataio/client-ts/pull/1203) [`d093d363`](https://github.com/xataio/client-ts/commit/d093d363a51fc23c8513d51600bb3b31bbc45334) Thanks [@SferaDev](https://github.com/SferaDev)! - [Attachments] Fix column selection
10
+
3
11
  ## 0.26.6
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -244,12 +244,6 @@ function getPreviewBranch() {
244
244
  }
245
245
  }
246
246
 
247
- var __defProp$8 = Object.defineProperty;
248
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
249
- var __publicField$8 = (obj, key, value) => {
250
- __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
251
- return value;
252
- };
253
247
  var __accessCheck$8 = (obj, member, msg) => {
254
248
  if (!member.has(obj))
255
249
  throw TypeError("Cannot " + msg);
@@ -289,8 +283,6 @@ class ApiRequestPool {
289
283
  __privateAdd$8(this, _fetch, void 0);
290
284
  __privateAdd$8(this, _queue, void 0);
291
285
  __privateAdd$8(this, _concurrency, void 0);
292
- __publicField$8(this, "running");
293
- __publicField$8(this, "started");
294
286
  __privateSet$8(this, _queue, []);
295
287
  __privateSet$8(this, _concurrency, concurrency);
296
288
  this.running = 0;
@@ -536,26 +528,16 @@ function defaultOnOpen(response) {
536
528
  }
537
529
  }
538
530
 
539
- const VERSION = "0.26.6";
531
+ const VERSION = "0.26.7";
540
532
 
541
- var __defProp$7 = Object.defineProperty;
542
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
543
- var __publicField$7 = (obj, key, value) => {
544
- __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
545
- return value;
546
- };
547
533
  class ErrorWithCause extends Error {
548
534
  constructor(message, options) {
549
535
  super(message, options);
550
- __publicField$7(this, "cause");
551
536
  }
552
537
  }
553
538
  class FetcherError extends ErrorWithCause {
554
539
  constructor(status, data, requestId) {
555
540
  super(getMessage(data));
556
- __publicField$7(this, "status");
557
- __publicField$7(this, "requestId");
558
- __publicField$7(this, "errors");
559
541
  this.status = status;
560
542
  this.errors = isBulkError(data) ? data.errors : [{ message: getMessage(data), status }];
561
543
  this.requestId = requestId;
@@ -1173,6 +1155,20 @@ const updateWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ u
1173
1155
  const cancelWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}", method: "delete", ...variables, signal });
1174
1156
  const acceptWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteKey}/accept", method: "post", ...variables, signal });
1175
1157
  const resendWorkspaceMemberInvite = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/invites/{inviteId}/resend", method: "post", ...variables, signal });
1158
+ const listClusters = (variables, signal) => controlPlaneFetch({
1159
+ url: "/workspaces/{workspaceId}/clusters",
1160
+ method: "get",
1161
+ ...variables,
1162
+ signal
1163
+ });
1164
+ const createCluster = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/clusters", method: "post", ...variables, signal });
1165
+ const getCluster = (variables, signal) => controlPlaneFetch({
1166
+ url: "/workspaces/{workspaceId}/clusters/{clusterId}",
1167
+ method: "get",
1168
+ ...variables,
1169
+ signal
1170
+ });
1171
+ const updateCluster = (variables, signal) => controlPlaneFetch({ url: "/workspaces/{workspaceId}/clusters/{clusterId}", method: "patch", ...variables, signal });
1176
1172
  const getDatabaseList = (variables, signal) => controlPlaneFetch({
1177
1173
  url: "/workspaces/{workspaceId}/dbs",
1178
1174
  method: "get",
@@ -1227,6 +1223,7 @@ const operationsByTag$1 = {
1227
1223
  acceptWorkspaceMemberInvite,
1228
1224
  resendWorkspaceMemberInvite
1229
1225
  },
1226
+ xbcontrolOther: { listClusters, createCluster, getCluster, updateCluster },
1230
1227
  databases: {
1231
1228
  getDatabaseList,
1232
1229
  createDatabase,
@@ -2641,9 +2638,9 @@ class FilesPlugin extends XataPlugin {
2641
2638
  rawResponse: true
2642
2639
  });
2643
2640
  },
2644
- upload: async (location, file) => {
2641
+ upload: async (location, file, options) => {
2645
2642
  const { table, record, column, fileId = "" } = location ?? {};
2646
- const contentType = getContentType(file);
2643
+ const contentType = options?.mediaType || getContentType(file);
2647
2644
  return await putFileItem({
2648
2645
  ...pluginOptions,
2649
2646
  pathParams: {
@@ -2719,58 +2716,8 @@ function transformImage(url, ...transformations) {
2719
2716
  return `https://${hostname}${transform}${path}${search}`;
2720
2717
  }
2721
2718
 
2722
- var __defProp$6 = Object.defineProperty;
2723
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2724
- var __publicField$6 = (obj, key, value) => {
2725
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
2726
- return value;
2727
- };
2728
2719
  class XataFile {
2729
2720
  constructor(file) {
2730
- /**
2731
- * Identifier of the file.
2732
- */
2733
- __publicField$6(this, "id");
2734
- /**
2735
- * Name of the file.
2736
- */
2737
- __publicField$6(this, "name");
2738
- /**
2739
- * Media type of the file.
2740
- */
2741
- __publicField$6(this, "mediaType");
2742
- /**
2743
- * Base64 encoded content of the file.
2744
- */
2745
- __publicField$6(this, "base64Content");
2746
- /**
2747
- * Whether to enable public url for the file.
2748
- */
2749
- __publicField$6(this, "enablePublicUrl");
2750
- /**
2751
- * Timeout for the signed url.
2752
- */
2753
- __publicField$6(this, "signedUrlTimeout");
2754
- /**
2755
- * Size of the file.
2756
- */
2757
- __publicField$6(this, "size");
2758
- /**
2759
- * Version of the file.
2760
- */
2761
- __publicField$6(this, "version");
2762
- /**
2763
- * Url of the file.
2764
- */
2765
- __publicField$6(this, "url");
2766
- /**
2767
- * Signed url of the file.
2768
- */
2769
- __publicField$6(this, "signedUrl");
2770
- /**
2771
- * Attributes of the file.
2772
- */
2773
- __publicField$6(this, "attributes");
2774
2721
  this.id = file.id;
2775
2722
  this.name = file.name || "";
2776
2723
  this.mediaType = file.mediaType || "application/octet-stream";
@@ -2929,12 +2876,6 @@ function parseJson(value) {
2929
2876
  }
2930
2877
  }
2931
2878
 
2932
- var __defProp$5 = Object.defineProperty;
2933
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2934
- var __publicField$5 = (obj, key, value) => {
2935
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
2936
- return value;
2937
- };
2938
2879
  var __accessCheck$6 = (obj, member, msg) => {
2939
2880
  if (!member.has(obj))
2940
2881
  throw TypeError("Cannot " + msg);
@@ -2957,14 +2898,6 @@ var _query, _page;
2957
2898
  class Page {
2958
2899
  constructor(query, meta, records = []) {
2959
2900
  __privateAdd$6(this, _query, void 0);
2960
- /**
2961
- * Page metadata, required to retrieve additional records.
2962
- */
2963
- __publicField$5(this, "meta");
2964
- /**
2965
- * The set of results for this page.
2966
- */
2967
- __publicField$5(this, "records");
2968
2901
  __privateSet$6(this, _query, query);
2969
2902
  this.meta = meta;
2970
2903
  this.records = new RecordArray(this, records);
@@ -3014,9 +2947,9 @@ class Page {
3014
2947
  }
3015
2948
  }
3016
2949
  _query = new WeakMap();
3017
- const PAGINATION_MAX_SIZE = 200;
2950
+ const PAGINATION_MAX_SIZE = 1e3;
3018
2951
  const PAGINATION_DEFAULT_SIZE = 20;
3019
- const PAGINATION_MAX_OFFSET = 800;
2952
+ const PAGINATION_MAX_OFFSET = 49e3;
3020
2953
  const PAGINATION_DEFAULT_OFFSET = 0;
3021
2954
  function isCursorPaginationOptions(options) {
3022
2955
  return isDefined(options) && (isDefined(options.start) || isDefined(options.end) || isDefined(options.after) || isDefined(options.before));
@@ -3095,12 +3028,6 @@ const _RecordArray = class _RecordArray extends Array {
3095
3028
  _page = new WeakMap();
3096
3029
  let RecordArray = _RecordArray;
3097
3030
 
3098
- var __defProp$4 = Object.defineProperty;
3099
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3100
- var __publicField$4 = (obj, key, value) => {
3101
- __defNormalProp$4(obj, typeof key !== "symbol" ? key + "" : key, value);
3102
- return value;
3103
- };
3104
3031
  var __accessCheck$5 = (obj, member, msg) => {
3105
3032
  if (!member.has(obj))
3106
3033
  throw TypeError("Cannot " + msg);
@@ -3131,8 +3058,8 @@ const _Query = class _Query {
3131
3058
  __privateAdd$5(this, _repository, void 0);
3132
3059
  __privateAdd$5(this, _data, { filter: {} });
3133
3060
  // Implements pagination
3134
- __publicField$4(this, "meta", { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } });
3135
- __publicField$4(this, "records", new RecordArray(this, []));
3061
+ this.meta = { page: { cursor: "start", more: true, size: PAGINATION_DEFAULT_SIZE } };
3062
+ this.records = new RecordArray(this, []);
3136
3063
  __privateSet$5(this, _table$1, table);
3137
3064
  if (repository) {
3138
3065
  __privateSet$5(this, _repository, repository);
@@ -4296,12 +4223,6 @@ function parseIfVersion(...args) {
4296
4223
  return void 0;
4297
4224
  }
4298
4225
 
4299
- var __defProp$3 = Object.defineProperty;
4300
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4301
- var __publicField$3 = (obj, key, value) => {
4302
- __defNormalProp$3(obj, typeof key !== "symbol" ? key + "" : key, value);
4303
- return value;
4304
- };
4305
4226
  var __accessCheck$3 = (obj, member, msg) => {
4306
4227
  if (!member.has(obj))
4307
4228
  throw TypeError("Cannot " + msg);
@@ -4324,8 +4245,6 @@ var _map;
4324
4245
  class SimpleCache {
4325
4246
  constructor(options = {}) {
4326
4247
  __privateAdd$3(this, _map, void 0);
4327
- __publicField$3(this, "capacity");
4328
- __publicField$3(this, "defaultQueryTTL");
4329
4248
  __privateSet$3(this, _map, /* @__PURE__ */ new Map());
4330
4249
  this.capacity = options.max ?? 500;
4331
4250
  this.defaultQueryTTL = options.defaultQueryTTL ?? 60 * 1e3;
@@ -4370,10 +4289,12 @@ const notExists = (column) => ({ $notExists: column });
4370
4289
  const startsWith = (value) => ({ $startsWith: value });
4371
4290
  const endsWith = (value) => ({ $endsWith: value });
4372
4291
  const pattern = (value) => ({ $pattern: value });
4292
+ const iPattern = (value) => ({ $iPattern: value });
4373
4293
  const is = (value) => ({ $is: value });
4374
4294
  const equals = is;
4375
4295
  const isNot = (value) => ({ $isNot: value });
4376
4296
  const contains = (value) => ({ $contains: value });
4297
+ const iContains = (value) => ({ $iContains: value });
4377
4298
  const includes = (value) => ({ $includes: value });
4378
4299
  const includesAll = (value) => ({ $includesAll: value });
4379
4300
  const includesNone = (value) => ({ $includesNone: value });
@@ -4595,12 +4516,6 @@ class TransactionPlugin extends XataPlugin {
4595
4516
  }
4596
4517
  }
4597
4518
 
4598
- var __defProp$2 = Object.defineProperty;
4599
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4600
- var __publicField$2 = (obj, key, value) => {
4601
- __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
4602
- return value;
4603
- };
4604
4519
  var __accessCheck = (obj, member, msg) => {
4605
4520
  if (!member.has(obj))
4606
4521
  throw TypeError("Cannot " + msg);
@@ -4630,11 +4545,6 @@ const buildClient = (plugins) => {
4630
4545
  __privateAdd(this, _parseOptions);
4631
4546
  __privateAdd(this, _getFetchProps);
4632
4547
  __privateAdd(this, _options, void 0);
4633
- __publicField$2(this, "db");
4634
- __publicField$2(this, "search");
4635
- __publicField$2(this, "transactions");
4636
- __publicField$2(this, "sql");
4637
- __publicField$2(this, "files");
4638
4548
  const safeOptions = __privateMethod(this, _parseOptions, parseOptions_fn).call(this, options);
4639
4549
  __privateSet(this, _options, safeOptions);
4640
4550
  const pluginOptions = {
@@ -4748,17 +4658,11 @@ const buildClient = (plugins) => {
4748
4658
  class BaseClient extends buildClient() {
4749
4659
  }
4750
4660
 
4751
- var __defProp$1 = Object.defineProperty;
4752
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4753
- var __publicField$1 = (obj, key, value) => {
4754
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
4755
- return value;
4756
- };
4757
4661
  const META = "__";
4758
4662
  const VALUE = "___";
4759
4663
  class Serializer {
4760
4664
  constructor() {
4761
- __publicField$1(this, "classes", {});
4665
+ this.classes = {};
4762
4666
  }
4763
4667
  add(clazz) {
4764
4668
  this.classes[clazz.name] = clazz;
@@ -4836,16 +4740,9 @@ function buildWorkerRunner(config) {
4836
4740
  };
4837
4741
  }
4838
4742
 
4839
- var __defProp = Object.defineProperty;
4840
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4841
- var __publicField = (obj, key, value) => {
4842
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4843
- return value;
4844
- };
4845
4743
  class XataError extends Error {
4846
4744
  constructor(message, status) {
4847
4745
  super(message);
4848
- __publicField(this, "status");
4849
4746
  this.status = status;
4850
4747
  }
4851
4748
  }
@@ -4894,6 +4791,7 @@ exports.compareMigrationRequest = compareMigrationRequest;
4894
4791
  exports.contains = contains;
4895
4792
  exports.copyBranch = copyBranch;
4896
4793
  exports.createBranch = createBranch;
4794
+ exports.createCluster = createCluster;
4897
4795
  exports.createDatabase = createDatabase;
4898
4796
  exports.createMigrationRequest = createMigrationRequest;
4899
4797
  exports.createTable = createTable;
@@ -4929,6 +4827,7 @@ exports.getBranchMigrationHistory = getBranchMigrationHistory;
4929
4827
  exports.getBranchMigrationPlan = getBranchMigrationPlan;
4930
4828
  exports.getBranchSchemaHistory = getBranchSchemaHistory;
4931
4829
  exports.getBranchStats = getBranchStats;
4830
+ exports.getCluster = getCluster;
4932
4831
  exports.getColumn = getColumn;
4933
4832
  exports.getDatabaseGithubSettings = getDatabaseGithubSettings;
4934
4833
  exports.getDatabaseList = getDatabaseList;
@@ -4957,6 +4856,8 @@ exports.greaterThan = greaterThan;
4957
4856
  exports.greaterThanEquals = greaterThanEquals;
4958
4857
  exports.gt = gt;
4959
4858
  exports.gte = gte;
4859
+ exports.iContains = iContains;
4860
+ exports.iPattern = iPattern;
4960
4861
  exports.includes = includes;
4961
4862
  exports.includesAll = includesAll;
4962
4863
  exports.includesAny = includesAny;
@@ -4977,6 +4878,7 @@ exports.le = le;
4977
4878
  exports.lessEquals = lessEquals;
4978
4879
  exports.lessThan = lessThan;
4979
4880
  exports.lessThanEquals = lessThanEquals;
4881
+ exports.listClusters = listClusters;
4980
4882
  exports.listMigrationRequestsCommits = listMigrationRequestsCommits;
4981
4883
  exports.listRegions = listRegions;
4982
4884
  exports.lt = lt;
@@ -5008,6 +4910,7 @@ exports.summarizeTable = summarizeTable;
5008
4910
  exports.transformImage = transformImage;
5009
4911
  exports.updateBranchMetadata = updateBranchMetadata;
5010
4912
  exports.updateBranchSchema = updateBranchSchema;
4913
+ exports.updateCluster = updateCluster;
5011
4914
  exports.updateColumn = updateColumn;
5012
4915
  exports.updateDatabaseGithubSettings = updateDatabaseGithubSettings;
5013
4916
  exports.updateDatabaseMetadata = updateDatabaseMetadata;