@dremio/js-sdk 0.31.2 → 0.31.3
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.
|
@@ -17,7 +17,7 @@ import { createRequest } from "../common/createRequest.js";
|
|
|
17
17
|
import { _replaceOriginResource } from "./replaceOriginResource.js";
|
|
18
18
|
export const getResourceConfig = (config) => (projectId) => {
|
|
19
19
|
const request = createRequest(config);
|
|
20
|
-
const sonarV2URL = (path) => new URL(`/ui/projects/${projectId}/${path}`, _replaceOriginResource(
|
|
20
|
+
const sonarV2URL = (path) => new URL(`/ui/projects/${projectId}/${path}`, _replaceOriginResource(config.origin, "app"));
|
|
21
21
|
const sonarV3URL = (path) => {
|
|
22
22
|
if (!projectId) {
|
|
23
23
|
throw new Error("projectId is required");
|
|
@@ -30,7 +30,7 @@ export const getResourceConfig = (config) => (projectId) => {
|
|
|
30
30
|
}
|
|
31
31
|
return new URL(`/v1/projects/${projectId}/${path}`, config.origin);
|
|
32
32
|
};
|
|
33
|
-
const v2URL = (path) => new URL(`/ui/${path}`, _replaceOriginResource(
|
|
33
|
+
const v2URL = (path) => new URL(`/ui/${path}`, _replaceOriginResource(config.origin, "app"));
|
|
34
34
|
const v3URL = (path) => new URL(`/v0/${path}`, config.origin);
|
|
35
35
|
const v4URL = (path) => new URL(`/v1/${path}`, config.origin);
|
|
36
36
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getResourceConfig.js","sourceRoot":"","sources":["../../src/cloud/getResourceConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,SAAkB,EAAE,EAAE;IAC1E,MAAM,OAAO,GAAG,aAAa,CAA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Y,EAAE,IAAkB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC;QACtF,KAAK;QACL,SAAS,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC;QACtF,KAAK;KAOG,CAAC;AACb,CAAC,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 {\n Config,\n ResourceConfig,\n SonarV2Config,\n SonarV3Config,\n SonarV4Config,\n V2Config,\n V3Config,\n V4Config,\n} from \"../common/Config.ts\";\nimport { createRequest } from \"../common/createRequest.ts\";\nimport { _replaceOriginResource } from \"./replaceOriginResource.ts\";\n\nexport const getResourceConfig = (config: Config) => (projectId?: string) => {\n const request = createRequest(config);\n\n const sonarV2URL = (path: string) =>\n new URL(`/ui/projects/${projectId}/${path}`, _replaceOriginResource(config.origin, \"app\"));\n\n const sonarV3URL = (path: string) => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return new URL(`/v0/projects/${projectId}/${path}`, config.origin);\n };\n\n const sonarV4URL = (path: string) => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return new URL(`/v1/projects/${projectId}/${path}`, config.origin);\n };\n\n const v2URL = (path: string) =>\n new URL(`/ui/${path}`, _replaceOriginResource(config.origin, \"app\"));\n\n const v3URL = (path: string) => new URL(`/v0/${path}`, config.origin);\n\n const v4URL = (path: string) => new URL(`/v1/${path}`, config.origin);\n\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV2Request: (path: string, init?: RequestInit) => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return request(sonarV2URL(path).toString(), init);\n },\n sonarV2URL,\n sonarV3Request: (path: string, init?: RequestInit) =>\n request(sonarV3URL(path).toString(), init),\n sonarV3URL,\n sonarV4Request: (path: string, init?: RequestInit) =>\n request(sonarV4URL(path).toString(), init),\n sonarV4URL,\n v2Request: (path: string, init?: RequestInit) => request(v2URL(path).toString(), init),\n v2URL,\n v3Request: (path: string, init?: RequestInit) => request(v3URL(path).toString(), init),\n v3URL,\n v4Request: (path: string, init?: RequestInit) => request(v4URL(path).toString(), init),\n v4URL,\n } satisfies ResourceConfig &\n SonarV2Config &\n SonarV3Config &\n SonarV4Config &\n V2Config &\n V3Config &\n V4Config;\n};\n"]}
|