@uipath/codedapp-tool 1.202.2 → 1.203.0-preview.180

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.
@@ -19,16 +19,20 @@ import {
19
19
  TenantSelectionError,
20
20
  TenantSelectionRequiredError,
21
21
  TokenRefreshOAuthError,
22
+ authProfileExistsAsync,
22
23
  authenticate,
23
24
  clearActiveAuthProfile,
24
25
  clearRefreshBreaker,
25
26
  clientCredentialsLogin,
27
+ deleteAuthProfileAsync,
28
+ describeAuthProfilesAsync,
26
29
  federatedCredentialsLogin,
27
30
  fetchTenantsAndOrganizations,
28
31
  getActiveAuthProfile,
29
32
  getActiveAuthProfileFilePath,
30
33
  getAuthContext,
31
34
  getAuthEnv,
35
+ getAuthProfilesRootPath,
32
36
  getLoginStatusAsync,
33
37
  getLoginStatusWithDeps,
34
38
  interactiveLogin,
@@ -37,6 +41,7 @@ import {
37
41
  isRobotAuthEnforced,
38
42
  isTenantSelectionError,
39
43
  isTokenRefreshOAuthFailure,
44
+ listAuthProfileNamesAsync,
40
45
  loadEnvFileAsync,
41
46
  loadRefreshBreaker,
42
47
  logout,
@@ -48,6 +53,7 @@ import {
48
53
  refreshAccessToken,
49
54
  refreshTokenFingerprint,
50
55
  registerRobotClientLoader,
56
+ resolveAuthProfileDirPath,
51
57
  resolveAuthProfileFilePath,
52
58
  resolveEnvFileLocationAsync,
53
59
  resolveEnvFilePathAsync,
@@ -58,7 +64,7 @@ import {
58
64
  selectTenantWithDeps,
59
65
  setActiveAuthProfile,
60
66
  setAuthFileConfig
61
- } from "./packager-tool-pvtdkdk8.js";
67
+ } from "./packager-tool-bvm4jqr1.js";
62
68
  import {
63
69
  isBrowser,
64
70
  isNode
@@ -96,16 +102,20 @@ export {
96
102
  TenantSelectionError,
97
103
  TenantSelectionRequiredError,
98
104
  TokenRefreshOAuthError,
105
+ authProfileExistsAsync,
99
106
  authenticate,
100
107
  clearActiveAuthProfile,
101
108
  clearRefreshBreaker,
102
109
  clientCredentialsLogin,
110
+ deleteAuthProfileAsync,
111
+ describeAuthProfilesAsync,
103
112
  federatedCredentialsLogin,
104
113
  fetchTenantsAndOrganizations,
105
114
  getActiveAuthProfile,
106
115
  getActiveAuthProfileFilePath,
107
116
  getAuthContext,
108
117
  getAuthEnv,
118
+ getAuthProfilesRootPath,
109
119
  getLoginStatusAsync,
110
120
  getLoginStatusWithDeps,
111
121
  interactiveLogin,
@@ -116,6 +126,7 @@ export {
116
126
  isRobotAuthEnforced,
117
127
  isTenantSelectionError,
118
128
  isTokenRefreshOAuthFailure,
129
+ listAuthProfileNamesAsync,
119
130
  loadEnvFileAsync,
120
131
  loadRefreshBreaker,
121
132
  logout,
@@ -127,6 +138,7 @@ export {
127
138
  refreshAccessToken,
128
139
  refreshTokenFingerprint,
129
140
  registerRobotClientLoader,
141
+ resolveAuthProfileDirPath,
130
142
  resolveAuthProfileFilePath,
131
143
  resolveEnvFileLocationAsync,
132
144
  resolveEnvFilePathAsync,
@@ -139,4 +151,4 @@ export {
139
151
  setAuthFileConfig
140
152
  };
141
153
 
142
- //# debugId=2791EE15E4B4F73864756E2164756E21
154
+ //# debugId=06C873373E697BCA64756E2164756E21
@@ -0,0 +1,25 @@
1
+ import {
2
+ CAMEL_CASE_ENUM_PROPERTIES,
3
+ JsonSerializer,
4
+ JsonSerializerFactory,
5
+ JsonSerializerNames,
6
+ JsonSerializerProxy,
7
+ PASCAL_CASE_ENUM_PROPERTIES,
8
+ RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES,
9
+ SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES,
10
+ StreamSerializer
11
+ } from "./packager-tool-gdtpsdn7.js";
12
+ import"./packager-tool-1yh8g550.js";
13
+ export {
14
+ CAMEL_CASE_ENUM_PROPERTIES,
15
+ JsonSerializer,
16
+ JsonSerializerFactory,
17
+ JsonSerializerNames,
18
+ JsonSerializerProxy,
19
+ PASCAL_CASE_ENUM_PROPERTIES,
20
+ RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES,
21
+ SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES,
22
+ StreamSerializer
23
+ };
24
+
25
+ //# debugId=A79DD62A6A37B41864756E2164756E21
package/dist/index.js CHANGED
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  metadata,
4
4
  registerCommands
5
- } from "./packager-tool-npxwr0xj.js";
5
+ } from "./packager-tool-jzxgk4ms.js";
6
6
  import {
7
7
  Command
8
- } from "./packager-tool-ckanbe2q.js";
9
- import"./packager-tool-pvtdkdk8.js";
10
- import"./packager-tool-05wez2xw.js";
11
- import"./packager-tool-aybzcdfg.js";
8
+ } from "./packager-tool-f1ptyxe1.js";
9
+ import"./packager-tool-bvm4jqr1.js";
12
10
  import"./packager-tool-0gctz400.js";
13
11
  import"./packager-tool-qyctya2j.js";
14
12
  import"./packager-tool-yc4kw997.js";
13
+ import"./packager-tool-shwgy5p6.js";
14
+ import"./packager-tool-aybzcdfg.js";
15
15
  import"./packager-tool-1yh8g550.js";
16
16
 
17
17
  // src/index.ts
@@ -0,0 +1,262 @@
1
+ // ../../node_modules/@uipath/resource-builder-sdk/dist/clients/generated/first-party-service.js
2
+ var first_party_service_DeploymentAction = /* @__PURE__ */ function(DeploymentAction) {
3
+ DeploymentAction["Install"] = "Install";
4
+ DeploymentAction["Link"] = "Link";
5
+ DeploymentAction["Uninstall"] = "Uninstall";
6
+ DeploymentAction["Unlink"] = "Unlink";
7
+ DeploymentAction["Merge"] = "Merge";
8
+ DeploymentAction["UseExisting"] = "UseExisting";
9
+ DeploymentAction["Activate"] = "Activate";
10
+ return DeploymentAction;
11
+ }({});
12
+ var first_party_service_SolutionDeploymentAction = /* @__PURE__ */ function(SolutionDeploymentAction) {
13
+ SolutionDeploymentAction["Install"] = "Install";
14
+ SolutionDeploymentAction["Uninstall"] = "Uninstall";
15
+ SolutionDeploymentAction["Upgrade"] = "Upgrade";
16
+ SolutionDeploymentAction["Rollback"] = "Rollback";
17
+ SolutionDeploymentAction["Activate"] = "Activate";
18
+ return SolutionDeploymentAction;
19
+ }({});
20
+ var first_party_service_SolutionStatus = /* @__PURE__ */ function(SolutionStatus) {
21
+ SolutionStatus["Installed"] = "Installed";
22
+ SolutionStatus["Uninstalled"] = "Uninstalled";
23
+ SolutionStatus["Installing"] = "Installing";
24
+ SolutionStatus["Uninstalling"] = "Uninstalling";
25
+ SolutionStatus["InstallError"] = "InstallError";
26
+ SolutionStatus["UninstallError"] = "UninstallError";
27
+ SolutionStatus["Unknown"] = "Unknown";
28
+ return SolutionStatus;
29
+ }({});
30
+ var first_party_service_QueryOptions = /* @__PURE__ */ function(QueryOptions) {
31
+ QueryOptions["Contains"] = "Contains";
32
+ QueryOptions["Equals"] = "Equals";
33
+ return QueryOptions;
34
+ }({});
35
+ var first_party_service_DeploymentResourceValidationErrorLevel = /* @__PURE__ */ function(DeploymentResourceValidationErrorLevel) {
36
+ DeploymentResourceValidationErrorLevel["Error"] = "Error";
37
+ DeploymentResourceValidationErrorLevel["Warning"] = "Warning";
38
+ DeploymentResourceValidationErrorLevel["Info"] = "Info";
39
+ return DeploymentResourceValidationErrorLevel;
40
+ }({});
41
+ var first_party_service_DeploymentResourceValidationErrorKind = /* @__PURE__ */ function(DeploymentResourceValidationErrorKind) {
42
+ DeploymentResourceValidationErrorKind["Conflict"] = "Conflict";
43
+ DeploymentResourceValidationErrorKind["ConfigurationError"] = "ConfigurationError";
44
+ return DeploymentResourceValidationErrorKind;
45
+ }({});
46
+ var first_party_service_DeploymentResourceValidationAction = /* @__PURE__ */ function(DeploymentResourceValidationAction) {
47
+ DeploymentResourceValidationAction["RenameExisting"] = "RenameExisting";
48
+ DeploymentResourceValidationAction["RenameInSolution"] = "RenameInSolution";
49
+ DeploymentResourceValidationAction["UseExisting"] = "UseExisting";
50
+ DeploymentResourceValidationAction["FixConfiguration"] = "FixConfiguration";
51
+ DeploymentResourceValidationAction["Delete"] = "Delete";
52
+ DeploymentResourceValidationAction["SkipDelete"] = "SkipDelete";
53
+ DeploymentResourceValidationAction["MergeConfiguration"] = "MergeConfiguration";
54
+ DeploymentResourceValidationAction["Replace"] = "Replace";
55
+ return DeploymentResourceValidationAction;
56
+ }({});
57
+ var first_party_service_ContentType = /* @__PURE__ */ function(ContentType) {
58
+ ContentType["Json"] = "application/json";
59
+ ContentType["JsonApi"] = "application/vnd.api+json";
60
+ ContentType["FormData"] = "multipart/form-data";
61
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
62
+ ContentType["Text"] = "text/plain";
63
+ return ContentType;
64
+ }({});
65
+
66
+ class HttpClient {
67
+ encodeQueryParam(key, value) {
68
+ const encodedKey = encodeURIComponent(key);
69
+ return `${encodedKey}=${encodeURIComponent(typeof value == "number" ? value : `${value}`)}`;
70
+ }
71
+ addQueryParam(query, key) {
72
+ return this.encodeQueryParam(key, query[key]);
73
+ }
74
+ addArrayQueryParam(query, key) {
75
+ const value = query[key];
76
+ return value.map((v) => this.encodeQueryParam(key, v)).join("&");
77
+ }
78
+ toQueryString(rawQuery) {
79
+ const query = rawQuery || {};
80
+ const keys = Object.keys(query).filter((key) => query[key] !== undefined);
81
+ return keys.map((key) => Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key)).join("&");
82
+ }
83
+ addQueryParams(rawQuery) {
84
+ const queryString = this.toQueryString(rawQuery);
85
+ return queryString ? `?${queryString}` : "";
86
+ }
87
+ mergeRequestParams(params1, params2) {
88
+ return {
89
+ ...this.baseApiParams,
90
+ ...params1,
91
+ ...params2 || {},
92
+ headers: {
93
+ ...this.baseApiParams.headers || {},
94
+ ...params1.headers || {},
95
+ ...params2 && params2.headers || {}
96
+ }
97
+ };
98
+ }
99
+ constructor(apiConfig = {}) {
100
+ this.baseUrl = "https://localhost:7008";
101
+ this.securityData = null;
102
+ this.abortControllers = new Map;
103
+ this.customFetch = (...fetchParams) => fetch(...fetchParams);
104
+ this.baseApiParams = {
105
+ credentials: "same-origin",
106
+ headers: {},
107
+ redirect: "follow",
108
+ referrerPolicy: "no-referrer"
109
+ };
110
+ this.setSecurityData = (data) => {
111
+ this.securityData = data;
112
+ };
113
+ this.contentFormatters = {
114
+ ["application/json"]: (input) => input !== null && (typeof input == "object" || typeof input == "string") ? JSON.stringify(input) : input,
115
+ ["application/vnd.api+json"]: (input) => input !== null && (typeof input == "object" || typeof input == "string") ? JSON.stringify(input) : input,
116
+ ["text/plain"]: (input) => input !== null && typeof input != "string" ? JSON.stringify(input) : input,
117
+ ["multipart/form-data"]: (input) => {
118
+ if (input instanceof FormData)
119
+ return input;
120
+ return Object.keys(input || {}).reduce((formData, key) => {
121
+ const property = input[key];
122
+ formData.append(key, property instanceof Blob ? property : typeof property == "object" && property !== null ? JSON.stringify(property) : `${property}`);
123
+ return formData;
124
+ }, new FormData);
125
+ },
126
+ ["application/x-www-form-urlencoded"]: (input) => this.toQueryString(input)
127
+ };
128
+ this.createAbortSignal = (cancelToken) => {
129
+ if (this.abortControllers.has(cancelToken)) {
130
+ const abortController2 = this.abortControllers.get(cancelToken);
131
+ if (abortController2)
132
+ return abortController2.signal;
133
+ return;
134
+ }
135
+ const abortController = new AbortController;
136
+ this.abortControllers.set(cancelToken, abortController);
137
+ return abortController.signal;
138
+ };
139
+ this.abortRequest = (cancelToken) => {
140
+ const abortController = this.abortControllers.get(cancelToken);
141
+ if (abortController) {
142
+ abortController.abort();
143
+ this.abortControllers.delete(cancelToken);
144
+ }
145
+ };
146
+ this.request = async ({ body, secure, path, type, query, format, baseUrl, cancelToken, ...params }) => {
147
+ const secureParams = (typeof secure == "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
148
+ const requestParams = this.mergeRequestParams(params, secureParams);
149
+ const queryString = query && this.toQueryString(query);
150
+ const payloadFormatter = this.contentFormatters[type || "application/json"];
151
+ const responseFormat = format || requestParams.format;
152
+ return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, {
153
+ ...requestParams,
154
+ headers: {
155
+ ...requestParams.headers || {},
156
+ ...type && type !== "multipart/form-data" ? {
157
+ "Content-Type": type
158
+ } : {}
159
+ },
160
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
161
+ body: body == null ? null : payloadFormatter(body)
162
+ }).then(async (response) => {
163
+ const r = response;
164
+ r.data = null;
165
+ r.error = null;
166
+ const responseToParse = responseFormat ? response.clone() : response;
167
+ const data = responseFormat ? await responseToParse[responseFormat]().then((data2) => {
168
+ if (r.ok)
169
+ r.data = data2;
170
+ else
171
+ r.error = data2;
172
+ return r;
173
+ }).catch((e) => {
174
+ r.error = e;
175
+ return r;
176
+ }) : r;
177
+ if (cancelToken)
178
+ this.abortControllers.delete(cancelToken);
179
+ if (!response.ok)
180
+ throw data;
181
+ return data.data;
182
+ });
183
+ };
184
+ Object.assign(this, apiConfig);
185
+ }
186
+ }
187
+
188
+ class FirstPartyServiceApi extends HttpClient {
189
+ constructor(...args) {
190
+ super(...args), this.v2 = {
191
+ automationSolutionsGetMetadata: (params = {}) => this.request({
192
+ path: "/v2/automationsolutions/metadata",
193
+ method: "GET",
194
+ ...params
195
+ }),
196
+ automationSolutionsHeadMetadata: (params = {}) => this.request({
197
+ path: "/v2/automationsolutions/metadata",
198
+ method: "HEAD",
199
+ ...params
200
+ }),
201
+ automationSolutionsSetState: (data, query, params = {}) => this.request({
202
+ path: "/v2/automationsolutions",
203
+ method: "PATCH",
204
+ query,
205
+ body: data,
206
+ type: "application/json",
207
+ ...params
208
+ }),
209
+ automationSolutionsInstall: (data, query, params = {}) => this.request({
210
+ path: "/v2/automationsolutions",
211
+ method: "PUT",
212
+ query,
213
+ body: data,
214
+ format: "json",
215
+ ...params
216
+ }),
217
+ automationSolutionsUninstall: (data, query, params = {}) => this.request({
218
+ path: "/v2/automationsolutions",
219
+ method: "DELETE",
220
+ query,
221
+ body: data,
222
+ type: "application/json",
223
+ format: "json",
224
+ ...params
225
+ }),
226
+ automationSolutionsExport: (data, params = {}) => this.request({
227
+ path: "/v2/automationsolutions/export",
228
+ method: "POST",
229
+ body: data,
230
+ type: "application/json",
231
+ format: "json",
232
+ ...params
233
+ }),
234
+ automationSolutionsGetTranslations: (query, params = {}) => this.request({
235
+ path: "/v2/automationsolutions/translations",
236
+ method: "GET",
237
+ query,
238
+ format: "json",
239
+ ...params
240
+ }),
241
+ automationSolutionsValidate: (data, query, params = {}) => this.request({
242
+ path: "/v2/automationsolutions/validate",
243
+ method: "POST",
244
+ query,
245
+ body: data,
246
+ type: "application/json",
247
+ format: "json",
248
+ ...params
249
+ }),
250
+ automationSolutionsLookup: (query, params = {}) => this.request({
251
+ path: "/v2/automationsolutions/lookup",
252
+ method: "GET",
253
+ query,
254
+ format: "json",
255
+ ...params
256
+ })
257
+ };
258
+ }
259
+ }
260
+ export { first_party_service_DeploymentAction, first_party_service_SolutionDeploymentAction, first_party_service_SolutionStatus, first_party_service_QueryOptions, first_party_service_DeploymentResourceValidationErrorLevel, first_party_service_DeploymentResourceValidationErrorKind, first_party_service_DeploymentResourceValidationAction, first_party_service_ContentType, HttpClient, FirstPartyServiceApi };
261
+
262
+ //# debugId=AC88CC622210E15664756E2164756E21
@@ -566,6 +566,63 @@ function getActiveAuthProfileFilePath() {
566
566
  const profile = getActiveAuthProfile();
567
567
  return profile ? resolveAuthProfileFilePath(profile) : undefined;
568
568
  }
569
+ function getAuthProfilesRootPath() {
570
+ const fs = getFileSystem();
571
+ return fs.path.join(fs.env.homedir(), UIPATH_HOME_DIR, PROFILE_DIR);
572
+ }
573
+ function resolveAuthProfileDirPath(profile) {
574
+ const normalized = normalizeAuthProfileName(profile);
575
+ if (normalized === undefined) {
576
+ throw new AuthProfileValidationError(`"${DEFAULT_AUTH_PROFILE}" is the built-in profile and does not have a profile directory.`);
577
+ }
578
+ const fs = getFileSystem();
579
+ return fs.path.join(getAuthProfilesRootPath(), normalized);
580
+ }
581
+ async function listAuthProfileNamesAsync() {
582
+ const fs = getFileSystem();
583
+ const root = getAuthProfilesRootPath();
584
+ if (!await fs.exists(root)) {
585
+ return [];
586
+ }
587
+ const [readError, entries] = await catchError(fs.readdir(root));
588
+ if (readError || !entries) {
589
+ return [];
590
+ }
591
+ const names = [];
592
+ for (const entry of entries) {
593
+ if (!PROFILE_NAME_RE.test(entry) || entry === DEFAULT_AUTH_PROFILE) {
594
+ continue;
595
+ }
596
+ const stats = await fs.stat(fs.path.join(root, entry));
597
+ if (stats?.isDirectory()) {
598
+ names.push(entry);
599
+ }
600
+ }
601
+ return names.sort((a, b) => a.localeCompare(b));
602
+ }
603
+ async function authProfileExistsAsync(profile) {
604
+ const fs = getFileSystem();
605
+ const [pathError, dir] = catchError(() => resolveAuthProfileDirPath(profile));
606
+ if (pathError || dir === undefined) {
607
+ return false;
608
+ }
609
+ const stats = await fs.stat(dir);
610
+ return stats?.isDirectory() === true;
611
+ }
612
+ async function deleteAuthProfileAsync(profile) {
613
+ const dir = resolveAuthProfileDirPath(profile);
614
+ const fs = getFileSystem();
615
+ const relativeToRoot = fs.path.relative(getAuthProfilesRootPath(), dir);
616
+ if (relativeToRoot === "" || relativeToRoot.startsWith("..") || fs.path.isAbsolute(relativeToRoot)) {
617
+ throw new AuthProfileValidationError(`Refusing to delete "${profile}": resolved path escapes the profiles directory.`);
618
+ }
619
+ const stats = await fs.stat(dir);
620
+ if (stats?.isDirectory() !== true) {
621
+ return;
622
+ }
623
+ await fs.rm(dir);
624
+ return dir;
625
+ }
569
626
 
570
627
  // ../auth/src/utils/jwt.ts
571
628
  class InvalidIssuerError extends Error {
@@ -1134,16 +1191,7 @@ var resolveEnvFilePathAsync = async (envFilePath = DEFAULT_ENV_FILENAME, opts) =
1134
1191
  errorMessage: location.source === "absolute" ? `Environment file not found: ${envFilePath}` : `Unable to locate environment file: ${envFilePath}. Run 'uip login' to authenticate.`
1135
1192
  };
1136
1193
  };
1137
- var loadEnvFileAsync = async ({ envPath }) => {
1138
- const fs = getFileSystem();
1139
- const absolutePath = fs.path.isAbsolute(envPath) ? envPath : fs.path.join(fs.env.cwd(), envPath);
1140
- if (!await fs.exists(absolutePath)) {
1141
- throw new Error(`Environment file not found: ${envPath}`);
1142
- }
1143
- const content = await fs.readFile(absolutePath, "utf-8");
1144
- if (content === null) {
1145
- throw new Error(`Environment file not found: ${envPath}`);
1146
- }
1194
+ var parseEnvContent = (content) => {
1147
1195
  const env = {};
1148
1196
  for (const line of content.split(`
1149
1197
  `)) {
@@ -1164,6 +1212,18 @@ var loadEnvFileAsync = async ({ envPath }) => {
1164
1212
  }
1165
1213
  return env;
1166
1214
  };
1215
+ var loadEnvFileAsync = async ({ envPath }) => {
1216
+ const fs = getFileSystem();
1217
+ const absolutePath = fs.path.isAbsolute(envPath) ? envPath : fs.path.join(fs.env.cwd(), envPath);
1218
+ if (!await fs.exists(absolutePath)) {
1219
+ throw new Error(`Environment file not found: ${envPath}`);
1220
+ }
1221
+ const content = await fs.readFile(absolutePath, "utf-8");
1222
+ if (content === null) {
1223
+ throw new Error(`Environment file not found: ${envPath}`);
1224
+ }
1225
+ return parseEnvContent(content);
1226
+ };
1167
1227
  var saveEnvFileAsync = async ({
1168
1228
  envPath,
1169
1229
  data,
@@ -1738,6 +1798,61 @@ var getAuthEnv = async (options = {}) => {
1738
1798
  }
1739
1799
  return { authEnv, loginStatus: status };
1740
1800
  };
1801
+ // ../auth/src/authProfileDetails.ts
1802
+ var ORGANIZATION_NAME_KEY = "UIPATH_ORGANIZATION_NAME";
1803
+ var TENANT_NAME_KEY = "UIPATH_TENANT_NAME";
1804
+ var URL_KEY = "UIPATH_URL";
1805
+ var ACCESS_TOKEN_KEY = "UIPATH_ACCESS_TOKEN";
1806
+ function statusFromToken(accessToken) {
1807
+ if (!accessToken) {
1808
+ return { status: "Not logged in" };
1809
+ }
1810
+ const expiration = getTokenExpiration(accessToken);
1811
+ if (expiration === undefined) {
1812
+ return { status: "Logged in" };
1813
+ }
1814
+ return {
1815
+ status: expiration.getTime() <= Date.now() ? "Expired" : "Logged in",
1816
+ expiresAt: expiration.toISOString()
1817
+ };
1818
+ }
1819
+ async function describeAuthProfileAsync(name, filePath, active) {
1820
+ const base = {
1821
+ name,
1822
+ active,
1823
+ ...filePath ? { path: filePath } : {}
1824
+ };
1825
+ if (!filePath) {
1826
+ return { ...base, status: "Not logged in" };
1827
+ }
1828
+ const fs = getFileSystem();
1829
+ const [readError, content] = await catchError(fs.readFile(filePath, "utf-8"));
1830
+ if (readError) {
1831
+ return { ...base, status: "Unreadable" };
1832
+ }
1833
+ if (content === null || content === undefined) {
1834
+ return { ...base, status: "Not logged in" };
1835
+ }
1836
+ const values = parseEnvContent(content);
1837
+ return {
1838
+ ...base,
1839
+ ...values[ORGANIZATION_NAME_KEY] ? { organizationName: values[ORGANIZATION_NAME_KEY] } : {},
1840
+ ...values[TENANT_NAME_KEY] ? { tenantName: values[TENANT_NAME_KEY] } : {},
1841
+ ...values[URL_KEY] ? { url: values[URL_KEY] } : {},
1842
+ ...statusFromToken(values[ACCESS_TOKEN_KEY])
1843
+ };
1844
+ }
1845
+ async function describeAuthProfilesAsync() {
1846
+ const activeProfile = getActiveAuthProfile();
1847
+ const [defaultPathError, defaultLocation] = await catchError(resolveEnvFilePathAsync());
1848
+ const rows = [
1849
+ await describeAuthProfileAsync(DEFAULT_AUTH_PROFILE, defaultPathError ? undefined : defaultLocation?.absolutePath, activeProfile === undefined)
1850
+ ];
1851
+ for (const name of await listAuthProfileNamesAsync()) {
1852
+ rows.push(await describeAuthProfileAsync(name, resolveAuthProfileFilePath(name), activeProfile === name));
1853
+ }
1854
+ return rows;
1855
+ }
1741
1856
  // ../auth/src/tokenGrant.ts
1742
1857
  var requestClientCredentialsToken = async ({
1743
1858
  tokenEndpoint,
@@ -2320,6 +2435,6 @@ var authenticate = async ({
2320
2435
  });
2321
2436
  };
2322
2437
 
2323
- export { setAuthFileConfig, InvalidBaseUrlError, DEFAULT_AUTH_PROFILE, AuthProfileValidationError, normalizeAuthProfileName, setActiveAuthProfile, clearActiveAuthProfile, getActiveAuthProfile, runWithAuthProfile, resolveAuthProfileFilePath, getActiveAuthProfileFilePath, parseJWT, parseAuthFlow, resolveSessionIdentity, ENV_AUTH_ENABLE_VAR, ENFORCE_ROBOT_AUTH_VAR, ENV_AUTH_VARS, EnvAuthConfigError, isEnvAuthEnabled, isRobotAuthEnforced, readAuthFromEnv, refreshTokenFingerprint, loadRefreshBreaker, saveRefreshBreaker, clearRefreshBreaker, registerRobotClientLoader, TokenRefreshOAuthError, isTokenRefreshOAuthFailure, refreshAccessToken, AUTH_FLOW_ENV_VAR, DEFAULT_AUTH_FILENAME, DEFAULT_ENV_FILENAME, resolveEnvFileLocationAsync, resolveEnvFilePathAsync, loadEnvFileAsync, saveEnvFileAsync, CredentialSource, getLoginStatusAsync, getLoginStatusWithDeps, getAuthContext, getAuthEnv, ClientCredentialsAuthenticationError, clientCredentialsLogin, JWT_BEARER_ASSERTION_TYPE, FederatedCredentialsAuthenticationError, federatedCredentialsLogin, fetchTenantsAndOrganizations, TENANT_SELECTION_REQUIRED_CODE, INVALID_TENANT_CODE, TenantSelectionError, TenantSelectionRequiredError, InvalidTenantError, isTenantSelectionError, selectTenantWithDeps, interactiveLoginWithDeps, interactiveLogin, logoutWithDeps, logout, authenticate };
2438
+ export { setAuthFileConfig, InvalidBaseUrlError, DEFAULT_AUTH_PROFILE, AuthProfileValidationError, normalizeAuthProfileName, setActiveAuthProfile, clearActiveAuthProfile, getActiveAuthProfile, runWithAuthProfile, resolveAuthProfileFilePath, getActiveAuthProfileFilePath, getAuthProfilesRootPath, resolveAuthProfileDirPath, listAuthProfileNamesAsync, authProfileExistsAsync, deleteAuthProfileAsync, parseJWT, parseAuthFlow, resolveSessionIdentity, ENV_AUTH_ENABLE_VAR, ENFORCE_ROBOT_AUTH_VAR, ENV_AUTH_VARS, EnvAuthConfigError, isEnvAuthEnabled, isRobotAuthEnforced, readAuthFromEnv, refreshTokenFingerprint, loadRefreshBreaker, saveRefreshBreaker, clearRefreshBreaker, registerRobotClientLoader, TokenRefreshOAuthError, isTokenRefreshOAuthFailure, refreshAccessToken, AUTH_FLOW_ENV_VAR, DEFAULT_AUTH_FILENAME, DEFAULT_ENV_FILENAME, resolveEnvFileLocationAsync, resolveEnvFilePathAsync, loadEnvFileAsync, saveEnvFileAsync, CredentialSource, getLoginStatusAsync, getLoginStatusWithDeps, getAuthContext, getAuthEnv, describeAuthProfilesAsync, ClientCredentialsAuthenticationError, clientCredentialsLogin, JWT_BEARER_ASSERTION_TYPE, FederatedCredentialsAuthenticationError, federatedCredentialsLogin, fetchTenantsAndOrganizations, TENANT_SELECTION_REQUIRED_CODE, INVALID_TENANT_CODE, TenantSelectionError, TenantSelectionRequiredError, InvalidTenantError, isTenantSelectionError, selectTenantWithDeps, interactiveLoginWithDeps, interactiveLogin, logoutWithDeps, logout, authenticate };
2324
2439
 
2325
- //# debugId=3D2BACA7964D278C64756E2164756E21
2440
+ //# debugId=E7AC7F320178FAB464756E2164756E21