@capgo/cli 7.63.0 → 7.64.1

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.
Files changed (109) hide show
  1. package/README.md +131 -14
  2. package/dist/index.js +413 -392
  3. package/dist/package.json +2 -3
  4. package/dist/src/api/app.d.ts +2 -2
  5. package/dist/src/api/channels.d.ts +952 -63
  6. package/dist/src/api/cryptoV2.d.ts +0 -1
  7. package/dist/src/api/update.d.ts +0 -1
  8. package/dist/src/api/versions.d.ts +0 -1
  9. package/dist/src/app/add.d.ts +0 -1
  10. package/dist/src/app/debug.d.ts +0 -1
  11. package/dist/src/app/delete.d.ts +0 -1
  12. package/dist/src/app/info.d.ts +0 -1
  13. package/dist/src/app/list.d.ts +0 -1
  14. package/dist/src/app/set.d.ts +0 -1
  15. package/dist/src/app/setting.d.ts +0 -1
  16. package/dist/src/build/credentials-command.d.ts +0 -1
  17. package/dist/src/build/credentials.d.ts +0 -1
  18. package/dist/src/build/request.d.ts +0 -1
  19. package/dist/src/bundle/check.d.ts +0 -1
  20. package/dist/src/bundle/cleanup.d.ts +0 -1
  21. package/dist/src/bundle/compatibility.d.ts +0 -1
  22. package/dist/src/bundle/decryptV2.d.ts +0 -1
  23. package/dist/src/bundle/delete.d.ts +0 -1
  24. package/dist/src/bundle/encryptV2.d.ts +0 -1
  25. package/dist/src/bundle/list.d.ts +0 -1
  26. package/dist/src/bundle/partial.d.ts +0 -1
  27. package/dist/src/bundle/unlink.d.ts +0 -1
  28. package/dist/src/bundle/upload.d.ts +0 -1
  29. package/dist/src/bundle/upload_interface.d.ts +0 -1
  30. package/dist/src/bundle/zip.d.ts +0 -1
  31. package/dist/src/channel/add.d.ts +0 -1
  32. package/dist/src/channel/currentBundle.d.ts +0 -1
  33. package/dist/src/channel/delete.d.ts +0 -1
  34. package/dist/src/channel/list.d.ts +0 -1
  35. package/dist/src/channel/set.d.ts +0 -1
  36. package/dist/src/checksum.d.ts +0 -1
  37. package/dist/src/config/index.d.ts +0 -1
  38. package/dist/src/docs.d.ts +0 -1
  39. package/dist/src/index.d.ts +0 -1
  40. package/dist/src/init.d.ts +0 -1
  41. package/dist/src/keyV2.d.ts +0 -1
  42. package/dist/src/login.d.ts +0 -1
  43. package/dist/src/mcp/server.d.ts +0 -1
  44. package/dist/src/{organisation → organization}/add.d.ts +3 -1
  45. package/dist/src/{organisation → organization}/delete.d.ts +0 -1
  46. package/dist/src/{organisation → organization}/index.d.ts +1 -1
  47. package/dist/src/{organisation → organization}/list.d.ts +4 -1
  48. package/dist/src/organization/members.d.ts +11 -0
  49. package/dist/src/{organisation → organization}/set.d.ts +2 -1
  50. package/dist/src/sdk.d.ts +6 -1
  51. package/dist/src/sdk.js +319 -308
  52. package/dist/src/types/supabase.types.d.ts +508 -29
  53. package/dist/src/user/account.d.ts +0 -1
  54. package/dist/src/utils/latest-version.d.ts +0 -1
  55. package/dist/src/utils/security_policy_errors.d.ts +50 -0
  56. package/dist/src/utils.d.ts +477 -27
  57. package/dist/src/versionHelpers.d.ts +0 -1
  58. package/package.json +2 -3
  59. package/dist/src/api/app.d.ts.map +0 -1
  60. package/dist/src/api/channels.d.ts.map +0 -1
  61. package/dist/src/api/cryptoV2.d.ts.map +0 -1
  62. package/dist/src/api/update.d.ts.map +0 -1
  63. package/dist/src/api/versions.d.ts.map +0 -1
  64. package/dist/src/app/add.d.ts.map +0 -1
  65. package/dist/src/app/debug.d.ts.map +0 -1
  66. package/dist/src/app/delete.d.ts.map +0 -1
  67. package/dist/src/app/info.d.ts.map +0 -1
  68. package/dist/src/app/list.d.ts.map +0 -1
  69. package/dist/src/app/set.d.ts.map +0 -1
  70. package/dist/src/app/setting.d.ts.map +0 -1
  71. package/dist/src/build/credentials-command.d.ts.map +0 -1
  72. package/dist/src/build/credentials.d.ts.map +0 -1
  73. package/dist/src/build/request.d.ts.map +0 -1
  74. package/dist/src/bundle/check.d.ts.map +0 -1
  75. package/dist/src/bundle/cleanup.d.ts.map +0 -1
  76. package/dist/src/bundle/compatibility.d.ts.map +0 -1
  77. package/dist/src/bundle/decryptV2.d.ts.map +0 -1
  78. package/dist/src/bundle/delete.d.ts.map +0 -1
  79. package/dist/src/bundle/encryptV2.d.ts.map +0 -1
  80. package/dist/src/bundle/list.d.ts.map +0 -1
  81. package/dist/src/bundle/partial.d.ts.map +0 -1
  82. package/dist/src/bundle/unlink.d.ts.map +0 -1
  83. package/dist/src/bundle/upload.d.ts.map +0 -1
  84. package/dist/src/bundle/upload_interface.d.ts.map +0 -1
  85. package/dist/src/bundle/zip.d.ts.map +0 -1
  86. package/dist/src/channel/add.d.ts.map +0 -1
  87. package/dist/src/channel/currentBundle.d.ts.map +0 -1
  88. package/dist/src/channel/delete.d.ts.map +0 -1
  89. package/dist/src/channel/list.d.ts.map +0 -1
  90. package/dist/src/channel/set.d.ts.map +0 -1
  91. package/dist/src/checksum.d.ts.map +0 -1
  92. package/dist/src/config/index.d.ts.map +0 -1
  93. package/dist/src/docs.d.ts.map +0 -1
  94. package/dist/src/index.d.ts.map +0 -1
  95. package/dist/src/init.d.ts.map +0 -1
  96. package/dist/src/keyV2.d.ts.map +0 -1
  97. package/dist/src/login.d.ts.map +0 -1
  98. package/dist/src/mcp/server.d.ts.map +0 -1
  99. package/dist/src/organisation/add.d.ts.map +0 -1
  100. package/dist/src/organisation/delete.d.ts.map +0 -1
  101. package/dist/src/organisation/index.d.ts.map +0 -1
  102. package/dist/src/organisation/list.d.ts.map +0 -1
  103. package/dist/src/organisation/set.d.ts.map +0 -1
  104. package/dist/src/sdk.d.ts.map +0 -1
  105. package/dist/src/types/supabase.types.d.ts.map +0 -1
  106. package/dist/src/user/account.d.ts.map +0 -1
  107. package/dist/src/utils/latest-version.d.ts.map +0 -1
  108. package/dist/src/utils.d.ts.map +0 -1
  109. package/dist/src/versionHelpers.d.ts.map +0 -1
@@ -1,4 +1,3 @@
1
1
  import type { Options } from '../api/app';
2
2
  export declare function getUserIdInternal(options: Options, silent?: boolean): Promise<string>;
3
3
  export declare function getUserId(options: Options): Promise<void>;
4
- //# sourceMappingURL=account.d.ts.map
@@ -4,4 +4,3 @@
4
4
  * @returns The latest version string, or null if not found
5
5
  */
6
6
  export declare function getLatestVersion(packageName: string): Promise<string | null>;
7
- //# sourceMappingURL=latest-version.d.ts.map
@@ -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;