@sitecore-content-sdk/cli 0.2.0-beta.12 → 0.2.0-beta.14

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.
@@ -1,24 +0,0 @@
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
- }>;
@@ -1,22 +0,0 @@
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>;
@@ -1,14 +0,0 @@
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;
@@ -1,40 +0,0 @@
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;