@dremio/js-sdk 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cloud/ai/AiResource.d.ts +3 -15
- package/dist/cloud/ai/AiResource.js +11 -14
- package/dist/cloud/ai/AiResource.js.map +1 -1
- package/dist/cloud/arctic/ArcticResource.d.ts +2 -3
- package/dist/cloud/arctic/ArcticResource.js +4 -6
- package/dist/cloud/arctic/ArcticResource.js.map +1 -1
- package/dist/cloud/engines/Engine.d.ts +2 -3
- package/dist/cloud/engines/Engine.js +5 -6
- package/dist/cloud/engines/Engine.js.map +1 -1
- package/dist/cloud/engines/EnginesResource.d.ts +2 -2
- package/dist/cloud/engines/EnginesResource.js +4 -4
- package/dist/cloud/engines/EnginesResource.js.map +1 -1
- package/dist/cloud/index.d.ts +3 -5
- package/dist/cloud/index.js +0 -1
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/oauth/OAuthApplication.d.ts +1 -2
- package/dist/cloud/oauth/OAuthApplication.js +1 -3
- package/dist/cloud/oauth/OAuthApplication.js.map +1 -1
- package/dist/cloud/oauth/OAuthApplicationsResource.d.ts +3 -4
- package/dist/cloud/oauth/OAuthApplicationsResource.js +7 -10
- package/dist/cloud/oauth/OAuthApplicationsResource.js.map +1 -1
- package/dist/cloud/projects/Project.d.ts +2 -2
- package/dist/cloud/projects/ProjectsResource.d.ts +4 -5
- package/dist/cloud/projects/ProjectsResource.js +7 -16
- package/dist/cloud/projects/ProjectsResource.js.map +1 -1
- package/dist/cloud/users/CloudUsersResource.d.ts +2 -3
- package/dist/cloud/users/CloudUsersResource.js +4 -7
- package/dist/cloud/users/CloudUsersResource.js.map +1 -1
- package/dist/common/Config.d.ts +4 -2
- package/dist/common/Config.js.map +1 -1
- package/dist/common/HttpError.d.ts +7 -13
- package/dist/common/HttpError.js +19 -36
- package/dist/common/HttpError.js.map +1 -1
- package/dist/common/Problem.d.ts +29 -34
- package/dist/common/Problem.js +47 -19
- package/dist/common/Problem.js.map +1 -1
- package/dist/common/createRequest.js +8 -33
- package/dist/common/createRequest.js.map +1 -1
- package/dist/common/problems.d.ts +11 -9
- package/dist/common/problems.js +18 -9
- package/dist/common/problems.js.map +1 -1
- package/dist/enterprise/catalog/CatalogReferences/retrieveCatalogGrants.d.ts +2 -3
- package/dist/enterprise/catalog/CatalogReferences/retrieveCatalogGrants.js +3 -5
- package/dist/enterprise/catalog/CatalogReferences/retrieveCatalogGrants.js.map +1 -1
- package/dist/enterprise/catalog/EnterpriseCatalogResource.js +3 -2
- package/dist/enterprise/catalog/EnterpriseCatalogResource.js.map +1 -1
- package/dist/enterprise/catalog/catalogRetrieve.js +4 -0
- package/dist/enterprise/catalog/catalogRetrieve.js.map +1 -1
- package/dist/enterprise/credentials/exchangePat.d.ts +2 -4
- package/dist/enterprise/credentials/exchangePat.js +3 -3
- package/dist/enterprise/credentials/exchangePat.js.map +1 -1
- package/dist/enterprise/engines/Engine.d.ts +3 -5
- package/dist/enterprise/engines/Engine.js +7 -11
- package/dist/enterprise/engines/Engine.js.map +1 -1
- package/dist/enterprise/engines/EnginesResource.d.ts +2 -4
- package/dist/enterprise/engines/EnginesResource.js +4 -6
- package/dist/enterprise/engines/EnginesResource.js.map +1 -1
- package/dist/enterprise/index.d.ts +7 -9
- package/dist/enterprise/index.js +0 -1
- package/dist/enterprise/index.js.map +1 -1
- package/dist/enterprise/roles/RolesResource.d.ts +2 -3
- package/dist/enterprise/roles/RolesResource.js +4 -7
- package/dist/enterprise/roles/RolesResource.js.map +1 -1
- package/dist/enterprise/scripts/EnterpriseScript.d.ts +3 -13
- package/dist/enterprise/scripts/EnterpriseScript.js +4 -6
- package/dist/enterprise/scripts/EnterpriseScript.js.map +1 -1
- package/dist/enterprise/scripts/EnterpriseScriptsResource.d.ts +6 -2
- package/dist/enterprise/scripts/EnterpriseScriptsResource.js +1 -1
- package/dist/enterprise/scripts/EnterpriseScriptsResource.js.map +1 -1
- package/dist/enterprise/users/EnterpriseUser.d.ts +2 -3
- package/dist/enterprise/users/EnterpriseUser.js +3 -5
- package/dist/enterprise/users/EnterpriseUser.js.map +1 -1
- package/dist/enterprise/users/EnterpriseUsersResource.d.ts +2 -3
- package/dist/enterprise/users/EnterpriseUsersResource.js +4 -7
- package/dist/enterprise/users/EnterpriseUsersResource.js.map +1 -1
- package/dist/oss/catalog/CatalogReferences/DatasetCatalogReference.d.ts +1 -1
- package/dist/oss/catalog/CatalogReferences/FolderCatalogReference.d.ts +1 -1
- package/dist/oss/catalog/CatalogReferences/HomeCatalogReference.d.ts +1 -1
- package/dist/oss/catalog/CatalogReferences/SourceCatalogReference.d.ts +1 -1
- package/dist/oss/catalog/CatalogReferences/SpaceCatalogReference.d.ts +1 -1
- package/dist/oss/catalog/CatalogReferences/utils/catalogChildren.js +1 -0
- package/dist/oss/catalog/CatalogReferences/utils/catalogChildren.js.map +1 -1
- package/dist/oss/catalog/CatalogReferences/utils/getTags.d.ts +1 -2
- package/dist/oss/catalog/CatalogReferences/utils/getTags.js +2 -4
- package/dist/oss/catalog/CatalogReferences/utils/getTags.js.map +1 -1
- package/dist/oss/catalog/CatalogReferences/utils/getWiki.d.ts +1 -2
- package/dist/oss/catalog/CatalogReferences/utils/getWiki.js +2 -4
- package/dist/oss/catalog/CatalogReferences/utils/getWiki.js.map +1 -1
- package/dist/oss/catalog/CatalogResource.js +1 -0
- package/dist/oss/catalog/CatalogResource.js.map +1 -1
- package/dist/oss/catalog/CatalogTags.d.ts +2 -6
- package/dist/oss/catalog/CatalogTags.js +8 -13
- package/dist/oss/catalog/CatalogTags.js.map +1 -1
- package/dist/oss/catalog/CatalogWiki.d.ts +2 -6
- package/dist/oss/catalog/CatalogWiki.js +8 -13
- package/dist/oss/catalog/CatalogWiki.js.map +1 -1
- package/dist/oss/catalog/catalogErrors.d.ts +3 -14
- package/dist/oss/catalog/catalogErrors.js +9 -12
- package/dist/oss/catalog/catalogErrors.js.map +1 -1
- package/dist/oss/catalog/catalogRetrieve.d.ts +3 -2
- package/dist/oss/catalog/catalogRetrieve.js +6 -2
- package/dist/oss/catalog/catalogRetrieve.js.map +1 -1
- package/dist/oss/index.d.ts +4 -7
- package/dist/oss/index.js +0 -1
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/jobs/Job.d.ts +3 -3
- package/dist/oss/jobs/Job.js +7 -9
- package/dist/oss/jobs/Job.js.map +1 -1
- package/dist/oss/jobs/JobsResource.d.ts +4 -5
- package/dist/oss/jobs/JobsResource.js +5 -7
- package/dist/oss/jobs/JobsResource.js.map +1 -1
- package/dist/oss/scripts/Script.d.ts +3 -22
- package/dist/oss/scripts/Script.js +12 -16
- package/dist/oss/scripts/Script.js.map +1 -1
- package/dist/oss/scripts/ScriptErrors.d.ts +6 -18
- package/dist/oss/scripts/ScriptErrors.js +10 -13
- package/dist/oss/scripts/ScriptErrors.js.map +1 -1
- package/dist/oss/scripts/ScriptsResource.d.ts +14 -6
- package/dist/oss/scripts/ScriptsResource.js +19 -21
- package/dist/oss/scripts/ScriptsResource.js.map +1 -1
- package/dist/oss/users/UsersResource.d.ts +2 -3
- package/dist/oss/users/UsersResource.js +4 -7
- package/dist/oss/users/UsersResource.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterpriseScript.js","sourceRoot":"","sources":["../../../src/enterprise/scripts/EnterpriseScript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,MAAM,EACN,wBAAwB,GAGzB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"EnterpriseScript.js","sourceRoot":"","sources":["../../../src/enterprise/scripts/EnterpriseScript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,yBAAyB,EACzB,UAAU,EACV,MAAM,EACN,wBAAwB,GAGzB,MAAM,6BAA6B,CAAC;AAIrC,MAAM,OA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GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;SACxD,CAAC,CAAC,GAAG,CACJ,CAAC,KAA6B,EAAE,EAAE,CAChC,IAAI,gBAAgB,CAAC,kCAAkC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAChF,CAAC,OAAO,CAAC;IACZ,CAAC;CACF;AAMD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,MAA8B,EAAE,EAAE,CAAC,CAAC;IACrF,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACnC,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC,KAAe;QAC1B,IAAI,EAAE,MAAM;KACwB;CACvC,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 { SonarV3Config } from \"../../common/Config.ts\";\nimport type { RoleGrantee, UserGrantee } from \"../Grantee.ts\";\nimport type { Ownable } from \"../Ownable.ts\";\nimport {\n createScriptPatchedFields,\n saveScript,\n Script,\n scriptEntityToProperties,\n type ScriptEntity,\n type ScriptPatchableProperties,\n} from \"../../oss/scripts/Script.ts\";\n\nimport type { SignalParam } from \"../../common/Params.ts\";\n\nexport class EnterpriseScript extends Script implements Ownable {\n readonly owner: UserGrantee;\n #config: SonarV3Config;\n\n constructor(properties: EnterpriseScriptProperties, config: SonarV3Config) {\n super(properties, config);\n this.owner = properties.owner;\n this.#config = config;\n }\n\n grants({ signal }: SignalParam = {}) {\n return this.#config\n .sonarV3Request(`scripts/${this.id}/grants`, { signal })\n .map((res) => res.json())\n .map(\n (entity: {\n roles: { granteeId: string; privileges: ScriptPrivileges[] }[];\n users: { granteeId: string; privileges: ScriptPrivileges[] }[];\n }) => [\n ...entity.roles.map((grant) => ({\n grantee: {\n id: grant.granteeId,\n type: \"ROLE\",\n } satisfies RoleGrantee as RoleGrantee,\n privileges: new Set(grant.privileges),\n })),\n ...entity.users.map((grant) => ({\n grantee: {\n id: grant.granteeId,\n type: \"USER\",\n } satisfies UserGrantee as UserGrantee,\n privileges: new Set(grant.privileges),\n })),\n ],\n ).promise;\n }\n\n override async save(properties: ScriptPatchableProperties & { owner?: UserGrantee }) {\n return saveScript(\n this.id,\n this.#config,\n )({\n ...createScriptPatchedFields(properties),\n ...(properties.owner && { owner: properties.owner.id }),\n }).map(\n (value: EnterpriseScriptEntity) =>\n new EnterpriseScript(enterpriseScriptEntityToProperties(value), this.#config),\n ).promise;\n }\n}\n\nexport type EnterpriseScriptProperties = ReturnType<typeof enterpriseScriptEntityToProperties>;\n\nexport type EnterpriseScriptEntity = ScriptEntity & { owner?: string };\n\nexport const enterpriseScriptEntityToProperties = (entity: EnterpriseScriptEntity) => ({\n ...scriptEntityToProperties(entity),\n owner: {\n id: entity.owner as string,\n type: \"USER\",\n } satisfies UserGrantee as UserGrantee,\n});\n\ntype ScriptPrivileges = \"DELETE\" | \"MANAGE_GRANTS\" | \"MODIFY\" | \"VIEW\";\n"]}
|
|
@@ -9,9 +9,13 @@ export declare class EnterpriseScriptsResource {
|
|
|
9
9
|
list(): {
|
|
10
10
|
data({ signal }?: SignalParam): AsyncGenerator<EnterpriseScript, void, unknown>;
|
|
11
11
|
};
|
|
12
|
-
retrieve(id: string, { signal }?: SignalParam): Promise<import("ts-results-es").
|
|
12
|
+
retrieve(id: string, { signal }?: SignalParam): Promise<import("ts-results-es").Result<EnterpriseScript, import("../index.ts").HttpError | import("../index.ts").Problem<"https://api.dremio.dev/problems/scripts/not-found", {
|
|
13
|
+
provided: {
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
}>>>;
|
|
13
17
|
store(properties: {
|
|
14
18
|
name: string;
|
|
15
19
|
query: Query;
|
|
16
|
-
}): Promise<import("ts-results-es").
|
|
20
|
+
}): Promise<import("ts-results-es").Result<EnterpriseScript, import("../index.ts").ValidationProblem | import("../index.ts").HttpError>>;
|
|
17
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterpriseScriptsResource.js","sourceRoot":"","sources":["../../../src/enterprise/scripts/EnterpriseScriptsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GAEnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEhG,MAAM,OAAO,yBAAyB;IACpC,OAAO,CAAiC;IAExC,YAAY,MAAsC;QAChD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,iBAAiB,CAAC,MAA8B;QAC9C,OAAO,IAAI,gBAAgB,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACxF,CAAC;IAED,IAAI;QACF,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,OAAO;YACL,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,KAAkB,EAAE;gBACtC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"EnterpriseScriptsResource.js","sourceRoot":"","sources":["../../../src/enterprise/scripts/EnterpriseScriptsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,gBAAgB,EAChB,kCAAkC,GAEnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAEhG,MAAM,OAAO,yBAAyB;IACpC,OAAO,CAAiC;IAExC,YAAY,MAAsC;QAChD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,iBAAiB,CAAC,MAA8B;QAC9C,OAAO,IAAI,gBAAgB,CAAC,kCAAkC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACxF,CAAC;IAED,IAAI;QACF,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,OAAO;YACL,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,KAAkB,EAAE;gBACtC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YACxC,CAAC;SACF,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;QAC/C,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,KAAK,CAAC,UAA0C;QAC9C,OAAO,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClF,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 type { ResourceConfig, SonarV3Config } from \"../../common/Config.ts\";\nimport type { Query } from \"../../common/Query.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport {\n EnterpriseScript,\n enterpriseScriptEntityToProperties,\n type EnterpriseScriptEntity,\n} from \"./EnterpriseScript.ts\";\nimport { listScripts, retrieveScript, storeScript } from \"../../oss/scripts/ScriptsResource.ts\";\n\nexport class EnterpriseScriptsResource {\n #config: ResourceConfig & SonarV3Config;\n\n constructor(config: ResourceConfig & SonarV3Config) {\n this.#config = config;\n }\n\n _scriptFromEntity(entity: EnterpriseScriptEntity) {\n return new EnterpriseScript(enterpriseScriptEntityToProperties(entity), this.#config);\n }\n\n list() {\n const l = listScripts(this.#config, this._scriptFromEntity.bind(this));\n return {\n async *data({ signal }: SignalParam = {}) {\n yield* (await l({ signal })).unwrap();\n },\n };\n }\n\n retrieve(id: string, { signal }: SignalParam = {}) {\n return retrieveScript(this.#config, this._scriptFromEntity.bind(this))(id, { signal });\n }\n\n store(properties: { name: string; query: Query }) {\n return storeScript(this.#config, this._scriptFromEntity.bind(this))(properties);\n }\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Err, Ok } from "ts-results-es";
|
|
2
1
|
import type { V3Config } from "../../common/Config.ts";
|
|
3
2
|
import type { SignalParam } from "../../common/Params.ts";
|
|
4
3
|
import { User, type UserEntity } from "../../oss/users/User.ts";
|
|
@@ -8,12 +7,12 @@ export declare class EnterpriseUser extends User {
|
|
|
8
7
|
roles: RoleReference[];
|
|
9
8
|
source: string;
|
|
10
9
|
constructor(properties: EnterpriseUserProperties, config: V3Config);
|
|
11
|
-
tokens({ signal }?: SignalParam): Promise<
|
|
10
|
+
tokens({ signal }?: SignalParam): Promise<import("ts-results-es").Result<{
|
|
12
11
|
createdAt: Date;
|
|
13
12
|
expiresAt: Date;
|
|
14
13
|
id: string;
|
|
15
14
|
label: string;
|
|
16
|
-
}[]>>;
|
|
15
|
+
}[], import("../index.ts").HttpError>>;
|
|
17
16
|
}
|
|
18
17
|
export type EnterpriseUserEntity = UserEntity & {
|
|
19
18
|
roles: RoleReference[];
|
|
@@ -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 { Err, Ok } from "ts-results-es";
|
|
17
16
|
import { User, userEntityToProperties } from "../../oss/users/User.js";
|
|
18
17
|
export class EnterpriseUser extends User {
|
|
19
18
|
#config;
|
|
@@ -31,14 +30,13 @@ export class EnterpriseUser extends User {
|
|
|
31
30
|
headers: { Accept: "application/json" },
|
|
32
31
|
signal,
|
|
33
32
|
})
|
|
34
|
-
.
|
|
35
|
-
.
|
|
33
|
+
.map((res) => res.json())
|
|
34
|
+
.map((response) => response.data.map((token) => ({
|
|
36
35
|
createdAt: new Date(token.createdAt),
|
|
37
36
|
expiresAt: new Date(token.expiresAt),
|
|
38
37
|
id: token.tid,
|
|
39
38
|
label: token.label,
|
|
40
|
-
})))
|
|
41
|
-
.catch((e) => Err(e));
|
|
39
|
+
}))).promise;
|
|
42
40
|
}
|
|
43
41
|
}
|
|
44
42
|
export const enterpriseUserEntityToProperties = (entity) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterpriseUser.js","sourceRoot":"","sources":["../../../src/enterprise/users/EnterpriseUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"EnterpriseUser.js","sourceRoot":"","sources":["../../../src/enterprise/users/EnterpriseUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,IAAI,EA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["/*\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 { V3Config } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { User, userEntityToProperties, type UserEntity } from \"../../oss/users/User.ts\";\nimport type { RoleReference } from \"../roles/Role.ts\";\n\ntype UserTokensResponse = {\n data: {\n tid: string;\n uid: string;\n label: string;\n createdAt: string;\n expiresAt: string;\n }[];\n};\n\nexport class EnterpriseUser extends User {\n #config: V3Config;\n\n roles: RoleReference[];\n source: string;\n\n constructor(properties: EnterpriseUserProperties, config: V3Config) {\n super(properties);\n this.#config = config;\n this.roles = properties.roles;\n this.source = properties.source;\n }\n\n tokens({ signal }: SignalParam = {}) {\n return this.#config\n .v3Request(`user/${this.id}/token`, {\n headers: { Accept: \"application/json\" },\n signal,\n })\n .map((res) => res.json() as Promise<UserTokensResponse>)\n .map((response) =>\n response.data.map((token) => ({\n createdAt: new Date(token.createdAt),\n expiresAt: new Date(token.expiresAt),\n id: token.tid,\n label: token.label,\n })),\n ).promise;\n }\n}\n\nexport type EnterpriseUserEntity = UserEntity & {\n roles: RoleReference[];\n source: string;\n};\n\nexport const enterpriseUserEntityToProperties = (entity: EnterpriseUserEntity) => ({\n ...userEntityToProperties(entity),\n roles: entity.roles,\n source: entity.source,\n});\n\nexport type EnterpriseUserProperties = ReturnType<typeof enterpriseUserEntityToProperties>;\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Err, Ok } from "ts-results-es";
|
|
2
1
|
import type { SonarV3Config, V3Config } from "../../common/Config.ts";
|
|
3
2
|
import { EnterpriseUser, type EnterpriseUserEntity } from "./EnterpriseUser.ts";
|
|
4
3
|
import type { SignalParam } from "../../common/Params.ts";
|
|
@@ -6,6 +5,6 @@ export declare class EnterpriseUsersResource {
|
|
|
6
5
|
#private;
|
|
7
6
|
constructor(config: SonarV3Config & V3Config);
|
|
8
7
|
_userFromEntity(entity: EnterpriseUserEntity): EnterpriseUser;
|
|
9
|
-
retrieveById(id: string, { signal }?: SignalParam): Promise<
|
|
10
|
-
retrieveByName(name: string, { signal }?: SignalParam): Promise<
|
|
8
|
+
retrieveById(id: string, { signal }?: SignalParam): Promise<import("ts-results-es").Result<EnterpriseUser, import("../index.ts").HttpError>>;
|
|
9
|
+
retrieveByName(name: string, { signal }?: SignalParam): Promise<import("ts-results-es").Result<EnterpriseUser, import("../index.ts").HttpError>>;
|
|
11
10
|
}
|
|
@@ -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 { Err, Ok } from "ts-results-es";
|
|
17
16
|
import { EnterpriseUser, enterpriseUserEntityToProperties, } from "./EnterpriseUser.js";
|
|
18
17
|
export class EnterpriseUsersResource {
|
|
19
18
|
#config;
|
|
@@ -26,16 +25,14 @@ export class EnterpriseUsersResource {
|
|
|
26
25
|
retrieveById(id, { signal } = {}) {
|
|
27
26
|
return this.#config
|
|
28
27
|
.sonarV3Request(`user/${id}`, { signal })
|
|
29
|
-
.
|
|
30
|
-
.
|
|
31
|
-
.catch((e) => Err(e));
|
|
28
|
+
.map((res) => res.json())
|
|
29
|
+
.map((entity) => this._userFromEntity(entity)).promise;
|
|
32
30
|
}
|
|
33
31
|
retrieveByName(name, { signal } = {}) {
|
|
34
32
|
return this.#config
|
|
35
33
|
.sonarV3Request(`user/by-name/${name}`, { signal })
|
|
36
|
-
.
|
|
37
|
-
.
|
|
38
|
-
.catch((e) => Err(e));
|
|
34
|
+
.map((res) => res.json())
|
|
35
|
+
.map((entity) => this._userFromEntity(entity)).promise;
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
//# sourceMappingURL=EnterpriseUsersResource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterpriseUsersResource.js","sourceRoot":"","sources":["../../../src/enterprise/users/EnterpriseUsersResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"EnterpriseUsersResource.js","sourceRoot":"","sources":["../../../src/enterprise/users/EnterpriseUsersResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,cAAc,EACd,gCAAgC,GAEjC,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,uBAAuB;IAClC,OAAO,CAA2B;IAElC,YAAY,MAAgC;QAC1C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,eAAe,CAAC,MAA4B;QAC1C,OAAO,IAAI,cAAc,CAAC,gCAAgC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACpF,CAAC;IAED,YAAY,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;QACnD,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;aACxC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAmC,CAAC;aACzD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAC3D,CAAC;IAED,cAAc,CAAC,IAAY,EAAE,EAAE,MAAM,KAAkB,EAAE;QACvD,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,gBAAgB,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;aAClD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAmC,CAAC;aACzD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAC3D,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 type { SonarV3Config, V3Config } from \"../../common/Config.ts\";\nimport {\n EnterpriseUser,\n enterpriseUserEntityToProperties,\n type EnterpriseUserEntity,\n} from \"./EnterpriseUser.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nexport class EnterpriseUsersResource {\n #config: SonarV3Config & V3Config;\n\n constructor(config: SonarV3Config & V3Config) {\n this.#config = config;\n }\n\n _userFromEntity(entity: EnterpriseUserEntity) {\n return new EnterpriseUser(enterpriseUserEntityToProperties(entity), this.#config);\n }\n\n retrieveById(id: string, { signal }: SignalParam = {}) {\n return this.#config\n .sonarV3Request(`user/${id}`, { signal })\n .map((res) => res.json() as Promise<EnterpriseUserEntity>)\n .map((entity) => this._userFromEntity(entity)).promise;\n }\n\n retrieveByName(name: string, { signal }: SignalParam = {}) {\n return this.#config\n .sonarV3Request(`user/by-name/${name}`, { signal })\n .map((res) => res.json() as Promise<EnterpriseUserEntity>)\n .map((entity) => this._userFromEntity(entity)).promise;\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ export declare class DatasetCatalogReference extends BaseCatalogReference {
|
|
|
9
9
|
type: `DATASET_${"DIRECT" | "PROMOTED" | "VIRTUAL"}`;
|
|
10
10
|
}, retrieveByPath: RetrieveByPath, config: SonarV3Config);
|
|
11
11
|
catalogObject(): Promise<Result<DatasetCatalogObject, unknown>>;
|
|
12
|
-
tags(): Promise<import("ts
|
|
12
|
+
tags(): Promise<Result<import("../CatalogTags.ts").CatalogTags, import("../../index.ts").HttpError>>;
|
|
13
13
|
}
|
|
14
14
|
export declare const mappedType: {
|
|
15
15
|
readonly PHYSICAL_DATASET: "DATASET_PROMOTED";
|
|
@@ -18,5 +18,5 @@ export declare class FolderCatalogReference extends BaseCatalogReference {
|
|
|
18
18
|
nextPageToken: string | undefined;
|
|
19
19
|
}>>;
|
|
20
20
|
};
|
|
21
|
-
wiki(): Promise<import("ts
|
|
21
|
+
wiki(): Promise<Result<import("../CatalogWiki.ts").CatalogWiki, import("../../index.ts").HttpError>>;
|
|
22
22
|
}
|
|
@@ -16,5 +16,5 @@ export declare class HomeCatalogReference extends BaseCatalogReference {
|
|
|
16
16
|
nextPageToken: string | undefined;
|
|
17
17
|
}>>;
|
|
18
18
|
};
|
|
19
|
-
wiki(): Promise<import("ts
|
|
19
|
+
wiki(): Promise<Result<import("../CatalogWiki.ts").CatalogWiki, import("../../index.ts").HttpError>>;
|
|
20
20
|
}
|
|
@@ -20,5 +20,5 @@ export declare class SourceCatalogReference extends BaseCatalogReference {
|
|
|
20
20
|
nextPageToken: string | undefined;
|
|
21
21
|
}>>;
|
|
22
22
|
};
|
|
23
|
-
wiki(): Promise<import("ts
|
|
23
|
+
wiki(): Promise<Result<import("../CatalogWiki.ts").CatalogWiki, import("../../index.ts").HttpError>>;
|
|
24
24
|
}
|
|
@@ -16,5 +16,5 @@ export declare class SpaceCatalogReference extends BaseCatalogReference {
|
|
|
16
16
|
nextPageToken: string | undefined;
|
|
17
17
|
}>>;
|
|
18
18
|
};
|
|
19
|
-
wiki(): Promise<import("ts
|
|
19
|
+
wiki(): Promise<Result<import("../CatalogWiki.ts").CatalogWiki, import("../../index.ts").HttpError>>;
|
|
20
20
|
}
|
|
@@ -28,6 +28,7 @@ export const catalogChildren = (catalogReference, config, retrieveByPath) => (ad
|
|
|
28
28
|
}
|
|
29
29
|
return config
|
|
30
30
|
.sonarV3Request(`catalog/by-path/${catalogReference.path.map(encodeURIComponent).join("/")}?${searchParams.toString()}`, { signal: params.signal })
|
|
31
|
+
.promise.then((result) => result.unwrap())
|
|
31
32
|
.then((res) => res.json())
|
|
32
33
|
.then((response) => {
|
|
33
34
|
return Ok({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogChildren.js","sourceRoot":"","sources":["../../../../../src/oss/catalog/CatalogReferences/utils/catalogChildren.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAG7F,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,gBAAkC,EAAE,MAAqB,EAAE,cAA8B,EAAE,EAAE,CAC9F,CAAC,mBAAwC,EAAE,EAAE,EAAE;IAC7C,MAAM,OAAO,GAAG,CAAC,SAAmD,EAAE,EAAE,EAAE;QACxE,MAAM,YAAY,GAAG,IAAI,eAAe,EAAE,CAAC;QAC3C,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACzB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QACtD,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;YACrC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,MAAM;aACV,cAAc,CACb,mBAAmB,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC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AK,CAAC;gBAC7B,CAAC;gBACD,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC;gBACtC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACrB,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YACzC,CAAC;QACH,CAAC;QACD,OAAO;KACR,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 { Err, Ok } from \"ts-results-es\";\nimport type { SonarV3Config } from \"../../../../common/Config.ts\";\nimport type { SignalParam } from \"../../../../common/Params.ts\";\nimport type { RetrieveByPath } from \"../BaseCatalogReference.ts\";\nimport { catalogReferenceFromProperties } from \"./catalogReferenceFromProperties.ts\";\nimport { catalogReferenceEntityToProperties } from \"./catalogReferenceEntityToProperties.ts\";\nimport type { CatalogReference } from \"../index.ts\";\n\nexport const catalogChildren =\n (catalogReference: CatalogReference, config: SonarV3Config, retrieveByPath: RetrieveByPath) =>\n (additionalParams: Record<string, any> = {}) => {\n const getPage = (params: { nextPageToken?: string } & SignalParam = {}) => {\n const searchParams = new URLSearchParams();\n searchParams.set(\"maxChildren\", \"100\");\n if (params.nextPageToken) {\n searchParams.set(\"pageToken\", params.nextPageToken);\n }\n for (const param in additionalParams) {\n searchParams.set(param, additionalParams[param]);\n }\n return config\n .sonarV3Request(\n `catalog/by-path/${catalogReference.path.map(encodeURIComponent).join(\"/\")}?${searchParams.toString()}`,\n { signal: params.signal },\n )\n .then((res) => res.json())\n .then((response: { children: unknown[]; nextPageToken?: string }) => {\n return Ok({\n data: response.children.map((entity: unknown) =>\n catalogReferenceFromProperties(\n catalogReferenceEntityToProperties(entity),\n config,\n retrieveByPath,\n ),\n ),\n nextPageToken: response.nextPageToken,\n });\n })\n .catch((e) => Err(e));\n };\n return {\n async *data({ signal }: SignalParam = {}) {\n const firstPageResult = await getPage({ signal });\n if (firstPageResult.isErr()) {\n throw firstPageResult.error;\n }\n const firstPage = firstPageResult.value;\n yield* firstPage.data;\n let nextPageToken = firstPage.nextPageToken;\n while (nextPageToken && !signal?.aborted) {\n const nextPageResult = await getPage({ nextPageToken, signal });\n if (nextPageResult.isErr()) {\n throw nextPageResult.error;\n }\n const nextPage = nextPageResult.value;\n yield* nextPage.data;\n nextPageToken = nextPage.nextPageToken;\n }\n },\n getPage,\n };\n };\n"]}
|
|
1
|
+
{"version":3,"file":"catalogChildren.js","sourceRoot":"","sources":["../../../../../src/oss/catalog/CatalogReferences/utils/catalogChildren.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAIxC,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAG7F,MAAM,CAAC,MAAM,eAAe,GAC1B,CAAC,gBAAkC,EAAE,MAAqB,EAAE,cAA8B,EAAE,EAAE,CAC9F,CAAC,mBAAwC,EAAE,EAAE,EAAE;IAC7C,MAAM,OAAO,GAAG,CAAC,SAAmD,EAAE,EAAE,EAAE;QACxE,MAAM,YAAY,GAAG,IAAI,eAAe,EAAE,CAAC;QAC3C,YAAY,CAAC,GAAG,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;QACvC,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACzB,YAAY,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QACtD,CAAC;QACD,KAAK,MAAM,KAAK,I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,IAAI,CAAC;YACtB,IAAI,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC;YAC5C,OAAO,aAAa,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC;gBACzC,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC;gBAChE,IAAI,cAAc,CAAC,KAAK,EAAE,EAAE,CAAC;oBAC3B,MAAM,cAAc,CAAC,KAAK,CAAC;gBAC7B,CAAC;gBACD,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC;gBACtC,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACrB,aAAa,GAAG,QAAQ,CAAC,aAAa,CAAC;YACzC,CAAC;QACH,CAAC;QACD,OAAO;KACR,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 { Err, Ok } from \"ts-results-es\";\nimport type { SonarV3Config } from \"../../../../common/Config.ts\";\nimport type { SignalParam } from \"../../../../common/Params.ts\";\nimport type { RetrieveByPath } from \"../BaseCatalogReference.ts\";\nimport { catalogReferenceFromProperties } from \"./catalogReferenceFromProperties.ts\";\nimport { catalogReferenceEntityToProperties } from \"./catalogReferenceEntityToProperties.ts\";\nimport type { CatalogReference } from \"../index.ts\";\n\nexport const catalogChildren =\n (catalogReference: CatalogReference, config: SonarV3Config, retrieveByPath: RetrieveByPath) =>\n (additionalParams: Record<string, any> = {}) => {\n const getPage = (params: { nextPageToken?: string } & SignalParam = {}) => {\n const searchParams = new URLSearchParams();\n searchParams.set(\"maxChildren\", \"100\");\n if (params.nextPageToken) {\n searchParams.set(\"pageToken\", params.nextPageToken);\n }\n for (const param in additionalParams) {\n searchParams.set(param, additionalParams[param]);\n }\n return config\n .sonarV3Request(\n `catalog/by-path/${catalogReference.path.map(encodeURIComponent).join(\"/\")}?${searchParams.toString()}`,\n { signal: params.signal },\n )\n .promise.then((result) => result.unwrap())\n .then((res) => res.json())\n .then((response: { children: unknown[]; nextPageToken?: string }) => {\n return Ok({\n data: response.children.map((entity: unknown) =>\n catalogReferenceFromProperties(\n catalogReferenceEntityToProperties(entity),\n config,\n retrieveByPath,\n ),\n ),\n nextPageToken: response.nextPageToken,\n });\n })\n .catch((e) => Err(e));\n };\n return {\n async *data({ signal }: SignalParam = {}) {\n const firstPageResult = await getPage({ signal });\n if (firstPageResult.isErr()) {\n throw firstPageResult.error;\n }\n const firstPage = firstPageResult.value;\n yield* firstPage.data;\n let nextPageToken = firstPage.nextPageToken;\n while (nextPageToken && !signal?.aborted) {\n const nextPageResult = await getPage({ nextPageToken, signal });\n if (nextPageResult.isErr()) {\n throw nextPageResult.error;\n }\n const nextPage = nextPageResult.value;\n yield* nextPage.data;\n nextPageToken = nextPage.nextPageToken;\n }\n },\n getPage,\n };\n };\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Err, Ok } from "ts-results-es";
|
|
2
1
|
import type { SonarV3Config } from "../../../../common/Config.ts";
|
|
3
2
|
import { CatalogTags } from "../../CatalogTags.ts";
|
|
4
3
|
import type { CatalogReference } from "../index.ts";
|
|
5
|
-
export declare const getTags: (config: SonarV3Config, catalogReference: CatalogReference) => () => Promise<
|
|
4
|
+
export declare const getTags: (config: SonarV3Config, catalogReference: CatalogReference) => () => Promise<import("ts-results-es").Result<CatalogTags, import("../../../index.ts").HttpError>>;
|
|
@@ -13,11 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Err, Ok } from "ts-results-es";
|
|
17
16
|
import { CatalogTags, catalogTagsEntityToProperties } from "../../CatalogTags.js";
|
|
18
17
|
export const getTags = (config, catalogReference) => () => config
|
|
19
18
|
.sonarV3Request(`catalog/${catalogReference.id}/collaboration/tag`)
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
.catch((e) => Err(e));
|
|
19
|
+
.map((res) => res.json())
|
|
20
|
+
.map((entity) => new CatalogTags(catalogTagsEntityToProperties(catalogReference, entity), config)).promise;
|
|
23
21
|
//# sourceMappingURL=getTags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTags.js","sourceRoot":"","sources":["../../../../../src/oss/catalog/CatalogReferences/utils/getTags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"getTags.js","sourceRoot":"","sources":["../../../../../src/oss/catalog/CatalogReferences/utils/getTags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAGlF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAqB,EAAE,gBAAkC,EAAE,EAAE,CAAC,GAAG,EAAE,CACzF,MAAM;KACH,cAAc,CAAC,WAAW,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;KAClE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;KACxB,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAC7F,CAAC,OAAO,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 { SonarV3Config } from \"../../../../common/Config.ts\";\nimport { CatalogTags, catalogTagsEntityToProperties } from \"../../CatalogTags.ts\";\nimport type { CatalogReference } from \"../index.ts\";\n\nexport const getTags = (config: SonarV3Config, catalogReference: CatalogReference) => () =>\n config\n .sonarV3Request(`catalog/${catalogReference.id}/collaboration/tag`)\n .map((res) => res.json())\n .map(\n (entity) => new CatalogTags(catalogTagsEntityToProperties(catalogReference, entity), config),\n ).promise;\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Err, Ok } from "ts-results-es";
|
|
2
1
|
import type { SonarV3Config } from "../../../../common/Config.ts";
|
|
3
2
|
import { CatalogWiki } from "../../CatalogWiki.ts";
|
|
4
3
|
import type { CatalogReference } from "../index.ts";
|
|
5
|
-
export declare const getWiki: (config: SonarV3Config, catalogReference: CatalogReference) => () => Promise<
|
|
4
|
+
export declare const getWiki: (config: SonarV3Config, catalogReference: CatalogReference) => () => Promise<import("ts-results-es").Result<CatalogWiki, import("../../../index.ts").HttpError>>;
|
|
@@ -13,11 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { Err, Ok } from "ts-results-es";
|
|
17
16
|
import { CatalogWiki, catalogWikiEntityToProperties } from "../../CatalogWiki.js";
|
|
18
17
|
export const getWiki = (config, catalogReference) => () => config
|
|
19
18
|
.sonarV3Request(`catalog/${catalogReference.id}/collaboration/wiki`)
|
|
20
|
-
.
|
|
21
|
-
.
|
|
22
|
-
.catch((e) => Err(e));
|
|
19
|
+
.map((res) => res.json())
|
|
20
|
+
.map((entity) => new CatalogWiki(catalogWikiEntityToProperties(catalogReference, entity), config)).promise;
|
|
23
21
|
//# sourceMappingURL=getWiki.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWiki.js","sourceRoot":"","sources":["../../../../../src/oss/catalog/CatalogReferences/utils/getWiki.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"getWiki.js","sourceRoot":"","sources":["../../../../../src/oss/catalog/CatalogReferences/utils/getWiki.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAGlF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,MAAqB,EAAE,gBAAkC,EAAE,EAAE,CAAC,GAAG,EAAE,CACzF,MAAM;KACH,cAAc,CAAC,WAAW,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;KACnE,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;KACxB,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,CAC7F,CAAC,OAAO,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 { SonarV3Config } from \"../../../../common/Config.ts\";\nimport { CatalogWiki, catalogWikiEntityToProperties } from \"../../CatalogWiki.ts\";\nimport type { CatalogReference } from \"../index.ts\";\n\nexport const getWiki = (config: SonarV3Config, catalogReference: CatalogReference) => () =>\n config\n .sonarV3Request(`catalog/${catalogReference.id}/collaboration/wiki`)\n .map((res) => res.json())\n .map(\n (entity) => new CatalogWiki(catalogWikiEntityToProperties(catalogReference, entity), config),\n ).promise;\n"]}
|
|
@@ -28,6 +28,7 @@ export class CatalogResource {
|
|
|
28
28
|
list() {
|
|
29
29
|
const getRoot = () => this.#config
|
|
30
30
|
.sonarV3Request("catalog")
|
|
31
|
+
.promise.then((result) => result.unwrap())
|
|
31
32
|
.then((res) => res.json())
|
|
32
33
|
.then((response) => response.data.map((entity) => catalogReferenceFromProperties(catalogReferenceEntityToProperties(entity), this.#config, this.retrieveByPath)));
|
|
33
34
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogResource.js","sourceRoot":"","sources":["../../../src/oss/catalog/CatalogResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,8BAA8B,EAAE,MAAM,6DAA6D,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,OAAO,eAAe;IAC1B,OAAO,CAAgB;IACvB,QAAQ,CAAkC;IAC1C,cAAc,CAAwC;IAEtD,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,IAAI;QACF,MAAM,OAAO,GAAG,GAAG,EAAE,CACnB,IAAI,CAAC,OAAO;aACT,cAAc,CAAC,SAAS,CAAC;aACzB,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAkC,CAAC;aACzD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,QAAQ,CAAC,IAAI,CAAC,GAAG,CACf,CAAC,MAAe,EAAE,EAAE,CAClB,8BAA8B,CAC5B,kCAAkC,CAAC,MAAM,CAAC,EAC1C,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,cAAc,CAKI,CAC5B,CACF,CAAC;QACN,OAAO;YACL,KAAK,CAAC,CAAC,IAAI;gBACT,KAAK,CAAC,CAAC,MAAM,OAAO,EAAE,CAAC;YACzB,CAAC;SACF,CAAC;IACJ,CAAC;IAED,2BAA2B,CAAC,MAAe;QACzC,OAAO,8BAA8B,CACnC,kCAAkC,CAAC,MAAM,CAAC,EAC1C,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,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 type { SonarV3Config } from \"../../common/Config.ts\";\nimport type {\n FunctionCatalogReference,\n HomeCatalogReference,\n SourceCatalogReference,\n SpaceCatalogReference,\n} from \"./CatalogReferences/index.ts\";\nimport { catalogReferenceEntityToProperties } from \"./CatalogReferences/utils/catalogReferenceEntityToProperties.ts\";\nimport { catalogReferenceFromProperties } from \"./CatalogReferences/utils/catalogReferenceFromProperties.ts\";\nimport { baseRetrieve, baseRetrieveByPath } from \"./catalogRetrieve.ts\";\n\nexport class CatalogResource {\n #config: SonarV3Config;\n retrieve: ReturnType<typeof baseRetrieve>;\n retrieveByPath: ReturnType<typeof baseRetrieveByPath>;\n\n constructor(config: SonarV3Config) {\n this.#config = config;\n this.retrieve = baseRetrieve(config);\n this.retrieveByPath = baseRetrieveByPath(config);\n }\n\n list() {\n const getRoot = () =>\n this.#config\n .sonarV3Request(\"catalog\")\n .then((res) => res.json() as Promise<{ data: unknown[] }>)\n .then((response) =>\n response.data.map(\n (entity: unknown) =>\n catalogReferenceFromProperties(\n catalogReferenceEntityToProperties(entity),\n this.#config,\n this.retrieveByPath,\n ) as\n | FunctionCatalogReference\n | HomeCatalogReference\n | SourceCatalogReference\n | SpaceCatalogReference,\n ),\n );\n return {\n async *data() {\n yield* await getRoot();\n },\n };\n }\n\n _catalogReferenceFromEntity(entity: unknown) {\n return catalogReferenceFromProperties(\n catalogReferenceEntityToProperties(entity),\n this.#config,\n this.retrieveByPath,\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CatalogResource.js","sourceRoot":"","sources":["../../../src/oss/catalog/CatalogResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EAAE,kCAAkC,EAAE,MAAM,iEAAiE,CAAC;AACrH,OAAO,EAAE,8BAA8B,EAAE,MAAM,6DAA6D,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,MAAM,OAAO,eAAe;IAC1B,OAAO,CAAgB;IACvB,QAAQ,CAAkC;IAC1C,cAAc,CAAwC;IAEtD,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,IAAI;QACF,MAAM,OAAO,GAAG,GAAG,EAAE,CACnB,IAAI,CAAC,OAAO;aACT,cAAc,CAAC,SAAS,CAAC;aACzB,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;aACzC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAkC,CAAC;aACzD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,QAAQ,CAAC,IAAI,CAAC,GAAG,CACf,CAAC,MAAe,EAAE,EAAE,CAClB,8BAA8B,CAC5B,kCAAkC,CAAC,MAAM,CAAC,EAC1C,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,cAAc,CAKI,CAC5B,CACF,CAAC;QACN,OAAO;YACL,KAAK,CAAC,CAAC,IAAI;gBACT,KAAK,CAAC,CAAC,MAAM,OAAO,EAAE,CAAC;YACzB,CAAC;SACF,CAAC;IACJ,CAAC;IAED,2BAA2B,CAAC,MAAe;QACzC,OAAO,8BAA8B,CACnC,kCAAkC,CAAC,MAAM,CAAC,EAC1C,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,cAAc,CACpB,CAAC;IACJ,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 type { SonarV3Config } from \"../../common/Config.ts\";\nimport type {\n FunctionCatalogReference,\n HomeCatalogReference,\n SourceCatalogReference,\n SpaceCatalogReference,\n} from \"./CatalogReferences/index.ts\";\nimport { catalogReferenceEntityToProperties } from \"./CatalogReferences/utils/catalogReferenceEntityToProperties.ts\";\nimport { catalogReferenceFromProperties } from \"./CatalogReferences/utils/catalogReferenceFromProperties.ts\";\nimport { baseRetrieve, baseRetrieveByPath } from \"./catalogRetrieve.ts\";\n\nexport class CatalogResource {\n #config: SonarV3Config;\n retrieve: ReturnType<typeof baseRetrieve>;\n retrieveByPath: ReturnType<typeof baseRetrieveByPath>;\n\n constructor(config: SonarV3Config) {\n this.#config = config;\n this.retrieve = baseRetrieve(config);\n this.retrieveByPath = baseRetrieveByPath(config);\n }\n\n list() {\n const getRoot = () =>\n this.#config\n .sonarV3Request(\"catalog\")\n .promise.then((result) => result.unwrap())\n .then((res) => res.json() as Promise<{ data: unknown[] }>)\n .then((response) =>\n response.data.map(\n (entity: unknown) =>\n catalogReferenceFromProperties(\n catalogReferenceEntityToProperties(entity),\n this.#config,\n this.retrieveByPath,\n ) as\n | FunctionCatalogReference\n | HomeCatalogReference\n | SourceCatalogReference\n | SpaceCatalogReference,\n ),\n );\n return {\n async *data() {\n yield* await getRoot();\n },\n };\n }\n\n _catalogReferenceFromEntity(entity: unknown) {\n return catalogReferenceFromProperties(\n catalogReferenceEntityToProperties(entity),\n this.#config,\n this.retrieveByPath,\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Err, Ok } from "ts-results-es";
|
|
2
1
|
import type { SonarV3Config } from "../../common/Config.ts";
|
|
3
2
|
import type { CatalogReference } from "../interfaces.ts";
|
|
4
|
-
import {
|
|
3
|
+
import { VersionConflictError } from "../../common/problems.ts";
|
|
5
4
|
export declare class CatalogTags {
|
|
6
5
|
#private;
|
|
7
6
|
readonly catalogReference: CatalogReference;
|
|
@@ -9,10 +8,7 @@ export declare class CatalogTags {
|
|
|
9
8
|
constructor(properties: CatalogTagsProperties, config: SonarV3Config);
|
|
10
9
|
update(properties: {
|
|
11
10
|
tags: string[];
|
|
12
|
-
}): Promise<
|
|
13
|
-
readonly title: "The version of the provided resource is older than the stored version";
|
|
14
|
-
readonly type: "https://api.dremio.dev/problems/version-conflict";
|
|
15
|
-
}> | Err<HttpError> | Ok<CatalogTags>>;
|
|
11
|
+
}): Promise<import("ts-results-es").Result<CatalogTags, import("../index.ts").HttpError | VersionConflictError>>;
|
|
16
12
|
}
|
|
17
13
|
export declare const catalogTagsEntityToProperties: (catalogReference: CatalogReference, entity: {
|
|
18
14
|
tags: string[];
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { HttpError } from "../../common/HttpError.js";
|
|
18
|
-
import { versionConflictError } from "../../common/problems.js";
|
|
16
|
+
import { VersionConflictError } from "../../common/problems.js";
|
|
19
17
|
export class CatalogTags {
|
|
20
18
|
catalogReference;
|
|
21
19
|
tags;
|
|
@@ -40,17 +38,14 @@ export class CatalogTags {
|
|
|
40
38
|
keepalive: true,
|
|
41
39
|
method: "POST",
|
|
42
40
|
})
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
if (e
|
|
47
|
-
|
|
48
|
-
return Err(versionConflictError);
|
|
49
|
-
}
|
|
50
|
-
return Err(e);
|
|
41
|
+
.map((res) => res.json())
|
|
42
|
+
.map((entity) => new CatalogTags(catalogTagsEntityToProperties(this.catalogReference, entity), this.#config))
|
|
43
|
+
.mapErr((e) => {
|
|
44
|
+
if (e.status === 409) {
|
|
45
|
+
return new VersionConflictError();
|
|
51
46
|
}
|
|
52
|
-
|
|
53
|
-
});
|
|
47
|
+
return e;
|
|
48
|
+
}).promise;
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
export const catalogTagsEntityToProperties = (catalogReference, entity) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogTags.js","sourceRoot":"","sources":["../../../src/oss/catalog/CatalogTags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"CatalogTags.js","sourceRoot":"","sources":["../../../src/oss/catalog/CatalogTags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,OAAO,WAAW;I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;IACJ,GAAG,MAAM;IACT,gBAAgB;CACjB,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 { SonarV3Config } from \"../../common/Config.ts\";\nimport type { CatalogReference } from \"../interfaces.ts\";\nimport { VersionConflictError } from \"../../common/problems.ts\";\n\nexport class CatalogTags {\n readonly catalogReference: CatalogReference;\n readonly tags: string[];\n\n #version: CatalogTagsProperties[\"version\"];\n #config: SonarV3Config;\n\n constructor(properties: CatalogTagsProperties, config: SonarV3Config) {\n this.catalogReference = properties.catalogReference;\n this.tags = properties.tags;\n this.#version = properties.version;\n this.#config = config;\n }\n\n update(properties: { tags: string[] }) {\n return this.#config\n .sonarV3Request(`catalog/${this.catalogReference.id}/collaboration/tag`, {\n body: JSON.stringify({\n tags: properties.tags,\n version: this.#version,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json())\n .map(\n (entity) =>\n new CatalogTags(\n catalogTagsEntityToProperties(this.catalogReference, entity),\n this.#config,\n ),\n )\n .mapErr((e) => {\n if (e.status === 409) {\n return new VersionConflictError();\n }\n return e;\n }).promise;\n }\n}\n\nexport const catalogTagsEntityToProperties = (\n catalogReference: CatalogReference,\n entity: {\n tags: string[];\n version: number;\n },\n) => ({\n ...entity,\n catalogReference,\n});\n\ntype CatalogTagsProperties = ReturnType<typeof catalogTagsEntityToProperties>;\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Err, Ok } from "ts-results-es";
|
|
2
1
|
import type { SonarV3Config } from "../../common/Config.ts";
|
|
3
2
|
import type { CatalogReference } from "../interfaces.ts";
|
|
4
|
-
import {
|
|
3
|
+
import { VersionConflictError } from "../../common/problems.ts";
|
|
5
4
|
export declare class CatalogWiki {
|
|
6
5
|
#private;
|
|
7
6
|
readonly catalogReference: CatalogReference;
|
|
@@ -9,10 +8,7 @@ export declare class CatalogWiki {
|
|
|
9
8
|
constructor(properties: CatalogWikiProperties, config: SonarV3Config);
|
|
10
9
|
update(properties: {
|
|
11
10
|
text: string;
|
|
12
|
-
}): Promise<
|
|
13
|
-
readonly title: "The version of the provided resource is older than the stored version";
|
|
14
|
-
readonly type: "https://api.dremio.dev/problems/version-conflict";
|
|
15
|
-
}> | Err<HttpError>>;
|
|
11
|
+
}): Promise<import("ts-results-es").Result<CatalogWiki, import("../index.ts").HttpError | VersionConflictError>>;
|
|
16
12
|
}
|
|
17
13
|
export declare const catalogWikiEntityToProperties: (catalogReference: CatalogReference, entity: {
|
|
18
14
|
text: string;
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
import { HttpError } from "../../common/HttpError.js";
|
|
18
|
-
import { versionConflictError } from "../../common/problems.js";
|
|
16
|
+
import { VersionConflictError } from "../../common/problems.js";
|
|
19
17
|
export class CatalogWiki {
|
|
20
18
|
catalogReference;
|
|
21
19
|
text;
|
|
@@ -40,17 +38,14 @@ export class CatalogWiki {
|
|
|
40
38
|
keepalive: true,
|
|
41
39
|
method: "POST",
|
|
42
40
|
})
|
|
43
|
-
.
|
|
44
|
-
.
|
|
45
|
-
.
|
|
46
|
-
if (e
|
|
47
|
-
|
|
48
|
-
return Err(versionConflictError);
|
|
49
|
-
}
|
|
50
|
-
return Err(e);
|
|
41
|
+
.map((res) => res.json())
|
|
42
|
+
.map((entity) => new CatalogWiki(catalogWikiEntityToProperties(this.catalogReference, entity), this.#config))
|
|
43
|
+
.mapErr((e) => {
|
|
44
|
+
if (e.status === 409) {
|
|
45
|
+
return new VersionConflictError();
|
|
51
46
|
}
|
|
52
|
-
|
|
53
|
-
});
|
|
47
|
+
return e;
|
|
48
|
+
}).promise;
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
export const catalogWikiEntityToProperties = (catalogReference, entity) => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogWiki.js","sourceRoot":"","sources":["../../../src/oss/catalog/CatalogWiki.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"CatalogWiki.js","sourceRoot":"","sources":["../../../src/oss/catalog/CatalogWiki.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,MAAM,OAAO,WAAW;IACb,gBAAgB,CAAmB;IACnC,IAAI,CAAgC;IAE7C,QAAQ,CAAmC;IAC3C,OAAO,CAAgB;IAEvB,YAAY,UAAiC,EAAE,MAAqB;QAClE,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,UAA4B;QACjC,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,gBAAgB,CAAC,EAAE,qBAAqB,EAAE;YACxE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,OAAO,EAAE,IAAI,CAAC,QAAQ;aACvB,CAAC;YACF,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,MAAM;SACf,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACxB,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CACT,IAAI,WAAW,CACb,6BAA6B,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAC5D,IAAI,CAAC,OAAO,CACb,CACJ;aACA,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;YACZ,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACrB,OAAO,IAAI,oBAAoB,EAAE,CAAC;YACpC,CAAC;YACD,OAAO,CAAC,CAAC;QACX,CAAC,CAAC,CAAC,OAAO,CAAC;IACf,CAAC;CACF;AAED,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,gBAAkC,EAClC,MAGC,EACD,EAAE,CAAC,CAAC;IACJ,GAAG,MAAM;IACT,gBAAgB;CACjB,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 { SonarV3Config } from \"../../common/Config.ts\";\nimport type { CatalogReference } from \"../interfaces.ts\";\nimport { VersionConflictError } from \"../../common/problems.ts\";\n\nexport class CatalogWiki {\n readonly catalogReference: CatalogReference;\n readonly text: CatalogWikiProperties[\"text\"];\n\n #version: CatalogWikiProperties[\"version\"];\n #config: SonarV3Config;\n\n constructor(properties: CatalogWikiProperties, config: SonarV3Config) {\n this.catalogReference = properties.catalogReference;\n this.text = properties.text;\n this.#version = properties.version;\n this.#config = config;\n }\n\n update(properties: { text: string }) {\n return this.#config\n .sonarV3Request(`catalog/${this.catalogReference.id}/collaboration/wiki`, {\n body: JSON.stringify({\n text: properties.text,\n version: this.#version,\n }),\n headers: {\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"POST\",\n })\n .map((res) => res.json())\n .map(\n (entity) =>\n new CatalogWiki(\n catalogWikiEntityToProperties(this.catalogReference, entity),\n this.#config,\n ),\n )\n .mapErr((e) => {\n if (e.status === 409) {\n return new VersionConflictError();\n }\n return e;\n }).promise;\n }\n}\n\nexport const catalogWikiEntityToProperties = (\n catalogReference: CatalogReference,\n entity: {\n text: string;\n version: number;\n },\n) => ({\n ...entity,\n catalogReference,\n});\n\ntype CatalogWikiProperties = ReturnType<typeof catalogWikiEntityToProperties>;\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly detail: "`path` parameter is required and cannot be empty";
|
|
4
|
-
readonly pointer: "#/path";
|
|
5
|
-
readonly type: "https://api.dremio.dev/problems/validation/min-length";
|
|
6
|
-
}];
|
|
7
|
-
readonly title: "There was a problem validating the content of the request";
|
|
8
|
-
readonly type: "https://api.dremio.dev/problems/validation-problem";
|
|
9
|
-
};
|
|
1
|
+
import { Problem, ValidationProblem } from "../../common/Problem.js";
|
|
2
|
+
export declare const emptyPathError: ValidationProblem;
|
|
10
3
|
/**
|
|
11
4
|
* Generic problem for when we don't know what specifically caused the retrieval
|
|
12
5
|
* to fail.
|
|
13
6
|
*/
|
|
14
|
-
export declare const unableToRetrieveProblem: (internalErrorMessage?: string) =>
|
|
15
|
-
readonly detail: string | undefined;
|
|
16
|
-
readonly title: "We were unable to fetch details for this catalog object";
|
|
17
|
-
readonly type: "https://api.dremio.dev/problems/catalog/failed-to-retrieve";
|
|
18
|
-
};
|
|
7
|
+
export declare const unableToRetrieveProblem: (internalErrorMessage?: string) => Problem<"https://api.dremio.dev/problems/catalog/failed-to-retrieve", undefined>;
|