@sitecore-content-sdk/cli 0.2.0-beta.10 → 0.2.0-beta.11
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/cjs/scripts/auth/index.js +26 -0
- package/dist/cjs/scripts/auth/list.js +36 -0
- package/dist/cjs/scripts/auth/login.js +112 -0
- package/dist/cjs/scripts/auth/logout.js +28 -0
- package/dist/cjs/scripts/auth/models.js +2 -0
- package/dist/cjs/scripts/auth/status.js +34 -0
- package/dist/cjs/scripts/index.js +3 -1
- package/dist/cjs/utils/auth/flow.js +72 -0
- package/dist/cjs/utils/auth/renewal.js +95 -0
- package/dist/cjs/utils/auth/tenant-state.js +91 -0
- package/dist/cjs/utils/auth/tenant-store.js +212 -0
- package/dist/esm/scripts/auth/index.js +23 -0
- package/dist/esm/scripts/auth/list.js +33 -0
- package/dist/esm/scripts/auth/login.js +109 -0
- package/dist/esm/scripts/auth/logout.js +25 -0
- package/dist/esm/scripts/auth/models.js +1 -0
- package/dist/esm/scripts/auth/status.js +31 -0
- package/dist/esm/scripts/index.js +2 -0
- package/dist/esm/utils/auth/flow.js +68 -0
- package/dist/esm/utils/auth/renewal.js +90 -0
- package/dist/esm/utils/auth/tenant-state.js +53 -0
- package/dist/esm/utils/auth/tenant-store.js +170 -0
- package/package.json +3 -3
- package/types/scripts/auth/index.d.ts +7 -0
- package/types/scripts/auth/list.d.ts +2 -0
- package/types/scripts/auth/login.d.ts +3 -0
- package/types/scripts/auth/logout.d.ts +2 -0
- package/types/scripts/auth/models.d.ts +94 -0
- package/types/scripts/auth/status.d.ts +2 -0
- package/types/scripts/index.d.ts +2 -0
- package/types/utils/auth/flow.d.ts +24 -0
- package/types/utils/auth/renewal.d.ts +22 -0
- package/types/utils/auth/tenant-state.d.ts +14 -0
- package/types/utils/auth/tenant-store.d.ts +40 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import * as fs from 'fs';
|
|
11
|
+
import * as path from 'path';
|
|
12
|
+
import * as os from 'os';
|
|
13
|
+
const CLAIMS = 'https://auth.sitecorecloud.io/claims';
|
|
14
|
+
const rootDir = path.join(os.homedir(), '.sitecore', 'sitecore-tools');
|
|
15
|
+
/**
|
|
16
|
+
* Get the full path to the tenant-specific folder.
|
|
17
|
+
* @param {string} tenantId - The tenant ID.
|
|
18
|
+
* @returns The absolute path to the tenant directory.
|
|
19
|
+
*/
|
|
20
|
+
function getTenantPath(tenantId) {
|
|
21
|
+
return path.join(rootDir, tenantId);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Write the authentication configuration for a tenant.
|
|
25
|
+
* @param {string} tenantId - The tenant ID.
|
|
26
|
+
* @param {TenantAuth} authInfo - The tenant's auth data.
|
|
27
|
+
*/
|
|
28
|
+
export function writeTenantAuthInfo(tenantId, authInfo) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
try {
|
|
31
|
+
const dir = getTenantPath(tenantId);
|
|
32
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
33
|
+
fs.writeFileSync(path.join(dir, 'auth.json'), JSON.stringify(authInfo, null, 2));
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error(`\n Failed to write auth.json for tenant '${tenantId}': ${error.message}`);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Read the authentication configuration for a tenant.
|
|
42
|
+
* @param {string} tenantId - The tenant ID.
|
|
43
|
+
* @returns Parsed auth config or null if not found or failed to read.
|
|
44
|
+
*/
|
|
45
|
+
export function readTenantAuthInfo(tenantId) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const filePath = path.join(getTenantPath(tenantId), 'auth.json');
|
|
48
|
+
if (!fs.existsSync(filePath))
|
|
49
|
+
return null;
|
|
50
|
+
try {
|
|
51
|
+
const raw = fs.readFileSync(filePath, 'utf-8');
|
|
52
|
+
return JSON.parse(raw);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error(`\n Failed to read auth.json for tenant '${tenantId}': ${error.message}`);
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Write the public metadata information for a tenant.
|
|
62
|
+
* @param {TenantInfo} info - The tenant info object.
|
|
63
|
+
*/
|
|
64
|
+
export function writeTenantInfo(info) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
try {
|
|
67
|
+
const dir = getTenantPath(info.tenantId);
|
|
68
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
69
|
+
fs.writeFileSync(path.join(dir, 'info.json'), JSON.stringify(info, null, 2));
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
console.error(`\n Failed to write info.json for tenant '${info.tenantId}': ${error.message}`);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Read the public metadata information for a tenant.
|
|
78
|
+
* @param {string} tenantId - The tenant ID.
|
|
79
|
+
* @returns Parsed tenant info or null if not found or failed to read.
|
|
80
|
+
*/
|
|
81
|
+
export function readTenantInfo(tenantId) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const infoFilePath = path.join(getTenantPath(tenantId), 'info.json');
|
|
84
|
+
if (!fs.existsSync(infoFilePath)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const content = fs.readFileSync(infoFilePath, 'utf-8');
|
|
89
|
+
return JSON.parse(content);
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.error(`\n Failed to read info.json for tenant '${tenantId}': ${error.message}`);
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deletes the stored auth.json file for the given tenant.
|
|
99
|
+
* @param {string} tenantId - The tenant ID.
|
|
100
|
+
*/
|
|
101
|
+
export function deleteTenantAuthInfo(tenantId) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
const filePath = path.join(getTenantPath(tenantId), 'auth.json');
|
|
104
|
+
try {
|
|
105
|
+
if (fs.existsSync(filePath)) {
|
|
106
|
+
fs.unlinkSync(filePath);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
console.error(`\n Failed to delete auth.json for tenant '${tenantId}': ${error.message}`);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Scans the CLI root directory and returns all valid tenant infos.
|
|
116
|
+
* @returns A list of TenantInfo objects found in {tenant-id}/info.json files.
|
|
117
|
+
*/
|
|
118
|
+
export function getAllTenantsInfo() {
|
|
119
|
+
if (!fs.existsSync(rootDir))
|
|
120
|
+
return [];
|
|
121
|
+
const subDirs = fs
|
|
122
|
+
.readdirSync(rootDir)
|
|
123
|
+
.filter((entry) => fs.statSync(path.join(rootDir, entry)).isDirectory());
|
|
124
|
+
const tenants = [];
|
|
125
|
+
for (const dir of subDirs) {
|
|
126
|
+
const infoPath = path.join(rootDir, dir, 'info.json');
|
|
127
|
+
if (fs.existsSync(infoPath)) {
|
|
128
|
+
try {
|
|
129
|
+
const content = fs.readFileSync(infoPath, 'utf-8');
|
|
130
|
+
const data = JSON.parse(content);
|
|
131
|
+
if (data.tenantId && data.tenantName && data.organizationId && data.clientId) {
|
|
132
|
+
tenants.push({
|
|
133
|
+
tenantId: data.tenantId,
|
|
134
|
+
tenantName: data.tenantName,
|
|
135
|
+
organizationId: data.organizationId,
|
|
136
|
+
clientId: data.clientId,
|
|
137
|
+
authority: data.authority,
|
|
138
|
+
audience: data.audience,
|
|
139
|
+
baseUrl: data.baseUrl,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
console.error('\n Failed to read tenant info file', error.message);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return tenants;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Decodes a JWT without verifying its signature.
|
|
152
|
+
* @param {string} token - The access token string.
|
|
153
|
+
* @returns Decoded payload object or null if invalid.
|
|
154
|
+
*/
|
|
155
|
+
export function decodeJwtPayload(token) {
|
|
156
|
+
try {
|
|
157
|
+
const base64Payload = token.split('.')[1];
|
|
158
|
+
const payload = Buffer.from(base64Payload, 'base64').toString('utf-8');
|
|
159
|
+
const decoded = JSON.parse(payload);
|
|
160
|
+
return {
|
|
161
|
+
tokenTenantId: decoded === null || decoded === void 0 ? void 0 : decoded[`${CLAIMS}/tenant_id`],
|
|
162
|
+
tokenOrgId: decoded === null || decoded === void 0 ? void 0 : decoded[`${CLAIMS}/org_id`],
|
|
163
|
+
tokenTenantName: decoded === null || decoded === void 0 ? void 0 : decoded[`${CLAIMS}/tenant_name`],
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
console.error('\n Failed to decode access token:', error.message);
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/cli",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.11",
|
|
4
4
|
"description": "Sitecore Content SDK CLI",
|
|
5
5
|
"main": "dist/cjs/cli.js",
|
|
6
6
|
"module": "dist/esm/cli.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@sitecore-content-sdk/core": "0.2.0-beta.
|
|
37
|
+
"@sitecore-content-sdk/core": "0.2.0-beta.11",
|
|
38
38
|
"dotenv": "^16.5.0",
|
|
39
39
|
"dotenv-expand": "^12.0.2",
|
|
40
40
|
"resolve": "^1.22.10",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"ts-node": "^10.9.1",
|
|
61
61
|
"typescript": "~5.8.3"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "6333d92ea071db49f8467e4c6259c6a82ae3a69f",
|
|
64
64
|
"files": [
|
|
65
65
|
"dist",
|
|
66
66
|
"types"
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Argv } from 'yargs';
|
|
2
|
+
/**
|
|
3
|
+
* Registers the `auth` command group and its subcommands (`login`, `logout`, `status`, `list`) with Yargs.
|
|
4
|
+
* @param {Argv} yargs - The Yargs instance used to define CLI commands.
|
|
5
|
+
* @returns The configured Yargs command group for authentication operations.
|
|
6
|
+
*/
|
|
7
|
+
export declare function builder(yargs: Argv): Argv<{}>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI arguments used for authentication and tenant identification.
|
|
3
|
+
*/
|
|
4
|
+
export interface TenantArgs {
|
|
5
|
+
/**
|
|
6
|
+
* OAuth2 client ID used to identify the application
|
|
7
|
+
*/
|
|
8
|
+
clientId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Client secret used for client credentials flow
|
|
11
|
+
*/
|
|
12
|
+
clientSecret?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Organization ID associated with the tenant
|
|
15
|
+
*/
|
|
16
|
+
organizationId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Tenant ID used for scoping the login
|
|
19
|
+
*/
|
|
20
|
+
tenantId?: string;
|
|
21
|
+
/**
|
|
22
|
+
* OAuth2 audience (e.g., API base URL the token is intended for)
|
|
23
|
+
*/
|
|
24
|
+
audience?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Auth authority/issuer URL (e.g., Sitecore identity endpoint)
|
|
27
|
+
*/
|
|
28
|
+
authority?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Base URL for the target Sitecore Content Management API
|
|
31
|
+
*/
|
|
32
|
+
baseUrl?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TenantSettings {
|
|
35
|
+
/**
|
|
36
|
+
* Currently active tenant ID tracked by the CLI
|
|
37
|
+
*/
|
|
38
|
+
activeTenant?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Auth configuration stored per tenant for accessing Sitecore APIs.
|
|
42
|
+
*/
|
|
43
|
+
export interface TenantAuth {
|
|
44
|
+
/**
|
|
45
|
+
* Access token issued by the identity provider
|
|
46
|
+
*/
|
|
47
|
+
access_token: string;
|
|
48
|
+
/**
|
|
49
|
+
* Token expiration duration in seconds
|
|
50
|
+
*/
|
|
51
|
+
expires_in: number;
|
|
52
|
+
/**
|
|
53
|
+
* Exact ISO timestamp when the token expires
|
|
54
|
+
*/
|
|
55
|
+
expires_at: string;
|
|
56
|
+
/**
|
|
57
|
+
* Secret used for client credentials flow and re-authenticate
|
|
58
|
+
*/
|
|
59
|
+
clientSecret?: string;
|
|
60
|
+
refresh_token?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Public metadata for a known tenant.
|
|
64
|
+
*/
|
|
65
|
+
export interface TenantInfo {
|
|
66
|
+
/**
|
|
67
|
+
* Unique ID of the tenant
|
|
68
|
+
*/
|
|
69
|
+
tenantId: string;
|
|
70
|
+
/**
|
|
71
|
+
* Human-readable name of the tenant
|
|
72
|
+
*/
|
|
73
|
+
tenantName: string;
|
|
74
|
+
/**
|
|
75
|
+
* Organization ID the tenant belongs to
|
|
76
|
+
*/
|
|
77
|
+
organizationId: string;
|
|
78
|
+
/**
|
|
79
|
+
* Client ID associated with this tenant's authentication
|
|
80
|
+
*/
|
|
81
|
+
clientId: string;
|
|
82
|
+
/**
|
|
83
|
+
* OAuth2 audience (e.g., API base URL the token is intended for)
|
|
84
|
+
*/
|
|
85
|
+
audience: string;
|
|
86
|
+
/**
|
|
87
|
+
* Auth authority/issuer URL (e.g., Sitecore identity endpoint)
|
|
88
|
+
*/
|
|
89
|
+
authority: string;
|
|
90
|
+
/**
|
|
91
|
+
* Base URL for the target Sitecore Content Management API
|
|
92
|
+
*/
|
|
93
|
+
baseUrl: string;
|
|
94
|
+
}
|
package/types/scripts/index.d.ts
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TenantArgs } from '../../scripts/auth/models';
|
|
2
|
+
export declare const AUTH0_DOMAIN = "https://auth.sitecorecloud.io";
|
|
3
|
+
export declare const AUDIENCE = "https://api.sitecorecloud.io";
|
|
4
|
+
export declare const BASE_URL = "https://edge-platform.sitecorecloud.io/cs/api";
|
|
5
|
+
/**
|
|
6
|
+
* Performs the OAuth 2.0 client credentials flow to obtain a JWT access token
|
|
7
|
+
* from the Sitecore Identity Provider using the provided client credentials.
|
|
8
|
+
* @param {object} [args] - The arguments for client credentials flow
|
|
9
|
+
* @param {string} [args.clientId] - The client ID registered with Sitecore Identity
|
|
10
|
+
* @param {string} [args.clientSecret] - The client secret associated with the client ID
|
|
11
|
+
* @param {string} [args.organizationId] - The ID of the organization the client belongs to
|
|
12
|
+
* @param {string} [args.tenantId] - The tenant ID representing the specific Sitecore environment
|
|
13
|
+
* @param {string} [args.audience] - The API audience the token is intended for. Defaults to `AUDIENCE`
|
|
14
|
+
* @param {string} [args.authority] - The auth server base URL. Defaults to `AUTH0_DOMAIN`
|
|
15
|
+
* @param {string} [args.baseUrl] - The base URL for the API, used to construct the audience
|
|
16
|
+
* @returns A Promise that resolves to the access token response (including access token, token type, expiry, etc.)
|
|
17
|
+
* @throws Will log and exit the process if the request fails or returns a non-OK status
|
|
18
|
+
*/
|
|
19
|
+
export declare function clientCredentialsFlow({ clientId, clientSecret, organizationId, tenantId, audience, authority, baseUrl, }: TenantArgs): Promise<{
|
|
20
|
+
data: any;
|
|
21
|
+
tokenOrgId: any;
|
|
22
|
+
tokenTenantId: any;
|
|
23
|
+
tokenTenantName: any;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TenantAuth, TenantInfo } from './../../scripts/auth/models';
|
|
2
|
+
/**
|
|
3
|
+
* Validates whether a given auth config is still valid (i.e., not expired).
|
|
4
|
+
* @param {TenantAuth} authInfo - The tenant auth configuration.
|
|
5
|
+
* @returns True if the token is still valid, false if expired.
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateAuthInfo(authInfo: TenantAuth): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Renews the token for a given tenant using stored credentials.
|
|
10
|
+
* @param {TenantAuth} authInfo - Current authentication info for the tenant.
|
|
11
|
+
* @param {TenantInfo} tenantInfo - Public metadata about the tenant (e.g., clientId).
|
|
12
|
+
* @returns Promise<void>
|
|
13
|
+
* @throws If credentials are missing or renewal fails.
|
|
14
|
+
*/
|
|
15
|
+
export declare function renewClientToken(authInfo: TenantAuth, tenantInfo: TenantInfo): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Ensures a valid token exists, renews it if expired.
|
|
18
|
+
* Returns tenant context if successful, otherwise null.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renewAuthIfExpired(): Promise<{
|
|
21
|
+
tenantId: string;
|
|
22
|
+
} | null>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the ID of the currently active tenant from settings.json.
|
|
3
|
+
* @returns The active tenant ID if present, otherwise null.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getActiveTenant(): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Sets the currently active tenant by writing to settings.json.
|
|
8
|
+
* @param {string} tenantId - The tenant ID to set as active.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setActiveTenant(tenantId: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Clears the currently active tenant from settings.json by deleting the file.
|
|
13
|
+
*/
|
|
14
|
+
export declare function clearActiveTenant(): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TenantAuth, TenantInfo } from './../../scripts/auth/models';
|
|
2
|
+
/**
|
|
3
|
+
* Write the authentication configuration for a tenant.
|
|
4
|
+
* @param {string} tenantId - The tenant ID.
|
|
5
|
+
* @param {TenantAuth} authInfo - The tenant's auth data.
|
|
6
|
+
*/
|
|
7
|
+
export declare function writeTenantAuthInfo(tenantId: string, authInfo: TenantAuth): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Read the authentication configuration for a tenant.
|
|
10
|
+
* @param {string} tenantId - The tenant ID.
|
|
11
|
+
* @returns Parsed auth config or null if not found or failed to read.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readTenantAuthInfo(tenantId: string): Promise<TenantAuth | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Write the public metadata information for a tenant.
|
|
16
|
+
* @param {TenantInfo} info - The tenant info object.
|
|
17
|
+
*/
|
|
18
|
+
export declare function writeTenantInfo(info: TenantInfo): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Read the public metadata information for a tenant.
|
|
21
|
+
* @param {string} tenantId - The tenant ID.
|
|
22
|
+
* @returns Parsed tenant info or null if not found or failed to read.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readTenantInfo(tenantId: string): Promise<TenantInfo | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Deletes the stored auth.json file for the given tenant.
|
|
27
|
+
* @param {string} tenantId - The tenant ID.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deleteTenantAuthInfo(tenantId: string): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Scans the CLI root directory and returns all valid tenant infos.
|
|
32
|
+
* @returns A list of TenantInfo objects found in {tenant-id}/info.json files.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getAllTenantsInfo(): TenantInfo[];
|
|
35
|
+
/**
|
|
36
|
+
* Decodes a JWT without verifying its signature.
|
|
37
|
+
* @param {string} token - The access token string.
|
|
38
|
+
* @returns Decoded payload object or null if invalid.
|
|
39
|
+
*/
|
|
40
|
+
export declare function decodeJwtPayload(token: string): Record<string, any> | null;
|