@dremio/js-sdk 0.41.0 → 0.42.0

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/README.md CHANGED
@@ -42,6 +42,17 @@ bun install @dremio/js-sdk
42
42
  </script>
43
43
  ```
44
44
 
45
+ ### Deno
46
+
47
+ ```typescript
48
+ import { Dremio, fromPat } from "npm:@dremio/js-sdk@latest/cloud";
49
+
50
+ const dremio = new Dremio({
51
+ origin: "https://api.dremio.cloud",
52
+ credentials: fromPat("PERSONAL_ACCESS_TOKEN"),
53
+ });
54
+ ```
55
+
45
56
  ## Quick Start
46
57
 
47
58
  ```typescript
@@ -119,6 +130,7 @@ API responses are automatically converted to native JavaScript/TypeScript types:
119
130
 
120
131
  ## Table of Contents
121
132
 
133
+ - [Configuration](#configuration)
122
134
  - [Authentication](#authentication)
123
135
  - [Catalog](#catalog)
124
136
  - [Engine Rules](#engine-rules)
@@ -131,6 +143,65 @@ API responses are automatically converted to native JavaScript/TypeScript types:
131
143
  - [Scripts](#scripts)
132
144
  - [Users](#users)
133
145
 
146
+ ## Configuration
147
+
148
+ The `Dremio` class accepts a configuration object with the following properties:
149
+
150
+ ```typescript
151
+ interface DremioConfig {
152
+ origin: string;
153
+ credentials: CredentialProvider;
154
+ logger?: Logger;
155
+ fetch?: typeof fetch;
156
+ }
157
+ ```
158
+
159
+ ### `origin`
160
+
161
+ The base API URL of your Dremio instance:
162
+
163
+ **Dremio Cloud:**
164
+
165
+ - `"https://api.dremio.cloud"` - US region
166
+ - `"https://api.eu.dremio.cloud"` - EU region
167
+
168
+ **Dremio Self-Hosted:**
169
+
170
+ - Your self-hosted Dremio URL (e.g., `"https://dremio.example.com"`)
171
+
172
+ ### `credentials`
173
+
174
+ A credential provider function that returns authentication headers. See the [Authentication](#authentication) section for available options:
175
+
176
+ - `fromAccessToken()` - OAuth access token
177
+ - `fromRefreshToken()` - OAuth refresh token (auto-refreshes)
178
+ - `fromPat()` - Personal access token
179
+
180
+ ### `logger` (optional)
181
+
182
+ A custom logger implementation. Must implement:
183
+
184
+ ```typescript
185
+ interface Logger {
186
+ debug(message: string, ...args: any[]): void;
187
+ info(message: string, ...args: any[]): void;
188
+ warn(message: string, ...args: any[]): void;
189
+ error(message: string, ...args: any[]): void;
190
+ }
191
+ ```
192
+
193
+ See [Custom Logger](#custom-logger) for examples.
194
+
195
+ ### `fetch` (optional)
196
+
197
+ A custom fetch implementation. Useful for:
198
+
199
+ - Adding custom middleware
200
+ - Using a specific fetch polyfill
201
+ - Intercepting requests for testing
202
+
203
+ Defaults to the global `fetch` function.
204
+
134
205
  ## Authentication
135
206
 
136
207
  ### Access Token
@@ -883,10 +954,10 @@ import { Result } from "ts-results-es";
883
954
  const result = await dremio.projects.retrieve("PROJECT_ID");
884
955
 
885
956
  if (result.isOk()) {
886
- const project = result.unwrap();
957
+ const project = result.value;
887
958
  console.log(project.name);
888
959
  } else {
889
- const error = result.unwrapErr();
960
+ const error = result.error;
890
961
  console.error("Error:", error);
891
962
  }
892
963
 
@@ -1430,7 +1430,7 @@ var DremioCloud = (() => {
1430
1430
  // dist/cloud/Dremio.js
1431
1431
  var import_moize2 = __toESM(require_moize(), 1);
1432
1432
 
1433
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/utils.js
1433
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/utils.js
1434
1434
  function toString(val) {
1435
1435
  var value = String(val);
1436
1436
  if (value === "[object Object]") {
@@ -1442,7 +1442,7 @@ var DremioCloud = (() => {
1442
1442
  return value;
1443
1443
  }
1444
1444
 
1445
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/option.js
1445
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/option.js
1446
1446
  var NoneImpl = (
1447
1447
  /** @class */
1448
1448
  (function() {
@@ -1611,7 +1611,7 @@ var DremioCloud = (() => {
1611
1611
  Option2.isOption = isOption;
1612
1612
  })(Option || (Option = {}));
1613
1613
 
1614
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/result.js
1614
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/result.js
1615
1615
  var __spreadArray = function(to2, from2, pack) {
1616
1616
  if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) {
1617
1617
  if (ar2 || !(i2 in from2)) {
@@ -1849,7 +1849,7 @@ var DremioCloud = (() => {
1849
1849
  Result2.isResult = isResult;
1850
1850
  })(Result || (Result = {}));
1851
1851
 
1852
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/asyncresult.js
1852
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/asyncresult.js
1853
1853
  var __awaiter = function(thisArg, _arguments, P2, generator) {
1854
1854
  function adopt(value) {
1855
1855
  return value instanceof P2 ? value : new P2(function(resolve) {
@@ -2032,6 +2032,9 @@ var DremioCloud = (() => {
2032
2032
  return result.toOption();
2033
2033
  }));
2034
2034
  };
2035
+ AsyncResult2.prototype.then = function(onfulfilled, onrejected) {
2036
+ return this.promise.then(onfulfilled, onrejected);
2037
+ };
2035
2038
  AsyncResult2.prototype.thenInternal = function(mapper) {
2036
2039
  return new AsyncResult2(this.promise.then(mapper));
2037
2040
  };
@@ -2039,7 +2042,7 @@ var DremioCloud = (() => {
2039
2042
  })()
2040
2043
  );
2041
2044
 
2042
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/asyncoption.js
2045
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/asyncoption.js
2043
2046
  var __awaiter2 = function(thisArg, _arguments, P2, generator) {
2044
2047
  function adopt(value) {
2045
2048
  return value instanceof P2 ? value : new P2(function(resolve) {
@@ -2202,6 +2205,9 @@ var DremioCloud = (() => {
2202
2205
  return option.toResult(error);
2203
2206
  }));
2204
2207
  };
2208
+ AsyncOption2.prototype.then = function(onfulfilled, onrejected) {
2209
+ return this.promise.then(onfulfilled, onrejected);
2210
+ };
2205
2211
  AsyncOption2.prototype.thenInternal = function(mapper) {
2206
2212
  return new AsyncOption2(this.promise.then(mapper));
2207
2213
  };
@@ -3486,7 +3486,7 @@ var DremioCommunity = (() => {
3486
3486
  }
3487
3487
  };
3488
3488
 
3489
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/utils.js
3489
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/utils.js
3490
3490
  function toString(val) {
3491
3491
  var value = String(val);
3492
3492
  if (value === "[object Object]") {
@@ -3498,7 +3498,7 @@ var DremioCommunity = (() => {
3498
3498
  return value;
3499
3499
  }
3500
3500
 
3501
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/option.js
3501
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/option.js
3502
3502
  var NoneImpl = (
3503
3503
  /** @class */
3504
3504
  (function() {
@@ -3667,7 +3667,7 @@ var DremioCommunity = (() => {
3667
3667
  Option2.isOption = isOption;
3668
3668
  })(Option || (Option = {}));
3669
3669
 
3670
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/result.js
3670
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/result.js
3671
3671
  var __spreadArray = function(to2, from2, pack) {
3672
3672
  if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) {
3673
3673
  if (ar2 || !(i2 in from2)) {
@@ -3905,7 +3905,7 @@ var DremioCommunity = (() => {
3905
3905
  Result2.isResult = isResult;
3906
3906
  })(Result || (Result = {}));
3907
3907
 
3908
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/asyncresult.js
3908
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/asyncresult.js
3909
3909
  var __awaiter = function(thisArg, _arguments, P2, generator) {
3910
3910
  function adopt(value) {
3911
3911
  return value instanceof P2 ? value : new P2(function(resolve) {
@@ -4088,6 +4088,9 @@ var DremioCommunity = (() => {
4088
4088
  return result.toOption();
4089
4089
  }));
4090
4090
  };
4091
+ AsyncResult2.prototype.then = function(onfulfilled, onrejected) {
4092
+ return this.promise.then(onfulfilled, onrejected);
4093
+ };
4091
4094
  AsyncResult2.prototype.thenInternal = function(mapper) {
4092
4095
  return new AsyncResult2(this.promise.then(mapper));
4093
4096
  };
@@ -4095,7 +4098,7 @@ var DremioCommunity = (() => {
4095
4098
  })()
4096
4099
  );
4097
4100
 
4098
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/asyncoption.js
4101
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/asyncoption.js
4099
4102
  var __awaiter2 = function(thisArg, _arguments, P2, generator) {
4100
4103
  function adopt(value) {
4101
4104
  return value instanceof P2 ? value : new P2(function(resolve) {
@@ -4258,6 +4261,9 @@ var DremioCommunity = (() => {
4258
4261
  return option.toResult(error);
4259
4262
  }));
4260
4263
  };
4264
+ AsyncOption2.prototype.then = function(onfulfilled, onrejected) {
4265
+ return this.promise.then(onfulfilled, onrejected);
4266
+ };
4261
4267
  AsyncOption2.prototype.thenInternal = function(mapper) {
4262
4268
  return new AsyncOption2(this.promise.then(mapper));
4263
4269
  };
@@ -3540,7 +3540,7 @@ var DremioEnterprise = (() => {
3540
3540
  var EnterpriseFileCatalogReference = class extends FileCatalogReference {
3541
3541
  };
3542
3542
 
3543
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/utils.js
3543
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/utils.js
3544
3544
  function toString(val) {
3545
3545
  var value = String(val);
3546
3546
  if (value === "[object Object]") {
@@ -3552,7 +3552,7 @@ var DremioEnterprise = (() => {
3552
3552
  return value;
3553
3553
  }
3554
3554
 
3555
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/option.js
3555
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/option.js
3556
3556
  var NoneImpl = (
3557
3557
  /** @class */
3558
3558
  (function() {
@@ -3721,7 +3721,7 @@ var DremioEnterprise = (() => {
3721
3721
  Option2.isOption = isOption;
3722
3722
  })(Option || (Option = {}));
3723
3723
 
3724
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/result.js
3724
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/result.js
3725
3725
  var __spreadArray = function(to2, from2, pack) {
3726
3726
  if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar2; i2 < l2; i2++) {
3727
3727
  if (ar2 || !(i2 in from2)) {
@@ -3959,7 +3959,7 @@ var DremioEnterprise = (() => {
3959
3959
  Result2.isResult = isResult;
3960
3960
  })(Result || (Result = {}));
3961
3961
 
3962
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/asyncresult.js
3962
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/asyncresult.js
3963
3963
  var __awaiter = function(thisArg, _arguments, P2, generator) {
3964
3964
  function adopt(value) {
3965
3965
  return value instanceof P2 ? value : new P2(function(resolve) {
@@ -4142,6 +4142,9 @@ var DremioEnterprise = (() => {
4142
4142
  return result.toOption();
4143
4143
  }));
4144
4144
  };
4145
+ AsyncResult2.prototype.then = function(onfulfilled, onrejected) {
4146
+ return this.promise.then(onfulfilled, onrejected);
4147
+ };
4145
4148
  AsyncResult2.prototype.thenInternal = function(mapper) {
4146
4149
  return new AsyncResult2(this.promise.then(mapper));
4147
4150
  };
@@ -4149,7 +4152,7 @@ var DremioEnterprise = (() => {
4149
4152
  })()
4150
4153
  );
4151
4154
 
4152
- // node_modules/.pnpm/ts-results-es@5.0.1/node_modules/ts-results-es/dist/esm/asyncoption.js
4155
+ // node_modules/.pnpm/ts-results-es@6.0.0/node_modules/ts-results-es/dist/esm/asyncoption.js
4153
4156
  var __awaiter2 = function(thisArg, _arguments, P2, generator) {
4154
4157
  function adopt(value) {
4155
4158
  return value instanceof P2 ? value : new P2(function(resolve) {
@@ -4312,6 +4315,9 @@ var DremioEnterprise = (() => {
4312
4315
  return option.toResult(error);
4313
4316
  }));
4314
4317
  };
4318
+ AsyncOption2.prototype.then = function(onfulfilled, onrejected) {
4319
+ return this.promise.then(onfulfilled, onrejected);
4320
+ };
4315
4321
  AsyncOption2.prototype.thenInternal = function(mapper) {
4316
4322
  return new AsyncOption2(this.promise.then(mapper));
4317
4323
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",
@@ -54,7 +54,7 @@
54
54
  "rxjs": "^7",
55
55
  "semver": "^7",
56
56
  "temporal-polyfill": "^0.3.0",
57
- "ts-results-es": "^5.0.1",
57
+ "ts-results-es": "^6.0.0",
58
58
  "zod": "^4.1.0"
59
59
  },
60
60
  "devDependencies": {