@dremio/js-sdk 0.4.0 → 0.4.1

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.
@@ -1,5 +1,6 @@
1
1
  import { type Result } from "ts-results-es";
2
2
  import type { SonarV3Config } from "../../common/Config.ts";
3
+ import { Temporal } from "temporal-polyfill";
3
4
  export declare class Engine implements EngineInterface {
4
5
  #private;
5
6
  readonly activeReplicas: EngineInterface["activeReplicas"];
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import { Err, Ok } from "ts-results-es";
17
17
  import { engineEntityToProperties, enginePropertiesToEntity } from "./utils.js";
18
+ import { Temporal } from "temporal-polyfill";
18
19
  export class Engine {
19
20
  activeReplicas;
20
21
  additionalEngineStateInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../../src/cloud/engines/Engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEhF,MAAM,OAAO,MAAM;IACR,cAAc,CAAoC;IAClD,yBAAyB,CAA+C;IACxE,aAAa,CAAmC;IAChD,EAAE,CAAwB;IAC1B,cAAc,CAAoC;IAClD,IAAI,CAA0B;IAC9B,KAAK,CAA2B;IAChC,eAAe,CAAqC;IACpD,SAAS,CAA+B;IAEjD,OAAO,CAAgB;IAEvB,YAAY,UAA4B,EAAE,MAAqB;QAC7D,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,UAAwC;QAC7C,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,EAAE,EAAE;YACpC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,GAAG,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC;gBAC/C,GAAG,wBAAwB,CAAC,UAAU,CAAC;aACxC,CAAC;YACF,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,KAAK;SACd,CAAC;aACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACzB,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,wBAAwB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;aACxF,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,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 { Err, Ok, type Result } from \"ts-results-es\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { engineEntityToProperties, enginePropertiesToEntity } from \"./utils.ts\";\n\nexport class Engine implements EngineInterface {\n readonly activeReplicas: EngineInterface[\"activeReplicas\"];\n readonly additionalEngineStateInfo: EngineInterface[\"additionalEngineStateInfo\"];\n readonly configuration: EngineInterface[\"configuration\"];\n readonly id: EngineInterface[\"id\"];\n readonly instanceFamily: EngineInterface[\"instanceFamily\"];\n readonly name: EngineInterface[\"name\"];\n readonly state: EngineInterface[\"state\"];\n readonly statusChangedAt: EngineInterface[\"statusChangedAt\"];\n readonly queriedAt: EngineInterface[\"queriedAt\"];\n\n #config: SonarV3Config;\n\n constructor(properties: EngineProperties, config: SonarV3Config) {\n this.activeReplicas = properties.activeReplicas;\n this.additionalEngineStateInfo = properties.additionalEngineStateInfo;\n this.configuration = properties.configuration;\n this.id = properties.id;\n this.instanceFamily = properties.instanceFamily;\n this.name = properties.name;\n this.state = properties.state;\n this.statusChangedAt = properties.statusChangedAt;\n this.queriedAt = properties.queriedAt;\n this.#config = config;\n }\n\n update(properties: Partial<EngineConfiguration>): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}`, {\n body: JSON.stringify({\n ...enginePropertiesToEntity(this.configuration),\n ...enginePropertiesToEntity(properties),\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n method: \"PUT\",\n })\n .then((res) => res.json())\n .then((properties) => Ok(new Engine(engineEntityToProperties(properties), this.#config)))\n .catch((e) => Err(e));\n }\n}\n\nexport type EngineSize =\n | \"XX_SMALL_V1\"\n | \"X_SMALL_V1\"\n | \"SMALL_V1\"\n | \"MEDIUM_V1\"\n | \"LARGE_V1\"\n | \"X_LARGE_V1\"\n | \"XX_LARGE_V1\"\n | \"XXX_LARGE_V1\";\n\nexport type EngineConfiguration = {\n readonly autoStopDelay: Temporal.Duration;\n readonly cloudTags: { key: string; value: string }[];\n readonly description: string | null;\n readonly drainTimeLimit: Temporal.Duration;\n readonly maxConcurrency: number;\n readonly maxReplicas: number;\n readonly minReplicas: number;\n readonly queueTimeLimit: Temporal.Duration;\n readonly runTimeLimit: Temporal.Duration;\n readonly size: EngineSize;\n};\n\nexport type EngineProperties = {\n readonly activeReplicas: number;\n readonly additionalEngineStateInfo: \"NONE\";\n readonly configuration: EngineConfiguration;\n readonly id: string;\n readonly instanceFamily: unknown;\n readonly name: string;\n readonly state: \"DELETING\" | \"DISABLED\" | \"DISABLING\" | \"ENABLED\" | \"ENABLING\" | \"INVALID\";\n readonly statusChangedAt: Date;\n readonly queriedAt: Date | null;\n};\n\nexport type EngineMethods = {\n update(properties: Partial<EngineConfiguration>): Promise<Result<Engine, unknown>>;\n};\n\nexport type EngineInterface = EngineProperties & EngineMethods;\n"]}
1
+ {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../../src/cloud/engines/Engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,eAAe,CAAC;AAErD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,MAAM;IACR,cAAc,CAAoC;IAClD,yBAAyB,CAA+C;IACxE,aAAa,CAAmC;IAChD,EAAE,CAAwB;IAC1B,cAAc,CAAoC;IAClD,IAAI,CAA0B;IAC9B,KAAK,CAA2B;IAChC,eAAe,CAAqC;IACpD,SAAS,CAA+B;IAEjD,OAAO,CAAgB;IAEvB,YAAY,UAA4B,EAAE,MAAqB;QAC7D,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC;QAC9C,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,UAAwC;QAC7C,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,EAAE,EAAE;YACpC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,GAAG,wBAAwB,CAAC,IAAI,CAAC,aAAa,CAAC;gBAC/C,GAAG,wBAAwB,CAAC,UAAU,CAAC;aACxC,CAAC;YACF,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,KAAK;SACd,CAAC;aACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACzB,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,wBAAwB,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;aACxF,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,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 { Err, Ok, type Result } from \"ts-results-es\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { engineEntityToProperties, enginePropertiesToEntity } from \"./utils.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\nexport class Engine implements EngineInterface {\n readonly activeReplicas: EngineInterface[\"activeReplicas\"];\n readonly additionalEngineStateInfo: EngineInterface[\"additionalEngineStateInfo\"];\n readonly configuration: EngineInterface[\"configuration\"];\n readonly id: EngineInterface[\"id\"];\n readonly instanceFamily: EngineInterface[\"instanceFamily\"];\n readonly name: EngineInterface[\"name\"];\n readonly state: EngineInterface[\"state\"];\n readonly statusChangedAt: EngineInterface[\"statusChangedAt\"];\n readonly queriedAt: EngineInterface[\"queriedAt\"];\n\n #config: SonarV3Config;\n\n constructor(properties: EngineProperties, config: SonarV3Config) {\n this.activeReplicas = properties.activeReplicas;\n this.additionalEngineStateInfo = properties.additionalEngineStateInfo;\n this.configuration = properties.configuration;\n this.id = properties.id;\n this.instanceFamily = properties.instanceFamily;\n this.name = properties.name;\n this.state = properties.state;\n this.statusChangedAt = properties.statusChangedAt;\n this.queriedAt = properties.queriedAt;\n this.#config = config;\n }\n\n update(properties: Partial<EngineConfiguration>): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}`, {\n body: JSON.stringify({\n ...enginePropertiesToEntity(this.configuration),\n ...enginePropertiesToEntity(properties),\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n method: \"PUT\",\n })\n .then((res) => res.json())\n .then((properties) => Ok(new Engine(engineEntityToProperties(properties), this.#config)))\n .catch((e) => Err(e));\n }\n}\n\nexport type EngineSize =\n | \"XX_SMALL_V1\"\n | \"X_SMALL_V1\"\n | \"SMALL_V1\"\n | \"MEDIUM_V1\"\n | \"LARGE_V1\"\n | \"X_LARGE_V1\"\n | \"XX_LARGE_V1\"\n | \"XXX_LARGE_V1\";\n\nexport type EngineConfiguration = {\n readonly autoStopDelay: Temporal.Duration;\n readonly cloudTags: { key: string; value: string }[];\n readonly description: string | null;\n readonly drainTimeLimit: Temporal.Duration;\n readonly maxConcurrency: number;\n readonly maxReplicas: number;\n readonly minReplicas: number;\n readonly queueTimeLimit: Temporal.Duration;\n readonly runTimeLimit: Temporal.Duration;\n readonly size: EngineSize;\n};\n\nexport type EngineProperties = {\n readonly activeReplicas: number;\n readonly additionalEngineStateInfo: \"NONE\";\n readonly configuration: EngineConfiguration;\n readonly id: string;\n readonly instanceFamily: unknown;\n readonly name: string;\n readonly state: \"DELETING\" | \"DISABLED\" | \"DISABLING\" | \"ENABLED\" | \"ENABLING\" | \"INVALID\";\n readonly statusChangedAt: Date;\n readonly queriedAt: Date | null;\n};\n\nexport type EngineMethods = {\n update(properties: Partial<EngineConfiguration>): Promise<Result<Engine, unknown>>;\n};\n\nexport type EngineInterface = EngineProperties & EngineMethods;\n"]}
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import parseMilliseconds from "parse-ms";
17
+ import { Temporal } from "temporal-polyfill";
17
18
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
19
  export const engineEntityToProperties = (properties) => {
19
20
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/cloud/engines/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAGzC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAe,EAAoB,EAAE;IAC5E,OAAO;QACL,cAAc,EAAE,UAAU,CAAC,cAAc;QACzC,yBAAyB,EAAE,UAAU,CAAC,yBAAyB;QAC/D,aAAa,EAAE;YACb,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,IA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EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GACzF,aAAa,CAAC;IAChB,OAAO;QACL,GAAG,IAAI;QACP,oBAAoB,EAAE,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC;QACrD,WAAW,EAAE,WAAW,IAAI,EAAE;QAC9B,qBAAqB,EAAE,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;QACvD,qBAAqB,EAAE,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;QACvD,mBAAmB,EAAE,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;KACpD,CAAC;AACJ,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 parseMilliseconds from \"parse-ms\";\nimport type { EngineConfiguration, EngineProperties } from \"./Engine.ts\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const engineEntityToProperties = (properties: any): EngineProperties => {\n return {\n activeReplicas: properties.activeReplicas,\n additionalEngineStateInfo: properties.additionalEngineStateInfo,\n configuration: {\n autoStopDelay: Temporal.Duration.from(\n parseMilliseconds(properties.autoStopDelaySeconds * 1000),\n ),\n cloudTags: properties.cloudTags,\n description: properties.description,\n drainTimeLimit: Temporal.Duration.from(\n parseMilliseconds(properties.drainTimeLimitSeconds * 1000),\n ),\n maxConcurrency: properties.maxConcurrency,\n maxReplicas: properties.maxReplicas,\n minReplicas: properties.minReplicas,\n queueTimeLimit: Temporal.Duration.from(\n parseMilliseconds(properties.queueTimeLimitSeconds * 1000),\n ),\n runTimeLimit: Temporal.Duration.from(\n parseMilliseconds(properties.runtimeLimitSeconds * 1000),\n ),\n size: properties.size,\n },\n id: properties.id,\n instanceFamily: properties.instanceFamily,\n name: properties.name,\n queriedAt: (() => {\n const d = new Date(properties.queriedAt);\n if (d.getTime() === 0) {\n return null;\n }\n return d;\n })(),\n state: properties.state,\n statusChangedAt: new Date(properties.statusChangedAt),\n };\n};\n\nexport const enginePropertiesToEntity = (configuration: Partial<EngineConfiguration>) => {\n const { autoStopDelay, description, drainTimeLimit, queueTimeLimit, runTimeLimit, ...rest } =\n configuration;\n return {\n ...rest,\n autoStopDelaySeconds: autoStopDelay?.total(\"seconds\"),\n description: description || \"\",\n drainTimeLimitSeconds: drainTimeLimit?.total(\"seconds\"),\n queueTimeLimitSeconds: queueTimeLimit?.total(\"seconds\"),\n runtimeLimitSeconds: runTimeLimit?.total(\"seconds\"),\n };\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/cloud/engines/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAe,EAAoB,EAAE;IAC5E,OAAO;QACL,cAAc,EAAE,UAAU,CAAC,cAAc;QACzC,yBAAyB,EAAE,UAAU,CAAC,yBAAyB;QAC/D,aAAa,EAAE;YACb,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CACnC,iBAAiB,CAAC,UAAU,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAC1D;YACD,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,WAAW,EAAE,UAAU,CAAC,WAAW;YACnC,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,IAAI,CACpC,iBAAiB,CAAC,UAAU,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAC3D;YACD,cAAc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c,EAAE,KAAK,CAAC,SAAS,CAAC;QACvD,mBAAmB,EAAE,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC;KACpD,CAAC;AACJ,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 parseMilliseconds from \"parse-ms\";\nimport type { EngineConfiguration, EngineProperties } from \"./Engine.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const engineEntityToProperties = (properties: any): EngineProperties => {\n return {\n activeReplicas: properties.activeReplicas,\n additionalEngineStateInfo: properties.additionalEngineStateInfo,\n configuration: {\n autoStopDelay: Temporal.Duration.from(\n parseMilliseconds(properties.autoStopDelaySeconds * 1000),\n ),\n cloudTags: properties.cloudTags,\n description: properties.description,\n drainTimeLimit: Temporal.Duration.from(\n parseMilliseconds(properties.drainTimeLimitSeconds * 1000),\n ),\n maxConcurrency: properties.maxConcurrency,\n maxReplicas: properties.maxReplicas,\n minReplicas: properties.minReplicas,\n queueTimeLimit: Temporal.Duration.from(\n parseMilliseconds(properties.queueTimeLimitSeconds * 1000),\n ),\n runTimeLimit: Temporal.Duration.from(\n parseMilliseconds(properties.runtimeLimitSeconds * 1000),\n ),\n size: properties.size,\n },\n id: properties.id,\n instanceFamily: properties.instanceFamily,\n name: properties.name,\n queriedAt: (() => {\n const d = new Date(properties.queriedAt);\n if (d.getTime() === 0) {\n return null;\n }\n return d;\n })(),\n state: properties.state,\n statusChangedAt: new Date(properties.statusChangedAt),\n };\n};\n\nexport const enginePropertiesToEntity = (configuration: Partial<EngineConfiguration>) => {\n const { autoStopDelay, description, drainTimeLimit, queueTimeLimit, runTimeLimit, ...rest } =\n configuration;\n return {\n ...rest,\n autoStopDelaySeconds: autoStopDelay?.total(\"seconds\"),\n description: description || \"\",\n drainTimeLimitSeconds: drainTimeLimit?.total(\"seconds\"),\n queueTimeLimitSeconds: queueTimeLimit?.total(\"seconds\"),\n runtimeLimitSeconds: runTimeLimit?.total(\"seconds\"),\n };\n};\n"]}
@@ -1,4 +1,3 @@
1
- import "temporal-polyfill/global";
2
1
  import type { Config } from "../common/Config.ts";
3
2
  import { Resources } from "./resources.ts";
4
3
  export declare const Dremio: (config: Config) => {
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import "temporal-polyfill/global";
17
16
  import { createRequest } from "../common/createRequest.js";
18
17
  import { Resources } from "./resources.js";
19
18
  const getSonarResourceConfig = (config) => (projectId) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloud/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,SAAkB,EAAE,EAAE;IACxE,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,EAAqB,EAAE;YACtE,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,EAAqB,EAAE,CACjE,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;KACqB,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,GAAG,SAAS,CAAC,mBAAmB,CAAC;QACjC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC;QAC/B,oBAAoB,EAAE,mBAAmB;QACzC,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,cAAc;KACtF,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,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 \"temporal-polyfill/global\";\nimport { createRequest } from \"../common/createRequest.ts\";\nimport type { Config, ResourceConfig, SonarV3Config, V3Config } from \"../common/Config.ts\";\nimport { Resources } from \"./resources.ts\";\n\nconst getSonarResourceConfig = (config: Config) => (projectId?: string) => {\n const request = createRequest(config);\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV3Request: (path: string, init?: RequestInit): Promise<Response> => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return request(`/v0/projects/${projectId}/${path}`, init);\n },\n v3Request: (path: string, init?: RequestInit): Promise<Response> =>\n request(`/v0/${path}`, init),\n } satisfies ResourceConfig & SonarV3Config & V3Config;\n};\n\nexport const Dremio = (config: Config) => {\n const sonarResourceConfig = getSonarResourceConfig(config);\n return {\n ...Resources(sonarResourceConfig),\n _request: createRequest(config),\n _sonarResourceConfig: sonarResourceConfig,\n _sonarV3Request: (projectId: string) => sonarResourceConfig(projectId).sonarV3Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\nexport * from \"./oauth/oauth.ts\";\n\nexport { Resources as _Resources };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloud/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,CAAC,SAAkB,EAAE,EAAE;IACxE,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,EAAqB,EAAE;YACtE,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,EAAqB,EAAE,CACjE,OAAO,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;KACqB,CAAC;AACxD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,GAAG,SAAS,CAAC,mBAAmB,CAAC;QACjC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC;QAC/B,oBAAoB,EAAE,mBAAmB;QACzC,eAAe,EAAE,CAAC,SAAiB,EAAE,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,cAAc;KACtF,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,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 { createRequest } from \"../common/createRequest.ts\";\nimport type { Config, ResourceConfig, SonarV3Config, V3Config } from \"../common/Config.ts\";\nimport { Resources } from \"./resources.ts\";\n\nconst getSonarResourceConfig = (config: Config) => (projectId?: string) => {\n const request = createRequest(config);\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV3Request: (path: string, init?: RequestInit): Promise<Response> => {\n if (!projectId) {\n throw new Error(\"projectId is required\");\n }\n return request(`/v0/projects/${projectId}/${path}`, init);\n },\n v3Request: (path: string, init?: RequestInit): Promise<Response> =>\n request(`/v0/${path}`, init),\n } satisfies ResourceConfig & SonarV3Config & V3Config;\n};\n\nexport const Dremio = (config: Config) => {\n const sonarResourceConfig = getSonarResourceConfig(config);\n return {\n ...Resources(sonarResourceConfig),\n _request: createRequest(config),\n _sonarResourceConfig: sonarResourceConfig,\n _sonarV3Request: (projectId: string) => sonarResourceConfig(projectId).sonarV3Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\nexport * from \"./oauth/oauth.ts\";\n\nexport { Resources as _Resources };\n"]}
@@ -17,10 +17,10 @@ export declare const enterpriseSourceEntityToProperties: (entity: any, config: S
17
17
  } | undefined;
18
18
  acceleration: {
19
19
  readonly activePolicyType: any;
20
- readonly gracePeriod: Temporal.Duration;
20
+ readonly gracePeriod: import("temporal-polyfill").Temporal.Duration;
21
21
  readonly neverExpire: any;
22
22
  readonly neverRefresh: any;
23
- readonly refreshPeriod: Temporal.Duration;
23
+ readonly refreshPeriod: import("temporal-polyfill").Temporal.Duration;
24
24
  readonly refreshSchedule: any;
25
25
  };
26
26
  allowCrossSourceSelection: any;
@@ -29,13 +29,13 @@ export declare const enterpriseSourceEntityToProperties: (entity: any, config: S
29
29
  disableMetadataValidityCheck: any;
30
30
  id: any;
31
31
  metadataPolicy: {
32
- readonly authTTL: Temporal.Duration;
32
+ readonly authTTL: import("temporal-polyfill").Temporal.Duration;
33
33
  readonly autoPromoteDatasets: any;
34
- readonly datasetExpireAfter: Temporal.Duration;
35
- readonly datasetRefreshAfter: Temporal.Duration;
34
+ readonly datasetExpireAfter: import("temporal-polyfill").Temporal.Duration;
35
+ readonly datasetRefreshAfter: import("temporal-polyfill").Temporal.Duration;
36
36
  readonly datasetUpdateMode: any;
37
37
  readonly deleteUnavailableDatasets: any;
38
- readonly namesRefresh: Temporal.Duration;
38
+ readonly namesRefresh: import("temporal-polyfill").Temporal.Duration;
39
39
  };
40
40
  name: any;
41
41
  sourceChangeState: any;
@@ -1,5 +1,6 @@
1
1
  import type { SonarV3Config } from "../../common/Config.ts";
2
2
  import { type Result } from "ts-results-es";
3
+ import { Temporal } from "temporal-polyfill";
3
4
  export declare class Engine {
4
5
  #private;
5
6
  readonly id: EngineEntity["id"];
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import parseMilliseconds from "parse-ms";
17
17
  import { Err, Ok } from "ts-results-es";
18
+ import { Temporal } from "temporal-polyfill";
18
19
  export class Engine {
19
20
  id;
20
21
  name;
@@ -1 +1 @@
1
- {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../../src/enterprise/engines/Engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,eAAe,CAAC;AAErD,MAAM,OAAO,MAAM;IACD,EAAE,CAAqB;IACvB,IAAI,CAAuB;IAC3B,IAAI,CAmBlB;IACc,MAAM,CAEpB;IAEO,OAAO,CAAgB;IAEhC,2DAA2D;IAClD,IAAI,CAAS;IAEtB,YAAY,MAAoB,EAAE,MAAqB;QACrD,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG;YACV,GAAG,MAAM,CAAC,IAAI;YACd,mBAAmB,EAAE;gBACnB,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB;gBAClC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW;oBACtD,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,WAAW,CAAC;oBACrE,CAAC,CAAC,SAAS;gBACb,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,mBAA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OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,OAAO,EAAE;YACzC,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;YACvC,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC;aACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAA2B,CAAC;aAClD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;aACtD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,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 parseMilliseconds from \"parse-ms\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { Err, Ok, type Result } from \"ts-results-es\";\n\nexport class Engine {\n public readonly id: EngineEntity[\"id\"];\n public readonly name: EngineEntity[\"name\"];\n public readonly spec: {\n c3StorageSize: EngineEntity[\"spec\"][\"c3StorageSize\"];\n executorPodMetadata: {\n annotations: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"annotations\"];\n labels: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"labels\"];\n nodeSelectors: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"nodeSelectors\"];\n tolerations: {\n key: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"key\"];\n operator: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"operator\"];\n effect: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"effect\"];\n tolerationDuration: Temporal.Duration;\n value?: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"value\"];\n }[];\n idleTimeout?: Temporal.Duration;\n resourceAllocationOffset: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"resourceAllocationOffset\"];\n size: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"size\"];\n spillStorageSize: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"spillStorageSize\"];\n targetCpuCapacity: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"targetCpuCapacity\"];\n };\n };\n public readonly status: Omit<EngineEntity[\"status\"], \"message\"> & {\n message: string | null;\n };\n\n readonly #config: SonarV3Config;\n\n // eslint-disable-next-line no-unused-private-class-members\n readonly #tag: string;\n\n constructor(entity: EngineEntity, config: SonarV3Config) {\n this.id = entity.id;\n this.name = entity.name;\n this.spec = {\n ...entity.spec,\n executorPodMetadata: {\n ...entity.spec.executorPodMetadata,\n idleTimeout: entity.spec.executorPodMetadata.idleTimeout\n ? Temporal.Duration.from(entity.spec.executorPodMetadata.idleTimeout)\n : undefined,\n tolerations: entity.spec.executorPodMetadata.tolerations.map(\n ({ tolerationSeconds, ...toleration }) => ({\n ...toleration,\n tolerationDuration: Temporal.Duration.from(parseMilliseconds(tolerationSeconds * 1000)),\n }),\n ),\n },\n };\n this.status = {\n ...entity.status,\n message: entity.status.message?.length ? entity.status.message : null,\n };\n this.#tag = entity.version;\n this.#config = config;\n }\n\n get settled() {\n return this.status.state !== \"STARTING\" && this.status.state !== \"STOPPING\";\n }\n\n start(): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}/start`, {\n headers: { Accept: \"application/json\" },\n keepalive: true,\n method: \"PUT\",\n })\n .then((res) => res.json() as Promise<EngineEntity>)\n .then((entity) => Ok(new Engine(entity, this.#config)))\n .catch((e: unknown) => Err(e));\n }\n\n stop(): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}/stop`, {\n headers: { Accept: \"application/json\" },\n keepalive: true,\n method: \"PUT\",\n })\n .then((res) => res.json() as Promise<EngineEntity>)\n .then((entity) => Ok(new Engine(entity, this.#config)))\n .catch((e: unknown) => Err(e));\n }\n}\n\nexport type EngineEntity = {\n id: string;\n name: string;\n spec: {\n c3StorageSize: string;\n executorPodMetadata: {\n labels: Record<string, string>;\n annotations: Record<string, string>;\n nodeSelectors: Record<string, string>;\n tolerations: {\n key: string;\n operator: \"Exists\" | \"Equal\";\n effect: \"NoSchedule\" | \"PreferNoSchedule\" | \"NoExecute\";\n tolerationSeconds: number;\n value?: number;\n }[];\n idleTimeout?: string;\n resourceAllocationOffset: string;\n size: \"2XSmall\" | \"XSmall\" | \"Small\" | \"Medium\" | \"Large\" | \"XLarge\" | \"2XLarge\";\n spillStorageSize: string;\n targetCpuCapacity: string;\n };\n };\n status: {\n message: string;\n replicas: {\n id: string;\n executors: {\n cpu: number;\n memory: number;\n name: string;\n status: string;\n }[];\n }[];\n runningExecutors: number;\n runningReplicas: number;\n startingExecutors: number;\n startingReplicas: number;\n state: \"STARTING\" | \"RUNNING\" | \"STOPPING\" | \"STOPPED\" | \"WARNING\" | \"FAILED\";\n stoppingExecutors: number;\n stoppingReplicas: number;\n };\n version: string;\n};\n"]}
1
+ {"version":3,"file":"Engine.js","sourceRoot":"","sources":["../../../src/enterprise/engines/Engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,MAAM;IACD,EAAE,CAAqB;IACvB,IAA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CAAC,KAAK,KAAK,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,UAAU,CAAC;IAC9E,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,QAAQ,EAAE;YAC1C,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;YACvC,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC;aACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAA2B,CAAC;aAClD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;aACtD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,IAAI;QACF,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,OAAO,EAAE;YACzC,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;YACvC,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd,CAAC;aACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAA2B,CAAC;aAClD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;aACtD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,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 parseMilliseconds from \"parse-ms\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { Err, Ok, type Result } from \"ts-results-es\";\nimport { Temporal } from \"temporal-polyfill\";\n\nexport class Engine {\n public readonly id: EngineEntity[\"id\"];\n public readonly name: EngineEntity[\"name\"];\n public readonly spec: {\n c3StorageSize: EngineEntity[\"spec\"][\"c3StorageSize\"];\n executorPodMetadata: {\n annotations: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"annotations\"];\n labels: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"labels\"];\n nodeSelectors: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"nodeSelectors\"];\n tolerations: {\n key: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"key\"];\n operator: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"operator\"];\n effect: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"effect\"];\n tolerationDuration: Temporal.Duration;\n value?: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"tolerations\"][number][\"value\"];\n }[];\n idleTimeout?: Temporal.Duration;\n resourceAllocationOffset: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"resourceAllocationOffset\"];\n size: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"size\"];\n spillStorageSize: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"spillStorageSize\"];\n targetCpuCapacity: EngineEntity[\"spec\"][\"executorPodMetadata\"][\"targetCpuCapacity\"];\n };\n };\n public readonly status: Omit<EngineEntity[\"status\"], \"message\"> & {\n message: string | null;\n };\n\n readonly #config: SonarV3Config;\n\n // eslint-disable-next-line no-unused-private-class-members\n readonly #tag: string;\n\n constructor(entity: EngineEntity, config: SonarV3Config) {\n this.id = entity.id;\n this.name = entity.name;\n this.spec = {\n ...entity.spec,\n executorPodMetadata: {\n ...entity.spec.executorPodMetadata,\n idleTimeout: entity.spec.executorPodMetadata.idleTimeout\n ? Temporal.Duration.from(entity.spec.executorPodMetadata.idleTimeout)\n : undefined,\n tolerations: entity.spec.executorPodMetadata.tolerations.map(\n ({ tolerationSeconds, ...toleration }) => ({\n ...toleration,\n tolerationDuration: Temporal.Duration.from(parseMilliseconds(tolerationSeconds * 1000)),\n }),\n ),\n },\n };\n this.status = {\n ...entity.status,\n message: entity.status.message?.length ? entity.status.message : null,\n };\n this.#tag = entity.version;\n this.#config = config;\n }\n\n get settled() {\n return this.status.state !== \"STARTING\" && this.status.state !== \"STOPPING\";\n }\n\n start(): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}/start`, {\n headers: { Accept: \"application/json\" },\n keepalive: true,\n method: \"PUT\",\n })\n .then((res) => res.json() as Promise<EngineEntity>)\n .then((entity) => Ok(new Engine(entity, this.#config)))\n .catch((e: unknown) => Err(e));\n }\n\n stop(): Promise<Result<Engine, unknown>> {\n return this.#config\n .sonarV3Request(`engines/${this.id}/stop`, {\n headers: { Accept: \"application/json\" },\n keepalive: true,\n method: \"PUT\",\n })\n .then((res) => res.json() as Promise<EngineEntity>)\n .then((entity) => Ok(new Engine(entity, this.#config)))\n .catch((e: unknown) => Err(e));\n }\n}\n\nexport type EngineEntity = {\n id: string;\n name: string;\n spec: {\n c3StorageSize: string;\n executorPodMetadata: {\n labels: Record<string, string>;\n annotations: Record<string, string>;\n nodeSelectors: Record<string, string>;\n tolerations: {\n key: string;\n operator: \"Exists\" | \"Equal\";\n effect: \"NoSchedule\" | \"PreferNoSchedule\" | \"NoExecute\";\n tolerationSeconds: number;\n value?: number;\n }[];\n idleTimeout?: string;\n resourceAllocationOffset: string;\n size: \"2XSmall\" | \"XSmall\" | \"Small\" | \"Medium\" | \"Large\" | \"XLarge\" | \"2XLarge\";\n spillStorageSize: string;\n targetCpuCapacity: string;\n };\n };\n status: {\n message: string;\n replicas: {\n id: string;\n executors: {\n cpu: number;\n memory: number;\n name: string;\n status: string;\n }[];\n }[];\n runningExecutors: number;\n runningReplicas: number;\n startingExecutors: number;\n startingReplicas: number;\n state: \"STARTING\" | \"RUNNING\" | \"STOPPING\" | \"STOPPED\" | \"WARNING\" | \"FAILED\";\n stoppingExecutors: number;\n stoppingReplicas: number;\n };\n version: string;\n};\n"]}
@@ -1,4 +1,3 @@
1
- import "temporal-polyfill/global";
2
1
  import type { Config } from "../common/Config.ts";
3
2
  import { Resources } from "./resources.ts";
4
3
  export declare const Dremio: (config: Config) => {
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import "temporal-polyfill/global";
17
16
  import { createRequest } from "../common/createRequest.js";
18
17
  import { Resources } from "./resources.js";
19
18
  const getSonarResourceConfig = (config) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enterprise/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,EAAE;IAChD,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,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,CAAC;QAC/D,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC;QAChE,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC;KACQ,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,GAAG,SAAS,CAAC,mBAAmB,CAAC;QACjC,QAAQ,EAAE,mBAAmB,CAAC,OAAO;QACrC,oBAAoB,EAAE,mBAAmB;QACzC,eAAe,EAAE,mBAAmB,CAAC,cAAc;QACnD,eAAe,EAAE,mBAAmB,CAAC,cAAc;KACpD,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,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 \"temporal-polyfill/global\";\nimport { createRequest } from \"../common/createRequest.ts\";\nimport type {\n Config,\n ResourceConfig,\n SonarV2Config,\n SonarV3Config,\n V3Config,\n} from \"../common/Config.ts\";\nimport { Resources } from \"./resources.ts\";\n\nconst getSonarResourceConfig = (config: Config) => {\n const request = createRequest(config);\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV2Request: (path, init) => request(`/apiv2/${path}`, init),\n sonarV3Request: (path, init) => request(`/api/v3/${path}`, init),\n v3Request: (path, init) => request(`/api/v3/${path}`, init),\n } satisfies ResourceConfig & SonarV2Config & SonarV3Config & V3Config;\n};\n\nexport const Dremio = (config: Config) => {\n const sonarResourceConfig = getSonarResourceConfig(config);\n return {\n ...Resources(sonarResourceConfig),\n _request: sonarResourceConfig.request,\n _sonarResourceConfig: sonarResourceConfig,\n _sonarV2Request: sonarResourceConfig.sonarV2Request,\n _sonarV3Request: sonarResourceConfig.sonarV3Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\nexport { Resources as _Resources };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enterprise/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAQ3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,EAAE;IAChD,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,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,CAAC;QAC/D,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC;QAChE,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC;KACQ,CAAC;AACxE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,GAAG,SAAS,CAAC,mBAAmB,CAAC;QACjC,QAAQ,EAAE,mBAAmB,CAAC,OAAO;QACrC,oBAAoB,EAAE,mBAAmB;QACzC,eAAe,EAAE,mBAAmB,CAAC,cAAc;QACnD,eAAe,EAAE,mBAAmB,CAAC,cAAc;KACpD,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,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 { createRequest } from \"../common/createRequest.ts\";\nimport type {\n Config,\n ResourceConfig,\n SonarV2Config,\n SonarV3Config,\n V3Config,\n} from \"../common/Config.ts\";\nimport { Resources } from \"./resources.ts\";\n\nconst getSonarResourceConfig = (config: Config) => {\n const request = createRequest(config);\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV2Request: (path, init) => request(`/apiv2/${path}`, init),\n sonarV3Request: (path, init) => request(`/api/v3/${path}`, init),\n v3Request: (path, init) => request(`/api/v3/${path}`, init),\n } satisfies ResourceConfig & SonarV2Config & SonarV3Config & V3Config;\n};\n\nexport const Dremio = (config: Config) => {\n const sonarResourceConfig = getSonarResourceConfig(config);\n return {\n ...Resources(sonarResourceConfig),\n _request: sonarResourceConfig.request,\n _sonarResourceConfig: sonarResourceConfig,\n _sonarV2Request: sonarResourceConfig.sonarV2Request,\n _sonarV3Request: sonarResourceConfig.sonarV3Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\nexport { Resources as _Resources };\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { EnterpriseDatasetCatalogReference } from "../catalog/CatalogReferences/index.ts";
2
+ import { Temporal } from "temporal-polyfill";
2
3
  export declare class ReflectionSummary {
3
4
  createdAt: ReflectionProperties["createdAt"];
4
5
  dataset: ReflectionProperties["dataset"];
@@ -14,6 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import parseMilliseconds from "parse-ms";
17
+ import { Temporal } from "temporal-polyfill";
17
18
  export class ReflectionSummary {
18
19
  createdAt;
19
20
  dataset;
@@ -1 +1 @@
1
- {"version":3,"file":"ReflectionSummary.js","sourceRoot":"","sources":["../../../src/enterprise/reflections/ReflectionSummary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAGzC,MAAM,OAAO,iBAAiB;IAC5B,SAAS,CAAoC;IAC7C,OAAO,CAAkC;IACzC,EAAE,CAA6B;IAC/B,UAAU,CAAqC;IAC/C,SAAS,CAAoC;IAC7C,OAAO,CAAkC;IACzC,IAAI,CAA+B;IACnC,MAAM,CAAiC;IACvC,IAAI,CAA+B;IACnC,SAAS,CAAoC;IAC7C,YAAY,UAAgC;QAC1C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;QAClC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,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Ae,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;QAC/F,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB,IAAI,IAAI;QAC5D,mBAAmB,EACjB,OAAO,MAAM,CAAC,MAAM,CAAC,yBAAyB,KAAK,QAAQ;YACzD,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;YACpF,CAAC,CAAC,IAAI;QACV,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;QAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;KAC3C;IACD,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,SAAS,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;CACtC,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 parseMilliseconds from \"parse-ms\";\nimport type { EnterpriseDatasetCatalogReference } from \"../catalog/CatalogReferences/index.ts\";\n\nexport class ReflectionSummary {\n createdAt: ReflectionProperties[\"createdAt\"];\n dataset: ReflectionProperties[\"dataset\"];\n id: ReflectionProperties[\"id\"];\n isCanAlter: ReflectionProperties[\"isCanAlter\"];\n isCanView: ReflectionProperties[\"isCanView\"];\n metrics: ReflectionProperties[\"metrics\"];\n name: ReflectionProperties[\"name\"];\n status: ReflectionProperties[\"status\"];\n type: ReflectionProperties[\"type\"];\n updatedAt: ReflectionProperties[\"updatedAt\"];\n constructor(properties: ReflectionProperties) {\n this.createdAt = properties.createdAt;\n this.dataset = properties.dataset;\n this.id = properties.id;\n this.isCanAlter = properties.isCanAlter;\n this.isCanView = properties.isCanView;\n this.metrics = properties.metrics;\n this.name = properties.name;\n this.status = properties.status;\n this.type = properties.type;\n this.updatedAt = properties.updatedAt;\n }\n}\n\nexport const reflectionSummaryEntityToProperties = (entity: {\n createdAt: string;\n id: string;\n isCanAlter: boolean;\n isCanView: boolean;\n chosenCount: number;\n consideredCount: number;\n currentSizeBytes: number;\n matchedCount: number;\n status: {\n availabilityStatus: \"AVAILABLE\" | \"EXPIRED\" | \"INCOMPLETE\" | \"NONE\";\n combinedStatus:\n | \"CAN_ACCELERATE\"\n | \"CAN_ACCELERATE_WITH_FAILURES\"\n | \"CANNOT_ACCELERATE_INITIALIZING\"\n | \"CANNOT_ACCELERATE_MANUAL\"\n | \"CANNOT_ACCELERATE_SCHEDULED\"\n | \"DISABLED\"\n | \"EXPIRED\"\n | \"FAILED\"\n | \"INVALID\"\n | \"INCOMPLETE\"\n | \"REFRESHING\";\n configStatus: \"OK\" | \"INVALID\";\n expiresAt: string;\n failureCount: number;\n lastDataFetchAt: string;\n lastFailureMessage: string;\n lastRefreshDurationMillis: number;\n refreshMethod: \"INCREMENTAL\" | \"FULL\" | \"NONE\";\n refreshStatus: \"GIVEN_UP\" | \"MANUAL\" | \"RUNNING\" | \"SCHEDULED\";\n };\n isEnabled: boolean;\n outputRecords: number;\n totalSizeBytes: number;\n name: string;\n reflectionType: \"RAW\" | \"AGGREGATION\";\n updatedAt: string;\n}) => ({\n createdAt: new Date(entity.createdAt),\n dataset: {} as EnterpriseDatasetCatalogReference,\n // dataset: new DatasetCatalogReference(\n // {\n // id: entity.datasetId,\n // path: entity.datasetPath,\n // type: entity.datasetType,\n // },\n // null as any,\n // ),\n id: entity.id,\n isCanAlter: entity.isCanAlter,\n isCanView: entity.isCanView,\n metrics: {\n chosenCount: entity.chosenCount,\n consideredCount: entity.consideredCount,\n currentSizeBytes: entity.currentSizeBytes,\n failureCount: entity.status.failureCount,\n matchedCount: entity.matchedCount,\n outputRecords: entity.outputRecords,\n totalSizeBytes: entity.totalSizeBytes,\n },\n name: entity.name,\n status: {\n availabilityStatus: entity.status.availabilityStatus,\n combinedStatus: entity.status.combinedStatus,\n configStatus: entity.status.configStatus,\n expiresAt: new Date(entity.status.expiresAt),\n isEnabled: entity.isEnabled,\n lastDataFetchAt: entity.status.lastDataFetchAt ? new Date(entity.status.lastDataFetchAt) : null,\n lastFailureMessage: entity.status.lastFailureMessage || null,\n lastRefreshDuration:\n typeof entity.status.lastRefreshDurationMillis === \"number\"\n ? Temporal.Duration.from(parseMilliseconds(entity.status.lastRefreshDurationMillis))\n : null,\n refreshMethod: entity.status.refreshMethod,\n refreshStatus: entity.status.refreshStatus,\n },\n type: entity.reflectionType,\n updatedAt: new Date(entity.updatedAt),\n});\n\ntype ReflectionProperties = ReturnType<typeof reflectionSummaryEntityToProperties>;\n"]}
1
+ {"version":3,"file":"ReflectionSummary.js","sourceRoot":"","sources":["../../../src/enterprise/reflections/ReflectionSummary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,iBAAiB;IAC5B,SAAS,CAAoC;IAC7C,OAAO,CAAkC;IACzC,EAAE,CAA6B;IAC/B,UAAU,CAAqC;IAC/C,SAAS,CAAoC;IAC7C,OAAO,CAAkC;IACzC,IAAI,CAA+B;IACnC,MAAM,CAAiC;IACvC,IAAI,CAA+B;IACnC,SAAS,CAAoC;IAC7C,YAAY,UAAgC;QAC1C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,OAAO,GAAG,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AM,CAAC,kBAAkB;QACpD,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc;QAC5C,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY;QACxC,SAAS,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QAC5C,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,eAAe,EAAE,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI;QAC/F,kBAAkB,EAAE,MAAM,CAAC,MAAM,CAAC,kBAAkB,IAAI,IAAI;QAC5D,mBAAmB,EACjB,OAAO,MAAM,CAAC,MAAM,CAAC,yBAAyB,KAAK,QAAQ;YACzD,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;YACpF,CAAC,CAAC,IAAI;QACV,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;QAC1C,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa;KAC3C;IACD,IAAI,EAAE,MAAM,CAAC,cAAc;IAC3B,SAAS,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC;CACtC,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 parseMilliseconds from \"parse-ms\";\nimport type { EnterpriseDatasetCatalogReference } from \"../catalog/CatalogReferences/index.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\nexport class ReflectionSummary {\n createdAt: ReflectionProperties[\"createdAt\"];\n dataset: ReflectionProperties[\"dataset\"];\n id: ReflectionProperties[\"id\"];\n isCanAlter: ReflectionProperties[\"isCanAlter\"];\n isCanView: ReflectionProperties[\"isCanView\"];\n metrics: ReflectionProperties[\"metrics\"];\n name: ReflectionProperties[\"name\"];\n status: ReflectionProperties[\"status\"];\n type: ReflectionProperties[\"type\"];\n updatedAt: ReflectionProperties[\"updatedAt\"];\n constructor(properties: ReflectionProperties) {\n this.createdAt = properties.createdAt;\n this.dataset = properties.dataset;\n this.id = properties.id;\n this.isCanAlter = properties.isCanAlter;\n this.isCanView = properties.isCanView;\n this.metrics = properties.metrics;\n this.name = properties.name;\n this.status = properties.status;\n this.type = properties.type;\n this.updatedAt = properties.updatedAt;\n }\n}\n\nexport const reflectionSummaryEntityToProperties = (entity: {\n createdAt: string;\n id: string;\n isCanAlter: boolean;\n isCanView: boolean;\n chosenCount: number;\n consideredCount: number;\n currentSizeBytes: number;\n matchedCount: number;\n status: {\n availabilityStatus: \"AVAILABLE\" | \"EXPIRED\" | \"INCOMPLETE\" | \"NONE\";\n combinedStatus:\n | \"CAN_ACCELERATE\"\n | \"CAN_ACCELERATE_WITH_FAILURES\"\n | \"CANNOT_ACCELERATE_INITIALIZING\"\n | \"CANNOT_ACCELERATE_MANUAL\"\n | \"CANNOT_ACCELERATE_SCHEDULED\"\n | \"DISABLED\"\n | \"EXPIRED\"\n | \"FAILED\"\n | \"INVALID\"\n | \"INCOMPLETE\"\n | \"REFRESHING\";\n configStatus: \"OK\" | \"INVALID\";\n expiresAt: string;\n failureCount: number;\n lastDataFetchAt: string;\n lastFailureMessage: string;\n lastRefreshDurationMillis: number;\n refreshMethod: \"INCREMENTAL\" | \"FULL\" | \"NONE\";\n refreshStatus: \"GIVEN_UP\" | \"MANUAL\" | \"RUNNING\" | \"SCHEDULED\";\n };\n isEnabled: boolean;\n outputRecords: number;\n totalSizeBytes: number;\n name: string;\n reflectionType: \"RAW\" | \"AGGREGATION\";\n updatedAt: string;\n}) => ({\n createdAt: new Date(entity.createdAt),\n dataset: {} as EnterpriseDatasetCatalogReference,\n // dataset: new DatasetCatalogReference(\n // {\n // id: entity.datasetId,\n // path: entity.datasetPath,\n // type: entity.datasetType,\n // },\n // null as any,\n // ),\n id: entity.id,\n isCanAlter: entity.isCanAlter,\n isCanView: entity.isCanView,\n metrics: {\n chosenCount: entity.chosenCount,\n consideredCount: entity.consideredCount,\n currentSizeBytes: entity.currentSizeBytes,\n failureCount: entity.status.failureCount,\n matchedCount: entity.matchedCount,\n outputRecords: entity.outputRecords,\n totalSizeBytes: entity.totalSizeBytes,\n },\n name: entity.name,\n status: {\n availabilityStatus: entity.status.availabilityStatus,\n combinedStatus: entity.status.combinedStatus,\n configStatus: entity.status.configStatus,\n expiresAt: new Date(entity.status.expiresAt),\n isEnabled: entity.isEnabled,\n lastDataFetchAt: entity.status.lastDataFetchAt ? new Date(entity.status.lastDataFetchAt) : null,\n lastFailureMessage: entity.status.lastFailureMessage || null,\n lastRefreshDuration:\n typeof entity.status.lastRefreshDurationMillis === \"number\"\n ? Temporal.Duration.from(parseMilliseconds(entity.status.lastRefreshDurationMillis))\n : null,\n refreshMethod: entity.status.refreshMethod,\n refreshStatus: entity.status.refreshStatus,\n },\n type: entity.reflectionType,\n updatedAt: new Date(entity.updatedAt),\n});\n\ntype ReflectionProperties = ReturnType<typeof reflectionSummaryEntityToProperties>;\n"]}
@@ -34,10 +34,10 @@ type EnterpriseScriptEntity = ScriptEntity & {
34
34
  };
35
35
  export declare const enterpriseScriptEntityToProperties: (entity: EnterpriseScriptEntity) => {
36
36
  owner: UserGrantee;
37
- createdAt: Temporal.Instant;
37
+ createdAt: import("temporal-polyfill").Temporal.Instant;
38
38
  createdBy: string;
39
39
  id: string;
40
- modifiedAt: Temporal.Instant;
40
+ modifiedAt: import("temporal-polyfill").Temporal.Instant;
41
41
  modifiedBy: string;
42
42
  name: string;
43
43
  query: import("../index.ts").Query;
@@ -1,6 +1,7 @@
1
1
  import type { SonarV3Config } from "../../../common/Config.ts";
2
2
  import { SourceCatalogReference } from "../CatalogReferences/SourceCatalogReference.ts";
3
3
  import type { RetrieveByPath } from "../CatalogReferences/BaseCatalogReference.ts";
4
+ import { Temporal } from "temporal-polyfill";
4
5
  export declare class SourceCatalogObject {
5
6
  readonly acceleration: SourceCatalogObjectProperties["acceleration"];
6
7
  readonly allowCrossSourceSelection: SourceCatalogObjectProperties["allowCrossSourceSelection"];
@@ -15,6 +15,7 @@
15
15
  */
16
16
  import parseMilliseconds from "parse-ms";
17
17
  import { SourceCatalogReference } from "../CatalogReferences/SourceCatalogReference.js";
18
+ import { Temporal } from "temporal-polyfill";
18
19
  export class SourceCatalogObject {
19
20
  acceleration;
20
21
  allowCrossSourceSelection;
@@ -1 +1 @@
1
- {"version":3,"file":"SourceCatalogObject.js","sourceRoot":"","sources":["../../../../src/oss/catalog/CatalogObjects/SourceCatalogObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAGxF,MAAM,OAAO,mBAAmB;IACrB,YAAY,CAAgD;IAC5D,yBAAyB,CAA6D;IACtF,gBAAgB,CAAyB;IACzC,MAAM,CAA0C;IAChD,SAAS,CAA6C;IACtD,4BAA4B,CAAgE;IAC5F,cAAc,CAAkD;IAChE,iBAAiB,CAAqD;IACtE,MAAM,CAA0C;IAChD,IAAI,CAAwC;IAElC,GAAG,CAAS;IAE/B,YACE,UAGC;QAED,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAA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I,EAAE,MAAM,CAAC,IAAI;IACjB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;IAC3C,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;IAC3B,GAAG,EAAE,MAAM,CAAC,GAAG;IACf,IAAI,EAAE,MAAM,CAAC,IAAI;CAClB,CAAU,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 parseMilliseconds from \"parse-ms\";\n\nimport type { SonarV3Config } from \"../../../common/Config.ts\";\nimport { SourceCatalogReference } from \"../CatalogReferences/SourceCatalogReference.ts\";\nimport type { RetrieveByPath } from \"../CatalogReferences/BaseCatalogReference.ts\";\n\nexport class SourceCatalogObject {\n readonly acceleration: SourceCatalogObjectProperties[\"acceleration\"];\n readonly allowCrossSourceSelection: SourceCatalogObjectProperties[\"allowCrossSourceSelection\"];\n readonly catalogReference: SourceCatalogReference;\n readonly config: SourceCatalogObjectProperties[\"config\"];\n readonly createdAt: SourceCatalogObjectProperties[\"createdAt\"];\n readonly disableMetadataValidityCheck: SourceCatalogObjectProperties[\"disableMetadataValidityCheck\"];\n readonly metadataPolicy: SourceCatalogObjectProperties[\"metadataPolicy\"];\n readonly sourceChangeState: SourceCatalogObjectProperties[\"sourceChangeState\"];\n readonly status: SourceCatalogObjectProperties[\"status\"];\n readonly type: SourceCatalogObjectProperties[\"type\"];\n\n protected readonly tag: string;\n\n constructor(\n properties: SourceCatalogObjectProperties & {\n catalogReference: SourceCatalogReference;\n tag: string;\n },\n ) {\n this.acceleration = properties.acceleration;\n this.allowCrossSourceSelection = properties.allowCrossSourceSelection;\n this.catalogReference = properties.catalogReference;\n this.config = properties.config;\n this.createdAt = properties.createdAt;\n this.disableMetadataValidityCheck = properties.disableMetadataValidityCheck;\n this.metadataPolicy = properties.metadataPolicy;\n this.sourceChangeState = properties.sourceChangeState;\n this.status = properties.status;\n this.tag = properties.tag;\n this.type = properties.type;\n\n this.pathString = this.catalogReference.pathString.bind(this.catalogReference);\n }\n\n get name() {\n return this.catalogReference.name;\n }\n\n /**\n * @deprecated\n */\n get id() {\n return this.catalogReference.id;\n }\n\n get path() {\n return this.catalogReference.path;\n }\n\n get settled() {\n return this.sourceChangeState === \"NONE\" || this.sourceChangeState === \"UNSPECIFIED\";\n }\n\n pathString: SourceCatalogReference[\"pathString\"];\n}\n\nexport const sourceEntityToProperties = (\n entity: any,\n config: SonarV3Config,\n retrieveByPath: RetrieveByPath,\n) =>\n ({\n acceleration: {\n activePolicyType: entity.accelerationActivePolicyType,\n gracePeriod: Temporal.Duration.from(parseMilliseconds(entity.accelerationGracePeriodMs)),\n neverExpire: entity.accelerationNeverExpire,\n neverRefresh: entity.accelerationNeverRefresh,\n refreshPeriod: Temporal.Duration.from(parseMilliseconds(entity.accelerationRefreshPeriodMs)),\n refreshSchedule: entity.accelerationRefreshSchedule,\n },\n allowCrossSourceSelection: entity.allowCrossSourceSelection,\n catalogReference: new SourceCatalogReference(\n {\n id: entity.id,\n path: [entity.name],\n },\n config,\n retrieveByPath,\n ),\n config: entity.config,\n createdAt: new Date(entity.createdAt),\n disableMetadataValidityCheck: entity.disableMetadataValidityCheck,\n id: entity.id,\n metadataPolicy: {\n authTTL: Temporal.Duration.from(parseMilliseconds(entity.metadataPolicy.authTTLMs)),\n autoPromoteDatasets: entity.metadataPolicy.autoPromoteDatasets,\n datasetExpireAfter: Temporal.Duration.from(\n parseMilliseconds(entity.metadataPolicy.datasetExpireAfterMs),\n ),\n datasetRefreshAfter: Temporal.Duration.from(\n parseMilliseconds(entity.metadataPolicy.datasetRefreshAfterMs),\n ),\n datasetUpdateMode: entity.metadataPolicy.datasetUpdateMode,\n deleteUnavailableDatasets: entity.metadataPolicy.deleteUnavailableDatasets,\n namesRefresh: Temporal.Duration.from(parseMilliseconds(entity.metadataPolicy.namesRefreshMs)),\n },\n name: entity.name,\n sourceChangeState: entity.sourceChangeState,\n status: entity.state.status,\n tag: entity.tag,\n type: entity.type,\n }) as const;\n\nexport type SourceCatalogObjectProperties = ReturnType<typeof sourceEntityToProperties>;\n"]}
1
+ {"version":3,"file":"SourceCatalogObject.js","sourceRoot":"","sources":["../../../../src/oss/catalog/CatalogObjects/SourceCatalogObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,iBAAiB,MAAM,UAAU,CAAC;AAGzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAExF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,mBAAmB;IACrB,YAAY,CAAgD;IAC5D,yBAAyB,CAA6D;IACtF,gBAAgB,CAAyB;IACzC,MAAM,CAA0C;IAChD,SAAS,CAA6C;IACtD,4BAA4B,CAAgE;IAC5F,cAAc,CAAkD;IAChE,iBAAiB,CAAqD;IACtE,MAAM,CAA0C;IAChD,IAAI,CAAwC;IAElC,GAAG,CAAS;IAE/B,YACE,UAGC;QAED,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;QAC5C,IAAI,CAAC,yBAAyB,GAAG,UAAU,CAAC,yBAAyB,CAAC;QACtE,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,4BAA4B,GAAG,UAAU,CAAC,4BAA4B,CAAC;QAC5E,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC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Content":["/*\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 parseMilliseconds from \"parse-ms\";\n\nimport type { SonarV3Config } from \"../../../common/Config.ts\";\nimport { SourceCatalogReference } from \"../CatalogReferences/SourceCatalogReference.ts\";\nimport type { RetrieveByPath } from \"../CatalogReferences/BaseCatalogReference.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\nexport class SourceCatalogObject {\n readonly acceleration: SourceCatalogObjectProperties[\"acceleration\"];\n readonly allowCrossSourceSelection: SourceCatalogObjectProperties[\"allowCrossSourceSelection\"];\n readonly catalogReference: SourceCatalogReference;\n readonly config: SourceCatalogObjectProperties[\"config\"];\n readonly createdAt: SourceCatalogObjectProperties[\"createdAt\"];\n readonly disableMetadataValidityCheck: SourceCatalogObjectProperties[\"disableMetadataValidityCheck\"];\n readonly metadataPolicy: SourceCatalogObjectProperties[\"metadataPolicy\"];\n readonly sourceChangeState: SourceCatalogObjectProperties[\"sourceChangeState\"];\n readonly status: SourceCatalogObjectProperties[\"status\"];\n readonly type: SourceCatalogObjectProperties[\"type\"];\n\n protected readonly tag: string;\n\n constructor(\n properties: SourceCatalogObjectProperties & {\n catalogReference: SourceCatalogReference;\n tag: string;\n },\n ) {\n this.acceleration = properties.acceleration;\n this.allowCrossSourceSelection = properties.allowCrossSourceSelection;\n this.catalogReference = properties.catalogReference;\n this.config = properties.config;\n this.createdAt = properties.createdAt;\n this.disableMetadataValidityCheck = properties.disableMetadataValidityCheck;\n this.metadataPolicy = properties.metadataPolicy;\n this.sourceChangeState = properties.sourceChangeState;\n this.status = properties.status;\n this.tag = properties.tag;\n this.type = properties.type;\n\n this.pathString = this.catalogReference.pathString.bind(this.catalogReference);\n }\n\n get name() {\n return this.catalogReference.name;\n }\n\n /**\n * @deprecated\n */\n get id() {\n return this.catalogReference.id;\n }\n\n get path() {\n return this.catalogReference.path;\n }\n\n get settled() {\n return this.sourceChangeState === \"NONE\" || this.sourceChangeState === \"UNSPECIFIED\";\n }\n\n pathString: SourceCatalogReference[\"pathString\"];\n}\n\nexport const sourceEntityToProperties = (\n entity: any,\n config: SonarV3Config,\n retrieveByPath: RetrieveByPath,\n) =>\n ({\n acceleration: {\n activePolicyType: entity.accelerationActivePolicyType,\n gracePeriod: Temporal.Duration.from(parseMilliseconds(entity.accelerationGracePeriodMs)),\n neverExpire: entity.accelerationNeverExpire,\n neverRefresh: entity.accelerationNeverRefresh,\n refreshPeriod: Temporal.Duration.from(parseMilliseconds(entity.accelerationRefreshPeriodMs)),\n refreshSchedule: entity.accelerationRefreshSchedule,\n },\n allowCrossSourceSelection: entity.allowCrossSourceSelection,\n catalogReference: new SourceCatalogReference(\n {\n id: entity.id,\n path: [entity.name],\n },\n config,\n retrieveByPath,\n ),\n config: entity.config,\n createdAt: new Date(entity.createdAt),\n disableMetadataValidityCheck: entity.disableMetadataValidityCheck,\n id: entity.id,\n metadataPolicy: {\n authTTL: Temporal.Duration.from(parseMilliseconds(entity.metadataPolicy.authTTLMs)),\n autoPromoteDatasets: entity.metadataPolicy.autoPromoteDatasets,\n datasetExpireAfter: Temporal.Duration.from(\n parseMilliseconds(entity.metadataPolicy.datasetExpireAfterMs),\n ),\n datasetRefreshAfter: Temporal.Duration.from(\n parseMilliseconds(entity.metadataPolicy.datasetRefreshAfterMs),\n ),\n datasetUpdateMode: entity.metadataPolicy.datasetUpdateMode,\n deleteUnavailableDatasets: entity.metadataPolicy.deleteUnavailableDatasets,\n namesRefresh: Temporal.Duration.from(parseMilliseconds(entity.metadataPolicy.namesRefreshMs)),\n },\n name: entity.name,\n sourceChangeState: entity.sourceChangeState,\n status: entity.state.status,\n tag: entity.tag,\n type: entity.type,\n }) as const;\n\nexport type SourceCatalogObjectProperties = ReturnType<typeof sourceEntityToProperties>;\n"]}
@@ -1,4 +1,3 @@
1
- import "temporal-polyfill/global";
2
1
  import { createRequest } from "../common/createRequest.ts";
3
2
  import type { Config } from "../common/Config.ts";
4
3
  import { Resources } from "./resources.ts";
package/dist/oss/index.js CHANGED
@@ -13,7 +13,6 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import "temporal-polyfill/global";
17
16
  import { createRequest } from "../common/createRequest.js";
18
17
  import { Resources } from "./resources.js";
19
18
  const getSonarResourceConfig = (config) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oss/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,EAAE;IAChD,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,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,CAAC;QAC/D,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC;KACR,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,GAAG,SAAS,CAAC,mBAAmB,CAAC;QACjC,QAAQ,EAAE,mBAAmB,CAAC,OAAO;QACrC,oBAAoB,EAAE,mBAAmB;QACzC,eAAe,EAAE,mBAAmB,CAAC,cAAc;QACnD,eAAe,EAAE,mBAAmB,CAAC,cAAc;KACpD,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,SAAS,IAAI,UAAU,EAAE,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 \"temporal-polyfill/global\";\nimport { createRequest } from \"../common/createRequest.ts\";\nimport type { Config, ResourceConfig, SonarV2Config, SonarV3Config } from \"../common/Config.ts\";\nimport { Resources } from \"./resources.ts\";\n\nconst getSonarResourceConfig = (config: Config) => {\n const request = createRequest(config);\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV2Request: (path, init) => request(`/apiv2/${path}`, init),\n sonarV3Request: (path, init) => request(`/api/v3/${path}`, init),\n } satisfies ResourceConfig & SonarV2Config & SonarV3Config;\n};\n\nexport const Dremio = (config: Config) => {\n const sonarResourceConfig = getSonarResourceConfig(config);\n return {\n ...Resources(sonarResourceConfig),\n _request: sonarResourceConfig.request,\n _sonarResourceConfig: sonarResourceConfig,\n _sonarV2Request: sonarResourceConfig.sonarV2Request,\n _sonarV3Request: sonarResourceConfig.sonarV3Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\nexport { createRequest, Resources as _Resources };\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/oss/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAE,EAAE;IAChD,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,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,IAAI,EAAE,EAAE,IAAI,CAAC;QAC/D,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,IAAI,EAAE,EAAE,IAAI,CAAC;KACR,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,MAAc,EAAE,EAAE;IACvC,MAAM,mBAAmB,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;QACL,GAAG,SAAS,CAAC,mBAAmB,CAAC;QACjC,QAAQ,EAAE,mBAAmB,CAAC,OAAO;QACrC,oBAAoB,EAAE,mBAAmB;QACzC,eAAe,EAAE,mBAAmB,CAAC,cAAc;QACnD,eAAe,EAAE,mBAAmB,CAAC,cAAc;KACpD,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,SAAS,IAAI,UAAU,EAAE,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 { createRequest } from \"../common/createRequest.ts\";\nimport type { Config, ResourceConfig, SonarV2Config, SonarV3Config } from \"../common/Config.ts\";\nimport { Resources } from \"./resources.ts\";\n\nconst getSonarResourceConfig = (config: Config) => {\n const request = createRequest(config);\n return {\n logger: config.logger,\n origin: config.origin,\n request,\n sonarV2Request: (path, init) => request(`/apiv2/${path}`, init),\n sonarV3Request: (path, init) => request(`/api/v3/${path}`, init),\n } satisfies ResourceConfig & SonarV2Config & SonarV3Config;\n};\n\nexport const Dremio = (config: Config) => {\n const sonarResourceConfig = getSonarResourceConfig(config);\n return {\n ...Resources(sonarResourceConfig),\n _request: sonarResourceConfig.request,\n _sonarResourceConfig: sonarResourceConfig,\n _sonarV2Request: sonarResourceConfig.sonarV2Request,\n _sonarV3Request: sonarResourceConfig.sonarV3Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\nexport { createRequest, Resources as _Resources };\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Err, Ok } from "ts-results-es";
2
2
  import { Query } from "../../common/Query.ts";
3
3
  import type { SonarV3Config } from "../../common/Config.ts";
4
+ import { Temporal } from "temporal-polyfill";
4
5
  export declare class Script {
5
6
  #private;
6
7
  readonly createdAt: ScriptProperties["createdAt"];
@@ -17,6 +17,7 @@ import { Err, Ok } from "ts-results-es";
17
17
  import { Query } from "../../common/Query.js";
18
18
  import { HttpError } from "../../common/HttpError.js";
19
19
  import { duplicateScriptNameError } from "./ScriptErrors.js";
20
+ import { Temporal } from "temporal-polyfill";
20
21
  export class Script {
21
22
  createdAt;
22
23
  createdBy;
@@ -1 +1 @@
1
- {"version":3,"file":"Script.js","sourceRoot":"","sources":["../../../src/oss/scripts/Script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,MAAM,OAAO,MAAM;IACR,SAAS,CAAgC;IACzC,SAAS,CAAgC;IACzC,EAAE,CAAyB;IAC3B,UAAU,CAAiC;IAC3C,UAAU,CAAiC;IAC3C,IAAI,CAA2B;IAC/B,KAAK,CAA4B;IAC1C,OAAO,CAAgB;IAEvB,YAAY,UAA4B,EAAE,MAAqB;QAC7D,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,EAAE,EAAE;YACpC,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,QAAQ;SACjB,CAAC;aACD,IAAI,CAAC,GA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O,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7C,aAAa,CAAC,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC;IACnD,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,MAAqB,EAAE,EAAE,CAAC,CAAC,IAAyB,EAAE,EAAE;IAC7F,OAAO,MAAM;SACV,cAAc,CAAC,WAAW,EAAE,EAAE,EAAE;QAC/B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1B,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,OAAO;KAChB,CAAC;SACD,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;SACzB,IAAI,CAAC,CAAC,MAAoB,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;SAC1C,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,IAAI,CAAC,YAAY,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,mCAAmC,CAAC,EAAE,CAAC;gBACjE,OAAO,GAAG,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,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 { Err, Ok } from \"ts-results-es\";\nimport { Query } from \"../../common/Query.ts\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { HttpError } from \"../../common/HttpError.ts\";\nimport { duplicateScriptNameError } from \"./ScriptErrors.ts\";\n\nexport class Script {\n readonly createdAt: ScriptProperties[\"createdAt\"];\n readonly createdBy: ScriptProperties[\"createdBy\"];\n readonly id: ScriptProperties[\"id\"];\n readonly modifiedAt: ScriptProperties[\"modifiedAt\"];\n readonly modifiedBy: ScriptProperties[\"modifiedBy\"];\n readonly name: ScriptProperties[\"name\"];\n readonly query: ScriptProperties[\"query\"];\n #config: SonarV3Config;\n\n constructor(properties: ScriptProperties, config: SonarV3Config) {\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.id = properties.id;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.query = properties.query;\n this.#config = config;\n }\n\n async delete() {\n return this.#config\n .sonarV3Request(`scripts/${this.id}`, {\n keepalive: true,\n method: \"DELETE\",\n })\n .then(() => Ok(undefined))\n .catch((e: unknown) => Err(e));\n }\n\n async save(properties: ScriptPatchableProperties) {\n return saveScript(\n this.id,\n this.#config,\n )(properties).then((result) =>\n result.map((value) => new Script(scriptEntityToProperties(value), this.#config)),\n );\n }\n}\n\nexport const scriptEntityToProperties = (entity: ScriptEntity) => ({\n createdAt: Temporal.Instant.from(entity.createdAt),\n createdBy: entity.createdBy,\n id: entity.id,\n modifiedAt: Temporal.Instant.from(entity.modifiedAt),\n modifiedBy: entity.modifiedBy,\n name: entity.name,\n query: new Query(entity.content, entity.context),\n});\n\nexport type ScriptEntity = {\n content: string;\n context: string[];\n createdAt: string;\n createdBy: string;\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n name: string;\n};\n\nexport type ScriptPatchableProperties = {\n name?: ScriptProperties[\"name\"];\n query?: ScriptProperties[\"query\"];\n};\n\nexport type ScriptProperties = ReturnType<typeof scriptEntityToProperties>;\n\nexport const createScriptPatchedFields = (properties: ScriptPatchableProperties) => {\n const patchedFields = {} as {\n name?: string;\n content?: string;\n context?: string[];\n };\n if (properties.name) {\n patchedFields.name = properties.name;\n }\n if (properties.query) {\n patchedFields.content = properties.query.sql;\n patchedFields.context = properties.query.context;\n }\n return patchedFields;\n};\n\nexport const saveScript = (id: string, config: SonarV3Config) => (body: Record<string, any>) => {\n return config\n .sonarV3Request(`scripts/${id}`, {\n body: JSON.stringify(body),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PATCH\",\n })\n .then((res) => res.json())\n .then((entity: ScriptEntity) => Ok(entity))\n .catch((e: unknown) => {\n if (e instanceof HttpError) {\n if (e.body.detail?.includes(\"Cannot reuse the same script name\")) {\n return Err(duplicateScriptNameError(body[\"name\"]));\n }\n return Err(e.body);\n }\n\n throw e;\n });\n};\n"]}
1
+ {"version":3,"file":"Script.js","sourceRoot":"","sources":["../../../src/oss/scripts/Script.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,OAAO,MAAM;IACR,SAAS,CAAgC;IACzC,SAAS,CAAgC;IACzC,EAAE,CAAyB;IAC3B,UAAU,CAAiC;IAC3C,UAAU,CAAiC;IAC3C,IAAI,CAA2B;IAC/B,KAAK,CAA4B;IAC1C,OAAO,CAAgB;IAEvB,YAAY,U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AC,MAAoB,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;SAC1C,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,IAAI,CAAC,YAAY,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,mCAAmC,CAAC,EAAE,CAAC;gBACjE,OAAO,GAAG,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,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 { Err, Ok } from \"ts-results-es\";\nimport { Query } from \"../../common/Query.ts\";\nimport type { SonarV3Config } from \"../../common/Config.ts\";\nimport { HttpError } from \"../../common/HttpError.ts\";\nimport { duplicateScriptNameError } from \"./ScriptErrors.ts\";\nimport { Temporal } from \"temporal-polyfill\";\n\nexport class Script {\n readonly createdAt: ScriptProperties[\"createdAt\"];\n readonly createdBy: ScriptProperties[\"createdBy\"];\n readonly id: ScriptProperties[\"id\"];\n readonly modifiedAt: ScriptProperties[\"modifiedAt\"];\n readonly modifiedBy: ScriptProperties[\"modifiedBy\"];\n readonly name: ScriptProperties[\"name\"];\n readonly query: ScriptProperties[\"query\"];\n #config: SonarV3Config;\n\n constructor(properties: ScriptProperties, config: SonarV3Config) {\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.id = properties.id;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.query = properties.query;\n this.#config = config;\n }\n\n async delete() {\n return this.#config\n .sonarV3Request(`scripts/${this.id}`, {\n keepalive: true,\n method: \"DELETE\",\n })\n .then(() => Ok(undefined))\n .catch((e: unknown) => Err(e));\n }\n\n async save(properties: ScriptPatchableProperties) {\n return saveScript(\n this.id,\n this.#config,\n )(properties).then((result) =>\n result.map((value) => new Script(scriptEntityToProperties(value), this.#config)),\n );\n }\n}\n\nexport const scriptEntityToProperties = (entity: ScriptEntity) => ({\n createdAt: Temporal.Instant.from(entity.createdAt),\n createdBy: entity.createdBy,\n id: entity.id,\n modifiedAt: Temporal.Instant.from(entity.modifiedAt),\n modifiedBy: entity.modifiedBy,\n name: entity.name,\n query: new Query(entity.content, entity.context),\n});\n\nexport type ScriptEntity = {\n content: string;\n context: string[];\n createdAt: string;\n createdBy: string;\n id: string;\n modifiedAt: string;\n modifiedBy: string;\n name: string;\n};\n\nexport type ScriptPatchableProperties = {\n name?: ScriptProperties[\"name\"];\n query?: ScriptProperties[\"query\"];\n};\n\nexport type ScriptProperties = ReturnType<typeof scriptEntityToProperties>;\n\nexport const createScriptPatchedFields = (properties: ScriptPatchableProperties) => {\n const patchedFields = {} as {\n name?: string;\n content?: string;\n context?: string[];\n };\n if (properties.name) {\n patchedFields.name = properties.name;\n }\n if (properties.query) {\n patchedFields.content = properties.query.sql;\n patchedFields.context = properties.query.context;\n }\n return patchedFields;\n};\n\nexport const saveScript = (id: string, config: SonarV3Config) => (body: Record<string, any>) => {\n return config\n .sonarV3Request(`scripts/${id}`, {\n body: JSON.stringify(body),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PATCH\",\n })\n .then((res) => res.json())\n .then((entity: ScriptEntity) => Ok(entity))\n .catch((e: unknown) => {\n if (e instanceof HttpError) {\n if (e.body.detail?.includes(\"Cannot reuse the same script name\")) {\n return Err(duplicateScriptNameError(body[\"name\"]));\n }\n return Err(e.body);\n }\n\n throw e;\n });\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",