@braingrid/cli 0.0.2
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 +164 -0
- package/dist/.build-info.json +9 -0
- package/dist/build-config.d.ts +25 -0
- package/dist/build-config.d.ts.map +1 -0
- package/dist/build-config.js +27 -0
- package/dist/build-config.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +246 -0
- package/dist/cli.js.map +1 -0
- package/dist/handlers/auth.handlers.d.ts +13 -0
- package/dist/handlers/auth.handlers.d.ts.map +1 -0
- package/dist/handlers/auth.handlers.js +99 -0
- package/dist/handlers/auth.handlers.js.map +1 -0
- package/dist/handlers/index.d.ts +11 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +11 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/project.handlers.d.ts +29 -0
- package/dist/handlers/project.handlers.d.ts.map +1 -0
- package/dist/handlers/project.handlers.js +200 -0
- package/dist/handlers/project.handlers.js.map +1 -0
- package/dist/handlers/requirement.handlers.d.ts +32 -0
- package/dist/handlers/requirement.handlers.d.ts.map +1 -0
- package/dist/handlers/requirement.handlers.js +234 -0
- package/dist/handlers/requirement.handlers.js.map +1 -0
- package/dist/handlers/status.handlers.d.ts +12 -0
- package/dist/handlers/status.handlers.d.ts.map +1 -0
- package/dist/handlers/status.handlers.js +209 -0
- package/dist/handlers/status.handlers.js.map +1 -0
- package/dist/handlers/task.handlers.d.ts +29 -0
- package/dist/handlers/task.handlers.d.ts.map +1 -0
- package/dist/handlers/task.handlers.js +272 -0
- package/dist/handlers/task.handlers.js.map +1 -0
- package/dist/handlers/types.d.ts +10 -0
- package/dist/handlers/types.d.ts.map +1 -0
- package/dist/handlers/types.js +5 -0
- package/dist/handlers/types.js.map +1 -0
- package/dist/services/auth.d.ts +41 -0
- package/dist/services/auth.d.ts.map +1 -0
- package/dist/services/auth.js +498 -0
- package/dist/services/auth.js.map +1 -0
- package/dist/services/claude.d.ts +18 -0
- package/dist/services/claude.d.ts.map +1 -0
- package/dist/services/claude.js +164 -0
- package/dist/services/claude.js.map +1 -0
- package/dist/services/context-manager.d.ts +170 -0
- package/dist/services/context-manager.d.ts.map +1 -0
- package/dist/services/context-manager.js +261 -0
- package/dist/services/context-manager.js.map +1 -0
- package/dist/services/credential-store.d.ts +47 -0
- package/dist/services/credential-store.d.ts.map +1 -0
- package/dist/services/credential-store.js +88 -0
- package/dist/services/credential-store.js.map +1 -0
- package/dist/services/oauth2-auth.d.ts +60 -0
- package/dist/services/oauth2-auth.d.ts.map +1 -0
- package/dist/services/oauth2-auth.js +377 -0
- package/dist/services/oauth2-auth.js.map +1 -0
- package/dist/services/project-service.d.ts +22 -0
- package/dist/services/project-service.d.ts.map +1 -0
- package/dist/services/project-service.js +52 -0
- package/dist/services/project-service.js.map +1 -0
- package/dist/services/requirement-service.d.ts +32 -0
- package/dist/services/requirement-service.d.ts.map +1 -0
- package/dist/services/requirement-service.js +91 -0
- package/dist/services/requirement-service.js.map +1 -0
- package/dist/services/task-service.d.ts +22 -0
- package/dist/services/task-service.d.ts.map +1 -0
- package/dist/services/task-service.js +52 -0
- package/dist/services/task-service.js.map +1 -0
- package/dist/test/setup.d.ts +2 -0
- package/dist/test/setup.d.ts.map +1 -0
- package/dist/test/setup.js +40 -0
- package/dist/test/setup.js.map +1 -0
- package/dist/types/api.d.ts +16 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +5 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/auth.d.ts +68 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +2 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/claude.d.ts +22 -0
- package/dist/types/claude.d.ts.map +1 -0
- package/dist/types/claude.js +2 -0
- package/dist/types/claude.js.map +1 -0
- package/dist/types/project.d.ts +32 -0
- package/dist/types/project.d.ts.map +1 -0
- package/dist/types/project.js +5 -0
- package/dist/types/project.js.map +1 -0
- package/dist/types/requirement.d.ts +69 -0
- package/dist/types/requirement.d.ts.map +1 -0
- package/dist/types/requirement.js +5 -0
- package/dist/types/requirement.js.map +1 -0
- package/dist/types/task.d.ts +44 -0
- package/dist/types/task.d.ts.map +1 -0
- package/dist/types/task.js +5 -0
- package/dist/types/task.js.map +1 -0
- package/dist/utils/axios-retry.d.ts +25 -0
- package/dist/utils/axios-retry.d.ts.map +1 -0
- package/dist/utils/axios-retry.js +174 -0
- package/dist/utils/axios-retry.js.map +1 -0
- package/dist/utils/axios-with-auth.d.ts +10 -0
- package/dist/utils/axios-with-auth.d.ts.map +1 -0
- package/dist/utils/axios-with-auth.js +118 -0
- package/dist/utils/axios-with-auth.js.map +1 -0
- package/dist/utils/cli-tools.d.ts +30 -0
- package/dist/utils/cli-tools.d.ts.map +1 -0
- package/dist/utils/cli-tools.js +131 -0
- package/dist/utils/cli-tools.js.map +1 -0
- package/dist/utils/command-execution.d.ts +30 -0
- package/dist/utils/command-execution.d.ts.map +1 -0
- package/dist/utils/command-execution.js +264 -0
- package/dist/utils/command-execution.js.map +1 -0
- package/dist/utils/command-parser.d.ts +85 -0
- package/dist/utils/command-parser.d.ts.map +1 -0
- package/dist/utils/command-parser.js +287 -0
- package/dist/utils/command-parser.js.map +1 -0
- package/dist/utils/config.d.ts +9 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +59 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +17 -0
- package/dist/utils/error-formatter.d.ts.map +1 -0
- package/dist/utils/error-formatter.js +115 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/formatting.d.ts +10 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +122 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/git.d.ts +55 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +131 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/jwt.d.ts +45 -0
- package/dist/utils/jwt.d.ts.map +1 -0
- package/dist/utils/jwt.js +64 -0
- package/dist/utils/jwt.js.map +1 -0
- package/dist/utils/logger.d.ts +36 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +176 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/requirements.d.ts +28 -0
- package/dist/utils/requirements.d.ts.map +1 -0
- package/dist/utils/requirements.js +54 -0
- package/dist/utils/requirements.js.map +1 -0
- package/dist/utils/status-parser.d.ts +95 -0
- package/dist/utils/status-parser.d.ts.map +1 -0
- package/dist/utils/status-parser.js +189 -0
- package/dist/utils/status-parser.js.map +1 -0
- package/dist/utils/tasks.d.ts +9 -0
- package/dist/utils/tasks.d.ts.map +1 -0
- package/dist/utils/tasks.js +38 -0
- package/dist/utils/tasks.js.map +1 -0
- package/package.json +101 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,IAAI,MAAM,CAAC;CAC3B;AAED,wBAAgB,SAAS,IAAI,eAAe,CA+D3C"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BUILD_ENV, PRODUCTION_CONFIG, DEVELOPMENT_CONFIG } from '../build-config.js';
|
|
2
|
+
export function getConfig() {
|
|
3
|
+
// Determine base config based on BUILD_ENV
|
|
4
|
+
const baseConfig = BUILD_ENV === 'production' ? PRODUCTION_CONFIG : DEVELOPMENT_CONFIG;
|
|
5
|
+
// In development builds, allow NODE_ENV to override
|
|
6
|
+
let apiUrl = baseConfig.apiUrl;
|
|
7
|
+
if (BUILD_ENV === 'development') {
|
|
8
|
+
if (process.env.NODE_ENV === 'local' || process.env.NODE_ENV === 'test') {
|
|
9
|
+
// In local/test environment, use localhost
|
|
10
|
+
apiUrl = 'http://localhost:3377';
|
|
11
|
+
}
|
|
12
|
+
else if (process.env.NODE_ENV === 'development') {
|
|
13
|
+
// In development, use dev server
|
|
14
|
+
apiUrl = DEVELOPMENT_CONFIG.apiUrl;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Determine WorkOS AuthKit URL based on environment
|
|
18
|
+
const getWorkOSAuthUrl = () => {
|
|
19
|
+
// Allow override via environment variable
|
|
20
|
+
if (process.env.WORKOS_AUTH_URL) {
|
|
21
|
+
return process.env.WORKOS_AUTH_URL;
|
|
22
|
+
}
|
|
23
|
+
// In production builds, always use production URL
|
|
24
|
+
if (BUILD_ENV === 'production') {
|
|
25
|
+
return PRODUCTION_CONFIG.workosAuthUrl;
|
|
26
|
+
}
|
|
27
|
+
// In development builds, respect NODE_ENV
|
|
28
|
+
const env = process.env.NODE_ENV || 'development';
|
|
29
|
+
if (env === 'local' || env === 'test' || env === 'development' || env === 'staging') {
|
|
30
|
+
return DEVELOPMENT_CONFIG.workosAuthUrl;
|
|
31
|
+
}
|
|
32
|
+
return PRODUCTION_CONFIG.workosAuthUrl;
|
|
33
|
+
};
|
|
34
|
+
// Determine WorkOS OAuth client ID based on environment
|
|
35
|
+
const getOAuthClientId = () => {
|
|
36
|
+
// Allow override via environment variable
|
|
37
|
+
if (process.env.WORKOS_CLIENT_ID) {
|
|
38
|
+
return process.env.WORKOS_CLIENT_ID;
|
|
39
|
+
}
|
|
40
|
+
// In production builds, always use production client ID
|
|
41
|
+
if (BUILD_ENV === 'production') {
|
|
42
|
+
return PRODUCTION_CONFIG.workosClientId;
|
|
43
|
+
}
|
|
44
|
+
// In development builds, respect NODE_ENV
|
|
45
|
+
const env = process.env.NODE_ENV || 'development';
|
|
46
|
+
if (env === 'local' || env === 'test' || env === 'development' || env === 'staging') {
|
|
47
|
+
return DEVELOPMENT_CONFIG.workosClientId;
|
|
48
|
+
}
|
|
49
|
+
return PRODUCTION_CONFIG.workosClientId;
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
apiUrl: process.env.BRAINGRID_API_URL || apiUrl,
|
|
53
|
+
organizationId: process.env.BRAINGRID_ORG_ID,
|
|
54
|
+
clientId: process.env.BRAINGRID_CLIENT_ID || 'braingrid-cli',
|
|
55
|
+
oauthClientId: getOAuthClientId(),
|
|
56
|
+
getWorkOSAuthUrl,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAUtF,MAAM,UAAU,SAAS;IACxB,2CAA2C;IAC3C,MAAM,UAAU,GAAG,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,CAAC;IAEvF,oDAAoD;IACpD,IAAI,MAAM,GAAW,UAAU,CAAC,MAAM,CAAC;IACvC,IAAI,SAAS,KAAK,aAAa,EAAE,CAAC;QACjC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACzE,2CAA2C;YAC3C,MAAM,GAAG,uBAAuB,CAAC;QAClC,CAAC;aAAM,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YACnD,iCAAiC;YACjC,MAAM,GAAG,kBAAkB,CAAC,MAAM,CAAC;QACpC,CAAC;IACF,CAAC;IAED,oDAAoD;IACpD,MAAM,gBAAgB,GAAG,GAAW,EAAE;QACrC,0CAA0C;QAC1C,IAAI,OAAO,CAAC,G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AC5C,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,eAAe;QAC5D,aAAa,EAAE,gBAAgB,EAAE;QACjC,gBAAgB;KAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Formatter Utility
|
|
3
|
+
*
|
|
4
|
+
* Extracts user-friendly error messages from API errors (AxiosError)
|
|
5
|
+
* and provides context-aware error messages for common scenarios.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Format an error for display to the user
|
|
9
|
+
* Extracts API error details from AxiosError responses
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatError(error: unknown, context?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Format context string for error messages
|
|
14
|
+
* Converts resource names to user-friendly format
|
|
15
|
+
*/
|
|
16
|
+
export declare function getResourceContext(resourceType: string, id?: string): string;
|
|
17
|
+
//# sourceMappingURL=error-formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-formatter.d.ts","sourceRoot":"","sources":["../../src/utils/error-formatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAapE;AAyGD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5E"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error Formatter Utility
|
|
3
|
+
*
|
|
4
|
+
* Extracts user-friendly error messages from API errors (AxiosError)
|
|
5
|
+
* and provides context-aware error messages for common scenarios.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Format an error for display to the user
|
|
9
|
+
* Extracts API error details from AxiosError responses
|
|
10
|
+
*/
|
|
11
|
+
export function formatError(error, context) {
|
|
12
|
+
// Handle AxiosError specifically
|
|
13
|
+
if (isAxiosError(error)) {
|
|
14
|
+
return formatAxiosError(error, context);
|
|
15
|
+
}
|
|
16
|
+
// Handle regular Error objects
|
|
17
|
+
if (error instanceof Error) {
|
|
18
|
+
return error.message;
|
|
19
|
+
}
|
|
20
|
+
// Fallback for unknown error types
|
|
21
|
+
return String(error);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Type guard to check if error is an AxiosError
|
|
25
|
+
*/
|
|
26
|
+
function isAxiosError(error) {
|
|
27
|
+
return (typeof error === 'object' &&
|
|
28
|
+
error !== null &&
|
|
29
|
+
'isAxiosError' in error &&
|
|
30
|
+
error.isAxiosError === true);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Format AxiosError with API response details
|
|
34
|
+
*/
|
|
35
|
+
function formatAxiosError(error, context) {
|
|
36
|
+
const status = error.response?.status;
|
|
37
|
+
const data = error.response?.data;
|
|
38
|
+
// Try to extract structured error from API response
|
|
39
|
+
if (data && typeof data === 'object' && 'error' in data) {
|
|
40
|
+
const errorResponse = data;
|
|
41
|
+
if (errorResponse.error?.message) {
|
|
42
|
+
// Use API error message if available
|
|
43
|
+
return errorResponse.error.message;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Handle specific HTTP status codes with context-aware messages
|
|
47
|
+
if (status) {
|
|
48
|
+
return getStatusMessage(status, context, error);
|
|
49
|
+
}
|
|
50
|
+
// Handle network errors (no response)
|
|
51
|
+
if (error.code === 'ECONNREFUSED') {
|
|
52
|
+
return 'Could not connect to BrainGrid API. Please check your network connection.';
|
|
53
|
+
}
|
|
54
|
+
if (error.code === 'ETIMEDOUT') {
|
|
55
|
+
return 'Request timed out. Please try again.';
|
|
56
|
+
}
|
|
57
|
+
// Fallback to error message
|
|
58
|
+
return error.message;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get user-friendly message for HTTP status codes
|
|
62
|
+
*/
|
|
63
|
+
function getStatusMessage(status, context, error) {
|
|
64
|
+
switch (status) {
|
|
65
|
+
case 400: {
|
|
66
|
+
// Bad Request - try to extract details from response
|
|
67
|
+
const data = error?.response?.data;
|
|
68
|
+
if (data && typeof data === 'object') {
|
|
69
|
+
// Check for validation errors or detailed message
|
|
70
|
+
if ('message' in data && typeof data.message === 'string') {
|
|
71
|
+
return data.message;
|
|
72
|
+
}
|
|
73
|
+
if ('detail' in data && typeof data.detail === 'string') {
|
|
74
|
+
return data.detail;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return context
|
|
78
|
+
? `Invalid ${context} - please check your input and try again`
|
|
79
|
+
: 'Invalid request - please check your input and try again';
|
|
80
|
+
}
|
|
81
|
+
case 401:
|
|
82
|
+
return 'Authentication required. Please run "braingrid login" to authenticate.';
|
|
83
|
+
case 403:
|
|
84
|
+
return context
|
|
85
|
+
? `You don't have permission to access this ${context}`
|
|
86
|
+
: "You don't have permission to perform this action";
|
|
87
|
+
case 404:
|
|
88
|
+
return context ? `${context} not found` : 'Resource not found';
|
|
89
|
+
case 409:
|
|
90
|
+
return context
|
|
91
|
+
? `${context} already exists or conflicts with existing data`
|
|
92
|
+
: 'Resource already exists or conflicts with existing data';
|
|
93
|
+
case 422:
|
|
94
|
+
return 'Validation failed - please check your input';
|
|
95
|
+
case 429:
|
|
96
|
+
return 'Too many requests. Please wait a moment and try again.';
|
|
97
|
+
case 500:
|
|
98
|
+
return 'Server error. Please try again later.';
|
|
99
|
+
case 502:
|
|
100
|
+
case 503:
|
|
101
|
+
case 504:
|
|
102
|
+
return 'BrainGrid service is temporarily unavailable. Please try again later.';
|
|
103
|
+
default:
|
|
104
|
+
return `Request failed with status ${status}`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Format context string for error messages
|
|
109
|
+
* Converts resource names to user-friendly format
|
|
110
|
+
*/
|
|
111
|
+
export function getResourceContext(resourceType, id) {
|
|
112
|
+
const formatted = resourceType.charAt(0).toUpperCase() + resourceType.slice(1);
|
|
113
|
+
return id ? `${formatted} '${id}'` : formatted;
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=error-formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-formatter.js","sourceRoot":"","sources":["../../src/utils/error-formatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc,EAAE,OAAgB;IAC3D,iCAAiC;IACjC,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,+BAA+B;IAC/B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,KAAK,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,mCAAmC;IACnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,KAAc;IACnC,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,cAAc,IAAI,KAAK;QACvB,KAAK,CAAC,YAAY,KAAK,IAAI,CAC3B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,gBAAgB,CAAC,KAAiB,EAAE,OAAgB;IAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;IACtC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC;IAElC,oDAAoD;IACpD,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACzD,MAAM,aAAa,GAAG,IAAqB,CAAC;QAC5C,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;YAClC,qCAAqC;YACrC,OAAO,aAAa,CAAC,KAAK,CAAC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AAC,kDAAkD,CAAC;QAEvD,KAAK,GAAG;YACP,OAAO,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,YAAY,CAAC,CAAC,CAAC,oBAAoB,CAAC;QAEhE,KAAK,GAAG;YACP,OAAO,OAAO;gBACb,CAAC,CAAC,GAAG,OAAO,iDAAiD;gBAC7D,CAAC,CAAC,yDAAyD,CAAC;QAE9D,KAAK,GAAG;YACP,OAAO,6CAA6C,CAAC;QAEtD,KAAK,GAAG;YACP,OAAO,wDAAwD,CAAC;QAEjE,KAAK,GAAG;YACP,OAAO,uCAAuC,CAAC;QAEhD,KAAK,GAAG,CAAC;QACT,KAAK,GAAG,CAAC;QACT,KAAK,GAAG;YACP,OAAO,uEAAuE,CAAC;QAEhF;YACC,OAAO,8BAA8B,MAAM,EAAE,CAAC;IAChD,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,YAAoB,EAAE,EAAW;IACnE,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/E,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Requirement, RequirementTask as Task } from '../types/requirement.js';
|
|
2
|
+
export declare function formatRequirementsList(requirements: Requirement[], total: number): string;
|
|
3
|
+
export declare function formatRequirementDetail(requirement: Requirement): string;
|
|
4
|
+
export declare function formatTasksList(tasks: Task[], total?: number): string;
|
|
5
|
+
export declare function formatTaskDetail(task: Task): string;
|
|
6
|
+
export declare function formatErrorMessage(message: string): string;
|
|
7
|
+
export declare function formatSuccessMessage(message: string): string;
|
|
8
|
+
export declare function formatInfoMessage(message: string): string;
|
|
9
|
+
export declare function formatWarningMessage(message: string): string;
|
|
10
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../../src/utils/formatting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,IAAI,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAI/E,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAyBzF;AAED,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAuBxE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CA0BrE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAwBnD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { formatRequirementId } from './requirements.js';
|
|
3
|
+
import { formatTaskId, getTaskStatusIcon } from './tasks.js';
|
|
4
|
+
export function formatRequirementsList(requirements, total) {
|
|
5
|
+
if (requirements.length === 0) {
|
|
6
|
+
return chalk.yellow('No requirements found.\n');
|
|
7
|
+
}
|
|
8
|
+
let output = chalk.bold.cyan(`📋 Requirements (${requirements.length} of ${total})\n\n`);
|
|
9
|
+
requirements.forEach((req, index) => {
|
|
10
|
+
const statusColor = getStatusColor(req.status);
|
|
11
|
+
const statusIcon = getStatusIcon(req.status);
|
|
12
|
+
output += chalk.bold(`${index + 1}. ${req.name}\n`);
|
|
13
|
+
output += ` ${statusIcon} Status: ${statusColor(req.status)}\n`;
|
|
14
|
+
output += ` 📝 ${req.description}\n`;
|
|
15
|
+
output += ` 🆔 ID: ${chalk.gray(formatRequirementId(req))}\n`;
|
|
16
|
+
output += ` 📎 UUID: ${chalk.gray(req.id)}\n`;
|
|
17
|
+
if (req.assigned_to) {
|
|
18
|
+
output += ` 👤 Assigned: ${chalk.blue(req.assigned_to)}\n`;
|
|
19
|
+
}
|
|
20
|
+
output += ` 📅 Updated: ${chalk.gray(new Date(req.updated_at).toLocaleDateString())}\n\n`;
|
|
21
|
+
});
|
|
22
|
+
return output;
|
|
23
|
+
}
|
|
24
|
+
export function formatRequirementDetail(requirement) {
|
|
25
|
+
const statusColor = getStatusColor(requirement.status);
|
|
26
|
+
const statusIcon = getStatusIcon(requirement.status);
|
|
27
|
+
let output = chalk.bold.cyan(`📋 Requirement Details\n`);
|
|
28
|
+
output += chalk.gray('━'.repeat(50)) + '\n\n';
|
|
29
|
+
output += chalk.bold(`Name: ${requirement.name}\n`);
|
|
30
|
+
output += `${statusIcon} Status: ${statusColor(requirement.status)}\n`;
|
|
31
|
+
output += `🆔 ID: ${chalk.gray(formatRequirementId(requirement))}\n`;
|
|
32
|
+
output += `📎 UUID: ${chalk.gray(requirement.id)}\n`;
|
|
33
|
+
if (requirement.assigned_to) {
|
|
34
|
+
output += `👤 Assigned: ${chalk.blue(requirement.assigned_to)}\n`;
|
|
35
|
+
}
|
|
36
|
+
output += `📅 Created: ${chalk.gray(new Date(requirement.created_at).toLocaleDateString())}\n`;
|
|
37
|
+
output += `📅 Updated: ${chalk.gray(new Date(requirement.updated_at).toLocaleDateString())}\n\n`;
|
|
38
|
+
output += chalk.bold('Description:\n');
|
|
39
|
+
output += `${requirement.description}\n\n`;
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
export function formatTasksList(tasks, total) {
|
|
43
|
+
if (tasks.length === 0) {
|
|
44
|
+
return chalk.yellow('No tasks found.\n');
|
|
45
|
+
}
|
|
46
|
+
const displayTotal = total !== undefined ? ` of ${total}` : '';
|
|
47
|
+
let output = chalk.bold.cyan(`📝 Tasks (${tasks.length}${displayTotal})\n\n`);
|
|
48
|
+
tasks.forEach((task, index) => {
|
|
49
|
+
const statusColor = getStatusColor(task.status);
|
|
50
|
+
const statusIcon = getTaskStatusIcon(task.status);
|
|
51
|
+
output += chalk.bold(`${index + 1}. ${task.title}\n`);
|
|
52
|
+
output += ` ${statusIcon} Status: ${statusColor(task.status)}\n`;
|
|
53
|
+
output += ` 📄 ${task.content}\n`;
|
|
54
|
+
output += ` 🆔 ID: ${chalk.gray(formatTaskId(task))}\n`;
|
|
55
|
+
output += ` 📎 UUID: ${chalk.gray(task.id)}\n`;
|
|
56
|
+
if (task.assigned_to) {
|
|
57
|
+
output += ` 👤 Assigned: ${chalk.blue(task.assigned_to)}\n`;
|
|
58
|
+
}
|
|
59
|
+
output += ` 📅 Updated: ${chalk.gray(new Date(task.updated_at).toLocaleDateString())}\n\n`;
|
|
60
|
+
});
|
|
61
|
+
return output;
|
|
62
|
+
}
|
|
63
|
+
export function formatTaskDetail(task) {
|
|
64
|
+
const statusColor = getStatusColor(task.status);
|
|
65
|
+
const statusIcon = getTaskStatusIcon(task.status);
|
|
66
|
+
let output = chalk.bold.cyan(`📝 Task Details\n`);
|
|
67
|
+
output += chalk.gray('━'.repeat(50)) + '\n\n';
|
|
68
|
+
output += chalk.bold(`Title: ${task.title}\n`);
|
|
69
|
+
output += `${statusIcon} Status: ${statusColor(task.status)}\n`;
|
|
70
|
+
output += `🆔 ID: ${chalk.gray(formatTaskId(task))}\n`;
|
|
71
|
+
output += `📎 UUID: ${chalk.gray(task.id)}\n`;
|
|
72
|
+
output += `🔗 Requirement: ${chalk.gray(task.requirement_id)}\n`;
|
|
73
|
+
if (task.assigned_to) {
|
|
74
|
+
output += `👤 Assigned: ${chalk.blue(task.assigned_to)}\n`;
|
|
75
|
+
}
|
|
76
|
+
output += `📅 Created: ${chalk.gray(new Date(task.created_at).toLocaleDateString())}\n`;
|
|
77
|
+
output += `📅 Updated: ${chalk.gray(new Date(task.updated_at).toLocaleDateString())}\n\n`;
|
|
78
|
+
output += chalk.bold('Content:\n');
|
|
79
|
+
output += `${task.content}\n\n`;
|
|
80
|
+
return output;
|
|
81
|
+
}
|
|
82
|
+
export function formatErrorMessage(message) {
|
|
83
|
+
return chalk.red(`❌ ${message}`);
|
|
84
|
+
}
|
|
85
|
+
export function formatSuccessMessage(message) {
|
|
86
|
+
return chalk.green(`✅ ${message}`);
|
|
87
|
+
}
|
|
88
|
+
export function formatInfoMessage(message) {
|
|
89
|
+
return chalk.blue(`ℹ️ ${message}`);
|
|
90
|
+
}
|
|
91
|
+
export function formatWarningMessage(message) {
|
|
92
|
+
return chalk.yellow(`⚠️ ${message}`);
|
|
93
|
+
}
|
|
94
|
+
function getStatusColor(status) {
|
|
95
|
+
switch (status) {
|
|
96
|
+
case 'PLANNED':
|
|
97
|
+
return chalk.blue;
|
|
98
|
+
case 'IN_PROGRESS':
|
|
99
|
+
return chalk.yellow;
|
|
100
|
+
case 'COMPLETED':
|
|
101
|
+
return chalk.green;
|
|
102
|
+
case 'CANCELLED':
|
|
103
|
+
return chalk.red;
|
|
104
|
+
default:
|
|
105
|
+
return chalk.gray;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function getStatusIcon(status) {
|
|
109
|
+
switch (status) {
|
|
110
|
+
case 'PLANNED':
|
|
111
|
+
return '📋';
|
|
112
|
+
case 'IN_PROGRESS':
|
|
113
|
+
return '🔄';
|
|
114
|
+
case 'COMPLETED':
|
|
115
|
+
return '✅';
|
|
116
|
+
case 'CANCELLED':
|
|
117
|
+
return '❌';
|
|
118
|
+
default:
|
|
119
|
+
return '❓';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=formatting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.js","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AC,IAAI,CAAC;IACpB,CAAC;AACF,CAAC;AAED,SAAS,aAAa,CAAC,MAAc;IACpC,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,SAAS;YACb,OAAO,IAAI,CAAC;QACb,KAAK,aAAa;YACjB,OAAO,IAAI,CAAC;QACb,KAAK,WAAW;YACf,OAAO,GAAG,CAAC;QACZ,KAAK,WAAW;YACf,OAAO,GAAG,CAAC;QACZ;YACC,OAAO,GAAG,CAAC;IACb,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions to interact with git repositories:
|
|
5
|
+
* - Detect if current directory is a git repository
|
|
6
|
+
* - Get remote repository information (owner/name)
|
|
7
|
+
* - Get current branch
|
|
8
|
+
* - Get git user configuration
|
|
9
|
+
*/
|
|
10
|
+
export interface GitRepoInfo {
|
|
11
|
+
isRepo: boolean;
|
|
12
|
+
owner: string | null;
|
|
13
|
+
name: string | null;
|
|
14
|
+
branch: string | null;
|
|
15
|
+
userName: string | null;
|
|
16
|
+
userEmail: string | null;
|
|
17
|
+
remoteUrl: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface GitUser {
|
|
20
|
+
name: string | null;
|
|
21
|
+
email: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface GitHubRepo {
|
|
24
|
+
owner: string;
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if current directory is inside a git repository
|
|
29
|
+
*/
|
|
30
|
+
export declare function isGitRepository(): Promise<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* Get the URL of the 'origin' remote
|
|
33
|
+
*/
|
|
34
|
+
export declare function getRemoteUrl(): Promise<string | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Parse GitHub repository owner and name from a git remote URL
|
|
37
|
+
* Supports both HTTPS and SSH formats:
|
|
38
|
+
* - https://github.com/owner/repo.git
|
|
39
|
+
* - git@github.com:owner/repo.git
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseGitHubRepo(url: string): GitHubRepo | null;
|
|
42
|
+
/**
|
|
43
|
+
* Get the current branch name
|
|
44
|
+
*/
|
|
45
|
+
export declare function getCurrentBranch(): Promise<string | null>;
|
|
46
|
+
/**
|
|
47
|
+
* Get git user configuration (name and email)
|
|
48
|
+
*/
|
|
49
|
+
export declare function getGitUser(): Promise<GitUser>;
|
|
50
|
+
/**
|
|
51
|
+
* Get comprehensive git repository information
|
|
52
|
+
* Returns null if not in a git repository
|
|
53
|
+
*/
|
|
54
|
+
export declare function getGitRepositoryInfo(): Promise<GitRepoInfo | null>;
|
|
55
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,MAAM,WAAW,WAAW;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC,CAOxD;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAO3D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAsB9D;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAO/D;AAED;;GAEG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAmBnD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAgCxE"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions to interact with git repositories:
|
|
5
|
+
* - Detect if current directory is a git repository
|
|
6
|
+
* - Get remote repository information (owner/name)
|
|
7
|
+
* - Get current branch
|
|
8
|
+
* - Get git user configuration
|
|
9
|
+
*/
|
|
10
|
+
import { exec } from 'child_process';
|
|
11
|
+
import { promisify } from 'util';
|
|
12
|
+
const execAsync = promisify(exec);
|
|
13
|
+
/**
|
|
14
|
+
* Check if current directory is inside a git repository
|
|
15
|
+
*/
|
|
16
|
+
export async function isGitRepository() {
|
|
17
|
+
try {
|
|
18
|
+
const { stdout } = await execAsync('git rev-parse --is-inside-work-tree');
|
|
19
|
+
return stdout.trim() === 'true';
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the URL of the 'origin' remote
|
|
27
|
+
*/
|
|
28
|
+
export async function getRemoteUrl() {
|
|
29
|
+
try {
|
|
30
|
+
const { stdout } = await execAsync('git config --get remote.origin.url');
|
|
31
|
+
return stdout.trim() || null;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse GitHub repository owner and name from a git remote URL
|
|
39
|
+
* Supports both HTTPS and SSH formats:
|
|
40
|
+
* - https://github.com/owner/repo.git
|
|
41
|
+
* - git@github.com:owner/repo.git
|
|
42
|
+
*/
|
|
43
|
+
export function parseGitHubRepo(url) {
|
|
44
|
+
if (!url)
|
|
45
|
+
return null;
|
|
46
|
+
// Match HTTPS format: https://github.com/owner/repo.git
|
|
47
|
+
const httpsMatch = url.match(/https?:\/\/github\.com\/([^/]+)\/([^/]+?)(\.git)?$/);
|
|
48
|
+
if (httpsMatch) {
|
|
49
|
+
return {
|
|
50
|
+
owner: httpsMatch[1],
|
|
51
|
+
name: httpsMatch[2],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// Match SSH format: git@github.com:owner/repo.git
|
|
55
|
+
const sshMatch = url.match(/git@github\.com:([^/]+)\/([^/]+?)(\.git)?$/);
|
|
56
|
+
if (sshMatch) {
|
|
57
|
+
return {
|
|
58
|
+
owner: sshMatch[1],
|
|
59
|
+
name: sshMatch[2],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get the current branch name
|
|
66
|
+
*/
|
|
67
|
+
export async function getCurrentBranch() {
|
|
68
|
+
try {
|
|
69
|
+
const { stdout } = await execAsync('git rev-parse --abbrev-ref HEAD');
|
|
70
|
+
return stdout.trim() || null;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get git user configuration (name and email)
|
|
78
|
+
*/
|
|
79
|
+
export async function getGitUser() {
|
|
80
|
+
let name = null;
|
|
81
|
+
let email = null;
|
|
82
|
+
try {
|
|
83
|
+
const { stdout: nameStdout } = await execAsync('git config --get user.name');
|
|
84
|
+
name = nameStdout.trim() || null;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// user.name not configured
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const { stdout: emailStdout } = await execAsync('git config --get user.email');
|
|
91
|
+
email = emailStdout.trim() || null;
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// user.email not configured
|
|
95
|
+
}
|
|
96
|
+
return { name, email };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Get comprehensive git repository information
|
|
100
|
+
* Returns null if not in a git repository
|
|
101
|
+
*/
|
|
102
|
+
export async function getGitRepositoryInfo() {
|
|
103
|
+
const isRepo = await isGitRepository();
|
|
104
|
+
if (!isRepo) {
|
|
105
|
+
return {
|
|
106
|
+
isRepo: false,
|
|
107
|
+
owner: null,
|
|
108
|
+
name: null,
|
|
109
|
+
branch: null,
|
|
110
|
+
userName: null,
|
|
111
|
+
userEmail: null,
|
|
112
|
+
remoteUrl: null,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
const [remoteUrl, branch, gitUser] = await Promise.all([
|
|
116
|
+
getRemoteUrl(),
|
|
117
|
+
getCurrentBranch(),
|
|
118
|
+
getGitUser(),
|
|
119
|
+
]);
|
|
120
|
+
const repo = remoteUrl ? parseGitHubRepo(remoteUrl) : null;
|
|
121
|
+
return {
|
|
122
|
+
isRepo: true,
|
|
123
|
+
owner: repo?.owner || null,
|
|
124
|
+
name: repo?.name || null,
|
|
125
|
+
branch,
|
|
126
|
+
userName: gitUser.name,
|
|
127
|
+
userEmail: gitUser.email,
|
|
128
|
+
remoteUrl,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAsBlC;;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EAAE;QACd,gBAAgB,EAAE;QAClB,UAAU,EAAE;KACZ,CAAC,CAAC;IAEH,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAE3D,OAAO;QACN,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,IAAI;QAC1B,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI;QACxB,MAAM;QACN,QAAQ,EAAE,OAAO,CAAC,IAAI;QACtB,SAAS,EAAE,OAAO,CAAC,KAAK;QACxB,SAAS;KACT,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JWT utility functions
|
|
3
|
+
* Note: This is basic JWT decoding without signature verification
|
|
4
|
+
* The server validates the token signature when we make API calls
|
|
5
|
+
*/
|
|
6
|
+
export interface JWTPayload {
|
|
7
|
+
sub?: string;
|
|
8
|
+
exp?: number;
|
|
9
|
+
iat?: number;
|
|
10
|
+
nbf?: number;
|
|
11
|
+
iss?: string;
|
|
12
|
+
aud?: string | string[];
|
|
13
|
+
email?: string;
|
|
14
|
+
firstName?: string;
|
|
15
|
+
first_name?: string;
|
|
16
|
+
lastName?: string;
|
|
17
|
+
last_name?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
given_name?: string;
|
|
20
|
+
family_name?: string;
|
|
21
|
+
organizationId?: string;
|
|
22
|
+
organization_id?: string;
|
|
23
|
+
org?: string;
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Decode a JWT token to extract the payload
|
|
28
|
+
* Note: This does NOT verify the signature - that's the server's job
|
|
29
|
+
*/
|
|
30
|
+
export declare function decodeJWT(token: string): JWTPayload | null;
|
|
31
|
+
/**
|
|
32
|
+
* Check if a JWT token is expired
|
|
33
|
+
*/
|
|
34
|
+
export declare function isJWTExpired(token: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Extract user information from JWT payload
|
|
37
|
+
*/
|
|
38
|
+
export declare function extractUserFromJWT(payload: JWTPayload): {
|
|
39
|
+
id: string;
|
|
40
|
+
email: string;
|
|
41
|
+
firstName: string;
|
|
42
|
+
lastName: string;
|
|
43
|
+
organizationId: string;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=jwt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../src/utils/jwt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,UAAU;IAE1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAGxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAqB1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KA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