langctl 0.2.0 → 0.3.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/CHANGELOG.md +42 -0
- package/README.md +155 -1188
- package/dist/commands/auth.js +85 -19
- package/dist/commands/config.js +36 -26
- package/dist/commands/export.js +11 -122
- package/dist/commands/import.js +32 -143
- package/dist/commands/init.js +61 -72
- package/dist/commands/keys.js +145 -279
- package/dist/commands/org.js +45 -111
- package/dist/commands/projects.js +124 -312
- package/dist/commands/pull.js +80 -130
- package/dist/commands/push.js +125 -0
- package/dist/commands/team.js +68 -257
- package/dist/core/config.js +130 -0
- package/dist/core/errors.js +67 -0
- package/dist/core/files.js +38 -0
- package/dist/core/http.js +121 -0
- package/dist/core/output.js +96 -0
- package/dist/core/project.js +58 -0
- package/dist/core/prompts.js +56 -0
- package/dist/formats/index.js +285 -0
- package/dist/index.js +261 -508
- package/dist/version.js +4 -0
- package/package.json +22 -15
- package/.gitattributes +0 -2
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -26
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -19
- package/CONTRIBUTING.md +0 -33
- package/dist/api.d.ts +0 -20
- package/dist/api.js +0 -75
- package/dist/auth.d.ts +0 -38
- package/dist/auth.js +0 -106
- package/dist/commands/auth.d.ts +0 -3
- package/dist/commands/config.d.ts +0 -2
- package/dist/commands/debug.d.ts +0 -3
- package/dist/commands/debug.js +0 -61
- package/dist/commands/export.d.ts +0 -13
- package/dist/commands/import.d.ts +0 -12
- package/dist/commands/init.d.ts +0 -2
- package/dist/commands/keys.d.ts +0 -25
- package/dist/commands/org.d.ts +0 -13
- package/dist/commands/projects.d.ts +0 -33
- package/dist/commands/pull.d.ts +0 -9
- package/dist/commands/team.d.ts +0 -29
- package/dist/config.d.ts +0 -48
- package/dist/config.js +0 -69
- package/dist/exporters/index.d.ts +0 -36
- package/dist/exporters/index.js +0 -214
- package/dist/index.d.ts +0 -3
- package/dist/utils/banner.d.ts +0 -9
- package/dist/utils/banner.js +0 -24
- package/translations/en.json +0 -5
- package/translations/en.xml +0 -9
- package/translations/fr.json +0 -4
- package/translations/fr.xml +0 -7
- package/translations/hi.json +0 -4
- package/translations/hi.xml +0 -7
- package/translations/ios/en.strings +0 -9
- package/translations/ios/fr.strings +0 -6
- package/translations/ios/hi.strings +0 -6
- package/translations/ios/ja.strings +0 -6
- package/translations/ja.json +0 -4
- package/translations/ja.xml +0 -7
package/dist/version.js
ADDED
package/package.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langctl",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Translation management CLI for developers
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Translation management CLI for developers: sync i18n files (JSON, Android, iOS, Flutter ARB) between your repo, CI and Langctl.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
8
|
"langctl": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "
|
|
11
|
+
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
|
|
12
12
|
"dev": "tsx src/index.ts",
|
|
13
13
|
"start": "node dist/index.js",
|
|
14
|
-
"
|
|
15
|
-
"test": "
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"test:e2e": "bash test/e2e.sh",
|
|
17
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
16
18
|
},
|
|
17
19
|
"keywords": [
|
|
18
20
|
"translation",
|
|
@@ -77,26 +79,31 @@
|
|
|
77
79
|
"license": "MIT",
|
|
78
80
|
"repository": {
|
|
79
81
|
"type": "git",
|
|
80
|
-
"url": "git+https://github.com/
|
|
82
|
+
"url": "git+https://github.com/litcode-pvt-ltd/langctl-cli.git"
|
|
81
83
|
},
|
|
82
84
|
"bugs": {
|
|
83
|
-
"url": "https://github.com/
|
|
85
|
+
"url": "https://github.com/litcode-pvt-ltd/langctl-cli/issues"
|
|
84
86
|
},
|
|
85
87
|
"homepage": "https://langctl.com",
|
|
86
88
|
"engines": {
|
|
87
|
-
"node": ">=
|
|
89
|
+
"node": ">=20"
|
|
88
90
|
},
|
|
89
91
|
"dependencies": {
|
|
90
92
|
"chalk": "^5.6.2",
|
|
91
|
-
"commander": "^14.0.2"
|
|
92
|
-
"conf": "^15.0.2",
|
|
93
|
-
"inquirer": "^13.1.0",
|
|
94
|
-
"ora": "^9.0.0"
|
|
93
|
+
"commander": "^14.0.2"
|
|
95
94
|
},
|
|
96
95
|
"devDependencies": {
|
|
97
|
-
"@types/inquirer": "^9.0.9",
|
|
98
96
|
"@types/node": "^25.0.3",
|
|
99
97
|
"tsx": "^4.21.0",
|
|
100
|
-
"typescript": "^5.9.3"
|
|
101
|
-
|
|
98
|
+
"typescript": "^5.9.3",
|
|
99
|
+
"vitest": "^4.1.11"
|
|
100
|
+
},
|
|
101
|
+
"files": [
|
|
102
|
+
"dist",
|
|
103
|
+
"!dist/**/*.map",
|
|
104
|
+
"!dist/**/*.d.ts",
|
|
105
|
+
"README.md",
|
|
106
|
+
"LICENSE",
|
|
107
|
+
"CHANGELOG.md"
|
|
108
|
+
]
|
|
102
109
|
}
|
package/.gitattributes
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug Report
|
|
3
|
-
about: Report a bug or unexpected behavior
|
|
4
|
-
title: ''
|
|
5
|
-
labels: bug
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Describe the bug**
|
|
10
|
-
A clear description of what the bug is.
|
|
11
|
-
|
|
12
|
-
**To reproduce**
|
|
13
|
-
Steps to reproduce:
|
|
14
|
-
1. Run `langctl ...`
|
|
15
|
-
2. ...
|
|
16
|
-
|
|
17
|
-
**Expected behavior**
|
|
18
|
-
What you expected to happen.
|
|
19
|
-
|
|
20
|
-
**Environment**
|
|
21
|
-
- OS: [e.g. macOS 14, Ubuntu 22.04]
|
|
22
|
-
- Node.js version: [e.g. 18.17.0]
|
|
23
|
-
- langctl version: [output of `langctl --version`]
|
|
24
|
-
|
|
25
|
-
**Additional context**
|
|
26
|
-
Add any other context, logs, or screenshots.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Feature Request
|
|
3
|
-
about: Suggest a new feature or improvement
|
|
4
|
-
title: ''
|
|
5
|
-
labels: enhancement
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Problem**
|
|
10
|
-
What problem does this feature solve?
|
|
11
|
-
|
|
12
|
-
**Proposed solution**
|
|
13
|
-
Describe how you'd like this to work.
|
|
14
|
-
|
|
15
|
-
**Alternatives considered**
|
|
16
|
-
Any alternative solutions or workarounds you've tried.
|
|
17
|
-
|
|
18
|
-
**Additional context**
|
|
19
|
-
Any other context, examples, or references.
|
package/CONTRIBUTING.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Contributing to langctl
|
|
2
|
-
|
|
3
|
-
Thanks for your interest in contributing! Here's how to get started.
|
|
4
|
-
|
|
5
|
-
## Development Setup
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
git clone https://github.com/siddharthsaxena0/langctl.git
|
|
9
|
-
cd langctl
|
|
10
|
-
npm install
|
|
11
|
-
npm run dev # runs tsx watch
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Making Changes
|
|
15
|
-
|
|
16
|
-
1. Fork the repo and create a feature branch from `main`
|
|
17
|
-
2. Make your changes
|
|
18
|
-
3. Test locally with `npm run dev`
|
|
19
|
-
4. Submit a pull request
|
|
20
|
-
|
|
21
|
-
## Reporting Bugs
|
|
22
|
-
|
|
23
|
-
Use the [bug report template](https://github.com/siddharthsaxena0/langctl/issues/new?template=bug_report.md) and include your `langctl --version`, Node.js version, and OS.
|
|
24
|
-
|
|
25
|
-
## Code Style
|
|
26
|
-
|
|
27
|
-
- TypeScript with strict mode
|
|
28
|
-
- Use `commander` for CLI commands
|
|
29
|
-
- Keep commands in `src/commands/`
|
|
30
|
-
|
|
31
|
-
## License
|
|
32
|
-
|
|
33
|
-
By contributing, you agree that your contributions will be licensed under the MIT License.
|
package/dist/api.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare class ApiClient {
|
|
2
|
-
private baseUrl;
|
|
3
|
-
private apiKey;
|
|
4
|
-
constructor(baseUrl: string, apiKey: string);
|
|
5
|
-
private request;
|
|
6
|
-
get<T>(path: string, params?: Record<string, string>): Promise<T>;
|
|
7
|
-
post<T>(path: string, body?: unknown): Promise<T>;
|
|
8
|
-
patch<T>(path: string, body: unknown): Promise<T>;
|
|
9
|
-
delete<T>(path: string): Promise<T>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Create an API client from the current config.
|
|
13
|
-
* Throws if not authenticated.
|
|
14
|
-
*/
|
|
15
|
-
export declare function getApiClient(): ApiClient;
|
|
16
|
-
/**
|
|
17
|
-
* Create an API client with a specific API key (for auth flow before key is saved).
|
|
18
|
-
*/
|
|
19
|
-
export declare function createApiClient(apiKey: string): ApiClient;
|
|
20
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { config } from './config.js';
|
|
2
|
-
const DEFAULT_API_URL = 'https://api.langctl.com/api/v1';
|
|
3
|
-
export class ApiClient {
|
|
4
|
-
constructor(baseUrl, apiKey) {
|
|
5
|
-
this.baseUrl = baseUrl.replace(/\/$/, '');
|
|
6
|
-
this.apiKey = apiKey;
|
|
7
|
-
}
|
|
8
|
-
async request(method, path, body, params) {
|
|
9
|
-
let url = `${this.baseUrl}${path}`;
|
|
10
|
-
if (params && Object.keys(params).length > 0) {
|
|
11
|
-
const searchParams = new URLSearchParams();
|
|
12
|
-
for (const [key, value] of Object.entries(params)) {
|
|
13
|
-
if (value !== undefined && value !== null && value !== '') {
|
|
14
|
-
searchParams.append(key, value);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const qs = searchParams.toString();
|
|
18
|
-
if (qs)
|
|
19
|
-
url += `?${qs}`;
|
|
20
|
-
}
|
|
21
|
-
const headers = {
|
|
22
|
-
'X-API-Key': this.apiKey,
|
|
23
|
-
};
|
|
24
|
-
if (body !== undefined) {
|
|
25
|
-
headers['Content-Type'] = 'application/json';
|
|
26
|
-
}
|
|
27
|
-
const response = await fetch(url, {
|
|
28
|
-
method,
|
|
29
|
-
headers,
|
|
30
|
-
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
31
|
-
signal: AbortSignal.timeout(30000),
|
|
32
|
-
});
|
|
33
|
-
if (!response.ok) {
|
|
34
|
-
const errorData = await response.json().catch(() => ({}));
|
|
35
|
-
throw new Error(errorData.error || errorData.message || `HTTP ${response.status}: ${response.statusText}`);
|
|
36
|
-
}
|
|
37
|
-
// Handle 204 No Content
|
|
38
|
-
if (response.status === 204) {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
return response.json();
|
|
42
|
-
}
|
|
43
|
-
async get(path, params) {
|
|
44
|
-
return this.request('GET', path, undefined, params);
|
|
45
|
-
}
|
|
46
|
-
async post(path, body) {
|
|
47
|
-
return this.request('POST', path, body);
|
|
48
|
-
}
|
|
49
|
-
async patch(path, body) {
|
|
50
|
-
return this.request('PATCH', path, body);
|
|
51
|
-
}
|
|
52
|
-
async delete(path) {
|
|
53
|
-
return this.request('DELETE', path);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Create an API client from the current config.
|
|
58
|
-
* Throws if not authenticated.
|
|
59
|
-
*/
|
|
60
|
-
export function getApiClient() {
|
|
61
|
-
const apiKey = config.get('apiKey');
|
|
62
|
-
const baseUrl = config.get('apiBaseUrl') || DEFAULT_API_URL;
|
|
63
|
-
if (!apiKey) {
|
|
64
|
-
throw new Error('Not authenticated. Please run "langctl auth <api-key>" first.');
|
|
65
|
-
}
|
|
66
|
-
return new ApiClient(baseUrl, apiKey);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Create an API client with a specific API key (for auth flow before key is saved).
|
|
70
|
-
*/
|
|
71
|
-
export function createApiClient(apiKey) {
|
|
72
|
-
const baseUrl = config.get('apiBaseUrl') || DEFAULT_API_URL;
|
|
73
|
-
return new ApiClient(baseUrl, apiKey);
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=api.js.map
|
package/dist/auth.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface ApiKeyData {
|
|
2
|
-
organizationId: string;
|
|
3
|
-
organization: {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
slug: string;
|
|
7
|
-
plan: string;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Verify API key via Fastify API
|
|
12
|
-
*/
|
|
13
|
-
export declare function verifyApiKey(plainTextKey: string): Promise<ApiKeyData | null>;
|
|
14
|
-
/**
|
|
15
|
-
* Authenticate and save credentials to config
|
|
16
|
-
*/
|
|
17
|
-
export declare function authenticate(apiKey: string): Promise<{
|
|
18
|
-
success: boolean;
|
|
19
|
-
message: string;
|
|
20
|
-
data?: ApiKeyData;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Check if user is authenticated
|
|
24
|
-
*/
|
|
25
|
-
export declare function isAuthenticated(): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Get current organization ID
|
|
28
|
-
*/
|
|
29
|
-
export declare function getOrganizationId(): string | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Get current API key
|
|
32
|
-
*/
|
|
33
|
-
export declare function getApiKey(): string | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Logout (clear authentication)
|
|
36
|
-
*/
|
|
37
|
-
export declare function logout(): void;
|
|
38
|
-
//# sourceMappingURL=auth.d.ts.map
|
package/dist/auth.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { config } from './config.js';
|
|
2
|
-
import { createApiClient } from './api.js';
|
|
3
|
-
// Normalize and validate API key input
|
|
4
|
-
function sanitizeApiKey(input) {
|
|
5
|
-
const raw = (input || '').trim().toLowerCase();
|
|
6
|
-
if (!raw.startsWith('lc_')) {
|
|
7
|
-
return { ok: false, message: 'API key must start with lc_' };
|
|
8
|
-
}
|
|
9
|
-
const hex = raw.slice(3); // after lc_
|
|
10
|
-
const hexOnly = hex.replace(/[^a-f0-9]/g, '');
|
|
11
|
-
if (hexOnly.length !== 64) {
|
|
12
|
-
return { ok: false, message: 'Invalid API key format. Expected lc_ followed by 64 hex characters' };
|
|
13
|
-
}
|
|
14
|
-
return { ok: true, key: `lc_${hexOnly}` };
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Verify API key via Fastify API
|
|
18
|
-
*/
|
|
19
|
-
export async function verifyApiKey(plainTextKey) {
|
|
20
|
-
try {
|
|
21
|
-
const sanitized = sanitizeApiKey(plainTextKey);
|
|
22
|
-
if (!sanitized.ok || !sanitized.key) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
// Create a temporary API client with the key to validate
|
|
26
|
-
const client = createApiClient(sanitized.key);
|
|
27
|
-
// Validate the API key
|
|
28
|
-
const validateResult = await client.post('/api-keys/validate', {
|
|
29
|
-
apiKey: sanitized.key,
|
|
30
|
-
});
|
|
31
|
-
if (!validateResult.valid) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
// Fetch organization details
|
|
35
|
-
const org = await client.get(`/orgs/${validateResult.organizationId}`);
|
|
36
|
-
return {
|
|
37
|
-
organizationId: validateResult.organizationId,
|
|
38
|
-
organization: {
|
|
39
|
-
id: org.id,
|
|
40
|
-
name: org.name,
|
|
41
|
-
slug: org.slug,
|
|
42
|
-
plan: org.plan,
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Authenticate and save credentials to config
|
|
52
|
-
*/
|
|
53
|
-
export async function authenticate(apiKey) {
|
|
54
|
-
const sanitized = sanitizeApiKey(apiKey);
|
|
55
|
-
if (!sanitized.ok || !sanitized.key) {
|
|
56
|
-
return {
|
|
57
|
-
success: false,
|
|
58
|
-
message: sanitized.message || 'Invalid API key format. Expected format: lc_[64 hex characters]',
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
// Verify via Fastify API
|
|
62
|
-
const keyData = await verifyApiKey(sanitized.key);
|
|
63
|
-
if (!keyData) {
|
|
64
|
-
return {
|
|
65
|
-
success: false,
|
|
66
|
-
message: 'Invalid or revoked API key. Please check your key and try again.',
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
// Save to config
|
|
70
|
-
config.set('apiKey', sanitized.key);
|
|
71
|
-
config.set('organizationId', keyData.organizationId);
|
|
72
|
-
config.set('organizationName', keyData.organization.name);
|
|
73
|
-
return {
|
|
74
|
-
success: true,
|
|
75
|
-
message: `Successfully authenticated as ${keyData.organization.name}`,
|
|
76
|
-
data: keyData,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Check if user is authenticated
|
|
81
|
-
*/
|
|
82
|
-
export function isAuthenticated() {
|
|
83
|
-
return !!(config.get('apiKey') && config.get('organizationId'));
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Get current organization ID
|
|
87
|
-
*/
|
|
88
|
-
export function getOrganizationId() {
|
|
89
|
-
return config.get('organizationId');
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Get current API key
|
|
93
|
-
*/
|
|
94
|
-
export function getApiKey() {
|
|
95
|
-
return config.get('apiKey');
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Logout (clear authentication)
|
|
99
|
-
*/
|
|
100
|
-
export function logout() {
|
|
101
|
-
config.delete('apiKey');
|
|
102
|
-
config.delete('organizationId');
|
|
103
|
-
config.delete('organizationName');
|
|
104
|
-
config.delete('defaultProject');
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=auth.js.map
|
package/dist/commands/auth.d.ts
DELETED
package/dist/commands/debug.d.ts
DELETED
package/dist/commands/debug.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import ora from 'ora';
|
|
3
|
-
import { isAuthenticated } from '../auth.js';
|
|
4
|
-
import { getApiClient } from '../api.js';
|
|
5
|
-
import { config } from '../config.js';
|
|
6
|
-
export async function debugListApiKeys() {
|
|
7
|
-
if (!isAuthenticated()) {
|
|
8
|
-
console.log(chalk.red('✗ Not authenticated.\n'));
|
|
9
|
-
process.exitCode = 1;
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const orgId = config.get('organizationId');
|
|
13
|
-
if (!orgId) {
|
|
14
|
-
console.log(chalk.red('✗ No organization configured.\n'));
|
|
15
|
-
process.exitCode = 1;
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
const spinner = ora('Testing API connection...').start();
|
|
19
|
-
try {
|
|
20
|
-
const api = getApiClient();
|
|
21
|
-
const org = await api.get(`/orgs/${orgId}`);
|
|
22
|
-
spinner.succeed(chalk.green(`API connection successful`));
|
|
23
|
-
console.log(chalk.blue.bold('\n🔧 Debug Info\n'));
|
|
24
|
-
console.log(chalk.white(`Organization: ${org.name}`));
|
|
25
|
-
console.log(chalk.white(`Plan: ${org.plan}`));
|
|
26
|
-
console.log(chalk.gray(`API URL: ${config.get('apiBaseUrl') || 'https://api.langctl.com/api/v1'}`));
|
|
27
|
-
console.log(chalk.gray(`Config: ${config.getConfigPath()}`));
|
|
28
|
-
console.log('');
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
spinner.fail(chalk.red('API connection failed'));
|
|
32
|
-
console.error(chalk.red(`Error: ${error.message}\n`));
|
|
33
|
-
process.exitCode = 1;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export async function debugListOrganizations() {
|
|
37
|
-
if (!isAuthenticated()) {
|
|
38
|
-
console.log(chalk.red('✗ Not authenticated.\n'));
|
|
39
|
-
process.exitCode = 1;
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
const orgId = config.get('organizationId');
|
|
43
|
-
if (!orgId) {
|
|
44
|
-
console.log(chalk.red('✗ No organization configured.\n'));
|
|
45
|
-
process.exitCode = 1;
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const spinner = ora('Fetching organization...').start();
|
|
49
|
-
try {
|
|
50
|
-
const api = getApiClient();
|
|
51
|
-
const org = await api.get(`/orgs/${orgId}`);
|
|
52
|
-
spinner.succeed(chalk.green('Found organization'));
|
|
53
|
-
console.log(`${chalk.cyan(org.id)} ${chalk.white(org.name)} plan=${chalk.magenta(org.plan)} created=${chalk.gray(org.createdAt)}`);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
spinner.fail(chalk.red('Failed to fetch organization'));
|
|
57
|
-
console.error(chalk.red(`Error: ${error.message}\n`));
|
|
58
|
-
process.exitCode = 1;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=debug.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
interface ExportOptions {
|
|
2
|
-
language?: string;
|
|
3
|
-
format?: string;
|
|
4
|
-
output?: string;
|
|
5
|
-
module?: string;
|
|
6
|
-
includeUnpublished?: boolean;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Export translations command
|
|
10
|
-
*/
|
|
11
|
-
export declare function exportCommand(projectSlug: string, options: ExportOptions): Promise<void>;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=export.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface ImportOptions {
|
|
2
|
-
language: string;
|
|
3
|
-
overwrite?: boolean;
|
|
4
|
-
module?: string;
|
|
5
|
-
publish?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Import translations command
|
|
9
|
-
*/
|
|
10
|
-
export declare function importCommand(projectSlug: string, filePath: string, options: ImportOptions): Promise<void>;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=import.d.ts.map
|
package/dist/commands/init.d.ts
DELETED
package/dist/commands/keys.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List translation keys
|
|
3
|
-
*/
|
|
4
|
-
export declare function listKeysCommand(projectSlug: string, options: any): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Get single key
|
|
7
|
-
*/
|
|
8
|
-
export declare function getKeyCommand(projectSlug: string, keyName: string): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Create translation key
|
|
11
|
-
*/
|
|
12
|
-
export declare function createKeyCommand(projectSlug: string, keyName: string, options: any): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Delete translation key
|
|
15
|
-
*/
|
|
16
|
-
export declare function deleteKeyCommand(projectSlug: string, keyName: string): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Update single translation
|
|
19
|
-
*/
|
|
20
|
-
export declare function translateKeyCommand(projectSlug: string, keyName: string, options: any): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Publish/unpublish keys
|
|
23
|
-
*/
|
|
24
|
-
export declare function publishKeysCommand(projectSlug: string, keys: string[], options: any): Promise<void>;
|
|
25
|
-
//# sourceMappingURL=keys.d.ts.map
|
package/dist/commands/org.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get organization information
|
|
3
|
-
*/
|
|
4
|
-
export declare function orgInfoCommand(): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Get organization statistics
|
|
7
|
-
*/
|
|
8
|
-
export declare function orgStatsCommand(): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Get organization plan and limits
|
|
11
|
-
*/
|
|
12
|
-
export declare function orgPlanCommand(): Promise<void>;
|
|
13
|
-
//# sourceMappingURL=org.d.ts.map
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List all projects
|
|
3
|
-
*/
|
|
4
|
-
export declare function projectsListCommand(): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Create new project
|
|
7
|
-
*/
|
|
8
|
-
export declare function projectsCreateCommand(name: string, options: any): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Get project details
|
|
11
|
-
*/
|
|
12
|
-
export declare function projectsGetCommand(slug: string): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Update project
|
|
15
|
-
*/
|
|
16
|
-
export declare function projectsUpdateCommand(slug: string, options: any): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Delete project
|
|
19
|
-
*/
|
|
20
|
-
export declare function projectsDeleteCommand(slug: string): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Add language to project
|
|
23
|
-
*/
|
|
24
|
-
export declare function projectsAddLanguageCommand(slug: string, language: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Remove language from project
|
|
27
|
-
*/
|
|
28
|
-
export declare function projectsRemoveLanguageCommand(slug: string, language: string): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Get project statistics
|
|
31
|
-
*/
|
|
32
|
-
export declare function projectsStatsCommand(slug: string): Promise<void>;
|
|
33
|
-
//# sourceMappingURL=projects.d.ts.map
|
package/dist/commands/pull.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface PullOptions {
|
|
2
|
-
language?: string;
|
|
3
|
-
format?: string;
|
|
4
|
-
output?: string;
|
|
5
|
-
dir?: string;
|
|
6
|
-
publishedOnly?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare function pullCommand(projectIdentifier: string, options: PullOptions): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=pull.d.ts.map
|
package/dist/commands/team.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List all team members
|
|
3
|
-
*/
|
|
4
|
-
export declare function listTeamCommand(): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Get team member details
|
|
7
|
-
*/
|
|
8
|
-
export declare function getTeamMemberCommand(email: string): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Invite team member
|
|
11
|
-
*/
|
|
12
|
-
export declare function inviteTeamMemberCommand(email: string, options: any): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Remove team member
|
|
15
|
-
*/
|
|
16
|
-
export declare function removeTeamMemberCommand(email: string): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Update team member role
|
|
19
|
-
*/
|
|
20
|
-
export declare function updateTeamRoleCommand(email: string, role: string): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* List invitations
|
|
23
|
-
*/
|
|
24
|
-
export declare function listInvitationsCommand(options: any): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Revoke invitation
|
|
27
|
-
*/
|
|
28
|
-
export declare function revokeInvitationCommand(email: string): Promise<void>;
|
|
29
|
-
//# sourceMappingURL=team.d.ts.map
|
package/dist/config.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export interface LangctlConfig {
|
|
2
|
-
apiKey?: string;
|
|
3
|
-
organizationId?: string;
|
|
4
|
-
organizationName?: string;
|
|
5
|
-
apiBaseUrl?: string;
|
|
6
|
-
defaultProject?: string;
|
|
7
|
-
defaultLanguage?: string;
|
|
8
|
-
}
|
|
9
|
-
declare class ConfigManager {
|
|
10
|
-
private config;
|
|
11
|
-
private configDir;
|
|
12
|
-
constructor();
|
|
13
|
-
/**
|
|
14
|
-
* Get a configuration value
|
|
15
|
-
*/
|
|
16
|
-
get<K extends keyof LangctlConfig>(key: K): LangctlConfig[K] | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Set a configuration value
|
|
19
|
-
*/
|
|
20
|
-
set<K extends keyof LangctlConfig>(key: K, value: LangctlConfig[K]): void;
|
|
21
|
-
/**
|
|
22
|
-
* Get all configuration
|
|
23
|
-
*/
|
|
24
|
-
getAll(): LangctlConfig;
|
|
25
|
-
/**
|
|
26
|
-
* Set multiple configuration values
|
|
27
|
-
*/
|
|
28
|
-
setAll(config: Partial<LangctlConfig>): void;
|
|
29
|
-
/**
|
|
30
|
-
* Delete a configuration value
|
|
31
|
-
*/
|
|
32
|
-
delete(key: keyof LangctlConfig): void;
|
|
33
|
-
/**
|
|
34
|
-
* Clear all configuration
|
|
35
|
-
*/
|
|
36
|
-
clear(): void;
|
|
37
|
-
/**
|
|
38
|
-
* Check if user is authenticated
|
|
39
|
-
*/
|
|
40
|
-
isConfigured(): boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Get the configuration file path
|
|
43
|
-
*/
|
|
44
|
-
getConfigPath(): string;
|
|
45
|
-
}
|
|
46
|
-
export declare const config: ConfigManager;
|
|
47
|
-
export {};
|
|
48
|
-
//# sourceMappingURL=config.d.ts.map
|