@dremio/js-sdk 0.24.3 → 0.25.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/Dremio.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare class Dremio {
|
|
|
37
37
|
request: import("../common/Config.ts").RequestFn;
|
|
38
38
|
sonarV2Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
39
39
|
sonarV3Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
40
|
+
sonarV4Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
41
|
+
v2Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
40
42
|
v3Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
41
43
|
v4Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
42
44
|
};
|
|
@@ -10,6 +10,8 @@ export declare const getResourceConfig: (config: Config) => (projectId?: string)
|
|
|
10
10
|
request: import("../common/Config.ts").RequestFn;
|
|
11
11
|
sonarV2Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
12
12
|
sonarV3Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
13
|
+
sonarV4Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
14
|
+
v2Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
13
15
|
v3Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
14
16
|
v4Request: (path: string, init?: RequestInit) => import("ts-results-es").AsyncResult<Response, import("./index.ts").HttpError>;
|
|
15
17
|
};
|
|
@@ -32,6 +32,13 @@ export const getResourceConfig = (config) => (projectId) => {
|
|
|
32
32
|
}
|
|
33
33
|
return request(`/v0/projects/${projectId}/${path}`, init);
|
|
34
34
|
},
|
|
35
|
+
sonarV4Request: (path, init) => {
|
|
36
|
+
if (!projectId) {
|
|
37
|
+
throw new Error("projectId is required");
|
|
38
|
+
}
|
|
39
|
+
return request(`/v1/projects/${projectId}/${path}`, init);
|
|
40
|
+
},
|
|
41
|
+
v2Request: (path, init) => request(new URL(`/ui/${path}`, config.origin.replace("api", "app")).toString(), init),
|
|
35
42
|
v3Request: (path, init) => request(`/v0/${path}`, init),
|
|
36
43
|
v4Request: (path, init) => request(`/v1/${path}`, init),
|
|
37
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getResourceConfig.js","sourceRoot":"","sources":["../../src/cloud/getResourceConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"getResourceConfig.js","sourceRoot":"","sources":["../../src/cloud/getResourceConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAYH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,SAAkB,EAAE,EAAE;IAC1E,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO;QACP,cAAc,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE;YACnD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,OAAO,CACZ,IAAI,GAAG,CACL,gBAAgB,SAAS,IAAI,IAAI,EAAE,EACnC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACpC,CAAC,QAAQ,EAAE,EACZ,IAAI,CACL,CAAC;QACJ,CAAC;QACD,cAAc,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE;YACnD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,OAAO,CAAC,gBAAgB,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,cAAc,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE;YACnD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,OAAO,CAAC,gBAAgB,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,SAAS,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE,CAC9C,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC;QACvF,SAAS,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;QAC7E,SAAS,EAAE,CAAC,IAAY,EAAE,IAAkB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;KAOrE,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\";\n\nexport const getResourceConfig = (config: Config) => (projectId?: string) => {\n const request = createRequest(config);\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(\n new URL(\n `/ui/projects/${projectId}/${path}`,\n config.origin.replace(\"api\", \"app\"),\n ).toString(),\n init,\n );\n },\n sonarV3Request: (path: string, init?: RequestInit) => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return request(`/v0/projects/${projectId}/${path}`, init);\n },\n sonarV4Request: (path: string, init?: RequestInit) => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return request(`/v1/projects/${projectId}/${path}`, init);\n },\n v2Request: (path: string, init?: RequestInit) =>\n request(new URL(`/ui/${path}`, config.origin.replace(\"api\", \"app\")).toString(), init),\n v3Request: (path: string, init?: RequestInit) => request(`/v0/${path}`, init),\n v4Request: (path: string, init?: RequestInit) => request(`/v1/${path}`, init),\n } satisfies ResourceConfig &\n SonarV2Config &\n SonarV3Config &\n SonarV4Config &\n V2Config &\n V3Config &\n V4Config;\n};\n"]}
|
package/dist/common/Config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/common/Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { AsyncResult } from \"ts-results-es\";\nimport type { CredentialProvider } from \"./CredentialProvider.ts\";\nimport type { HttpError } from \"./HttpError.ts\";\n\nexport type RequestFn = (input: string, init?: RequestInit) => AsyncResult<Response, HttpError>;\n\nexport type Config = {\n /**\n * Custom `fetch` provider\n * @default globalThis.fetch\n */\n fetch?: (input: string, init?: RequestInit) => Promise<Response>;\n\n /**\n * Dremio API base origin\n */\n origin: string;\n\n logger?: {\n debug: typeof console.debug;\n error: typeof console.error;\n info: typeof console.info;\n warn: typeof console.warn;\n };\n\n /**\n * Provides credentials to Dremio for all authenticated API requests.\n * Required unless using a custom `fetch` provider with its own credentials provision\n */\n credentials?: CredentialProvider;\n\n /**\n * Configure the maximum number of times to retry requests that failed due to a\n * temporary condition such as 429 or 503. Default is 10. Set to 0 to disable\n * automatic retry.\n */\n maxRetryCount?: number;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type ResourceConfig = {\n logger?: Config[\"logger\"];\n origin: Config[\"origin\"];\n request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV2Config = {\n sonarV2Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV3Config = {\n sonarV3Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV4Config = {\n sonarV4Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type V3Config = {\n v3Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type V4Config = {\n v4Request: RequestFn;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/common/Config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","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 { AsyncResult } from \"ts-results-es\";\nimport type { CredentialProvider } from \"./CredentialProvider.ts\";\nimport type { HttpError } from \"./HttpError.ts\";\n\nexport type RequestFn = (input: string, init?: RequestInit) => AsyncResult<Response, HttpError>;\n\nexport type Config = {\n /**\n * Custom `fetch` provider\n * @default globalThis.fetch\n */\n fetch?: (input: string, init?: RequestInit) => Promise<Response>;\n\n /**\n * Dremio API base origin\n */\n origin: string;\n\n logger?: {\n debug: typeof console.debug;\n error: typeof console.error;\n info: typeof console.info;\n warn: typeof console.warn;\n };\n\n /**\n * Provides credentials to Dremio for all authenticated API requests.\n * Required unless using a custom `fetch` provider with its own credentials provision\n */\n credentials?: CredentialProvider;\n\n /**\n * Configure the maximum number of times to retry requests that failed due to a\n * temporary condition such as 429 or 503. Default is 10. Set to 0 to disable\n * automatic retry.\n */\n maxRetryCount?: number;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type ResourceConfig = {\n logger?: Config[\"logger\"];\n origin: Config[\"origin\"];\n request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV2Config = {\n sonarV2Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV3Config = {\n sonarV3Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type SonarV4Config = {\n sonarV4Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type V2Config = {\n v2Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type V3Config = {\n v3Request: RequestFn;\n};\n\n/**\n * @hidden\n * @internal\n */\nexport type V4Config = {\n v4Request: RequestFn;\n};\n"]}
|