@capgo/cli 7.62.2 → 7.64.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/README.md +33 -2
- package/dist/index.js +413 -392
- package/dist/package.json +2 -3
- package/dist/src/api/app.d.ts +2 -2
- package/dist/src/api/channels.d.ts +952 -63
- package/dist/src/api/cryptoV2.d.ts +0 -1
- package/dist/src/api/update.d.ts +0 -1
- package/dist/src/api/versions.d.ts +0 -1
- package/dist/src/app/add.d.ts +0 -1
- package/dist/src/app/debug.d.ts +0 -1
- package/dist/src/app/delete.d.ts +0 -1
- package/dist/src/app/info.d.ts +0 -1
- package/dist/src/app/list.d.ts +0 -1
- package/dist/src/app/set.d.ts +0 -1
- package/dist/src/app/setting.d.ts +0 -1
- package/dist/src/build/credentials-command.d.ts +0 -1
- package/dist/src/build/credentials.d.ts +0 -1
- package/dist/src/build/request.d.ts +0 -1
- package/dist/src/bundle/check.d.ts +0 -1
- package/dist/src/bundle/cleanup.d.ts +0 -1
- package/dist/src/bundle/compatibility.d.ts +0 -1
- package/dist/src/bundle/decryptV2.d.ts +0 -1
- package/dist/src/bundle/delete.d.ts +0 -1
- package/dist/src/bundle/encryptV2.d.ts +0 -1
- package/dist/src/bundle/list.d.ts +0 -1
- package/dist/src/bundle/partial.d.ts +0 -1
- package/dist/src/bundle/unlink.d.ts +0 -1
- package/dist/src/bundle/upload.d.ts +0 -1
- package/dist/src/bundle/upload_interface.d.ts +0 -1
- package/dist/src/bundle/zip.d.ts +0 -1
- package/dist/src/channel/add.d.ts +0 -1
- package/dist/src/channel/currentBundle.d.ts +0 -1
- package/dist/src/channel/delete.d.ts +0 -1
- package/dist/src/channel/list.d.ts +0 -1
- package/dist/src/channel/set.d.ts +0 -1
- package/dist/src/checksum.d.ts +0 -1
- package/dist/src/config/index.d.ts +0 -1
- package/dist/src/docs.d.ts +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/init.d.ts +0 -1
- package/dist/src/keyV2.d.ts +0 -1
- package/dist/src/login.d.ts +0 -1
- package/dist/src/mcp/server.d.ts +0 -1
- package/dist/src/organization/add.d.ts +3 -1
- package/dist/src/organization/delete.d.ts +0 -1
- package/dist/src/organization/index.d.ts +1 -1
- package/dist/src/organization/list.d.ts +4 -1
- package/dist/src/organization/members.d.ts +11 -0
- package/dist/src/organization/set.d.ts +2 -1
- package/dist/src/sdk.d.ts +6 -1
- package/dist/src/sdk.js +319 -308
- package/dist/src/types/supabase.types.d.ts +508 -29
- package/dist/src/user/account.d.ts +0 -1
- package/dist/src/utils/latest-version.d.ts +0 -1
- package/dist/src/utils/security_policy_errors.d.ts +50 -0
- package/dist/src/utils.d.ts +477 -27
- package/dist/src/versionHelpers.d.ts +0 -1
- package/package.json +2 -3
- package/dist/src/api/app.d.ts.map +0 -1
- package/dist/src/api/channels.d.ts.map +0 -1
- package/dist/src/api/cryptoV2.d.ts.map +0 -1
- package/dist/src/api/update.d.ts.map +0 -1
- package/dist/src/api/versions.d.ts.map +0 -1
- package/dist/src/app/add.d.ts.map +0 -1
- package/dist/src/app/debug.d.ts.map +0 -1
- package/dist/src/app/delete.d.ts.map +0 -1
- package/dist/src/app/info.d.ts.map +0 -1
- package/dist/src/app/list.d.ts.map +0 -1
- package/dist/src/app/set.d.ts.map +0 -1
- package/dist/src/app/setting.d.ts.map +0 -1
- package/dist/src/build/credentials-command.d.ts.map +0 -1
- package/dist/src/build/credentials.d.ts.map +0 -1
- package/dist/src/build/request.d.ts.map +0 -1
- package/dist/src/bundle/check.d.ts.map +0 -1
- package/dist/src/bundle/cleanup.d.ts.map +0 -1
- package/dist/src/bundle/compatibility.d.ts.map +0 -1
- package/dist/src/bundle/decryptV2.d.ts.map +0 -1
- package/dist/src/bundle/delete.d.ts.map +0 -1
- package/dist/src/bundle/encryptV2.d.ts.map +0 -1
- package/dist/src/bundle/list.d.ts.map +0 -1
- package/dist/src/bundle/partial.d.ts.map +0 -1
- package/dist/src/bundle/unlink.d.ts.map +0 -1
- package/dist/src/bundle/upload.d.ts.map +0 -1
- package/dist/src/bundle/upload_interface.d.ts.map +0 -1
- package/dist/src/bundle/zip.d.ts.map +0 -1
- package/dist/src/channel/add.d.ts.map +0 -1
- package/dist/src/channel/currentBundle.d.ts.map +0 -1
- package/dist/src/channel/delete.d.ts.map +0 -1
- package/dist/src/channel/list.d.ts.map +0 -1
- package/dist/src/channel/set.d.ts.map +0 -1
- package/dist/src/checksum.d.ts.map +0 -1
- package/dist/src/config/index.d.ts.map +0 -1
- package/dist/src/docs.d.ts.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/init.d.ts.map +0 -1
- package/dist/src/keyV2.d.ts.map +0 -1
- package/dist/src/login.d.ts.map +0 -1
- package/dist/src/mcp/server.d.ts.map +0 -1
- package/dist/src/organization/add.d.ts.map +0 -1
- package/dist/src/organization/delete.d.ts.map +0 -1
- package/dist/src/organization/index.d.ts.map +0 -1
- package/dist/src/organization/list.d.ts.map +0 -1
- package/dist/src/organization/set.d.ts.map +0 -1
- package/dist/src/sdk.d.ts.map +0 -1
- package/dist/src/types/supabase.types.d.ts.map +0 -1
- package/dist/src/user/account.d.ts.map +0 -1
- package/dist/src/utils/latest-version.d.ts.map +0 -1
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/versionHelpers.d.ts.map +0 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Policy Error Handling for CLI, SDK, and MCP
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for parsing and displaying security policy errors
|
|
5
|
+
* returned from the Capgo API. It transforms error codes into human-readable messages.
|
|
6
|
+
*
|
|
7
|
+
* Note: These are the error codes actually returned by the backend API.
|
|
8
|
+
* Other security policies (2FA, password policy, hashed API keys) are enforced
|
|
9
|
+
* via RLS which returns generic permission denied errors.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SECURITY_POLICY_ERRORS: {
|
|
12
|
+
readonly ORG_REQUIRES_EXPIRING_KEY: "org_requires_expiring_key";
|
|
13
|
+
readonly EXPIRATION_REQUIRED: "expiration_required";
|
|
14
|
+
readonly EXPIRATION_EXCEEDS_MAX: "expiration_exceeds_max";
|
|
15
|
+
};
|
|
16
|
+
export type SecurityPolicyErrorCode = typeof SECURITY_POLICY_ERRORS[keyof typeof SECURITY_POLICY_ERRORS];
|
|
17
|
+
export declare const SECURITY_POLICY_MESSAGES: Record<string, string>;
|
|
18
|
+
export interface ParsedSecurityError {
|
|
19
|
+
isSecurityPolicyError: boolean;
|
|
20
|
+
errorCode: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if an error code is a security policy error.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isSecurityPolicyError(errorCode: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Parse an error response and return formatted security policy information.
|
|
29
|
+
*
|
|
30
|
+
* @param error - The error object or error message from the API
|
|
31
|
+
* @returns ParsedSecurityError with formatted message and metadata
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseSecurityPolicyError(error: unknown): ParsedSecurityError;
|
|
34
|
+
/**
|
|
35
|
+
* Get a human-readable message for a security policy error code.
|
|
36
|
+
* Returns the original message if not a security policy error.
|
|
37
|
+
*
|
|
38
|
+
* @param errorCode - The error code from the API
|
|
39
|
+
* @param defaultMessage - The default message to use if not a security policy error
|
|
40
|
+
* @returns Human-readable error message
|
|
41
|
+
*/
|
|
42
|
+
export declare function getSecurityPolicyMessage(errorCode: string, defaultMessage?: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Format an API error for CLI display with security policy awareness.
|
|
45
|
+
* This should be used when displaying errors to users in the CLI.
|
|
46
|
+
*
|
|
47
|
+
* @param error - The error object from the API
|
|
48
|
+
* @returns Formatted error string for CLI display
|
|
49
|
+
*/
|
|
50
|
+
export declare function formatApiErrorForCli(error: unknown): string;
|