@dremio/js-sdk 0.49.0 → 0.51.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/replaceOriginResource.js +5 -0
- package/dist/cloud/replaceOriginResource.js.map +1 -1
- package/dist/cloud/users/UsersResource.d.ts +7 -1
- package/dist/cloud/users/UsersResource.js +2 -2
- package/dist/cloud/users/UsersResource.js.map +1 -1
- package/dist-iife/cloud.js +7 -2
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
const prodLikePattern = /^([^.]+)(\.(?:(?:eu\.)?dremio\.cloud|[^.]+\.dremio\.site))$/;
|
|
17
17
|
const privateLinkPattern = /^([^.]+\.)([^.]+)((\.privatelink\.dremio\.cloud)|(\.privatelink\.([^.]+)\.dremio\.site))$/;
|
|
18
18
|
const daasEnginePattern = /^(dcs-(?:aws|cloud)-\d+-ns\.)([^.]+)(\.drem\.io)$/;
|
|
19
|
+
const daasAzurePattern = /^([^.]+)(\.daas-azure\.drem\.io)$/;
|
|
19
20
|
const awsInternalPattern = /^([^.]+)(\.([^.]+\.aws\.dremio\.site))$/;
|
|
20
21
|
/**
|
|
21
22
|
* @hidden
|
|
@@ -31,6 +32,10 @@ export function _replaceOriginResource(origin, resource) {
|
|
|
31
32
|
url.hostname = hostname.replace(privateLinkPattern, `$1${resource}$3`);
|
|
32
33
|
return url.origin;
|
|
33
34
|
}
|
|
35
|
+
if (daasAzurePattern.test(hostname)) {
|
|
36
|
+
url.hostname = hostname.replace(daasAzurePattern, `${resource}$2`);
|
|
37
|
+
return url.origin;
|
|
38
|
+
}
|
|
34
39
|
if (daasEnginePattern.test(hostname)) {
|
|
35
40
|
url.hostname = hostname.replace(daasEnginePattern, `$1${resource}$3`);
|
|
36
41
|
return url.origin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replaceOriginResource.js","sourceRoot":"","sources":["../../src/cloud/replaceOriginResource.ts"],"names":[],"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AAC","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 type { Config } from \"../common/Config.ts\";\n\nconst prodLikePattern = /^([^.]+)(\\.(?:(?:eu\\.)?dremio\\.cloud|[^.]+\\.dremio\\.site))$/;\nconst privateLinkPattern =\n /^([^.]+\\.)([^.]+)((\\.privatelink\\.dremio\\.cloud)|(\\.privatelink\\.([^.]+)\\.dremio\\.site))$/;\nconst daasEnginePattern = /^(dcs-(?:aws|cloud)-\\d+-ns\\.)([^.]+)(\\.drem\\.io)$/;\nconst awsInternalPattern = /^([^.]+)(\\.([^.]+\\.aws\\.dremio\\.site))$/;\n\n/**\n * @hidden\n * @internal\n */\nexport function _replaceOriginResource(origin: Config[\"origin\"], resource: string): string {\n const url = new URL(origin);\n const hostname = url.hostname;\n\n if (awsInternalPattern.test(hostname)) {\n url.hostname = hostname.replace(awsInternalPattern, `${resource}$2`);\n }\n\n if (privateLinkPattern.test(hostname)) {\n url.hostname = hostname.replace(privateLinkPattern, `$1${resource}$3`);\n return url.origin;\n }\n\n if (daasEnginePattern.test(hostname)) {\n url.hostname = hostname.replace(daasEnginePattern, `$1${resource}$3`);\n return url.origin;\n }\n\n if (prodLikePattern.test(hostname)) {\n url.hostname = hostname.replace(prodLikePattern, `${resource}$2`);\n return url.origin;\n }\n\n return url.origin;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"replaceOriginResource.js","sourceRoot":"","sources":["../../src/cloud/replaceOriginResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,eAAe,GAAG,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,CAAC;QACnC,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,QAAQ,IAAI,CAAC,CAAC;QAClE,OAAO,GAAG,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,OAAO,GAAG,CAAC,MAAM,CAAC;AACpB,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 type { Config } from \"../common/Config.ts\";\n\nconst prodLikePattern = /^([^.]+)(\\.(?:(?:eu\\.)?dremio\\.cloud|[^.]+\\.dremio\\.site))$/;\nconst privateLinkPattern =\n /^([^.]+\\.)([^.]+)((\\.privatelink\\.dremio\\.cloud)|(\\.privatelink\\.([^.]+)\\.dremio\\.site))$/;\nconst daasEnginePattern = /^(dcs-(?:aws|cloud)-\\d+-ns\\.)([^.]+)(\\.drem\\.io)$/;\nconst daasAzurePattern = /^([^.]+)(\\.daas-azure\\.drem\\.io)$/;\nconst awsInternalPattern = /^([^.]+)(\\.([^.]+\\.aws\\.dremio\\.site))$/;\n\n/**\n * @hidden\n * @internal\n */\nexport function _replaceOriginResource(origin: Config[\"origin\"], resource: string): string {\n const url = new URL(origin);\n const hostname = url.hostname;\n\n if (awsInternalPattern.test(hostname)) {\n url.hostname = hostname.replace(awsInternalPattern, `${resource}$2`);\n }\n\n if (privateLinkPattern.test(hostname)) {\n url.hostname = hostname.replace(privateLinkPattern, `$1${resource}$3`);\n return url.origin;\n }\n\n if (daasAzurePattern.test(hostname)) {\n url.hostname = hostname.replace(daasAzurePattern, `${resource}$2`);\n return url.origin;\n }\n\n if (daasEnginePattern.test(hostname)) {\n url.hostname = hostname.replace(daasEnginePattern, `$1${resource}$3`);\n return url.origin;\n }\n\n if (prodLikePattern.test(hostname)) {\n url.hostname = hostname.replace(prodLikePattern, `${resource}$2`);\n return url.origin;\n }\n\n return url.origin;\n}\n"]}
|
|
@@ -9,8 +9,14 @@ type CreateUserParams = {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
};
|
|
11
11
|
type UpdateUserParams = {
|
|
12
|
+
id: string;
|
|
13
|
+
active: boolean;
|
|
14
|
+
name: string;
|
|
15
|
+
identityType?: z.output<typeof identityTypeSchema>;
|
|
12
16
|
firstName?: string;
|
|
13
17
|
lastName?: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
oauthClientId?: string;
|
|
14
20
|
};
|
|
15
21
|
type PatchParentRolesParams = {
|
|
16
22
|
addRoles?: string[];
|
|
@@ -40,7 +46,7 @@ export declare class UsersResource {
|
|
|
40
46
|
create(params: CreateUserParams, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
41
47
|
retrieveById(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
42
48
|
retrieveByName(name: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
43
|
-
update(
|
|
49
|
+
update(params: UpdateUserParams, { signal }?: SignalParam): import("ts-results-es").AsyncResult<User, import("../index.ts").HttpError>;
|
|
44
50
|
delete(id: string, { signal }?: SignalParam): import("ts-results-es").AsyncResult<Response, import("../index.ts").HttpError>;
|
|
45
51
|
listParentRoles(userId: string, params?: {
|
|
46
52
|
maxResults?: number;
|
|
@@ -95,9 +95,9 @@ export class UsersResource {
|
|
|
95
95
|
.map((res) => res.json())
|
|
96
96
|
.map((entity) => new User(this.#config, z.decode(userPropertiesCodec, entity)));
|
|
97
97
|
}
|
|
98
|
-
update(
|
|
98
|
+
update(params, { signal } = {}) {
|
|
99
99
|
return this.#config
|
|
100
|
-
.v3Request(`users/${id}`, {
|
|
100
|
+
.v3Request(`users/${params.id}`, {
|
|
101
101
|
body: JSON.stringify(params),
|
|
102
102
|
headers: {
|
|
103
103
|
Accept: "application/json",
|
|
@@ -1 +1 @@
|
|
|
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;AA8BjC,MAAM,OAAO,aAAa;IACxB,OAAO,CAAW;IAElB,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,MAAmE;QACtE,MAAM,UAAU,GAAG,CAAC,KAA8B,EAAE,EAAE;YACpD,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;YACpC,IAAI,MAAM,EAAE,MAAM;gBAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;YACvD,IAAI,MAAM,EAAE,UAAU;gBAAE,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;YAC3E,IAAI,MAAM,EAAE,OAAO;gBAAE,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;YAC1D,IAAI,KAAK,EAAE,SAAS;gBAAE,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;YAC9D,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QAEF,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,MAAM,KAA2C,EAAE,EAAE,EAAE,CACnF,IAA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AC,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\ntype PatchParentRolesParams = {\n addRoles?: string[];\n removeRoles?: string[];\n};\n\ntype PatchParentRolesResponse = {\n addedRoles?: string[];\n removedRoles?: 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 patchParentRoles(userId: string, params: PatchParentRolesParams, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`users/${userId}/parent-roles`, {\n body: JSON.stringify(params),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n method: \"PATCH\",\n signal,\n })\n .map((res) => res.json() as Promise<PatchParentRolesResponse>);\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
|
+
{"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;AAoCjC,MAAM,OAAO,aAAa;IACxB,OAAO,CAAW;IAElB,YAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACx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AE,kBAAkB;aACnC;YACD,MAAM,EAAE,MAAM;YACd,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,MAAc,EAAE,MAA8B,EAAE,EAAE,MAAM,KAAkB,EAAE;QAC3F,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,SAAS,MAAM,eAAe,EAAE;YACzC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAC5B,OAAO,EAAE;gBACP,MAAM,EAAE,kBAAkB;gBAC1B,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,OAAO;YACf,MAAM;SACP,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAuC,CAAC,CAAC;IACnE,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 id: string;\n active: boolean;\n name: string;\n identityType?: z.output<typeof identityTypeSchema>;\n firstName?: string;\n lastName?: string;\n description?: string;\n oauthClientId?: string;\n};\n\ntype PatchParentRolesParams = {\n addRoles?: string[];\n removeRoles?: string[];\n};\n\ntype PatchParentRolesResponse = {\n addedRoles?: string[];\n removedRoles?: 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(params: UpdateUserParams, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`users/${params.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 patchParentRoles(userId: string, params: PatchParentRolesParams, { signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`users/${userId}/parent-roles`, {\n body: JSON.stringify(params),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n method: \"PATCH\",\n signal,\n })\n .map((res) => res.json() as Promise<PatchParentRolesResponse>);\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"]}
|
package/dist-iife/cloud.js
CHANGED
|
@@ -12648,6 +12648,7 @@ var DremioCloud = (() => {
|
|
|
12648
12648
|
var prodLikePattern = /^([^.]+)(\.(?:(?:eu\.)?dremio\.cloud|[^.]+\.dremio\.site))$/;
|
|
12649
12649
|
var privateLinkPattern = /^([^.]+\.)([^.]+)((\.privatelink\.dremio\.cloud)|(\.privatelink\.([^.]+)\.dremio\.site))$/;
|
|
12650
12650
|
var daasEnginePattern = /^(dcs-(?:aws|cloud)-\d+-ns\.)([^.]+)(\.drem\.io)$/;
|
|
12651
|
+
var daasAzurePattern = /^([^.]+)(\.daas-azure\.drem\.io)$/;
|
|
12651
12652
|
var awsInternalPattern = /^([^.]+)(\.([^.]+\.aws\.dremio\.site))$/;
|
|
12652
12653
|
function _replaceOriginResource(origin, resource) {
|
|
12653
12654
|
const url = new URL(origin);
|
|
@@ -12659,6 +12660,10 @@ var DremioCloud = (() => {
|
|
|
12659
12660
|
url.hostname = hostname2.replace(privateLinkPattern, `$1${resource}$3`);
|
|
12660
12661
|
return url.origin;
|
|
12661
12662
|
}
|
|
12663
|
+
if (daasAzurePattern.test(hostname2)) {
|
|
12664
|
+
url.hostname = hostname2.replace(daasAzurePattern, `${resource}$2`);
|
|
12665
|
+
return url.origin;
|
|
12666
|
+
}
|
|
12662
12667
|
if (daasEnginePattern.test(hostname2)) {
|
|
12663
12668
|
url.hostname = hostname2.replace(daasEnginePattern, `$1${resource}$3`);
|
|
12664
12669
|
return url.origin;
|
|
@@ -16210,8 +16215,8 @@ var DremioCloud = (() => {
|
|
|
16210
16215
|
signal
|
|
16211
16216
|
}).map((res) => res.json()).map((entity) => new User2(this.#config, decode(userPropertiesCodec, entity)));
|
|
16212
16217
|
}
|
|
16213
|
-
update(
|
|
16214
|
-
return this.#config.v3Request(`users/${id}`, {
|
|
16218
|
+
update(params, { signal } = {}) {
|
|
16219
|
+
return this.#config.v3Request(`users/${params.id}`, {
|
|
16215
16220
|
body: JSON.stringify(params),
|
|
16216
16221
|
headers: {
|
|
16217
16222
|
Accept: "application/json",
|