@dremio/js-sdk 0.52.0 → 0.54.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.
@@ -16068,28 +16068,34 @@ var DremioCloud = (() => {
16068
16068
  var identityTypeSchema = _enum(["REGULAR_USER", "SERVICE_USER"]);
16069
16069
  var userPropertiesInSchema = object({
16070
16070
  active: boolean2(),
16071
+ description: optional(nullable(string2())),
16071
16072
  firstName: optional(nullable(string2())),
16072
16073
  id: string2().check(_minLength(1)),
16073
16074
  identityType: optional(identityTypeSchema),
16074
16075
  lastName: optional(nullable(string2())),
16075
- name: string2()
16076
+ name: string2(),
16077
+ oauthClientId: optional(nullable(string2()))
16076
16078
  });
16077
16079
  var userPropertiesCodec = codec(userPropertiesInSchema, object({
16080
+ description: nullable(string2()),
16078
16081
  email: nullable(string2()),
16079
16082
  familyName: nullable(string2().check(_trim())),
16080
16083
  givenName: nullable(string2().check(_trim())),
16081
16084
  id: string2().check(_minLength(1)),
16082
16085
  identityType: optional(identityTypeSchema),
16086
+ oauthClientId: nullable(string2()),
16083
16087
  status: _enum(["ACTIVE", "INACTIVE"]),
16084
16088
  username: string2().check(_trim(), _minLength(1))
16085
16089
  }), {
16086
16090
  decode(v2) {
16087
16091
  return {
16092
+ description: v2.description || null,
16088
16093
  email: v2.name || null,
16089
16094
  familyName: v2.lastName || null,
16090
16095
  givenName: v2.firstName || null,
16091
16096
  id: v2.id,
16092
16097
  identityType: v2.identityType,
16098
+ oauthClientId: v2.oauthClientId || null,
16093
16099
  status: v2.active ? "ACTIVE" : "INACTIVE",
16094
16100
  username: v2.name
16095
16101
  };
@@ -16097,11 +16103,13 @@ var DremioCloud = (() => {
16097
16103
  encode(v2) {
16098
16104
  return {
16099
16105
  active: v2.status === "ACTIVE",
16106
+ description: v2.description || void 0,
16100
16107
  firstName: v2.givenName || void 0,
16101
16108
  id: v2.id,
16102
16109
  identityType: v2.identityType,
16103
16110
  lastName: v2.familyName || void 0,
16104
- name: v2.username
16111
+ name: v2.username,
16112
+ oauthClientId: v2.oauthClientId || void 0
16105
16113
  };
16106
16114
  }
16107
16115
  });
@@ -16110,20 +16118,24 @@ var DremioCloud = (() => {
16110
16118
  var User2 = class {
16111
16119
  // eslint-disable-next-line no-unused-private-class-members
16112
16120
  #config;
16121
+ description;
16113
16122
  email;
16114
16123
  familyName;
16115
16124
  givenName;
16116
16125
  id;
16117
16126
  identityType;
16127
+ oauthClientId;
16118
16128
  status;
16119
16129
  username;
16120
16130
  constructor(config3, properties) {
16121
16131
  this.#config = config3;
16132
+ this.description = properties.description;
16122
16133
  this.email = properties.email;
16123
16134
  this.familyName = properties.familyName;
16124
16135
  this.givenName = properties.givenName;
16125
16136
  this.id = properties.id;
16126
16137
  this.identityType = properties.identityType;
16138
+ this.oauthClientId = properties.oauthClientId;
16127
16139
  this.status = properties.status;
16128
16140
  this.username = properties.username;
16129
16141
  }
@@ -16349,6 +16361,185 @@ var DremioCloud = (() => {
16349
16361
  }
16350
16362
  };
16351
16363
 
16364
+ // dist/cloud/roles/Role.js
16365
+ var Role2 = class {
16366
+ id;
16367
+ name;
16368
+ type;
16369
+ description;
16370
+ constructor(properties) {
16371
+ this.id = properties.id;
16372
+ this.name = properties.name;
16373
+ this.type = properties.type;
16374
+ this.description = properties.description;
16375
+ }
16376
+ };
16377
+
16378
+ // dist/cloud/roles/RolesResource.js
16379
+ var RolesResource2 = class {
16380
+ #config;
16381
+ constructor(config3) {
16382
+ this.#config = config3;
16383
+ }
16384
+ list(params) {
16385
+ const buildQuery = (extra) => {
16386
+ const query = new URLSearchParams();
16387
+ if (params?.filter)
16388
+ query.set("filter", params.filter);
16389
+ if (params?.maxResults)
16390
+ query.set("maxResults", String(params.maxResults));
16391
+ if (params?.orderBy)
16392
+ query.set("orderBy", params.orderBy);
16393
+ if (extra?.pageToken)
16394
+ query.set("pageToken", extra.pageToken);
16395
+ return query;
16396
+ };
16397
+ const getPage = ({ pageToken, signal } = {}) => this.#config.v3Request(`roles?${buildQuery({ pageToken })}`, {
16398
+ headers: { Accept: "application/json" },
16399
+ signal
16400
+ }).map((res) => res.json()).map((page) => ({
16401
+ ...page,
16402
+ data: page.data.map((entity) => new Role2(entity))
16403
+ }));
16404
+ return {
16405
+ async *data({ signal } = {}) {
16406
+ const firstPageResult = await getPage({ signal }).promise;
16407
+ if (firstPageResult.isErr()) {
16408
+ throw firstPageResult.error;
16409
+ }
16410
+ let currentPage = firstPageResult.value;
16411
+ yield* currentPage.data;
16412
+ while (currentPage.nextPageToken) {
16413
+ currentPage = await getPage({
16414
+ pageToken: currentPage.nextPageToken,
16415
+ signal
16416
+ }).promise.then((result) => result.unwrap());
16417
+ yield* currentPage.data;
16418
+ }
16419
+ },
16420
+ getPage
16421
+ };
16422
+ }
16423
+ create(params, { signal } = {}) {
16424
+ return this.#config.v3Request("roles", {
16425
+ body: JSON.stringify(params),
16426
+ headers: {
16427
+ Accept: "application/json",
16428
+ "Content-Type": "application/json"
16429
+ },
16430
+ method: "POST",
16431
+ signal
16432
+ }).map((res) => res.json()).map((entity) => new Role2(entity));
16433
+ }
16434
+ retrieveById(id, { signal } = {}) {
16435
+ return this.#config.v3Request(`roles/${id}`, {
16436
+ headers: { Accept: "application/json" },
16437
+ signal
16438
+ }).map((res) => res.json()).map((entity) => new Role2(entity));
16439
+ }
16440
+ retrieveByName(name, { signal } = {}) {
16441
+ return this.#config.v3Request(`roles/names/${name}`, {
16442
+ headers: { Accept: "application/json" },
16443
+ signal
16444
+ }).map((res) => res.json()).map((entity) => new Role2(entity));
16445
+ }
16446
+ update(params, { signal } = {}) {
16447
+ return this.#config.v3Request(`roles/${params.id}`, {
16448
+ body: JSON.stringify(params),
16449
+ headers: {
16450
+ Accept: "application/json",
16451
+ "Content-Type": "application/json"
16452
+ },
16453
+ method: "PUT",
16454
+ signal
16455
+ }).map((res) => res.json()).map((entity) => new Role2(entity));
16456
+ }
16457
+ delete(id, { signal } = {}) {
16458
+ return this.#config.v3Request(`roles/${id}`, {
16459
+ method: "DELETE",
16460
+ signal
16461
+ });
16462
+ }
16463
+ listParentRoles(roleId, params, { signal } = {}) {
16464
+ const query = new URLSearchParams();
16465
+ if (params?.maxResults)
16466
+ query.set("maxResults", String(params.maxResults));
16467
+ if (params?.pageToken)
16468
+ query.set("pageToken", params.pageToken);
16469
+ return this.#config.v3Request(`roles/${roleId}/parent-roles?${query}`, {
16470
+ headers: { Accept: "application/json" },
16471
+ signal
16472
+ }).map((res) => res.json()).map((page) => ({ ...page, data: page.data.map((entity) => new Role2(entity)) }));
16473
+ }
16474
+ addParentRole(roleId, parentRoleId, { signal } = {}) {
16475
+ return this.#config.v3Request(`roles/${roleId}/parent-roles`, {
16476
+ body: JSON.stringify({ id: parentRoleId }),
16477
+ headers: {
16478
+ Accept: "application/json",
16479
+ "Content-Type": "application/json"
16480
+ },
16481
+ method: "POST",
16482
+ signal
16483
+ });
16484
+ }
16485
+ patchParentRoles(roleId, params, { signal } = {}) {
16486
+ return this.#config.v3Request(`roles/${roleId}/parent-roles`, {
16487
+ body: JSON.stringify(params),
16488
+ headers: {
16489
+ Accept: "application/json",
16490
+ "Content-Type": "application/json"
16491
+ },
16492
+ method: "PATCH",
16493
+ signal
16494
+ }).map((res) => res.json());
16495
+ }
16496
+ removeParentRole(roleId, parentRoleId, { signal } = {}) {
16497
+ return this.#config.v3Request(`roles/${roleId}/parent-roles/${parentRoleId}`, {
16498
+ method: "DELETE",
16499
+ signal
16500
+ });
16501
+ }
16502
+ listMembers(roleId, params, { signal } = {}) {
16503
+ const query = new URLSearchParams();
16504
+ if (params?.maxResults)
16505
+ query.set("maxResults", String(params.maxResults));
16506
+ if (params?.pageToken)
16507
+ query.set("pageToken", params.pageToken);
16508
+ return this.#config.v3Request(`roles/${roleId}/members?${query}`, {
16509
+ headers: { Accept: "application/json" },
16510
+ signal
16511
+ }).map((res) => res.json());
16512
+ }
16513
+ addMember(roleId, params, { signal } = {}) {
16514
+ return this.#config.v3Request(`roles/${roleId}/members`, {
16515
+ body: JSON.stringify(params),
16516
+ headers: {
16517
+ Accept: "application/json",
16518
+ "Content-Type": "application/json"
16519
+ },
16520
+ method: "POST",
16521
+ signal
16522
+ });
16523
+ }
16524
+ patchMembers(roleId, params, { signal } = {}) {
16525
+ return this.#config.v3Request(`roles/${roleId}/members`, {
16526
+ body: JSON.stringify(params),
16527
+ headers: {
16528
+ Accept: "application/json",
16529
+ "Content-Type": "application/json"
16530
+ },
16531
+ method: "PATCH",
16532
+ signal
16533
+ }).map((res) => res.json());
16534
+ }
16535
+ removeMember(roleId, memberId, { signal } = {}) {
16536
+ return this.#config.v3Request(`roles/${roleId}/members/${memberId}`, {
16537
+ method: "DELETE",
16538
+ signal
16539
+ });
16540
+ }
16541
+ };
16542
+
16352
16543
  // dist/enterprise/ai/chat/ChatSession.js
16353
16544
  var chatSessionInputSchema = object({
16354
16545
  id: string2(),
@@ -16961,6 +17152,13 @@ var DremioCloud = (() => {
16961
17152
  name: string2(),
16962
17153
  result: record(string2(), unknown())
16963
17154
  });
17155
+ var jobUpdateChunkSchema = object({
17156
+ chunkType: literal("jobUpdate"),
17157
+ jobId: string2(),
17158
+ jobState: string2(),
17159
+ toolExecutionId: string2(),
17160
+ toolName: string2()
17161
+ });
16964
17162
  var userMessageChunkSchema = object({
16965
17163
  chunkType: literal("userMessage"),
16966
17164
  text: string2()
@@ -16976,6 +17174,7 @@ var DremioCloud = (() => {
16976
17174
  extend2(endOfStreamChunkSchema, chatEventSharedSchema),
16977
17175
  extend2(interruptChunkSchema, chatEventSharedSchema),
16978
17176
  extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
17177
+ extend2(jobUpdateChunkSchema, chatEventSharedSchema),
16979
17178
  extend2(modelChunkSchema, chatEventSharedSchema),
16980
17179
  extend2(toolRequestChunkSchema, chatEventSharedSchema),
16981
17180
  extend2(toolResponseChunkSchema, chatEventSharedSchema),
@@ -16999,6 +17198,10 @@ var DremioCloud = (() => {
16999
17198
  content: interruptChunkSchema,
17000
17199
  role: literal("agent")
17001
17200
  }),
17201
+ extend2(chatEventOutputSharedSchema, {
17202
+ content: jobUpdateChunkSchema,
17203
+ role: literal("agent")
17204
+ }),
17002
17205
  extend2(chatEventOutputSharedSchema, { content: modelChunkSchema, role: literal("agent") }),
17003
17206
  extend2(chatEventOutputSharedSchema, {
17004
17207
  content: toolRequestChunkSchema,
@@ -17060,6 +17263,18 @@ var DremioCloud = (() => {
17060
17263
  },
17061
17264
  role: "agent"
17062
17265
  };
17266
+ case "jobUpdate":
17267
+ return {
17268
+ ...sharedProperties,
17269
+ content: {
17270
+ chunkType: "jobUpdate",
17271
+ jobId: v2.jobId,
17272
+ jobState: v2.jobState,
17273
+ toolExecutionId: v2.toolExecutionId,
17274
+ toolName: v2.toolName
17275
+ },
17276
+ role: "agent"
17277
+ };
17063
17278
  case "model":
17064
17279
  return {
17065
17280
  ...sharedProperties,
@@ -23095,6 +23310,7 @@ ${err.message}`);
23095
23310
  roles;
23096
23311
  scripts;
23097
23312
  sql;
23313
+ _roles;
23098
23314
  _users;
23099
23315
  users;
23100
23316
  #resourceConfig;
@@ -23113,6 +23329,7 @@ ${err.message}`);
23113
23329
  this.roles = import_moize2.default.default((projectId) => new RolesResource(this.#resourceConfig(projectId)));
23114
23330
  this.scripts = import_moize2.default.default((projectId) => new EnterpriseScriptsResource(this.#resourceConfig(projectId)));
23115
23331
  this.sql = import_moize2.default.default((projectId) => new SqlResource(this.#resourceConfig(projectId)));
23332
+ this._roles = new RolesResource2(this.#resourceConfig());
23116
23333
  this._users = new UsersResource(this.#resourceConfig());
23117
23334
  this.users = import_moize2.default.default((projectId) => new CloudUsersResource(this.#resourceConfig(projectId)));
23118
23335
  }
@@ -16082,6 +16082,13 @@ var DremioEnterprise = (() => {
16082
16082
  name: string2(),
16083
16083
  result: record(string2(), unknown())
16084
16084
  });
16085
+ var jobUpdateChunkSchema = object({
16086
+ chunkType: literal("jobUpdate"),
16087
+ jobId: string2(),
16088
+ jobState: string2(),
16089
+ toolExecutionId: string2(),
16090
+ toolName: string2()
16091
+ });
16085
16092
  var userMessageChunkSchema = object({
16086
16093
  chunkType: literal("userMessage"),
16087
16094
  text: string2()
@@ -16097,6 +16104,7 @@ var DremioEnterprise = (() => {
16097
16104
  extend2(endOfStreamChunkSchema, chatEventSharedSchema),
16098
16105
  extend2(interruptChunkSchema, chatEventSharedSchema),
16099
16106
  extend2(conversationUpdateChunkSchema, chatEventSharedSchema),
16107
+ extend2(jobUpdateChunkSchema, chatEventSharedSchema),
16100
16108
  extend2(modelChunkSchema, chatEventSharedSchema),
16101
16109
  extend2(toolRequestChunkSchema, chatEventSharedSchema),
16102
16110
  extend2(toolResponseChunkSchema, chatEventSharedSchema),
@@ -16120,6 +16128,10 @@ var DremioEnterprise = (() => {
16120
16128
  content: interruptChunkSchema,
16121
16129
  role: literal("agent")
16122
16130
  }),
16131
+ extend2(chatEventOutputSharedSchema, {
16132
+ content: jobUpdateChunkSchema,
16133
+ role: literal("agent")
16134
+ }),
16123
16135
  extend2(chatEventOutputSharedSchema, { content: modelChunkSchema, role: literal("agent") }),
16124
16136
  extend2(chatEventOutputSharedSchema, {
16125
16137
  content: toolRequestChunkSchema,
@@ -16181,6 +16193,18 @@ var DremioEnterprise = (() => {
16181
16193
  },
16182
16194
  role: "agent"
16183
16195
  };
16196
+ case "jobUpdate":
16197
+ return {
16198
+ ...sharedProperties,
16199
+ content: {
16200
+ chunkType: "jobUpdate",
16201
+ jobId: v2.jobId,
16202
+ jobState: v2.jobState,
16203
+ toolExecutionId: v2.toolExecutionId,
16204
+ toolName: v2.toolName
16205
+ },
16206
+ role: "agent"
16207
+ };
16184
16208
  case "model":
16185
16209
  return {
16186
16210
  ...sharedProperties,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.52.0",
3
+ "version": "0.54.0",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",