@dremio/js-sdk 0.9.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 +8 -7
- package/dist/cloud/arctic/ArcticResource.js +27 -20
- 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 +8 -11
- package/dist/cloud/engines/EnginesResource.js +25 -23
- package/dist/cloud/engines/EnginesResource.js.map +1 -1
- package/dist/cloud/index.d.ts +33 -214
- 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 +9 -8
- package/dist/cloud/oauth/OAuthApplicationsResource.js +35 -31
- package/dist/cloud/oauth/OAuthApplicationsResource.js.map +1 -1
- package/dist/cloud/projects/Project.d.ts +4 -4
- package/dist/cloud/projects/Project.js +5 -5
- package/dist/cloud/projects/Project.js.map +1 -1
- package/dist/cloud/projects/ProjectsResource.d.ts +11 -13
- package/dist/cloud/projects/ProjectsResource.js +42 -30
- package/dist/cloud/projects/ProjectsResource.js.map +1 -1
- package/dist/cloud/resources.d.ts +39 -209
- package/dist/cloud/resources.js +9 -9
- package/dist/cloud/resources.js.map +1 -1
- package/dist/cloud/users/CloudUsersResource.d.ts +8 -11
- package/dist/cloud/users/CloudUsersResource.js +19 -18
- 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 -34
- 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/Query.js +1 -2
- package/dist/common/Query.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/CatalogObjects/index.d.ts +1 -2
- package/dist/enterprise/catalog/CatalogObjects/index.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.d.ts +9 -6
- package/dist/enterprise/catalog/EnterpriseCatalogResource.js +25 -19
- package/dist/enterprise/catalog/EnterpriseCatalogResource.js.map +1 -1
- package/dist/enterprise/catalog/catalogObjectFromEntity.js +0 -8
- package/dist/enterprise/catalog/catalogObjectFromEntity.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 +12 -45
- package/dist/enterprise/index.js +0 -1
- package/dist/enterprise/index.js.map +1 -1
- package/dist/enterprise/resources.d.ts +10 -36
- package/dist/enterprise/resources.js +5 -5
- package/dist/enterprise/resources.js.map +1 -1
- package/dist/enterprise/roles/RolesResource.d.ts +6 -5
- package/dist/enterprise/roles/RolesResource.js +16 -13
- package/dist/enterprise/roles/RolesResource.js.map +1 -1
- package/dist/enterprise/scripts/EnterpriseScript.d.ts +4 -14
- package/dist/enterprise/scripts/EnterpriseScript.js +4 -6
- package/dist/enterprise/scripts/EnterpriseScript.js.map +1 -1
- package/dist/enterprise/scripts/EnterpriseScriptsResource.d.ts +13 -7
- package/dist/enterprise/scripts/EnterpriseScriptsResource.js +24 -55
- package/dist/enterprise/scripts/EnterpriseScriptsResource.js.map +1 -1
- package/dist/enterprise/users/EnterpriseUser.d.ts +8 -5
- package/dist/enterprise/users/EnterpriseUser.js +3 -5
- package/dist/enterprise/users/EnterpriseUser.js.map +1 -1
- package/dist/enterprise/users/EnterpriseUsersResource.d.ts +9 -10
- package/dist/enterprise/users/EnterpriseUsersResource.js +20 -14
- package/dist/enterprise/users/EnterpriseUsersResource.js.map +1 -1
- package/dist/oss/catalog/CatalogObjects/index.d.ts +2 -3
- package/dist/oss/catalog/CatalogObjects/index.js.map +1 -1
- package/dist/oss/catalog/CatalogObjects/utils/catalogObjectFromEntity.d.ts +1 -2
- package/dist/oss/catalog/CatalogObjects/utils/catalogObjectFromEntity.js +0 -8
- package/dist/oss/catalog/CatalogObjects/utils/catalogObjectFromEntity.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/SourceCatalogReference.js +4 -4
- package/dist/oss/catalog/CatalogReferences/SourceCatalogReference.js.map +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.d.ts +9 -6
- package/dist/oss/catalog/CatalogResource.js +25 -19
- 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/VersionReference.d.ts +12 -12
- package/dist/oss/catalog/VersionReference.js +18 -3
- package/dist/oss/catalog/VersionReference.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 +8 -39
- package/dist/oss/index.js +0 -1
- package/dist/oss/index.js.map +1 -1
- package/dist/oss/interfaces.d.ts +2 -2
- package/dist/oss/interfaces.js +1 -0
- package/dist/oss/interfaces.js.map +1 -1
- package/dist/oss/jobs/Job.d.ts +5 -45
- package/dist/oss/jobs/Job.js +7 -27
- package/dist/oss/jobs/Job.js.map +1 -1
- package/dist/oss/jobs/JobsResource.d.ts +11 -8
- package/dist/oss/jobs/JobsResource.js +52 -46
- package/dist/oss/jobs/JobsResource.js.map +1 -1
- package/dist/oss/jobs/utils/jobEntityToProperties.d.ts +40 -0
- package/dist/oss/jobs/utils/jobEntityToProperties.js +34 -0
- package/dist/oss/jobs/utils/jobEntityToProperties.js.map +1 -0
- package/dist/oss/resources.d.ts +8 -36
- package/dist/oss/resources.js +4 -8
- package/dist/oss/resources.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 +24 -7
- package/dist/oss/scripts/ScriptsResource.js +57 -51
- package/dist/oss/scripts/ScriptsResource.js.map +1 -1
- package/dist/oss/users/User.d.ts +9 -10
- package/dist/oss/users/User.js.map +1 -1
- package/dist/oss/users/UsersResource.d.ts +9 -10
- package/dist/oss/users/UsersResource.js +19 -13
- package/dist/oss/users/UsersResource.js.map +1 -1
- package/package.json +11 -13
- package/dist/cloud/projects/projectApiMethods.d.ts +0 -9
- package/dist/cloud/projects/projectApiMethods.js +0 -43
- package/dist/cloud/projects/projectApiMethods.js.map +0 -1
- package/dist/oss/catalog/CatalogObjects/VersionedDatasetCatalogObject.d.ts +0 -31
- package/dist/oss/catalog/CatalogObjects/VersionedDatasetCatalogObject.js +0 -58
- package/dist/oss/catalog/CatalogObjects/VersionedDatasetCatalogObject.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Config } from "../common/Config.ts";
|
|
2
|
-
import { Resources } from "./resources.ts";
|
|
3
2
|
export declare const Dremio: (config: Config) => {
|
|
4
3
|
_request: import("../common/Config.ts").RequestFn;
|
|
5
4
|
_sonarResourceConfig: {
|
|
@@ -11,53 +10,21 @@ export declare const Dremio: (config: Config) => {
|
|
|
11
10
|
} | undefined;
|
|
12
11
|
origin: string;
|
|
13
12
|
request: import("../common/Config.ts").RequestFn;
|
|
14
|
-
sonarV2Request: (path: string, init: RequestInit | undefined) =>
|
|
15
|
-
sonarV3Request: (path: string, init: RequestInit | undefined) =>
|
|
16
|
-
sonarV4Request: (path: string, init: RequestInit | undefined) =>
|
|
17
|
-
v3Request: (path: string, init: RequestInit | undefined) =>
|
|
18
|
-
};
|
|
19
|
-
_sonarV2Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
|
|
20
|
-
_sonarV3Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
|
|
21
|
-
_sonarV4Request: (path: string, init: RequestInit | undefined) => Promise<Response>;
|
|
22
|
-
catalog: {
|
|
23
|
-
_catalogReferenceFromEntity: (entity: unknown) => import("./interfaces.ts").EnterpriseCatalogReference;
|
|
24
|
-
list: () => {
|
|
25
|
-
data(): AsyncGenerator<import("./interfaces.ts").EnterpriseFunctionCatalogReference | import("./interfaces.ts").EnterpriseHomeCatalogReference | import("./interfaces.ts").EnterpriseSourceCatalogReference | import("./interfaces.ts").EnterpriseSpaceCatalogReference, void, unknown>;
|
|
26
|
-
};
|
|
27
|
-
retrieve: (key: string) => Promise<import("ts-results-es").Result<import("./interfaces.ts").EnterpriseCatalogObject, unknown>>;
|
|
28
|
-
retrieveByPath: (key: string[]) => Promise<import("ts-results-es").Result<import("./interfaces.ts").EnterpriseCatalogObject, unknown>>;
|
|
13
|
+
sonarV2Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
14
|
+
sonarV3Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
15
|
+
sonarV4Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
16
|
+
v3Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
29
17
|
};
|
|
18
|
+
_sonarV2Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
19
|
+
_sonarV3Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
20
|
+
_sonarV4Request: (path: string, init: RequestInit | undefined) => import("ts-results-es").AsyncResult<Response, import("../common/HttpError.ts").HttpError>;
|
|
21
|
+
catalog: import("./catalog/EnterpriseCatalogResource.ts").EnterpriseCatalogResource;
|
|
30
22
|
engines: import("./engines/EnginesResource.ts").EnginesResource;
|
|
31
|
-
jobs:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("../oss/jobs/Job.ts").JobResult>;
|
|
36
|
-
};
|
|
37
|
-
roles: {
|
|
38
|
-
retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Result<import("./interfaces.ts").Role, unknown>>;
|
|
39
|
-
retrieveByName: (name: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Result<import("./interfaces.ts").Role, unknown>>;
|
|
40
|
-
};
|
|
41
|
-
scripts: {
|
|
42
|
-
list(): {
|
|
43
|
-
data({ signal }?: import("../common/Params.ts").SignalParam): AsyncGenerator<import("./interfaces.ts").EnterpriseScript, void, unknown>;
|
|
44
|
-
};
|
|
45
|
-
retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseScript>>;
|
|
46
|
-
store: (properties: {
|
|
47
|
-
name: string;
|
|
48
|
-
query: import("../common/Query.ts").Query;
|
|
49
|
-
}) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseScript>>;
|
|
50
|
-
};
|
|
51
|
-
users: {
|
|
52
|
-
retrieveById: (id: string, { signal }?: {
|
|
53
|
-
signal?: AbortSignal;
|
|
54
|
-
}) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseUser>>;
|
|
55
|
-
retrieveByName: (name: string, { signal }?: {
|
|
56
|
-
signal?: AbortSignal;
|
|
57
|
-
}) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseUser>>;
|
|
58
|
-
};
|
|
23
|
+
jobs: import("../oss/jobs/JobsResource.ts").JobsResource;
|
|
24
|
+
roles: import("./roles/RolesResource.ts").RolesResource;
|
|
25
|
+
scripts: import("./scripts/EnterpriseScriptsResource.ts").EnterpriseScriptsResource;
|
|
26
|
+
users: import("./users/EnterpriseUsersResource.ts").EnterpriseUsersResource;
|
|
59
27
|
};
|
|
60
28
|
export * from "../common/sharedExports.ts";
|
|
61
29
|
export * from "./credentials/index.ts";
|
|
62
30
|
export * from "./interfaces.ts";
|
|
63
|
-
export { Resources as _Resources };
|
package/dist/enterprise/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enterprise/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,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,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;KACwB,CAAC;AACxF,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;QACnD,eAAe,EAAE,mBAAmB,CAAC,cAAc;KACpD,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/enterprise/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAS3D,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,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;KACwB,CAAC;AACxF,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;QACnD,eAAe,EAAE,mBAAmB,CAAC,cAAc;KACpD,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,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 SonarV4Config,\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 sonarV4Request: (path, init) => request(`/api/v4/${path}`, init),\n v3Request: (path, init) => request(`/api/v3/${path}`, init),\n } satisfies ResourceConfig & SonarV2Config & SonarV3Config & SonarV4Config & 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 _sonarV4Request: sonarResourceConfig.sonarV4Request,\n };\n};\n\nexport * from \"../common/sharedExports.ts\";\nexport * from \"./credentials/index.ts\";\nexport * from \"./interfaces.ts\";\n"]}
|
|
@@ -1,45 +1,19 @@
|
|
|
1
1
|
import type { ResourceConfig, SonarV2Config, SonarV3Config, SonarV4Config, V3Config } from "../common/Config.ts";
|
|
2
|
+
import { JobsResource } from "../oss/jobs/JobsResource.ts";
|
|
3
|
+
import { EnterpriseCatalogResource } from "./catalog/EnterpriseCatalogResource.ts";
|
|
4
|
+
import { RolesResource } from "./roles/RolesResource.ts";
|
|
5
|
+
import { EnterpriseScriptsResource } from "./scripts/EnterpriseScriptsResource.ts";
|
|
6
|
+
import { EnterpriseUsersResource } from "./users/EnterpriseUsersResource.ts";
|
|
2
7
|
import { EnginesResource } from "./engines/EnginesResource.ts";
|
|
3
8
|
/**
|
|
4
9
|
* @internal
|
|
5
10
|
* @hidden
|
|
6
11
|
*/
|
|
7
12
|
export declare const Resources: (config: ResourceConfig & SonarV2Config & SonarV3Config & SonarV4Config & V3Config) => {
|
|
8
|
-
catalog:
|
|
9
|
-
_catalogReferenceFromEntity: (entity: unknown) => import("./interfaces.ts").EnterpriseCatalogReference;
|
|
10
|
-
list: () => {
|
|
11
|
-
data(): AsyncGenerator<import("./interfaces.ts").EnterpriseFunctionCatalogReference | import("./interfaces.ts").EnterpriseHomeCatalogReference | import("./interfaces.ts").EnterpriseSourceCatalogReference | import("./interfaces.ts").EnterpriseSpaceCatalogReference, void, unknown>;
|
|
12
|
-
};
|
|
13
|
-
retrieve: (key: string) => Promise<import("ts-results-es").Result<import("./interfaces.ts").EnterpriseCatalogObject, unknown>>;
|
|
14
|
-
retrieveByPath: (key: string[]) => Promise<import("ts-results-es").Result<import("./interfaces.ts").EnterpriseCatalogObject, unknown>>;
|
|
15
|
-
};
|
|
13
|
+
catalog: EnterpriseCatalogResource;
|
|
16
14
|
engines: EnginesResource;
|
|
17
|
-
jobs:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("../oss/jobs/Job.ts").JobResult>;
|
|
22
|
-
};
|
|
23
|
-
roles: {
|
|
24
|
-
retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Result<import("./interfaces.ts").Role, unknown>>;
|
|
25
|
-
retrieveByName: (name: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Result<import("./interfaces.ts").Role, unknown>>;
|
|
26
|
-
};
|
|
27
|
-
scripts: {
|
|
28
|
-
list(): {
|
|
29
|
-
data({ signal }?: import("../common/Params.ts").SignalParam): AsyncGenerator<import("./interfaces.ts").EnterpriseScript, void, unknown>;
|
|
30
|
-
};
|
|
31
|
-
retrieve: (id: string, { signal }?: import("../common/Params.ts").SignalParam) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseScript>>;
|
|
32
|
-
store: (properties: {
|
|
33
|
-
name: string;
|
|
34
|
-
query: import("./index.ts").Query;
|
|
35
|
-
}) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseScript>>;
|
|
36
|
-
};
|
|
37
|
-
users: {
|
|
38
|
-
retrieveById: (id: string, { signal }?: {
|
|
39
|
-
signal?: AbortSignal;
|
|
40
|
-
}) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseUser>>;
|
|
41
|
-
retrieveByName: (name: string, { signal }?: {
|
|
42
|
-
signal?: AbortSignal;
|
|
43
|
-
}) => Promise<import("ts-results-es").Err<unknown> | import("ts-results-es").Ok<import("./interfaces.ts").EnterpriseUser>>;
|
|
44
|
-
};
|
|
15
|
+
jobs: JobsResource;
|
|
16
|
+
roles: RolesResource;
|
|
17
|
+
scripts: EnterpriseScriptsResource;
|
|
18
|
+
users: EnterpriseUsersResource;
|
|
45
19
|
};
|
|
@@ -26,11 +26,11 @@ import { EnginesResource } from "./engines/EnginesResource.js";
|
|
|
26
26
|
*/
|
|
27
27
|
export const Resources = (config) => ({
|
|
28
28
|
...CommunityResources(config),
|
|
29
|
-
catalog: EnterpriseCatalogResource(config),
|
|
29
|
+
catalog: new EnterpriseCatalogResource(config),
|
|
30
30
|
engines: new EnginesResource(config),
|
|
31
|
-
jobs: JobsResource(config),
|
|
32
|
-
roles: RolesResource(config),
|
|
33
|
-
scripts: EnterpriseScriptsResource(config),
|
|
34
|
-
users: EnterpriseUsersResource(config),
|
|
31
|
+
jobs: new JobsResource(config),
|
|
32
|
+
roles: new RolesResource(config),
|
|
33
|
+
scripts: new EnterpriseScriptsResource(config),
|
|
34
|
+
users: new EnterpriseUsersResource(config),
|
|
35
35
|
});
|
|
36
36
|
//# sourceMappingURL=resources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/enterprise/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,MAAiF,EACjF,EAAE,CAAC,CAAC;IACJ,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../../src/enterprise/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,MAAiF,EACjF,EAAE,CAAC,CAAC;IACJ,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC7B,OAAO,EAAE,IAAI,yBAAyB,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,IAAI,eAAe,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,IAAI,YAAY,CAAC,MAAM,CAAC;IAC9B,KAAK,EAAE,IAAI,aAAa,CAAC,MAAM,CAAC;IAChC,OAAO,EAAE,IAAI,yBAAyB,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,IAAI,uBAAuB,CAAC,MAAM,CAAC;CAC3C,CAAC,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type {\n ResourceConfig,\n SonarV2Config,\n SonarV3Config,\n SonarV4Config,\n V3Config,\n} from \"../common/Config.ts\";\nimport { JobsResource } from \"../oss/jobs/JobsResource.ts\";\nimport { Resources as CommunityResources } from \"../oss/resources.ts\";\nimport { EnterpriseCatalogResource } from \"./catalog/EnterpriseCatalogResource.ts\";\nimport { RolesResource } from \"./roles/RolesResource.ts\";\nimport { EnterpriseScriptsResource } from \"./scripts/EnterpriseScriptsResource.ts\";\nimport { EnterpriseUsersResource } from \"./users/EnterpriseUsersResource.ts\";\nimport { EnginesResource } from \"./engines/EnginesResource.ts\";\n\n/**\n * @internal\n * @hidden\n */\nexport const Resources = (\n config: ResourceConfig & SonarV2Config & SonarV3Config & SonarV4Config & V3Config,\n) => ({\n ...CommunityResources(config),\n catalog: new EnterpriseCatalogResource(config),\n engines: new EnginesResource(config),\n jobs: new JobsResource(config),\n roles: new RolesResource(config),\n scripts: new EnterpriseScriptsResource(config),\n users: new EnterpriseUsersResource(config),\n});\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type Result } from "ts-results-es";
|
|
2
1
|
import type { SonarV3Config } from "../../common/Config.ts";
|
|
3
2
|
import { Role } from "./Role.ts";
|
|
4
3
|
import type { SignalParam } from "../../common/Params.ts";
|
|
5
|
-
export declare
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
4
|
+
export declare class RolesResource {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(config: SonarV3Config);
|
|
7
|
+
retrieve(id: string, { signal }?: SignalParam): Promise<import("ts-results-es").Result<Role, import("../index.ts").HttpError>>;
|
|
8
|
+
retrieveByName(name: string, { signal }?: SignalParam): Promise<import("ts-results-es").Result<Role, import("../index.ts").HttpError>>;
|
|
9
|
+
}
|
|
@@ -13,20 +13,23 @@
|
|
|
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 { Role } from "./Role.js";
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
export class RolesResource {
|
|
18
|
+
#config;
|
|
19
|
+
constructor(config) {
|
|
20
|
+
this.#config = config;
|
|
21
|
+
}
|
|
22
|
+
retrieve(id, { signal } = {}) {
|
|
23
|
+
return this.#config
|
|
21
24
|
.sonarV3Request(`role/${id}`, { signal })
|
|
22
|
-
.
|
|
23
|
-
.
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
.map((res) => res.json())
|
|
26
|
+
.map((properties) => Role.fromResource(properties)).promise;
|
|
27
|
+
}
|
|
28
|
+
retrieveByName(name, { signal } = {}) {
|
|
29
|
+
return this.#config
|
|
26
30
|
.sonarV3Request(`role/by-name/${name}`, { signal })
|
|
27
|
-
.
|
|
28
|
-
.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
31
|
+
.map((res) => res.json())
|
|
32
|
+
.map((properties) => Role.fromResource(properties)).promise;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
32
35
|
//# sourceMappingURL=RolesResource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RolesResource.js","sourceRoot":"","sources":["../../../src/enterprise/roles/RolesResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"RolesResource.js","sourceRoot":"","sources":["../../../src/enterprise/roles/RolesResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,MAAM,OAAO,aAAa;IACxB,OAAO,CAAgB;IAEvB,YAAY,MAAqB;QAC/B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,EAAE,MAAM,KAAkB,EAAE;QAC/C,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,EAAE,CAAC;aACxB,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IAChE,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,EAAE,CAAC;aACxB,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC;IAChE,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 { Role } from \"./Role.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\n\nexport class RolesResource {\n #config: SonarV3Config;\n\n constructor(config: SonarV3Config) {\n this.#config = config;\n }\n\n retrieve(id: string, { signal }: SignalParam = {}) {\n return this.#config\n .sonarV3Request(`role/${id}`, { signal })\n .map((res) => res.json())\n .map((properties) => Role.fromResource(properties)).promise;\n }\n\n retrieveByName(name: string, { signal }: SignalParam = {}) {\n return this.#config\n .sonarV3Request(`role/by-name/${name}`, { signal })\n .map((res) => res.json())\n .map((properties) => Role.fromResource(properties)).promise;\n }\n}\n"]}
|
|
@@ -2,34 +2,24 @@ import type { SonarV3Config } from "../../common/Config.ts";
|
|
|
2
2
|
import type { RoleGrantee, UserGrantee } from "../Grantee.ts";
|
|
3
3
|
import type { Ownable } from "../Ownable.ts";
|
|
4
4
|
import { Script, type ScriptEntity, type ScriptPatchableProperties } from "../../oss/scripts/Script.ts";
|
|
5
|
-
import { Err, Ok } from "ts-results-es";
|
|
6
5
|
import type { SignalParam } from "../../common/Params.ts";
|
|
7
6
|
export declare class EnterpriseScript extends Script implements Ownable {
|
|
8
7
|
#private;
|
|
9
8
|
readonly owner: UserGrantee;
|
|
10
9
|
constructor(properties: EnterpriseScriptProperties, config: SonarV3Config);
|
|
11
|
-
grants({ signal }?: SignalParam): Promise<
|
|
10
|
+
grants({ signal }?: SignalParam): Promise<import("ts-results-es").Result<({
|
|
12
11
|
grantee: RoleGrantee;
|
|
13
12
|
privileges: Set<ScriptPrivileges>;
|
|
14
13
|
} | {
|
|
15
14
|
grantee: UserGrantee;
|
|
16
15
|
privileges: Set<ScriptPrivileges>;
|
|
17
|
-
})[]>>;
|
|
16
|
+
})[], import("../index.ts").HttpError>>;
|
|
18
17
|
save(properties: ScriptPatchableProperties & {
|
|
19
18
|
owner?: UserGrantee;
|
|
20
|
-
}): Promise<
|
|
21
|
-
readonly errors: [{
|
|
22
|
-
readonly detail: "A script with this name already exists";
|
|
23
|
-
readonly pointer: "#/name";
|
|
24
|
-
readonly type: "https://api.dremio.dev/problems/validation/field-conflict";
|
|
25
|
-
readonly value: string;
|
|
26
|
-
}];
|
|
27
|
-
readonly title: "There was a problem validating the content of the request";
|
|
28
|
-
readonly type: "https://api.dremio.dev/problems/validation-problem";
|
|
29
|
-
}> | Err<import("../index.ts").Problem> | Ok<EnterpriseScript>>;
|
|
19
|
+
}): Promise<import("ts-results-es").Result<EnterpriseScript, import("../index.ts").ValidationProblem | import("../index.ts").HttpError>>;
|
|
30
20
|
}
|
|
31
21
|
export type EnterpriseScriptProperties = ReturnType<typeof enterpriseScriptEntityToProperties>;
|
|
32
|
-
type EnterpriseScriptEntity = ScriptEntity & {
|
|
22
|
+
export type EnterpriseScriptEntity = ScriptEntity & {
|
|
33
23
|
owner?: string;
|
|
34
24
|
};
|
|
35
25
|
export declare const enterpriseScriptEntityToProperties: (entity: EnterpriseScriptEntity) => {
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { createScriptPatchedFields, saveScript, Script, scriptEntityToProperties, } from "../../oss/scripts/Script.js";
|
|
17
|
-
import { Err, Ok, Result } from "ts-results-es";
|
|
18
17
|
export class EnterpriseScript extends Script {
|
|
19
18
|
owner;
|
|
20
19
|
#config;
|
|
@@ -26,8 +25,8 @@ export class EnterpriseScript extends Script {
|
|
|
26
25
|
grants({ signal } = {}) {
|
|
27
26
|
return this.#config
|
|
28
27
|
.sonarV3Request(`scripts/${this.id}/grants`, { signal })
|
|
29
|
-
.
|
|
30
|
-
.
|
|
28
|
+
.map((res) => res.json())
|
|
29
|
+
.map((entity) => [
|
|
31
30
|
...entity.roles.map((grant) => ({
|
|
32
31
|
grantee: {
|
|
33
32
|
id: grant.granteeId,
|
|
@@ -42,14 +41,13 @@ export class EnterpriseScript extends Script {
|
|
|
42
41
|
},
|
|
43
42
|
privileges: new Set(grant.privileges),
|
|
44
43
|
})),
|
|
45
|
-
])
|
|
46
|
-
.catch((e) => Err(e));
|
|
44
|
+
]).promise;
|
|
47
45
|
}
|
|
48
46
|
async save(properties) {
|
|
49
47
|
return saveScript(this.id, this.#config)({
|
|
50
48
|
...createScriptPatchedFields(properties),
|
|
51
49
|
...(properties.owner && { owner: properties.owner.id }),
|
|
52
|
-
}).
|
|
50
|
+
}).map((value) => new EnterpriseScript(enterpriseScriptEntityToProperties(value), this.#config)).promise;
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
export const enterpriseScriptEntityToProperties = (entity) => ({
|
|
@@ -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,OAAO,gBAAiB,SAAQ,MAAM;IACjC,KAAK,CAAc;IAC5B,OAAO,CAAgB;IAEvB,YAAY,UAAsC,EAAE,MAAqB;QACvE,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,KAAkB,EAAE;QACjC,OAAO,IAAI,CAAC,OAAO;aAChB,cAAc,CAAC,WAAW,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC;aACvD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;aACxB,GAAG,CACF,CAAC,MAGA,EAAE,EAAE,CAAC;YACJ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC9B,OAAO,EAAE;oBACP,EAAE,EAAE,KAAK,CAAC,SAAS;oBACnB,IAAI,EAAE,MAAM;iBACwB;gBACtC,UAAU,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC;aACtC,CAAC,CAAC;YACH,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC9B,OAAO,EAAE;oBACP,EAAE,EAAE,KAAK,CAAC,SAAS;oBACnB,IAAI,EAAE,MAAM;iBACwB;gBACtC,UAAU,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC;aACtC,CAAC,CAAC;SACJ,CACF,CAAC,OAAO,CAAC;IACd,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,UAA+D;QACjF,OAAO,UAAU,CACf,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,OAAO,CACb,CAAC;YACA,GAAG,yBAAyB,CAAC,UAAU,CAAC;YACxC,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"]}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import type { ResourceConfig, SonarV3Config } from "../../common/Config.ts";
|
|
2
|
-
import { EnterpriseScript } from "./EnterpriseScript.ts";
|
|
3
|
-
import { Ok, Err } from "ts-results-es";
|
|
4
2
|
import type { Query } from "../../common/Query.ts";
|
|
5
3
|
import type { SignalParam } from "../../common/Params.ts";
|
|
6
|
-
|
|
4
|
+
import { EnterpriseScript, type EnterpriseScriptEntity } from "./EnterpriseScript.ts";
|
|
5
|
+
export declare class EnterpriseScriptsResource {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(config: ResourceConfig & SonarV3Config);
|
|
8
|
+
_scriptFromEntity(entity: EnterpriseScriptEntity): EnterpriseScript;
|
|
7
9
|
list(): {
|
|
8
10
|
data({ signal }?: SignalParam): AsyncGenerator<EnterpriseScript, void, unknown>;
|
|
9
11
|
};
|
|
10
|
-
retrieve
|
|
11
|
-
|
|
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
|
+
}>>>;
|
|
17
|
+
store(properties: {
|
|
12
18
|
name: string;
|
|
13
19
|
query: Query;
|
|
14
|
-
})
|
|
15
|
-
}
|
|
20
|
+
}): Promise<import("ts-results-es").Result<EnterpriseScript, import("../index.ts").ValidationProblem | import("../index.ts").HttpError>>;
|
|
21
|
+
}
|
|
@@ -13,60 +13,29 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { EnterpriseScript, enterpriseScriptEntityToProperties } from "./EnterpriseScript.js";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
const store = (properties) => {
|
|
33
|
-
const { query, ...rest } = properties;
|
|
34
|
-
return config
|
|
35
|
-
.sonarV3Request("scripts", {
|
|
36
|
-
body: JSON.stringify({
|
|
37
|
-
...rest,
|
|
38
|
-
content: query.sql,
|
|
39
|
-
context: query.context,
|
|
40
|
-
}),
|
|
41
|
-
headers: {
|
|
42
|
-
"Content-Type": "application/json",
|
|
16
|
+
import { EnterpriseScript, enterpriseScriptEntityToProperties, } from "./EnterpriseScript.js";
|
|
17
|
+
import { listScripts, retrieveScript, storeScript } from "../../oss/scripts/ScriptsResource.js";
|
|
18
|
+
export class EnterpriseScriptsResource {
|
|
19
|
+
#config;
|
|
20
|
+
constructor(config) {
|
|
21
|
+
this.#config = config;
|
|
22
|
+
}
|
|
23
|
+
_scriptFromEntity(entity) {
|
|
24
|
+
return new EnterpriseScript(enterpriseScriptEntityToProperties(entity), this.#config);
|
|
25
|
+
}
|
|
26
|
+
list() {
|
|
27
|
+
const l = listScripts(this.#config, this._scriptFromEntity.bind(this));
|
|
28
|
+
return {
|
|
29
|
+
async *data({ signal } = {}) {
|
|
30
|
+
yield* (await l({ signal })).unwrap();
|
|
43
31
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
return Err(e);
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
return {
|
|
58
|
-
list() {
|
|
59
|
-
return {
|
|
60
|
-
async *data({ signal } = {}) {
|
|
61
|
-
yield* await config
|
|
62
|
-
.sonarV3Request("scripts?maxResults=1000", { signal })
|
|
63
|
-
.then((res) => res.json())
|
|
64
|
-
.then((response) => response.data.map((entity) => new EnterpriseScript(enterpriseScriptEntityToProperties(entity), config)));
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
retrieve,
|
|
69
|
-
store,
|
|
70
|
-
};
|
|
71
|
-
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
retrieve(id, { signal } = {}) {
|
|
35
|
+
return retrieveScript(this.#config, this._scriptFromEntity.bind(this))(id, { signal });
|
|
36
|
+
}
|
|
37
|
+
store(properties) {
|
|
38
|
+
return storeScript(this.#config, this._scriptFromEntity.bind(this))(properties);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
72
41
|
//# sourceMappingURL=EnterpriseScriptsResource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterpriseScriptsResource.js","sourceRoot":"","sources":["../../../src/enterprise/scripts/EnterpriseScriptsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
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,21 +1,24 @@
|
|
|
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
|
-
import { User } from "../../oss/users/User.ts";
|
|
3
|
+
import { User, type UserEntity } from "../../oss/users/User.ts";
|
|
5
4
|
import type { RoleReference } from "../roles/Role.ts";
|
|
6
5
|
export declare class EnterpriseUser extends User {
|
|
7
6
|
#private;
|
|
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
|
-
export
|
|
17
|
+
export type EnterpriseUserEntity = UserEntity & {
|
|
18
|
+
roles: RoleReference[];
|
|
19
|
+
source: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const enterpriseUserEntityToProperties: (entity: EnterpriseUserEntity) => {
|
|
19
22
|
roles: RoleReference[];
|
|
20
23
|
source: string;
|
|
21
24
|
email: string;
|
|
@@ -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,EAAE,sBAAsB,EAAmB,MAAM,yBAAyB,CAAC;AAaxF,MAAM,OAAO,cAAe,SAAQ,IAAI;IACtC,OAAO,CAAW;IAElB,KAAK,CAAkB;IACvB,MAAM,CAAS;IAEf,YAAY,UAAoC,EAAE,MAAgB;QAChE,KAAK,CAAC,UAAU,CAAC,CAAC;QAClB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,KAAkB,EAAE;QACjC,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,QAAQ,IAAI,CAAC,EAAE,QAAQ,EAAE;YAClC,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;YACvC,MAAM;SACP,CAAC;aACD,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAiC,CAAC;aACvD,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAChB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAC5B,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YACpC,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YACpC,EAAE,EAAE,KAAK,CAAC,GAAG;YACb,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB,CAAC,CAAC,CACJ,CAAC,OAAO,CAAC;IACd,CAAC;CACF;AAOD,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,MAA4B,EAAE,EAAE,CAAC,CAAC;IACjF,GAAG,sBAAsB,CAAC,MAAM,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM;CACtB,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 { 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"]}
|