@dremio/js-sdk 0.25.0 → 0.27.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.
@@ -2,7 +2,7 @@ import type { ArcticCatalog } from "./arctic/ArcticCatalog.ts";
2
2
  import type { CloudUser } from "./users/CloudUser.ts";
3
3
  import type { Engine } from "./engines/Engine.ts";
4
4
  import type { Project } from "./projects/Project.ts";
5
- import type { Organization } from "./organizations/Organization.ts";
5
+ import { Organization } from "./organizations/Organization.ts";
6
6
  import type { Job, Reflection } from "../oss/interfaces.ts";
7
7
  import type { EnterpriseScript } from "../enterprise/scripts/EnterpriseScript.ts";
8
8
  import type { ReflectionSummary } from "../enterprise/reflections/ReflectionSummary.ts";
@@ -10,7 +10,8 @@ import type { Role } from "../enterprise/roles/Role.ts";
10
10
  import type { BranchHeadVersionReference, BareCommitVersionReference, TagVersionReference, VersionReference } from "../oss/catalog/VersionReference.ts";
11
11
  import type { JobResultsSchema } from "../oss/jobs/utils/JobResultsResponse.ts";
12
12
  export type { ArcticCatalog, CloudUser, Engine, Project };
13
- export type { Job, JobResultsSchema, Reflection, EnterpriseScript, ReflectionSummary, Role, BranchHeadVersionReference, BareCommitVersionReference, TagVersionReference, VersionReference, Organization, };
13
+ export type { Job, JobResultsSchema, Reflection, EnterpriseScript, ReflectionSummary, Role, BranchHeadVersionReference, BareCommitVersionReference, TagVersionReference, VersionReference, };
14
+ export { Organization };
14
15
  export * from "../enterprise/catalog/CatalogObjects/index.ts";
15
16
  export * from "../enterprise/catalog/CatalogReferences/index.ts";
16
17
  export * from "../enterprise/catalog/catalogSearch/CatalogSearchResult.ts";
@@ -13,6 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { Organization } from "./organizations/Organization.js";
17
+ export { Organization };
16
18
  export * from "../enterprise/catalog/CatalogObjects/index.js";
17
19
  export * from "../enterprise/catalog/CatalogReferences/index.js";
18
20
  export * from "../enterprise/catalog/catalogSearch/CatalogSearchResult.js";
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/cloud/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiCH,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,+BAA+B,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 { ArcticCatalog } from \"./arctic/ArcticCatalog.ts\";\nimport type { CloudUser } from \"./users/CloudUser.ts\";\nimport type { Engine } from \"./engines/Engine.ts\";\nimport type { Project } from \"./projects/Project.ts\";\nimport type { Organization } from \"./organizations/Organization.ts\";\nimport type { Job, Reflection } from \"../oss/interfaces.ts\";\nimport type { EnterpriseScript } from \"../enterprise/scripts/EnterpriseScript.ts\";\nimport type { ReflectionSummary } from \"../enterprise/reflections/ReflectionSummary.ts\";\nimport type { Role } from \"../enterprise/roles/Role.ts\";\nimport type {\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n} from \"../oss/catalog/VersionReference.ts\";\nimport type { JobResultsSchema } from \"../oss/jobs/utils/JobResultsResponse.ts\";\n\nexport type { ArcticCatalog, CloudUser, Engine, Project };\nexport type {\n Job,\n JobResultsSchema,\n Reflection,\n EnterpriseScript,\n ReflectionSummary,\n Role,\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n Organization,\n};\nexport * from \"../enterprise/catalog/CatalogObjects/index.ts\";\nexport * from \"../enterprise/catalog/CatalogReferences/index.ts\";\nexport * from \"../enterprise/catalog/catalogSearch/CatalogSearchResult.ts\";\nexport * from \"../enterprise/grants/Grant.ts\";\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/cloud/interfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AA0B/D,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,4DAA4D,CAAC;AAC3E,cAAc,+BAA+B,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 { ArcticCatalog } from \"./arctic/ArcticCatalog.ts\";\nimport type { CloudUser } from \"./users/CloudUser.ts\";\nimport type { Engine } from \"./engines/Engine.ts\";\nimport type { Project } from \"./projects/Project.ts\";\nimport { Organization } from \"./organizations/Organization.ts\";\nimport type { Job, Reflection } from \"../oss/interfaces.ts\";\nimport type { EnterpriseScript } from \"../enterprise/scripts/EnterpriseScript.ts\";\nimport type { ReflectionSummary } from \"../enterprise/reflections/ReflectionSummary.ts\";\nimport type { Role } from \"../enterprise/roles/Role.ts\";\nimport type {\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n} from \"../oss/catalog/VersionReference.ts\";\nimport type { JobResultsSchema } from \"../oss/jobs/utils/JobResultsResponse.ts\";\n\nexport type { ArcticCatalog, CloudUser, Engine, Project };\nexport type {\n Job,\n JobResultsSchema,\n Reflection,\n EnterpriseScript,\n ReflectionSummary,\n Role,\n BranchHeadVersionReference,\n BareCommitVersionReference,\n TagVersionReference,\n VersionReference,\n};\nexport { Organization };\nexport * from \"../enterprise/catalog/CatalogObjects/index.ts\";\nexport * from \"../enterprise/catalog/CatalogReferences/index.ts\";\nexport * from \"../enterprise/catalog/catalogSearch/CatalogSearchResult.ts\";\nexport * from \"../enterprise/grants/Grant.ts\";\n"]}
@@ -1,13 +1,153 @@
1
- import type { OrganizationProperties } from "./organizationEntityToProperties.ts";
1
+ import * as z from "zod/mini";
2
+ import { Temporal } from "temporal-polyfill";
3
+ import type { V2Config } from "../../common/Config.ts";
4
+ export declare const organizationPropertiesCodec: z.ZodMiniCodec<z.ZodMiniObject<{
5
+ auditDestinationCloudType: z.ZodMiniEnum<{
6
+ AWS: "AWS";
7
+ AZURE: "AZURE";
8
+ }>;
9
+ auditDestinationCredentials: z.ZodMiniObject<{
10
+ accessKeyId: z.ZodMiniString<string>;
11
+ secretAccessKey: z.ZodMiniString<string>;
12
+ type: z.ZodMiniEnum<{
13
+ ACCESS_KEY: "ACCESS_KEY";
14
+ AZURE_ACTIVE_DIRECTORY: "AZURE_ACTIVE_DIRECTORY";
15
+ IAM_ROLE: "IAM_ROLE";
16
+ }>;
17
+ }, z.core.$strip>;
18
+ auditDestinationPath: z.ZodMiniString<string>;
19
+ cloudTags: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniObject<{
20
+ key: z.ZodMiniString<string>;
21
+ value: z.ZodMiniString<string>;
22
+ }, z.core.$strip>>>;
23
+ createdAt: z.ZodMiniString<string>;
24
+ createdBy: z.ZodMiniString<string>;
25
+ defaultProjectId: z.ZodMiniString<string>;
26
+ id: z.ZodMiniString<string>;
27
+ isCreatedWithCFT: z.ZodMiniBoolean<boolean>;
28
+ modifiedAt: z.ZodMiniString<string>;
29
+ modifiedBy: z.ZodMiniString<string>;
30
+ name: z.ZodMiniString<string>;
31
+ state: z.ZodMiniEnum<{
32
+ FAILED: "FAILED";
33
+ INVALID: "INVALID";
34
+ ACTIVE: "ACTIVE";
35
+ DELETED: "DELETED";
36
+ CFT_STARTED: "CFT_STARTED";
37
+ CFT_COMPLETE: "CFT_COMPLETE";
38
+ COMMISSIONING: "COMMISSIONING";
39
+ MARK_ROLLBACK: "MARK_ROLLBACK";
40
+ FIRST_CLOUD_ADDED: "FIRST_CLOUD_ADDED";
41
+ ROLLBACK_COMPLETED: "ROLLBACK_COMPLETED";
42
+ CFT_FINISH_TIMEOUT: "CFT_FINISH_TIMEOUT";
43
+ }>;
44
+ }, z.core.$strip>, z.ZodMiniObject<{
45
+ id: z.ZodMiniString<string>;
46
+ state: z.ZodMiniEnum<{
47
+ FAILED: "FAILED";
48
+ INVALID: "INVALID";
49
+ ACTIVE: "ACTIVE";
50
+ DELETED: "DELETED";
51
+ CFT_STARTED: "CFT_STARTED";
52
+ CFT_COMPLETE: "CFT_COMPLETE";
53
+ COMMISSIONING: "COMMISSIONING";
54
+ MARK_ROLLBACK: "MARK_ROLLBACK";
55
+ FIRST_CLOUD_ADDED: "FIRST_CLOUD_ADDED";
56
+ ROLLBACK_COMPLETED: "ROLLBACK_COMPLETED";
57
+ CFT_FINISH_TIMEOUT: "CFT_FINISH_TIMEOUT";
58
+ }>;
59
+ createdBy: z.ZodMiniString<string>;
60
+ modifiedBy: z.ZodMiniString<string>;
61
+ auditDestinationCloudType: z.ZodMiniEnum<{
62
+ AWS: "AWS";
63
+ AZURE: "AZURE";
64
+ }>;
65
+ auditDestinationCredentials: z.ZodMiniObject<{
66
+ accessKeyId: z.ZodMiniString<string>;
67
+ secretAccessKey: z.ZodMiniString<string>;
68
+ type: z.ZodMiniEnum<{
69
+ ACCESS_KEY: "ACCESS_KEY";
70
+ AZURE_ACTIVE_DIRECTORY: "AZURE_ACTIVE_DIRECTORY";
71
+ IAM_ROLE: "IAM_ROLE";
72
+ }>;
73
+ }, z.core.$strip>;
74
+ auditDestinationPath: z.ZodMiniString<string>;
75
+ defaultProjectId: z.ZodMiniString<string>;
76
+ _isCreatedWithCFT: z.ZodMiniBoolean<boolean>;
77
+ cloudTags: z.ZodMiniArray<z.ZodMiniObject<{
78
+ key: z.ZodMiniString<string>;
79
+ value: z.ZodMiniString<string>;
80
+ }, z.core.$strip>>;
81
+ createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
82
+ modifiedAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
83
+ name: z.ZodMiniString<string>;
84
+ }, z.core.$strip>>;
85
+ declare const organizationUpdateSchema: z.ZodMiniObject<{
86
+ name: z.ZodMiniString<string>;
87
+ defaultProjectId: z.ZodMiniString<string>;
88
+ }, z.core.$strip>;
89
+ type OrganizationProperties = z.output<typeof organizationPropertiesCodec>;
2
90
  export declare class Organization implements OrganizationProperties {
3
- createdAt: OrganizationProperties["createdAt"];
4
- createdBy: OrganizationProperties["createdBy"];
5
- defaultProjectId: OrganizationProperties["defaultProjectId"];
6
- id: OrganizationProperties["id"];
7
- modifiedAt: OrganizationProperties["modifiedAt"];
8
- modifiedBy: OrganizationProperties["modifiedBy"];
9
- name: OrganizationProperties["name"];
10
- state: OrganizationProperties["state"];
11
- constructor(properties: OrganizationProperties);
91
+ #private;
92
+ readonly auditDestinationCloudType: OrganizationProperties["auditDestinationCloudType"];
93
+ readonly auditDestinationCredentials: OrganizationProperties["auditDestinationCredentials"];
94
+ readonly auditDestinationPath: OrganizationProperties["auditDestinationPath"];
95
+ readonly cloudTags: OrganizationProperties["cloudTags"];
96
+ readonly createdAt: OrganizationProperties["createdAt"];
97
+ readonly createdBy: OrganizationProperties["createdBy"];
98
+ readonly defaultProjectId: OrganizationProperties["defaultProjectId"];
99
+ readonly id: OrganizationProperties["id"];
100
+ readonly modifiedAt: OrganizationProperties["modifiedAt"];
101
+ readonly modifiedBy: OrganizationProperties["modifiedBy"];
102
+ readonly name: OrganizationProperties["name"];
103
+ readonly state: OrganizationProperties["state"];
104
+ /**
105
+ * @hidden
106
+ */
107
+ readonly _isCreatedWithCFT: OrganizationProperties["_isCreatedWithCFT"];
108
+ constructor(config: V2Config, properties: OrganizationProperties);
12
109
  get settled(): boolean;
110
+ update(fields: Partial<z.infer<typeof organizationUpdateSchema>>): import("ts-results-es").AsyncResult<Organization, import("../index.ts").HttpError>;
111
+ static schema: z.ZodMiniObject<{
112
+ id: z.ZodMiniString<string>;
113
+ state: z.ZodMiniEnum<{
114
+ FAILED: "FAILED";
115
+ INVALID: "INVALID";
116
+ ACTIVE: "ACTIVE";
117
+ DELETED: "DELETED";
118
+ CFT_STARTED: "CFT_STARTED";
119
+ CFT_COMPLETE: "CFT_COMPLETE";
120
+ COMMISSIONING: "COMMISSIONING";
121
+ MARK_ROLLBACK: "MARK_ROLLBACK";
122
+ FIRST_CLOUD_ADDED: "FIRST_CLOUD_ADDED";
123
+ ROLLBACK_COMPLETED: "ROLLBACK_COMPLETED";
124
+ CFT_FINISH_TIMEOUT: "CFT_FINISH_TIMEOUT";
125
+ }>;
126
+ createdBy: z.ZodMiniString<string>;
127
+ modifiedBy: z.ZodMiniString<string>;
128
+ auditDestinationCloudType: z.ZodMiniEnum<{
129
+ AWS: "AWS";
130
+ AZURE: "AZURE";
131
+ }>;
132
+ auditDestinationCredentials: z.ZodMiniObject<{
133
+ accessKeyId: z.ZodMiniString<string>;
134
+ secretAccessKey: z.ZodMiniString<string>;
135
+ type: z.ZodMiniEnum<{
136
+ ACCESS_KEY: "ACCESS_KEY";
137
+ AZURE_ACTIVE_DIRECTORY: "AZURE_ACTIVE_DIRECTORY";
138
+ IAM_ROLE: "IAM_ROLE";
139
+ }>;
140
+ }, z.core.$strip>;
141
+ auditDestinationPath: z.ZodMiniString<string>;
142
+ defaultProjectId: z.ZodMiniString<string>;
143
+ _isCreatedWithCFT: z.ZodMiniBoolean<boolean>;
144
+ cloudTags: z.ZodMiniArray<z.ZodMiniObject<{
145
+ key: z.ZodMiniString<string>;
146
+ value: z.ZodMiniString<string>;
147
+ }, z.core.$strip>>;
148
+ createdAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
149
+ modifiedAt: z.ZodMiniCustom<Temporal.Instant, Temporal.Instant>;
150
+ name: z.ZodMiniString<string>;
151
+ }, z.core.$strip>;
13
152
  }
153
+ export {};
@@ -13,7 +13,85 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import * as z from "zod/mini";
17
+ import { Temporal } from "temporal-polyfill";
18
+ const organizationPropertiesInSchema = z.object({
19
+ auditDestinationCloudType: z.enum(["AWS", "AZURE"]),
20
+ auditDestinationCredentials: z.object({
21
+ accessKeyId: z.string(),
22
+ secretAccessKey: z.string(),
23
+ type: z.enum(["ACCESS_KEY", "AZURE_ACTIVE_DIRECTORY", "IAM_ROLE"]),
24
+ }),
25
+ auditDestinationPath: z.string(),
26
+ cloudTags: z.optional(z.array(z.object({
27
+ key: z.string(),
28
+ value: z.string(),
29
+ }))),
30
+ createdAt: z.string(),
31
+ createdBy: z.string(),
32
+ defaultProjectId: z.string(),
33
+ id: z.string(),
34
+ isCreatedWithCFT: z.boolean(),
35
+ modifiedAt: z.string(),
36
+ modifiedBy: z.string(),
37
+ name: z.string(),
38
+ state: z.enum([
39
+ "ACTIVE",
40
+ "FAILED",
41
+ "DELETED",
42
+ "INVALID",
43
+ "CFT_STARTED",
44
+ "CFT_COMPLETE",
45
+ "COMMISSIONING",
46
+ "MARK_ROLLBACK",
47
+ "FIRST_CLOUD_ADDED",
48
+ "ROLLBACK_COMPLETED",
49
+ "CFT_FINISH_TIMEOUT",
50
+ ]),
51
+ });
52
+ export const organizationPropertiesCodec = z.codec(organizationPropertiesInSchema, z.extend(z.omit(organizationPropertiesInSchema, {
53
+ cloudTags: true,
54
+ createdAt: true,
55
+ isCreatedWithCFT: true,
56
+ modifiedAt: true,
57
+ name: true,
58
+ }), {
59
+ _isCreatedWithCFT: z.boolean(),
60
+ cloudTags: z.array(z.object({
61
+ key: z.string(),
62
+ value: z.string(),
63
+ })),
64
+ createdAt: z.instanceof(Temporal.Instant),
65
+ modifiedAt: z.instanceof(Temporal.Instant),
66
+ name: z.string(),
67
+ }), {
68
+ decode(v) {
69
+ return {
70
+ ...v,
71
+ _isCreatedWithCFT: v.isCreatedWithCFT,
72
+ cloudTags: v.cloudTags ?? [],
73
+ createdAt: Temporal.Instant.from(new Date(v.createdAt).toISOString()),
74
+ modifiedAt: Temporal.Instant.from(new Date(v.modifiedAt).toISOString()),
75
+ };
76
+ },
77
+ encode(v) {
78
+ return {
79
+ ...v,
80
+ createdAt: Temporal.Instant.toString(),
81
+ isCreatedWithCFT: v._isCreatedWithCFT,
82
+ modifiedAt: Temporal.Instant.toString(),
83
+ };
84
+ },
85
+ });
86
+ const organizationUpdateSchema = z.pick(organizationPropertiesCodec.def.out, {
87
+ defaultProjectId: true,
88
+ name: true,
89
+ });
16
90
  export class Organization {
91
+ auditDestinationCloudType;
92
+ auditDestinationCredentials;
93
+ auditDestinationPath;
94
+ cloudTags;
17
95
  createdAt;
18
96
  createdBy;
19
97
  defaultProjectId;
@@ -22,25 +100,50 @@ export class Organization {
22
100
  modifiedBy;
23
101
  name;
24
102
  state;
25
- constructor(properties) {
103
+ /**
104
+ * @hidden
105
+ */
106
+ _isCreatedWithCFT;
107
+ #config;
108
+ constructor(config, properties) {
109
+ this.auditDestinationCloudType = properties.auditDestinationCloudType;
110
+ this.auditDestinationCredentials = properties.auditDestinationCredentials;
111
+ this.auditDestinationPath = properties.auditDestinationPath;
112
+ this.cloudTags = properties.cloudTags;
26
113
  this.createdAt = properties.createdAt;
27
114
  this.createdBy = properties.createdBy;
28
115
  this.defaultProjectId = properties.defaultProjectId;
29
116
  this.id = properties.id;
117
+ this._isCreatedWithCFT = properties._isCreatedWithCFT;
30
118
  this.modifiedAt = properties.modifiedAt;
31
119
  this.modifiedBy = properties.modifiedBy;
32
120
  this.name = properties.name;
33
121
  this.state = properties.state;
122
+ this.#config = config;
34
123
  }
35
124
  get settled() {
36
- switch (this.state) {
37
- case "ACTIVE":
38
- case "DELETED":
39
- case "FAILED":
40
- case "INVALID":
41
- return true;
42
- }
43
- return false;
125
+ return (this.state === "ACTIVE" ||
126
+ this.state === "DELETED" ||
127
+ this.state === "FAILED" ||
128
+ this.state === "INVALID");
44
129
  }
130
+ update(fields) {
131
+ return this.#config
132
+ .v2Request("organizations", {
133
+ body: JSON.stringify(z.parse(organizationUpdateSchema, {
134
+ defaultProjectId: this.defaultProjectId,
135
+ name: fields.name || this.name,
136
+ })),
137
+ headers: {
138
+ Accept: "application/json",
139
+ "Content-Type": "application/json",
140
+ },
141
+ keepalive: true,
142
+ method: "PUT",
143
+ })
144
+ .map((res) => res.json())
145
+ .map((entity) => new Organization(this.#config, z.decode(organizationPropertiesCodec, entity)));
146
+ }
147
+ static schema = organizationPropertiesCodec.def.out;
45
148
  }
46
149
  //# sourceMappingURL=Organization.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Organization.js","sourceRoot":"","sources":["../../../src/cloud/organizations/Organization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,MAAM,OAAO,YAAY;IACvB,SAAS,CAAsC;IAC/C,SAAS,CAAsC;IAC/C,gBAAgB,CAA6C;IAC7D,EAAE,CAA+B;IACjC,UAAU,CAAuC;IACjD,UAAU,CAAuC;IACjD,IAAI,CAAiC;IACrC,KAAK,CAAkC;IAEvC,YAAY,UAAkC;QAC5C,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;IAChC,CAAC;IAED,IAAI,OAAO;QACT,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,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 { OrganizationProperties } from \"./organizationEntityToProperties.ts\";\n\nexport class Organization implements OrganizationProperties {\n createdAt: OrganizationProperties[\"createdAt\"];\n createdBy: OrganizationProperties[\"createdBy\"];\n defaultProjectId: OrganizationProperties[\"defaultProjectId\"];\n id: OrganizationProperties[\"id\"];\n modifiedAt: OrganizationProperties[\"modifiedAt\"];\n modifiedBy: OrganizationProperties[\"modifiedBy\"];\n name: OrganizationProperties[\"name\"];\n state: OrganizationProperties[\"state\"];\n\n constructor(properties: OrganizationProperties) {\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.defaultProjectId = properties.defaultProjectId;\n this.id = properties.id;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.state = properties.state;\n }\n\n get settled() {\n switch (this.state) {\n case \"ACTIVE\":\n case \"DELETED\":\n case \"FAILED\":\n case \"INVALID\":\n return true;\n }\n return false;\n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AC","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 * as z from \"zod/mini\";\nimport { Temporal } from \"temporal-polyfill\";\nimport type { V2Config } from \"../../common/Config.ts\";\n\nconst organizationPropertiesInSchema = z.object({\n auditDestinationCloudType: z.enum([\"AWS\", \"AZURE\"]),\n auditDestinationCredentials: z.object({\n accessKeyId: z.string(),\n secretAccessKey: z.string(),\n type: z.enum([\"ACCESS_KEY\", \"AZURE_ACTIVE_DIRECTORY\", \"IAM_ROLE\"]),\n }),\n auditDestinationPath: z.string(),\n cloudTags: z.optional(\n z.array(\n z.object({\n key: z.string(),\n value: z.string(),\n }),\n ),\n ),\n createdAt: z.string(),\n createdBy: z.string(),\n defaultProjectId: z.string(),\n id: z.string(),\n isCreatedWithCFT: z.boolean(),\n modifiedAt: z.string(),\n modifiedBy: z.string(),\n name: z.string(),\n state: z.enum([\n \"ACTIVE\",\n \"FAILED\",\n \"DELETED\",\n \"INVALID\",\n \"CFT_STARTED\",\n \"CFT_COMPLETE\",\n \"COMMISSIONING\",\n \"MARK_ROLLBACK\",\n \"FIRST_CLOUD_ADDED\",\n \"ROLLBACK_COMPLETED\",\n \"CFT_FINISH_TIMEOUT\",\n ]),\n});\n\nexport const organizationPropertiesCodec = z.codec(\n organizationPropertiesInSchema,\n z.extend(\n z.omit(organizationPropertiesInSchema, {\n cloudTags: true,\n createdAt: true,\n isCreatedWithCFT: true,\n modifiedAt: true,\n name: true,\n }),\n {\n _isCreatedWithCFT: z.boolean(),\n cloudTags: z.array(\n z.object({\n key: z.string(),\n value: z.string(),\n }),\n ),\n createdAt: z.instanceof(Temporal.Instant),\n modifiedAt: z.instanceof(Temporal.Instant),\n name: z.string(),\n },\n ),\n {\n decode(v) {\n return {\n ...v,\n _isCreatedWithCFT: v.isCreatedWithCFT,\n cloudTags: v.cloudTags ?? [],\n createdAt: Temporal.Instant.from(new Date(v.createdAt).toISOString()),\n modifiedAt: Temporal.Instant.from(new Date(v.modifiedAt).toISOString()),\n };\n },\n encode(v) {\n return {\n ...v,\n createdAt: Temporal.Instant.toString(),\n isCreatedWithCFT: v._isCreatedWithCFT,\n modifiedAt: Temporal.Instant.toString(),\n };\n },\n },\n);\n\nconst organizationUpdateSchema = z.pick(organizationPropertiesCodec.def.out, {\n defaultProjectId: true,\n name: true,\n});\n\ntype OrganizationProperties = z.output<typeof organizationPropertiesCodec>;\n\nexport class Organization implements OrganizationProperties {\n readonly auditDestinationCloudType: OrganizationProperties[\"auditDestinationCloudType\"];\n readonly auditDestinationCredentials: OrganizationProperties[\"auditDestinationCredentials\"];\n readonly auditDestinationPath: OrganizationProperties[\"auditDestinationPath\"];\n readonly cloudTags: OrganizationProperties[\"cloudTags\"];\n readonly createdAt: OrganizationProperties[\"createdAt\"];\n readonly createdBy: OrganizationProperties[\"createdBy\"];\n readonly defaultProjectId: OrganizationProperties[\"defaultProjectId\"];\n readonly id: OrganizationProperties[\"id\"];\n readonly modifiedAt: OrganizationProperties[\"modifiedAt\"];\n readonly modifiedBy: OrganizationProperties[\"modifiedBy\"];\n readonly name: OrganizationProperties[\"name\"];\n readonly state: OrganizationProperties[\"state\"];\n\n /**\n * @hidden\n */\n readonly _isCreatedWithCFT: OrganizationProperties[\"_isCreatedWithCFT\"];\n\n readonly #config: V2Config;\n\n constructor(config: V2Config, properties: OrganizationProperties) {\n this.auditDestinationCloudType = properties.auditDestinationCloudType;\n this.auditDestinationCredentials = properties.auditDestinationCredentials;\n this.auditDestinationPath = properties.auditDestinationPath;\n this.cloudTags = properties.cloudTags;\n this.createdAt = properties.createdAt;\n this.createdBy = properties.createdBy;\n this.defaultProjectId = properties.defaultProjectId;\n this.id = properties.id;\n this._isCreatedWithCFT = properties._isCreatedWithCFT;\n this.modifiedAt = properties.modifiedAt;\n this.modifiedBy = properties.modifiedBy;\n this.name = properties.name;\n this.state = properties.state;\n\n this.#config = config;\n }\n\n get settled(): boolean {\n return (\n this.state === \"ACTIVE\" ||\n this.state === \"DELETED\" ||\n this.state === \"FAILED\" ||\n this.state === \"INVALID\"\n );\n }\n\n update(fields: Partial<z.infer<typeof organizationUpdateSchema>>) {\n return this.#config\n .v2Request(\"organizations\", {\n body: JSON.stringify(\n z.parse(organizationUpdateSchema, {\n defaultProjectId: this.defaultProjectId,\n name: fields.name || this.name,\n }),\n ),\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n keepalive: true,\n method: \"PUT\",\n })\n .map((res) => res.json() as Promise<z.input<typeof organizationPropertiesCodec>>)\n .map(\n (entity) => new Organization(this.#config, z.decode(organizationPropertiesCodec, entity)),\n );\n }\n\n static schema = organizationPropertiesCodec.def.out;\n}\n"]}
@@ -1,8 +1,10 @@
1
- import type { ResourceConfig, V3Config } from "../../common/Config.ts";
2
- import { Organization } from "./Organization.ts";
3
- import { type OrganizationEntity } from "./organizationEntityToProperties.ts";
1
+ import * as z from "zod/mini";
2
+ import type { ResourceConfig, V2Config } from "../../common/Config.ts";
3
+ import { Organization, organizationPropertiesCodec } from "./Organization.ts";
4
+ import type { SignalParam } from "../../common/Params.ts";
4
5
  export declare class OrganizationsResource {
5
6
  #private;
6
- constructor(config: ResourceConfig & V3Config);
7
- _organizationFromEntity(entity: OrganizationEntity): Organization;
7
+ constructor(config: ResourceConfig & V2Config);
8
+ retrieve({ signal }?: SignalParam): import("ts-results-es").AsyncResult<Organization, import("../index.ts").HttpError>;
9
+ _organizationFromEntity(entity: z.input<typeof organizationPropertiesCodec>): Organization;
8
10
  }
@@ -13,16 +13,21 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Organization } from "./Organization.js";
17
- import { organizationEntityToProperties, } from "./organizationEntityToProperties.js";
16
+ import * as z from "zod/mini";
17
+ import { Organization, organizationPropertiesCodec } from "./Organization.js";
18
18
  export class OrganizationsResource {
19
- // eslint-disable-next-line no-unused-private-class-members
20
19
  #config;
21
20
  constructor(config) {
22
21
  this.#config = config;
23
22
  }
23
+ retrieve({ signal } = {}) {
24
+ return this.#config
25
+ .v2Request("organizations", { headers: { Accept: "application/json" }, signal })
26
+ .map((res) => res.json())
27
+ .map((entity) => new Organization(this.#config, z.decode(organizationPropertiesCodec, entity)));
28
+ }
24
29
  _organizationFromEntity(entity) {
25
- return new Organization(organizationEntityToProperties(entity));
30
+ return new Organization(this.#config, z.decode(organizationPropertiesCodec, entity));
26
31
  }
27
32
  }
28
33
  //# sourceMappingURL=OrganizationsResource.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OrganizationsResource.js","sourceRoot":"","sources":["../../../src/cloud/organizations/OrganizationsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,8BAA8B,GAE/B,MAAM,qCAAqC,CAAC;AAE7C,MAAM,OAAO,qBAAqB;IAChC,2DAA2D;IAClD,OAAO,CAA4B;IAE5C,YAAY,MAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,uBAAuB,CAAC,MAA0B;QAChD,OAAO,IAAI,YAAY,CAAC,8BAA8B,CAAC,MAAM,CAAC,CAAC,CAAC;IAClE,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, V3Config } from \"../../common/Config.ts\";\nimport { Organization } from \"./Organization.ts\";\nimport {\n organizationEntityToProperties,\n type OrganizationEntity,\n} from \"./organizationEntityToProperties.ts\";\n\nexport class OrganizationsResource {\n // eslint-disable-next-line no-unused-private-class-members\n readonly #config: ResourceConfig & V3Config;\n\n constructor(config: ResourceConfig & V3Config) {\n this.#config = config;\n }\n\n _organizationFromEntity(entity: OrganizationEntity) {\n return new Organization(organizationEntityToProperties(entity));\n }\n}\n"]}
1
+ {"version":3,"file":"OrganizationsResource.js","sourceRoot":"","sources":["../../../src/cloud/organizations/OrganizationsResource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAG9E,MAAM,OAAO,qBAAqB;IACvB,OAAO,CAA4B;IAE5C,YAAY,MAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,QAAQ,CAAC,EAAE,MAAM,KAAkB,EAAE;QACnC,OAAO,IAAI,CAAC,OAAO;aAChB,SAAS,CAAC,eAAe,EAAE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,MAAM,EAAE,CAAC;aAC/E,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAA0D,CAAC;aAChF,GAAG,CACF,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,CAC1F,CAAC;IACN,CAAC;IAED,uBAAuB,CAAC,MAAmD;QACzE,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAAC,CAAC,CAAC;IACvF,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 * as z from \"zod/mini\";\nimport type { ResourceConfig, V2Config } from \"../../common/Config.ts\";\nimport { Organization, organizationPropertiesCodec } from \"./Organization.ts\";\nimport type { SignalParam } from \"../../common/Params.ts\";\n\nexport class OrganizationsResource {\n readonly #config: ResourceConfig & V2Config;\n\n constructor(config: ResourceConfig & V2Config) {\n this.#config = config;\n }\n\n retrieve({ signal }: SignalParam = {}) {\n return this.#config\n .v2Request(\"organizations\", { headers: { Accept: \"application/json\" }, signal })\n .map((res) => res.json() as Promise<z.input<typeof organizationPropertiesCodec>>)\n .map(\n (entity) => new Organization(this.#config, z.decode(organizationPropertiesCodec, entity)),\n );\n }\n\n _organizationFromEntity(entity: z.input<typeof organizationPropertiesCodec>) {\n return new Organization(this.#config, z.decode(organizationPropertiesCodec, entity));\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dremio/js-sdk",
3
- "version": "0.25.0",
3
+ "version": "0.27.0",
4
4
  "description": "JavaScript library for the Dremio API",
5
5
  "keywords": [
6
6
  "dremio",
@@ -34,10 +34,12 @@
34
34
  "dependencies": {
35
35
  "eventsource-parser": "^3.0.1",
36
36
  "moize": "^6",
37
+ "nanoid": "^5",
37
38
  "parse-ms": "^4",
38
39
  "rxjs": "^7",
39
40
  "temporal-polyfill": "^0.3.0",
40
- "ts-results-es": "^5.0.1"
41
+ "ts-results-es": "^5.0.1",
42
+ "zod": "^4"
41
43
  },
42
44
  "devDependencies": {
43
45
  "@eslint/compat": "^1.3.1",
@@ -1,34 +0,0 @@
1
- import { Temporal } from "temporal-polyfill";
2
- export declare const organizationEntityToProperties: (entity: OrganizationEntity) => {
3
- createdAt: Temporal.Instant;
4
- createdBy: string;
5
- defaultProjectId: string;
6
- id: string;
7
- modifiedAt: Temporal.Instant;
8
- modifiedBy: string;
9
- name: string;
10
- state: "FAILED" | "INVALID" | "ACTIVE" | "DELETED" | "CFT_STARTED" | "CFT_COMPLETE" | "COMMISSIONING" | "MARK_ROLLBACK" | "FIRST_CLOUD_ADDED" | "ROLLBACK_COMPLETED" | "CFT_FINISH_TIMEOUT";
11
- };
12
- export type OrganizationProperties = ReturnType<typeof organizationEntityToProperties>;
13
- export type OrganizationEntity = {
14
- auditDestinationCloudType: "AWS" | "AZURE";
15
- auditDestinationCredentials: {
16
- accessKeyId: string;
17
- secretAccessKey: string;
18
- type: "ACCESS_KEY" | "AZURE_ACTIVE_DIRECTORY" | "IAM_ROLE";
19
- };
20
- auditDestinationPath: string;
21
- cloudTags: {
22
- key: string;
23
- value: string;
24
- }[];
25
- createdAt: string;
26
- createdBy: string;
27
- defaultProjectId: string;
28
- id: string;
29
- isCreatedWithCFT: boolean;
30
- modifiedAt: string;
31
- modifiedBy: string;
32
- name: string;
33
- state: "ACTIVE" | "FAILED" | "DELETED" | "INVALID" | "CFT_STARTED" | "CFT_COMPLETE" | "COMMISSIONING" | "MARK_ROLLBACK" | "FIRST_CLOUD_ADDED" | "ROLLBACK_COMPLETED" | "CFT_FINISH_TIMEOUT";
34
- };
@@ -1,27 +0,0 @@
1
- /*
2
- * Copyright (C) 2024-2025 Dremio Corporation
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Temporal } from "temporal-polyfill";
17
- export const organizationEntityToProperties = (entity) => ({
18
- createdAt: Temporal.Instant.from(new Date(entity.createdAt).toISOString()),
19
- createdBy: entity.createdBy,
20
- defaultProjectId: entity.defaultProjectId,
21
- id: entity.id,
22
- modifiedAt: Temporal.Instant.from(new Date(entity.modifiedAt).toISOString()),
23
- modifiedBy: entity.modifiedBy,
24
- name: entity.name,
25
- state: entity.state,
26
- });
27
- //# sourceMappingURL=organizationEntityToProperties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organizationEntityToProperties.js","sourceRoot":"","sources":["../../../src/cloud/organizations/organizationEntityToProperties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAA0B,EAAE,EAAE,CAAC,CAAC;IAC7E,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IAC1E,SAAS,EAAE,MAAM,CAAC,SAAS;IAC3B,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;IACzC,EAAE,EAAE,MAAM,CAAC,EAAE;IACb,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5E,UAAU,EAAE,MAAM,CAAC,UAAU;IAC7B,IAAI,EAAE,MAAM,CAAC,IAAI;IACjB,KAAK,EAAE,MAAM,CAAC,KAAK;CACpB,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 { Temporal } from \"temporal-polyfill\";\n\nexport const organizationEntityToProperties = (entity: OrganizationEntity) => ({\n createdAt: Temporal.Instant.from(new Date(entity.createdAt).toISOString()),\n createdBy: entity.createdBy,\n defaultProjectId: entity.defaultProjectId,\n id: entity.id,\n modifiedAt: Temporal.Instant.from(new Date(entity.modifiedAt).toISOString()),\n modifiedBy: entity.modifiedBy,\n name: entity.name,\n state: entity.state,\n});\n\nexport type OrganizationProperties = ReturnType<typeof organizationEntityToProperties>;\n\nexport type OrganizationEntity = {\n auditDestinationCloudType: \"AWS\" | \"AZURE\";\n auditDestinationCredentials: {\n accessKeyId: string;\n secretAccessKey: string;\n type: \"ACCESS_KEY\" | \"AZURE_ACTIVE_DIRECTORY\" | \"IAM_ROLE\";\n };\n auditDestinationPath: string;\n cloudTags: { key: string; value: string }[];\n createdAt: string;\n createdBy: string;\n defaultProjectId: string;\n id: string;\n isCreatedWithCFT: boolean;\n modifiedAt: string;\n modifiedBy: string;\n name: string;\n state:\n | \"ACTIVE\"\n | \"FAILED\"\n | \"DELETED\"\n | \"INVALID\"\n | \"CFT_STARTED\"\n | \"CFT_COMPLETE\"\n | \"COMMISSIONING\"\n | \"MARK_ROLLBACK\"\n | \"FIRST_CLOUD_ADDED\"\n | \"ROLLBACK_COMPLETED\"\n | \"CFT_FINISH_TIMEOUT\";\n};\n"]}