@dremio/js-sdk 0.7.1 → 0.9.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/enterprise/catalog/CatalogObjects/EnterpriseDatasetCatalogObject.d.ts +1 -0
- package/dist/enterprise/users/EnterpriseUser.d.ts +5 -0
- package/dist/enterprise/users/EnterpriseUser.js +6 -0
- package/dist/enterprise/users/EnterpriseUser.js.map +1 -1
- package/dist/oss/catalog/CatalogObjects/DatasetCatalogObject.d.ts +6 -0
- package/dist/oss/catalog/CatalogObjects/DatasetCatalogObject.js +8 -0
- package/dist/oss/catalog/CatalogObjects/DatasetCatalogObject.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,11 @@ import { Err, Ok } from "ts-results-es";
|
|
|
2
2
|
import type { V3Config } from "../../common/Config.ts";
|
|
3
3
|
import type { SignalParam } from "../../common/Params.ts";
|
|
4
4
|
import { User } from "../../oss/users/User.ts";
|
|
5
|
+
import type { RoleReference } from "../roles/Role.ts";
|
|
5
6
|
export declare class EnterpriseUser extends User {
|
|
6
7
|
#private;
|
|
8
|
+
roles: RoleReference[];
|
|
9
|
+
source: string;
|
|
7
10
|
constructor(properties: EnterpriseUserProperties, config: V3Config);
|
|
8
11
|
tokens({ signal }?: SignalParam): Promise<Err<any> | Ok<{
|
|
9
12
|
createdAt: Date;
|
|
@@ -13,6 +16,8 @@ export declare class EnterpriseUser extends User {
|
|
|
13
16
|
}[]>>;
|
|
14
17
|
}
|
|
15
18
|
export declare const enterpriseUserEntityToProperties: (entity: any) => {
|
|
19
|
+
roles: RoleReference[];
|
|
20
|
+
source: string;
|
|
16
21
|
email: string;
|
|
17
22
|
familyName: string | null;
|
|
18
23
|
givenName: string | null;
|
|
@@ -17,9 +17,13 @@ import { Err, Ok } from "ts-results-es";
|
|
|
17
17
|
import { User, userEntityToProperties } from "../../oss/users/User.js";
|
|
18
18
|
export class EnterpriseUser extends User {
|
|
19
19
|
#config;
|
|
20
|
+
roles;
|
|
21
|
+
source;
|
|
20
22
|
constructor(properties, config) {
|
|
21
23
|
super(properties);
|
|
22
24
|
this.#config = config;
|
|
25
|
+
this.roles = properties.roles;
|
|
26
|
+
this.source = properties.source;
|
|
23
27
|
}
|
|
24
28
|
tokens({ signal } = {}) {
|
|
25
29
|
return this.#config
|
|
@@ -39,5 +43,7 @@ export class EnterpriseUser extends User {
|
|
|
39
43
|
}
|
|
40
44
|
export const enterpriseUserEntityToProperties = (entity) => ({
|
|
41
45
|
...userEntityToProperties(entity),
|
|
46
|
+
roles: entity.roles,
|
|
47
|
+
source: entity.source,
|
|
42
48
|
});
|
|
43
49
|
//# sourceMappingURL=EnterpriseUser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnterpriseUser.js","sourceRoot":"","sources":["../../../src/enterprise/users/EnterpriseUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"EnterpriseUser.js","sourceRoot":"","sources":["../../../src/enterprise/users/EnterpriseUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAavE,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,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAiC,CAAC;aACxD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CACjB,EAAE,CACA,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,CACF;aACA,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AAED,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,MAAW,EAAE,EAAE,CAAC,CAAC;IAChE,GAAG,sBAAsB,CAAC,MAAM,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC,KAAwB;IACtC,MAAM,EAAE,MAAM,CAAC,MAAgB;CAChC,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 { V3Config } from \"../../common/Config.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\nimport { User, userEntityToProperties } 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 .then((res) => res.json() as Promise<UserTokensResponse>)\n .then((response) =>\n Ok(\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 ),\n )\n .catch((e) => Err(e));\n }\n}\n\nexport const enterpriseUserEntityToProperties = (entity: any) => ({\n ...userEntityToProperties(entity),\n roles: entity.roles as RoleReference[],\n source: entity.source as string,\n});\n\nexport type EnterpriseUserProperties = ReturnType<typeof enterpriseUserEntityToProperties>;\n"]}
|
|
@@ -7,6 +7,10 @@ export declare class DatasetCatalogObject {
|
|
|
7
7
|
readonly fields: DatasetCatalogObjectProperties["fields"];
|
|
8
8
|
readonly schemaOutdated: DatasetCatalogObjectProperties["schemaOutdated"];
|
|
9
9
|
readonly type: DatasetCatalogObjectProperties["type"];
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated
|
|
12
|
+
*/
|
|
13
|
+
readonly _datasetVersion?: string;
|
|
10
14
|
constructor(properties: DatasetCatalogObjectProperties);
|
|
11
15
|
get name(): string;
|
|
12
16
|
/**
|
|
@@ -31,10 +35,12 @@ export type DatasetEntity = {
|
|
|
31
35
|
createdAt: string;
|
|
32
36
|
fields: Field[];
|
|
33
37
|
schemaOutdated: boolean;
|
|
38
|
+
datasetVersion?: string;
|
|
34
39
|
};
|
|
35
40
|
export declare const datasetEntityToProperties: (entity: DatasetEntity, config: SonarV3Config, retrieveByPath: RetrieveByPath) => {
|
|
36
41
|
readonly catalogReference: DatasetCatalogReference;
|
|
37
42
|
readonly createdAt: Date;
|
|
43
|
+
readonly datasetVersion: string | undefined;
|
|
38
44
|
readonly fields: Field[];
|
|
39
45
|
readonly schemaOutdated: boolean;
|
|
40
46
|
readonly type: any;
|
|
@@ -20,6 +20,10 @@ export class DatasetCatalogObject {
|
|
|
20
20
|
fields;
|
|
21
21
|
schemaOutdated;
|
|
22
22
|
type;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
_datasetVersion;
|
|
23
27
|
constructor(properties) {
|
|
24
28
|
this.catalogReference = properties.catalogReference;
|
|
25
29
|
this.createdAt = properties.createdAt;
|
|
@@ -27,6 +31,9 @@ export class DatasetCatalogObject {
|
|
|
27
31
|
this.schemaOutdated = properties.schemaOutdated;
|
|
28
32
|
this.type = properties.type;
|
|
29
33
|
this.pathString = this.catalogReference.pathString.bind(this.catalogReference);
|
|
34
|
+
if (properties.type === "DATASET_VIRTUAL") {
|
|
35
|
+
this._datasetVersion = properties.datasetVersion;
|
|
36
|
+
}
|
|
30
37
|
}
|
|
31
38
|
get name() {
|
|
32
39
|
return this.catalogReference.name;
|
|
@@ -49,6 +56,7 @@ export const datasetEntityToProperties = (entity, config, retrieveByPath) => ({
|
|
|
49
56
|
type: mappedType[entity.type],
|
|
50
57
|
}, retrieveByPath, config),
|
|
51
58
|
createdAt: new Date(entity.createdAt),
|
|
59
|
+
datasetVersion: entity.datasetVersion,
|
|
52
60
|
fields: entity.fields,
|
|
53
61
|
schemaOutdated: entity.schemaOutdated,
|
|
54
62
|
type: mappedType[entity.type],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasetCatalogObject.js","sourceRoot":"","sources":["../../../../src/oss/catalog/CatalogObjects/DatasetCatalogObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,uBAAuB,EACvB,UAAU,GACX,MAAM,iDAAiD,CAAC;AAEzD,MAAM,OAAO,oBAAoB;IACtB,gBAAgB,CAAqD;IACrE,SAAS,CAA8C;IACvD,MAAM,CAA2C;IACjD,cAAc,CAAmD;IACjE,IAAI,CAAyC;IAEtD,YAAY,UAA0C;QACpD,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAChC,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DatasetCatalogObject.js","sourceRoot":"","sources":["../../../../src/oss/catalog/CatalogObjects/DatasetCatalogObject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EACL,uBAAuB,EACvB,UAAU,GACX,MAAM,iDAAiD,CAAC;AAEzD,MAAM,OAAO,oBAAoB;IACtB,gBAAgB,CAAqD;IACrE,SAAS,CAA8C;IACvD,MAAM,CAA2C;IACjD,cAAc,CAAmD;IACjE,IAAI,CAAyC;IAEtD;;OAEG;IACM,eAAe,CAAU;IAElC,YAAY,UAA0C;QACpD,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,UAAU,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,CAAU,CAAC","sourcesContent":["/*\n * Copyright (C) 2024-2025 Dremio Corporation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { SonarV3Config } from \"../../../common/Config.ts\";\nimport type { RetrieveByPath } from \"../CatalogReferences/BaseCatalogReference.ts\";\nimport {\n DatasetCatalogReference,\n mappedType,\n} from \"../CatalogReferences/DatasetCatalogReference.ts\";\n\nexport class DatasetCatalogObject {\n readonly catalogReference: DatasetCatalogObjectProperties[\"catalogReference\"];\n readonly createdAt: DatasetCatalogObjectProperties[\"createdAt\"];\n readonly fields: DatasetCatalogObjectProperties[\"fields\"];\n readonly schemaOutdated: DatasetCatalogObjectProperties[\"schemaOutdated\"];\n readonly type: DatasetCatalogObjectProperties[\"type\"];\n\n /**\n * @deprecated\n */\n readonly _datasetVersion?: string;\n\n constructor(properties: DatasetCatalogObjectProperties) {\n this.catalogReference = properties.catalogReference;\n this.createdAt = properties.createdAt;\n this.fields = properties.fields;\n this.schemaOutdated = properties.schemaOutdated;\n this.type = properties.type;\n this.pathString = this.catalogReference.pathString.bind(this.catalogReference);\n\n if (properties.type === \"DATASET_VIRTUAL\") {\n this._datasetVersion = properties.datasetVersion;\n }\n }\n\n get name() {\n return this.catalogReference.name;\n }\n\n /**\n * @deprecated\n */\n get id() {\n return this.catalogReference.id;\n }\n\n get path() {\n return this.catalogReference.path;\n }\n\n pathString: DatasetCatalogReference[\"pathString\"];\n}\n\ntype Field = {\n isPartitioned: boolean;\n isSorted: boolean;\n name: string;\n type: {\n name: string;\n };\n};\n\nexport type DatasetEntity = {\n id: string;\n path: string[];\n type: string;\n createdAt: string;\n fields: Field[];\n schemaOutdated: boolean;\n datasetVersion?: string;\n};\n\nexport const datasetEntityToProperties = (\n entity: DatasetEntity,\n config: SonarV3Config,\n retrieveByPath: RetrieveByPath,\n) =>\n ({\n catalogReference: new DatasetCatalogReference(\n {\n id: entity.id,\n path: entity.path,\n type: (mappedType as any)[entity.type],\n },\n retrieveByPath,\n config,\n ),\n createdAt: new Date(entity.createdAt),\n datasetVersion: entity.datasetVersion,\n fields: entity.fields,\n schemaOutdated: entity.schemaOutdated,\n type: (mappedType as any)[entity.type],\n }) as const;\n\nexport type DatasetCatalogObjectProperties = ReturnType<typeof datasetEntityToProperties>;\n"]}
|