@dremio/js-sdk 0.46.0 → 0.47.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/dist/cloud/ai/AIResource.d.ts +68 -13
- package/dist/cloud/ai/AIResource.js +2 -1
- package/dist/cloud/ai/AIResource.js.map +1 -1
- package/dist/cloud/users/CloudUser.js +1 -1
- package/dist/cloud/users/CloudUser.js.map +1 -1
- package/dist/cloud/users/User.d.ts +3 -3
- package/dist/cloud/users/User.js +2 -2
- package/dist/cloud/users/User.js.map +1 -1
- package/dist/cloud/users/UsersResource.d.ts +33 -19
- package/dist/cloud/users/UsersResource.js +86 -24
- package/dist/cloud/users/UsersResource.js.map +1 -1
- package/dist/cloud/users/userPropertiesCodec.d.ts +19 -29
- package/dist/cloud/users/userPropertiesCodec.js +23 -23
- package/dist/cloud/users/userPropertiesCodec.js.map +1 -1
- package/dist/enterprise/ai/AIResource.d.ts +68 -22
- package/dist/enterprise/ai/AIResource.js +2 -2
- package/dist/enterprise/ai/AIResource.js.map +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.js +1 -1
- package/dist/enterprise/ai/conversations/AgentConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/createConversationMachine.d.ts +60 -7
- package/dist/enterprise/ai/conversations/methods/createConversation.d.ts +10 -2
- package/dist/enterprise/ai/conversations/methods/createConversation.js +1 -2
- package/dist/enterprise/ai/conversations/methods/createConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/listConversations.d.ts +6 -3
- package/dist/enterprise/ai/conversations/methods/listConversations.js +6 -8
- package/dist/enterprise/ai/conversations/methods/listConversations.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/retrieveConversation.d.ts +2 -4
- package/dist/enterprise/ai/conversations/methods/retrieveConversation.js +2 -10
- package/dist/enterprise/ai/conversations/methods/retrieveConversation.js.map +1 -1
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.d.ts +4 -0
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.js +4 -0
- package/dist/enterprise/ai/conversations/methods/retrieveConversationHistory.js.map +1 -1
- package/dist-iife/cloud.js +1257 -11586
- package/dist-iife/enterprise.js +4400 -14727
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import type { SignalParam } from "../../common/Params.ts";
|
|
|
10
10
|
import { type createConversationCodec } from "../../enterprise/ai/conversations/methods/createConversation.ts";
|
|
11
11
|
import type { ChatEvent } from "../../enterprise/ai/chat/chatEventSchema.ts";
|
|
12
12
|
import type { HttpError } from "../../common/HttpError.ts";
|
|
13
|
+
import { AgentConversation } from "../../enterprise/ai/conversations/AgentConversation.ts";
|
|
13
14
|
export declare class AIResource {
|
|
14
15
|
#private;
|
|
15
16
|
constructor(config: Logger & V4Config & SonarV4Config);
|
|
@@ -84,11 +85,29 @@ export declare class AIResource {
|
|
|
84
85
|
} | {
|
|
85
86
|
type: "REFRESH_HISTORY";
|
|
86
87
|
}, {
|
|
87
|
-
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<
|
|
88
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
|
|
89
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
90
|
+
currentRunId: string | null;
|
|
91
|
+
id: string;
|
|
92
|
+
modelName: string | null;
|
|
93
|
+
modelProviderId: string | null;
|
|
94
|
+
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
95
|
+
tag: string;
|
|
96
|
+
title: string | null;
|
|
97
|
+
}, {
|
|
88
98
|
message: UserChatMessage;
|
|
89
99
|
modelName?: string | undefined;
|
|
90
100
|
modelProviderId?: string | undefined;
|
|
91
|
-
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<
|
|
101
|
+
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
|
|
102
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
103
|
+
currentRunId: string | null;
|
|
104
|
+
id: string;
|
|
105
|
+
modelName: string | null;
|
|
106
|
+
modelProviderId: string | null;
|
|
107
|
+
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
108
|
+
tag: string;
|
|
109
|
+
title: string | null;
|
|
110
|
+
}, {
|
|
92
111
|
conversationId: string;
|
|
93
112
|
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
|
|
94
113
|
data: ({
|
|
@@ -199,7 +218,16 @@ export declare class AIResource {
|
|
|
199
218
|
}, {
|
|
200
219
|
conversationId: string;
|
|
201
220
|
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<{
|
|
202
|
-
conversation:
|
|
221
|
+
conversation: {
|
|
222
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
223
|
+
currentRunId: string | null;
|
|
224
|
+
id: string;
|
|
225
|
+
modelName: string | null;
|
|
226
|
+
modelProviderId: string | null;
|
|
227
|
+
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
228
|
+
tag: string;
|
|
229
|
+
title: string | null;
|
|
230
|
+
};
|
|
203
231
|
history: {
|
|
204
232
|
data: ({
|
|
205
233
|
conversationId: string;
|
|
@@ -437,7 +465,16 @@ export declare class AIResource {
|
|
|
437
465
|
}, import("xstate").EventObject>> | undefined;
|
|
438
466
|
}, {
|
|
439
467
|
src: "createConversation";
|
|
440
|
-
logic: import("xstate").PromiseActorLogic<
|
|
468
|
+
logic: import("xstate").PromiseActorLogic<{
|
|
469
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
470
|
+
currentRunId: string | null;
|
|
471
|
+
id: string;
|
|
472
|
+
modelName: string | null;
|
|
473
|
+
modelProviderId: string | null;
|
|
474
|
+
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
475
|
+
tag: string;
|
|
476
|
+
title: string | null;
|
|
477
|
+
}, {
|
|
441
478
|
message: UserChatMessage;
|
|
442
479
|
modelName?: string | undefined;
|
|
443
480
|
modelProviderId?: string | undefined;
|
|
@@ -445,7 +482,16 @@ export declare class AIResource {
|
|
|
445
482
|
id: string | undefined;
|
|
446
483
|
} | {
|
|
447
484
|
src: "retrieveConversation";
|
|
448
|
-
logic: import("xstate").PromiseActorLogic<
|
|
485
|
+
logic: import("xstate").PromiseActorLogic<{
|
|
486
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
487
|
+
currentRunId: string | null;
|
|
488
|
+
id: string;
|
|
489
|
+
modelName: string | null;
|
|
490
|
+
modelProviderId: string | null;
|
|
491
|
+
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
492
|
+
tag: string;
|
|
493
|
+
title: string | null;
|
|
494
|
+
}, {
|
|
449
495
|
conversationId: string;
|
|
450
496
|
}, import("xstate").EventObject>;
|
|
451
497
|
id: string | undefined;
|
|
@@ -564,7 +610,16 @@ export declare class AIResource {
|
|
|
564
610
|
} | {
|
|
565
611
|
src: "retrieveState";
|
|
566
612
|
logic: import("xstate").PromiseActorLogic<{
|
|
567
|
-
conversation:
|
|
613
|
+
conversation: {
|
|
614
|
+
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
615
|
+
currentRunId: string | null;
|
|
616
|
+
id: string;
|
|
617
|
+
modelName: string | null;
|
|
618
|
+
modelProviderId: string | null;
|
|
619
|
+
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
620
|
+
tag: string;
|
|
621
|
+
title: string | null;
|
|
622
|
+
};
|
|
568
623
|
history: {
|
|
569
624
|
data: ({
|
|
570
625
|
conversationId: string;
|
|
@@ -842,9 +897,9 @@ export declare class AIResource {
|
|
|
842
897
|
readonly uninitialized: {};
|
|
843
898
|
};
|
|
844
899
|
}>;
|
|
845
|
-
createConversation(body: z.input<typeof createConversationCodec>): import("ts-results-es").AsyncResult<
|
|
900
|
+
createConversation(body: z.input<typeof createConversationCodec>): import("ts-results-es").AsyncResult<AgentConversation, HttpError>;
|
|
846
901
|
listConversations(): {
|
|
847
|
-
data({ signal }?: SignalParam): AsyncGenerator<import("ts-results-es").
|
|
902
|
+
data({ signal }?: SignalParam): AsyncGenerator<import("ts-results-es").Err<z.core.$ZodError<{
|
|
848
903
|
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
849
904
|
currentRunId: string | null;
|
|
850
905
|
id: string;
|
|
@@ -853,11 +908,11 @@ export declare class AIResource {
|
|
|
853
908
|
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
854
909
|
tag: string;
|
|
855
910
|
title: string | null;
|
|
856
|
-
}
|
|
911
|
+
}>> | import("ts-results-es").Ok<AgentConversation>, void, unknown>;
|
|
857
912
|
getPage: (params: {
|
|
858
913
|
maxResults: number;
|
|
859
914
|
}, { signal }?: SignalParam) => import("ts-results-es").AsyncResult<{
|
|
860
|
-
data: (import("ts-results-es").
|
|
915
|
+
data: (import("ts-results-es").Err<z.core.$ZodError<{
|
|
861
916
|
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
862
917
|
currentRunId: string | null;
|
|
863
918
|
id: string;
|
|
@@ -866,10 +921,10 @@ export declare class AIResource {
|
|
|
866
921
|
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
867
922
|
tag: string;
|
|
868
923
|
title: string | null;
|
|
869
|
-
}>>)[];
|
|
924
|
+
}>> | import("ts-results-es").Ok<AgentConversation>)[];
|
|
870
925
|
}, HttpError>;
|
|
871
926
|
};
|
|
872
|
-
retrieveConversation(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<
|
|
927
|
+
retrieveConversation(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<{
|
|
873
928
|
createdAt: import("temporal-polyfill").Temporal.Instant;
|
|
874
929
|
currentRunId: string | null;
|
|
875
930
|
id: string;
|
|
@@ -878,7 +933,7 @@ export declare class AIResource {
|
|
|
878
933
|
modifiedAt: import("temporal-polyfill").Temporal.Instant;
|
|
879
934
|
tag: string;
|
|
880
935
|
title: string | null;
|
|
881
|
-
}
|
|
936
|
+
}, HttpError>;
|
|
882
937
|
retrieveConversationHistory(id: string): {
|
|
883
938
|
data(): AsyncGenerator<ChatEvent, void, HttpError>;
|
|
884
939
|
};
|
|
@@ -27,6 +27,7 @@ import { createConversation, } from "../../enterprise/ai/conversations/methods/c
|
|
|
27
27
|
import { retrieveConversation } from "../../enterprise/ai/conversations/methods/retrieveConversation.js";
|
|
28
28
|
import { retrieveConversationHistory } from "../../enterprise/ai/conversations/methods/retrieveConversationHistory.js";
|
|
29
29
|
import { createConversationMachine } from "../../enterprise/ai/conversations/createConversationMachine.js";
|
|
30
|
+
import { AgentConversation } from "../../enterprise/ai/conversations/AgentConversation.js";
|
|
30
31
|
export class AIResource {
|
|
31
32
|
#config;
|
|
32
33
|
constructor(config) {
|
|
@@ -51,7 +52,7 @@ export class AIResource {
|
|
|
51
52
|
return createConversationMachine(this.#config);
|
|
52
53
|
}
|
|
53
54
|
createConversation(body) {
|
|
54
|
-
return createConversation(this.#config)(body);
|
|
55
|
+
return createConversation(this.#config)(body).map((properties) => new AgentConversation(this.#config, properties));
|
|
55
56
|
}
|
|
56
57
|
listConversations() {
|
|
57
58
|
const getPage = listConversations(this.#config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIResource.js","sourceRoot":"","sources":["../../../src/cloud/ai/AIResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,MAAM,yDAAyD,CAAC;AACvI,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA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E,OAAO,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IAED,qBAAqB,CAAC,EAAU;QAC9B,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,yBAAyB,EAAE,EAAE,EAAE;YACxC,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAyD,CAAC;aAC/E,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;IACxE,CAAC;IAED;;;;;OAKG;IACH,eAAe,CAAC,WAAwB,EAAE,eAAgC;QACxE,OAAO,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ChatSession } from \"../../enterprise/ai/chat/ChatSession.ts\";\nimport type { UserChatMessage } from \"../../enterprise/ai/chat/UserChatMessage.ts\";\nimport type { Logger, SonarV4Config, V4Config } from \"../../common/Config.ts\";\nimport { ModelProvider } from \"../../enterprise/ai/modelProvider/ModelProvider.ts\";\nimport * as z from \"zod/mini\";\nimport {\n dremioProvidedSchema,\n modelProviderCreateCodec,\n modelProviderRetrieveCodec,\n safeDecodeModelProvider,\n type SafeDecodeResultWithoutDremioLLM,\n} from \"./modelProviderCodec.js\";\nimport { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from \"../../enterprise/ai/modelProvider/modelProviderCodec.ts\";\nimport { DremioModelProvider } from \"./DremioModelProvider.ts\";\nimport { safeParseResultToResult } from \"../../common/safeParseResultToResult.ts\";\nimport { listAvailableModels } from \"../../enterprise/ai/AIResource.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { createSendChatMessage } from \"../../enterprise/ai/chat/methods/sendChatMessage.ts\";\nimport { listConversations } from \"../../enterprise/ai/conversations/methods/listConversations.ts\";\nimport {\n createConversation,\n type createConversationCodec,\n} from \"../../enterprise/ai/conversations/methods/createConversation.ts\";\nimport { retrieveConversation } from \"../../enterprise/ai/conversations/methods/retrieveConversation.ts\";\nimport { retrieveConversationHistory } from \"../../enterprise/ai/conversations/methods/retrieveConversationHistory.ts\";\nimport type { ChatEvent } from \"../../enterprise/ai/chat/chatEventSchema.ts\";\nimport type { HttpError } from \"../../common/HttpError.ts\";\nimport { createConversationMachine } from \"../../enterprise/ai/conversations/createConversationMachine.ts\";\n\nexport class AIResource {\n #config: Logger & V4Config & SonarV4Config;\n\n constructor(config: Logger & V4Config & SonarV4Config) {\n this.#config = config;\n }\n\n createModelProvider(properties: z.output<typeof modelProviderCreateCodec>) {\n const body = z.encode(modelProviderCreateCodec, properties);\n return this.#config\n .v4Request(`model-provider/config`, {\n body: JSON.stringify(body),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen(\n (entity) =>\n safeDecodeModelProvider(this.#config, entity) as SafeDecodeResultWithoutDremioLLM,\n );\n }\n\n get conversationMachine() {\n return createConversationMachine(this.#config);\n }\n\n createConversation(body: z.input<typeof createConversationCodec>) {\n return createConversation(this.#config)(body);\n }\n\n listConversations() {\n const getPage = listConversations(this.#config);\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (\n await getPage({ maxResults: 100 }, { signal }).map((response) => response.data).promise\n ).unwrap();\n },\n getPage,\n };\n }\n\n retrieveConversation(id: string, { signal }: SignalParam = {}) {\n return retrieveConversation(this.#config)(id, { signal });\n }\n\n retrieveConversationHistory(id: string) {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n const getPage = (params: {}, { signal }: SignalParam = {}) =>\n retrieveConversationHistory(this.#config)(id, { signal });\n return {\n async *data(): AsyncGenerator<ChatEvent, void, HttpError> {\n const history = await getPage({}).then((result) => {\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n });\n yield* history.data;\n },\n };\n }\n\n listModelProviders() {\n const getPage = ({ signal }: SignalParam = {}) => {\n return this.#config\n .v4Request(\"model-provider/config\", {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map(\n (res) => res.json() as Promise<{ configs: z.input<typeof modelProviderRetrieveCodec>[] }>,\n )\n .map((response) => ({\n data: response.configs.map((entity) =>\n safeParseResultToResult(z.safeDecode(modelProviderRetrieveCodec, entity)).map(\n (properties) => {\n if (\"dremioProvided\" in properties.config) {\n return new DremioModelProvider(\n this.#config,\n properties as z.infer<typeof dremioProvidedSchema>,\n );\n }\n return new ModelProvider(\n this.#config,\n properties as z.output<typeof baseModelProviderRetrieveCodec>,\n );\n },\n ),\n ),\n }));\n };\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (await getPage({ signal }).promise).map((response) => response.data).unwrap();\n },\n getPage,\n };\n }\n\n listAvailableModels(...args: Parameters<ReturnType<typeof listAvailableModels>>) {\n return listAvailableModels(this.#config)(...args);\n }\n\n retrieveModelProvider(id: string) {\n return this.#config\n .v4Request(`model-provider/config/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen((entity) => safeDecodeModelProvider(this.#config, entity));\n }\n\n /**\n * Sends a chat message to the Dremio AI Agent and returns an Observable containing\n * Agent replies.\n *\n * @deprecated\n */\n sendChatMessage(chatSession: ChatSession, userChatMessage: UserChatMessage) {\n return createSendChatMessage(this.#config)(chatSession, userChatMessage);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AIResource.js","sourceRoot":"","sources":["../../../src/cloud/ai/AIResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC;AACnF,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAC9B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,0BAA0B,IAAI,8BAA8B,EAAE,MAAM,yDAAyD,CAAC;AACvI,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AACnG,OAAO,EACL,kBAAkB,GAEnB,MAAM,iEAAiE,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mEAAmE,CAAC;AACzG,OAAO,EAAE,2BAA2B,EAAE,MAAM,0EAA0E,CAAC;AAGvH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAE3F,MAAM,OAAO,UAAU;IACrB,OAAO,CAAoC;IAE3C,YAAY,MAAyC;QACnD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,mBAAmB,CAAC,UAAqD;QACvE,MAAM,IAAI,GAA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B,EAAE,eAAgC;QACxE,OAAO,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IAC3E,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ChatSession } from \"../../enterprise/ai/chat/ChatSession.ts\";\nimport type { UserChatMessage } from \"../../enterprise/ai/chat/UserChatMessage.ts\";\nimport type { Logger, SonarV4Config, V4Config } from \"../../common/Config.ts\";\nimport { ModelProvider } from \"../../enterprise/ai/modelProvider/ModelProvider.ts\";\nimport * as z from \"zod/mini\";\nimport {\n dremioProvidedSchema,\n modelProviderCreateCodec,\n modelProviderRetrieveCodec,\n safeDecodeModelProvider,\n type SafeDecodeResultWithoutDremioLLM,\n} from \"./modelProviderCodec.js\";\nimport { modelProviderRetrieveCodec as baseModelProviderRetrieveCodec } from \"../../enterprise/ai/modelProvider/modelProviderCodec.ts\";\nimport { DremioModelProvider } from \"./DremioModelProvider.ts\";\nimport { safeParseResultToResult } from \"../../common/safeParseResultToResult.ts\";\nimport { listAvailableModels } from \"../../enterprise/ai/AIResource.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { createSendChatMessage } from \"../../enterprise/ai/chat/methods/sendChatMessage.ts\";\nimport { listConversations } from \"../../enterprise/ai/conversations/methods/listConversations.ts\";\nimport {\n createConversation,\n type createConversationCodec,\n} from \"../../enterprise/ai/conversations/methods/createConversation.ts\";\nimport { retrieveConversation } from \"../../enterprise/ai/conversations/methods/retrieveConversation.ts\";\nimport { retrieveConversationHistory } from \"../../enterprise/ai/conversations/methods/retrieveConversationHistory.ts\";\nimport type { ChatEvent } from \"../../enterprise/ai/chat/chatEventSchema.ts\";\nimport type { HttpError } from \"../../common/HttpError.ts\";\nimport { createConversationMachine } from \"../../enterprise/ai/conversations/createConversationMachine.ts\";\nimport { AgentConversation } from \"../../enterprise/ai/conversations/AgentConversation.ts\";\n\nexport class AIResource {\n #config: Logger & V4Config & SonarV4Config;\n\n constructor(config: Logger & V4Config & SonarV4Config) {\n this.#config = config;\n }\n\n createModelProvider(properties: z.output<typeof modelProviderCreateCodec>) {\n const body = z.encode(modelProviderCreateCodec, properties);\n return this.#config\n .v4Request(`model-provider/config`, {\n body: JSON.stringify(body),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen(\n (entity) =>\n safeDecodeModelProvider(this.#config, entity) as SafeDecodeResultWithoutDremioLLM,\n );\n }\n\n get conversationMachine() {\n return createConversationMachine(this.#config);\n }\n\n createConversation(body: z.input<typeof createConversationCodec>) {\n return createConversation(this.#config)(body).map(\n (properties) => new AgentConversation(this.#config, properties),\n );\n }\n\n listConversations() {\n const getPage = listConversations(this.#config);\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (\n await getPage({ maxResults: 100 }, { signal }).map((response) => response.data).promise\n ).unwrap();\n },\n getPage,\n };\n }\n\n retrieveConversation(id: string, { signal }: SignalParam = {}) {\n return retrieveConversation(this.#config)(id, { signal });\n }\n\n retrieveConversationHistory(id: string) {\n // eslint-disable-next-line @typescript-eslint/no-empty-object-type\n const getPage = (params: {}, { signal }: SignalParam = {}) =>\n retrieveConversationHistory(this.#config)(id, { signal });\n return {\n async *data(): AsyncGenerator<ChatEvent, void, HttpError> {\n const history = await getPage({}).then((result) => {\n if (result.isErr()) {\n throw result.error;\n }\n return result.value;\n });\n yield* history.data;\n },\n };\n }\n\n listModelProviders() {\n const getPage = ({ signal }: SignalParam = {}) => {\n return this.#config\n .v4Request(\"model-provider/config\", {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map(\n (res) => res.json() as Promise<{ configs: z.input<typeof modelProviderRetrieveCodec>[] }>,\n )\n .map((response) => ({\n data: response.configs.map((entity) =>\n safeParseResultToResult(z.safeDecode(modelProviderRetrieveCodec, entity)).map(\n (properties) => {\n if (\"dremioProvided\" in properties.config) {\n return new DremioModelProvider(\n this.#config,\n properties as z.infer<typeof dremioProvidedSchema>,\n );\n }\n return new ModelProvider(\n this.#config,\n properties as z.output<typeof baseModelProviderRetrieveCodec>,\n );\n },\n ),\n ),\n }));\n };\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (await getPage({ signal }).promise).map((response) => response.data).unwrap();\n },\n getPage,\n };\n }\n\n listAvailableModels(...args: Parameters<ReturnType<typeof listAvailableModels>>) {\n return listAvailableModels(this.#config)(...args);\n }\n\n retrieveModelProvider(id: string) {\n return this.#config\n .v4Request(`model-provider/config/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n })\n .map((res) => res.json() as Promise<z.input<typeof modelProviderRetrieveCodec>>)\n .andThen((entity) => safeDecodeModelProvider(this.#config, entity));\n }\n\n /**\n * Sends a chat message to the Dremio AI Agent and returns an Observable containing\n * Agent replies.\n *\n * @deprecated\n */\n sendChatMessage(chatSession: ChatSession, userChatMessage: UserChatMessage) {\n return createSendChatMessage(this.#config)(chatSession, userChatMessage);\n }\n}\n"]}
|
|
@@ -20,7 +20,7 @@ import { EnterpriseUser, } from "../../enterprise/users/EnterpriseUser.js";
|
|
|
20
20
|
export class CloudUser extends EnterpriseUser {
|
|
21
21
|
}
|
|
22
22
|
export const cloudUserEntityToProperties = (entity) => ({
|
|
23
|
-
email: entity.
|
|
23
|
+
email: entity.name,
|
|
24
24
|
familyName: entity.lastName || null,
|
|
25
25
|
givenName: entity.firstName || null,
|
|
26
26
|
id: entity.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudUser.js","sourceRoot":"","sources":["../../../src/cloud/users/CloudUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,cAAc,GAEf,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,cAAc;CAAG;AAEhD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAW,EAAE,EAAE,CACzD,CAAC;IACC,KAAK,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"CloudUser.js","sourceRoot":"","sources":["../../../src/cloud/users/CloudUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,cAAc,GAEf,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,cAAc;CAAG;AAEhD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAW,EAAE,EAAE,CACzD,CAAC;IACC,KAAK,EAAE,MAAM,CAAC,IAAI;IAClB,UAAU,EAAE,MAAM,CAAC,QAAQ,IAAI,IAAI;IACnC,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,IAAI;IACnC,EAAE,EAAE,MAAM,CAAC,EAAE;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;IAC7C,QAAQ,EAAE,MAAM,CAAC,IAAI;CACtB,CAA6B,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n EnterpriseUser,\n type EnterpriseUserProperties,\n} from \"../../enterprise/users/EnterpriseUser.ts\";\n\n/**\n * @deprecated\n */\nexport class CloudUser extends EnterpriseUser {}\n\nexport const cloudUserEntityToProperties = (entity: any) =>\n ({\n email: entity.name,\n familyName: entity.lastName || null,\n givenName: entity.firstName || null,\n id: entity.id,\n status: entity.active ? \"ACTIVE\" : \"INACTIVE\",\n username: entity.name,\n }) as EnterpriseUserProperties;\n"]}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
2
|
import type { userPropertiesCodec } from "./userPropertiesCodec.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { V3Config } from "../../common/Config.ts";
|
|
4
4
|
export declare class User implements z.output<typeof userPropertiesCodec> {
|
|
5
5
|
#private;
|
|
6
6
|
readonly email: string | null;
|
|
7
7
|
readonly familyName: string | null;
|
|
8
8
|
readonly givenName: string | null;
|
|
9
9
|
readonly id: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly identityType: z.output<typeof userPropertiesCodec>["identityType"];
|
|
11
11
|
readonly status: z.output<typeof userPropertiesCodec>["status"];
|
|
12
12
|
readonly username: string;
|
|
13
|
-
constructor(config:
|
|
13
|
+
constructor(config: V3Config, properties: z.output<typeof userPropertiesCodec>);
|
|
14
14
|
get displayName(): string;
|
|
15
15
|
get initials(): string;
|
|
16
16
|
}
|
package/dist/cloud/users/User.js
CHANGED
|
@@ -21,7 +21,7 @@ export class User {
|
|
|
21
21
|
familyName;
|
|
22
22
|
givenName;
|
|
23
23
|
id;
|
|
24
|
-
|
|
24
|
+
identityType;
|
|
25
25
|
status;
|
|
26
26
|
username;
|
|
27
27
|
constructor(config, properties) {
|
|
@@ -30,7 +30,7 @@ export class User {
|
|
|
30
30
|
this.familyName = properties.familyName;
|
|
31
31
|
this.givenName = properties.givenName;
|
|
32
32
|
this.id = properties.id;
|
|
33
|
-
this.
|
|
33
|
+
this.identityType = properties.identityType;
|
|
34
34
|
this.status = properties.status;
|
|
35
35
|
this.username = properties.username;
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/cloud/users/User.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,MAAM,OAAO,IAAI;IACf,2DAA2D;IAClD,OAAO,CAAW;IAClB,KAAK,CAAgB;IACrB,UAAU,CAAgB;IAC1B,SAAS,CAAgB;IACzB,EAAE,CAAS;IACX,
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/cloud/users/User.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAI9B,MAAM,OAAO,IAAI;IACf,2DAA2D;IAClD,OAAO,CAAW;IAClB,KAAK,CAAgB;IACrB,UAAU,CAAgB;IAC1B,SAAS,CAAgB;IACzB,EAAE,CAAS;IACX,YAAY,CAAuD;IACnE,MAAM,CAAiD;IACvD,QAAQ,CAAS;IAE1B,YAAY,MAAgB,EAAE,UAAgD;QAC5E,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,IAAI,WAAW;QACb,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;QACvB,CAAC;QAED,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAED,IAAI,QAAQ;QACV,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACtC,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport type { userPropertiesCodec } from \"./userPropertiesCodec.ts\";\nimport type { V3Config } from \"../../common/Config.ts\";\n\nexport class User implements z.output<typeof userPropertiesCodec> {\n // eslint-disable-next-line no-unused-private-class-members\n readonly #config: V3Config;\n readonly email: string | null;\n readonly familyName: string | null;\n readonly givenName: string | null;\n readonly id: string;\n readonly identityType: z.output<typeof userPropertiesCodec>[\"identityType\"];\n readonly status: z.output<typeof userPropertiesCodec>[\"status\"];\n readonly username: string;\n\n constructor(config: V3Config, properties: z.output<typeof userPropertiesCodec>) {\n this.#config = config;\n this.email = properties.email;\n this.familyName = properties.familyName;\n this.givenName = properties.givenName;\n this.id = properties.id;\n this.identityType = properties.identityType;\n this.status = properties.status;\n this.username = properties.username;\n }\n\n get displayName(): string {\n if (this.givenName || this.familyName) {\n return [this.givenName, this.familyName].filter(Boolean).join(\" \");\n }\n\n if (this.username) {\n return this.username;\n }\n\n if (this.email) {\n return this.email;\n }\n\n return this.id;\n }\n\n get initials(): string {\n if (this.givenName && this.familyName) {\n return this.givenName.charAt(0) + this.familyName.charAt(0);\n }\n\n return this.displayName.slice(0, 2);\n }\n}\n"]}
|
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
import type { V3Config } from "../../common/Config.ts";
|
|
2
3
|
import type { SignalParam } from "../../common/Params.ts";
|
|
3
4
|
import { User } from "./User.ts";
|
|
5
|
+
import type { identityTypeSchema } from "./userPropertiesCodec.js";
|
|
6
|
+
type CreateUserParams = {
|
|
7
|
+
name: string;
|
|
8
|
+
identityType?: z.output<typeof identityTypeSchema>;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
type UpdateUserParams = {
|
|
12
|
+
firstName?: string;
|
|
13
|
+
lastName?: string;
|
|
14
|
+
};
|
|
4
15
|
export declare class UsersResource {
|
|
5
16
|
#private;
|
|
6
|
-
constructor(config:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
constructor(config: V3Config);
|
|
18
|
+
list(params?: {
|
|
19
|
+
filter?: string;
|
|
20
|
+
maxResults?: number;
|
|
21
|
+
orderBy?: string;
|
|
22
|
+
}): {
|
|
11
23
|
data({ signal }?: SignalParam): AsyncGenerator<User, void, unknown>;
|
|
12
|
-
getPage: ({
|
|
13
|
-
|
|
14
|
-
offset: number;
|
|
24
|
+
getPage: ({ pageToken, signal }?: {
|
|
25
|
+
pageToken?: string;
|
|
15
26
|
} & SignalParam) => import("ts-results-es").AsyncResult<{
|
|
16
27
|
data: User[];
|
|
17
|
-
|
|
18
|
-
startIndex: number;
|
|
28
|
+
nextPageToken?: string;
|
|
19
29
|
totalResults: number;
|
|
20
30
|
}, import("../index.ts").HttpError>;
|
|
21
31
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
create(params: CreateUserParams, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
33
|
+
retrieveById(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
34
|
+
retrieveByName(name: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
35
|
+
update(id: string, params: UpdateUserParams, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
36
|
+
delete(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<Response, import("../index.ts").HttpError>;
|
|
37
|
+
listParentRoles(userId: string, params?: {
|
|
38
|
+
maxResults?: number;
|
|
39
|
+
pageToken?: string;
|
|
40
|
+
}, { signal }?: SignalParam): import("ts-results-es").AsyncResult<Response, import("../index.ts").HttpError>;
|
|
41
|
+
addParentRole(userId: string, roleId: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<Response, import("../index.ts").HttpError>;
|
|
42
|
+
removeParentRole(userId: string, roleId: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<Response, import("../index.ts").HttpError>;
|
|
30
43
|
}
|
|
44
|
+
export {};
|
|
@@ -21,14 +21,24 @@ export class UsersResource {
|
|
|
21
21
|
constructor(config) {
|
|
22
22
|
this.#config = config;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
list(params) {
|
|
25
|
+
const buildQuery = (extra) => {
|
|
26
|
+
const query = new URLSearchParams();
|
|
27
|
+
if (params?.filter)
|
|
28
|
+
query.set("filter", params.filter);
|
|
29
|
+
if (params?.maxResults)
|
|
30
|
+
query.set("maxResults", String(params.maxResults));
|
|
31
|
+
if (params?.orderBy)
|
|
32
|
+
query.set("orderBy", params.orderBy);
|
|
33
|
+
if (extra?.pageToken)
|
|
34
|
+
query.set("pageToken", extra.pageToken);
|
|
35
|
+
return query;
|
|
36
|
+
};
|
|
37
|
+
const getPage = ({ pageToken, signal } = {}) => this.#config
|
|
38
|
+
.v3Request(`users?${buildQuery({ pageToken })}`, {
|
|
39
|
+
headers: { Accept: "application/json" },
|
|
40
|
+
signal,
|
|
41
|
+
})
|
|
32
42
|
.map((res) => res.json())
|
|
33
43
|
.map((page) => ({
|
|
34
44
|
...page,
|
|
@@ -36,50 +46,102 @@ export class UsersResource {
|
|
|
36
46
|
}));
|
|
37
47
|
return {
|
|
38
48
|
async *data({ signal } = {}) {
|
|
39
|
-
const
|
|
40
|
-
let offset = 0;
|
|
41
|
-
const firstPageResult = await getPage({ limit: USERS_PAGE_SIZE, offset, signal }).promise;
|
|
49
|
+
const firstPageResult = await getPage({ signal }).promise;
|
|
42
50
|
if (firstPageResult.isErr()) {
|
|
43
51
|
throw firstPageResult.error;
|
|
44
52
|
}
|
|
45
53
|
let currentPage = firstPageResult.value;
|
|
46
54
|
yield* currentPage.data;
|
|
47
|
-
while (currentPage.
|
|
48
|
-
|
|
49
|
-
|
|
55
|
+
while (currentPage.nextPageToken) {
|
|
56
|
+
currentPage = await getPage({
|
|
57
|
+
pageToken: currentPage.nextPageToken,
|
|
58
|
+
signal,
|
|
59
|
+
}).promise.then((result) => result.unwrap());
|
|
50
60
|
yield* currentPage.data;
|
|
51
61
|
}
|
|
52
62
|
},
|
|
53
63
|
getPage,
|
|
54
64
|
};
|
|
55
65
|
}
|
|
56
|
-
|
|
57
|
-
* @deprecated
|
|
58
|
-
*/
|
|
59
|
-
_retrieveById(id, { signal } = {}) {
|
|
66
|
+
create(params, { signal } = {}) {
|
|
60
67
|
return this.#config
|
|
61
|
-
.
|
|
68
|
+
.v3Request("users", {
|
|
69
|
+
body: JSON.stringify(params),
|
|
62
70
|
headers: {
|
|
63
71
|
Accept: "application/json",
|
|
72
|
+
"Content-Type": "application/json",
|
|
64
73
|
},
|
|
74
|
+
method: "POST",
|
|
75
|
+
signal,
|
|
76
|
+
})
|
|
77
|
+
.map((res) => res.json())
|
|
78
|
+
.map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));
|
|
79
|
+
}
|
|
80
|
+
retrieveById(id, { signal } = {}) {
|
|
81
|
+
return this.#config
|
|
82
|
+
.v3Request(`users/${id}`, {
|
|
83
|
+
headers: { Accept: "application/json" },
|
|
84
|
+
signal,
|
|
85
|
+
})
|
|
86
|
+
.map((res) => res.json())
|
|
87
|
+
.map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));
|
|
88
|
+
}
|
|
89
|
+
retrieveByName(name, { signal } = {}) {
|
|
90
|
+
return this.#config
|
|
91
|
+
.v3Request(`users/names/${name}`, {
|
|
92
|
+
headers: { Accept: "application/json" },
|
|
65
93
|
signal,
|
|
66
94
|
})
|
|
67
95
|
.map((res) => res.json())
|
|
68
96
|
.map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));
|
|
69
97
|
}
|
|
70
|
-
|
|
71
|
-
* @deprecated
|
|
72
|
-
*/
|
|
73
|
-
_retrieveByUsername(username, { signal } = {}) {
|
|
98
|
+
update(id, params, { signal } = {}) {
|
|
74
99
|
return this.#config
|
|
75
|
-
.
|
|
100
|
+
.v3Request(`users/${id}`, {
|
|
101
|
+
body: JSON.stringify(params),
|
|
76
102
|
headers: {
|
|
77
103
|
Accept: "application/json",
|
|
104
|
+
"Content-Type": "application/json",
|
|
78
105
|
},
|
|
106
|
+
method: "PUT",
|
|
79
107
|
signal,
|
|
80
108
|
})
|
|
81
109
|
.map((res) => res.json())
|
|
82
110
|
.map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));
|
|
83
111
|
}
|
|
112
|
+
delete(id, { signal } = {}) {
|
|
113
|
+
return this.#config.v3Request(`users/${id}`, {
|
|
114
|
+
method: "DELETE",
|
|
115
|
+
signal,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
listParentRoles(userId, params, { signal } = {}) {
|
|
119
|
+
const query = new URLSearchParams();
|
|
120
|
+
if (params?.maxResults)
|
|
121
|
+
query.set("maxResults", String(params.maxResults));
|
|
122
|
+
if (params?.pageToken)
|
|
123
|
+
query.set("pageToken", params.pageToken);
|
|
124
|
+
return this.#config.v3Request(`users/${userId}/parent-roles?${query}`, {
|
|
125
|
+
headers: { Accept: "application/json" },
|
|
126
|
+
signal,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
addParentRole(userId, roleId, { signal } = {}) {
|
|
130
|
+
return this.#config.v3Request(`users/${userId}/parent-roles`, {
|
|
131
|
+
body: JSON.stringify({ id: roleId }),
|
|
132
|
+
headers: {
|
|
133
|
+
Accept: "application/json",
|
|
134
|
+
"Content-Type": "application/json",
|
|
135
|
+
},
|
|
136
|
+
method: "POST",
|
|
137
|
+
signal,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
removeParentRole(userId, roleId, { signal } = {}) {
|
|
141
|
+
return this.#config.v3Request(`users/${userId}/parent-roles/${roleId}`, {
|
|
142
|
+
method: "DELETE",
|
|
143
|
+
signal,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
84
146
|
}
|
|
85
147
|
//# sourceMappingURL=UsersResource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UsersResource.js","sourceRoot":"","sources":["../../../src/cloud/users/UsersResource.ts"],"names":[],"mappings":"AAAA;;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AO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,gBAAgB,QAAQ,EAAE,EAAE;YACrC,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;aAC3B;YACD,MAAM;SACP,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAkD,CAAC;aACxE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACpF,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport type { V2Config } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { userPropertiesCodec } from \"./userPropertiesCodec.js\";\nimport { User } from \"./User.ts\";\n\nexport class UsersResource {\n #config: V2Config;\n\n constructor(config: V2Config) {\n this.#config = config;\n }\n\n /**\n * @deprecated\n */\n _list() {\n const getPage = ({ limit, offset, signal }: { limit: number; offset: number } & SignalParam) =>\n this.#config\n .v2Request(\n // startIndex for this API must be >= 1\n `user?${new URLSearchParams({ count: String(limit), startIndex: String(offset + 1) }).toString()}`,\n { headers: { Accept: \"application/json\" }, signal },\n )\n .map(\n (res) =>\n res.json() as Promise<{\n data: z.input<typeof userPropertiesCodec>[];\n itemsPerPage: number;\n startIndex: number;\n totalResults: number;\n }>,\n )\n .map((page) => ({\n ...page,\n data: page.data.map(\n (entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)),\n ),\n }));\n\n return {\n async *data({ signal }: SignalParam = {}) {\n const USERS_PAGE_SIZE = 100;\n let offset = 0;\n const firstPageResult = await getPage({ limit: USERS_PAGE_SIZE, offset, signal }).promise;\n if (firstPageResult.isErr()) {\n throw firstPageResult.error;\n }\n let currentPage = firstPageResult.value;\n yield* currentPage.data;\n while (currentPage.totalResults > offset - 1 + USERS_PAGE_SIZE) {\n offset += USERS_PAGE_SIZE;\n currentPage = await getPage({ limit: USERS_PAGE_SIZE, offset, signal }).promise.then(\n (result) => result.unwrap(),\n );\n yield* currentPage.data;\n }\n },\n getPage,\n };\n }\n\n /**\n * @deprecated\n */\n _retrieveById(id: string, { signal }: SignalParam = {}) {\n return this.#config\n .v2Request(`user/${id}`, {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof userPropertiesCodec>>)\n .map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));\n }\n\n /**\n * @deprecated\n */\n _retrieveByUsername(username: string, { signal }: SignalParam = {}) {\n return this.#config\n .v2Request(`user/by-name/${username}`, {\n headers: {\n Accept: \"application/json\",\n },\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof userPropertiesCodec>>)\n .map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UsersResource.js","sourceRoot":"","sources":["../../../src/cloud/users/UsersResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAG9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAoBjC,MAAM,OAAO,aAAa;IACxB,OAAO,CAAW;IAElB,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC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B;aACnC;YACD,MAAM,EAAE,MAAM;YACd,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,MAAc,EAAE,MAAc,EAAE,EAAE,MAAM,KAAkB,EAAE;QAC3E,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,MAAM,iBAAiB,MAAM,EAAE,EAAE;YACtE,MAAM,EAAE,QAAQ;YAChB,MAAM;SACP,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as z from \"zod/mini\";\nimport type { V3Config } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { userPropertiesCodec } from \"./userPropertiesCodec.js\";\nimport { User } from \"./User.ts\";\nimport type { identityTypeSchema } from \"./userPropertiesCodec.js\";\n\ntype PaginatedUserListResponse = {\n data: z.input<typeof userPropertiesCodec>[];\n nextPageToken?: string;\n totalResults: number;\n};\n\ntype CreateUserParams = {\n name: string;\n identityType?: z.output<typeof identityTypeSchema>;\n description?: string;\n};\n\ntype UpdateUserParams = {\n firstName?: string;\n lastName?: string;\n};\n\nexport class UsersResource {\n #config: V3Config;\n\n constructor(config: V3Config) {\n this.#config = config;\n }\n\n list(params?: { filter?: string; maxResults?: number; orderBy?: string }) {\n const buildQuery = (extra?: { pageToken?: string }) => {\n const query = new URLSearchParams();\n if (params?.filter) query.set(\"filter\", params.filter);\n if (params?.maxResults) query.set(\"maxResults\", String(params.maxResults));\n if (params?.orderBy) query.set(\"orderBy\", params.orderBy);\n if (extra?.pageToken) query.set(\"pageToken\", extra.pageToken);\n return query;\n };\n\n const getPage = ({ pageToken, signal }: { pageToken?: string } & SignalParam = {}) =>\n this.#config\n .v3Request(`users?${buildQuery({ pageToken })}`, {\n headers: { Accept: \"application/json\" },\n signal,\n })\n .map((res) => res.json() as Promise<PaginatedUserListResponse>)\n .map((page) => ({\n ...page,\n data: page.data.map(\n (entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)),\n ),\n }));\n\n return {\n async *data({ signal }: SignalParam = {}) {\n const firstPageResult = await getPage({ signal }).promise;\n if (firstPageResult.isErr()) {\n throw firstPageResult.error;\n }\n let currentPage = firstPageResult.value;\n yield* currentPage.data;\n while (currentPage.nextPageToken) {\n currentPage = await getPage({\n pageToken: currentPage.nextPageToken,\n signal,\n }).promise.then((result) => result.unwrap());\n yield* currentPage.data;\n }\n },\n getPage,\n };\n }\n\n create(params: CreateUserParams, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(\"users\", {\n body: JSON.stringify(params),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof userPropertiesCodec>>)\n .map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));\n }\n\n retrieveById(id: string, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`users/${id}`, {\n headers: { Accept: \"application/json\" },\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof userPropertiesCodec>>)\n .map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));\n }\n\n retrieveByName(name: string, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`users/names/${name}`, {\n headers: { Accept: \"application/json\" },\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof userPropertiesCodec>>)\n .map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));\n }\n\n update(id: string, params: UpdateUserParams, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`users/${id}`, {\n body: JSON.stringify(params),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n method: \"PUT\",\n signal,\n })\n .map((res) => res.json() as Promise<z.input<typeof userPropertiesCodec>>)\n .map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));\n }\n\n delete(id: string, { signal }: SignalParam = {}) {\n return this.#config.v3Request(`users/${id}`, {\n method: \"DELETE\",\n signal,\n });\n }\n\n listParentRoles(\n userId: string,\n params?: { maxResults?: number; pageToken?: string },\n { signal }: SignalParam = {},\n ) {\n const query = new URLSearchParams();\n if (params?.maxResults) query.set(\"maxResults\", String(params.maxResults));\n if (params?.pageToken) query.set(\"pageToken\", params.pageToken);\n\n return this.#config.v3Request(`users/${userId}/parent-roles?${query}`, {\n headers: { Accept: \"application/json\" },\n signal,\n });\n }\n\n addParentRole(userId: string, roleId: string, { signal }: SignalParam = {}) {\n return this.#config.v3Request(`users/${userId}/parent-roles`, {\n body: JSON.stringify({ id: roleId }),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n signal,\n });\n }\n\n removeParentRole(userId: string, roleId: string, { signal }: SignalParam = {}) {\n return this.#config.v3Request(`users/${userId}/parent-roles/${roleId}`, {\n method: \"DELETE\",\n signal,\n });\n }\n}\n"]}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
1
|
import * as z from "zod/mini";
|
|
2
|
+
export declare const identityTypeSchema: z.ZodMiniEnum<{
|
|
3
|
+
REGULAR_USER: "REGULAR_USER";
|
|
4
|
+
SERVICE_USER: "SERVICE_USER";
|
|
5
|
+
}>;
|
|
2
6
|
export declare const userPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
|
|
3
|
-
|
|
4
|
-
firstName: z.ZodMiniString<string
|
|
7
|
+
active: z.ZodMiniBoolean<boolean>;
|
|
8
|
+
firstName: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
5
9
|
id: z.ZodMiniString<string>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
EXTERNAL: "EXTERNAL";
|
|
13
|
-
SYSTEM: "SYSTEM";
|
|
14
|
-
}>;
|
|
15
|
-
}, z.core.$strip>>;
|
|
16
|
-
status: z.ZodMiniEnum<{
|
|
17
|
-
ACTIVE: "ACTIVE";
|
|
18
|
-
INACTIVE: "INACTIVE";
|
|
19
|
-
}>;
|
|
20
|
-
username: z.ZodMiniString<string>;
|
|
10
|
+
identityType: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
11
|
+
REGULAR_USER: "REGULAR_USER";
|
|
12
|
+
SERVICE_USER: "SERVICE_USER";
|
|
13
|
+
}>>;
|
|
14
|
+
lastName: z.ZodMiniOptional<z.ZodMiniNullable<z.ZodMiniString<string>>>;
|
|
15
|
+
name: z.ZodMiniString<string>;
|
|
21
16
|
}, z.core.$strip>, z.ZodMiniObject<{
|
|
17
|
+
email: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
18
|
+
familyName: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
19
|
+
givenName: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
22
20
|
id: z.ZodMiniString<string>;
|
|
21
|
+
identityType: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
22
|
+
REGULAR_USER: "REGULAR_USER";
|
|
23
|
+
SERVICE_USER: "SERVICE_USER";
|
|
24
|
+
}>>;
|
|
23
25
|
status: z.ZodMiniEnum<{
|
|
24
26
|
ACTIVE: "ACTIVE";
|
|
25
27
|
INACTIVE: "INACTIVE";
|
|
26
28
|
}>;
|
|
27
29
|
username: z.ZodMiniString<string>;
|
|
28
|
-
roles: z.ZodMiniArray<z.ZodMiniObject<{
|
|
29
|
-
id: z.ZodMiniString<string>;
|
|
30
|
-
name: z.ZodMiniString<string>;
|
|
31
|
-
type: z.ZodMiniEnum<{
|
|
32
|
-
INTERNAL: "INTERNAL";
|
|
33
|
-
EXTERNAL: "EXTERNAL";
|
|
34
|
-
SYSTEM: "SYSTEM";
|
|
35
|
-
}>;
|
|
36
|
-
}, z.core.$strip>>;
|
|
37
|
-
email: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
38
|
-
familyName: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
39
|
-
givenName: z.ZodMiniNullable<z.ZodMiniString<string>>;
|
|
40
30
|
}, z.core.$strip>>;
|