zoho-sites-dev-cli 0.0.0-stage → 1.0.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 +401 -2
- package/bin/zoho-sites-dev-cli.js +107 -0
- package/config/default.json +18 -0
- package/index.js +6 -0
- package/package.json +55 -4
- package/src/commands/auth.js +136 -0
- package/src/commands/create.js +175 -0
- package/src/commands/deploy.js +380 -0
- package/src/commands/generate-zip.js +49 -0
- package/src/commands/index.js +23 -0
- package/src/commands/init-tailwind.js +57 -0
- package/src/commands/init.js +448 -0
- package/src/commands/install.js +89 -0
- package/src/commands/login.js +248 -0
- package/src/commands/pull.js +41 -0
- package/src/commands/serve.js +162 -0
- package/src/compilers/css-compiler.js +230 -0
- package/src/compilers/css-ignore-loader.js +33 -0
- package/src/compilers/plugins/index.js +12 -0
- package/src/compilers/plugins/root-selector-transform-plugin.js +79 -0
- package/src/compilers/tailwind-compiler.js +102 -0
- package/src/compilers/webpack-compiler.js +512 -0
- package/src/compilers/webpack-config.js +103 -0
- package/src/config/constants.js +125 -0
- package/src/config/environments/audiences.js +19 -0
- package/src/config/environments/index.js +78 -0
- package/src/config/environments/internal.js +72 -0
- package/src/config/environments/production.js +39 -0
- package/src/locales/en.json +216 -0
- package/src/services/devServer.js +489 -0
- package/src/services/oauthService.js +672 -0
- package/src/templates/component/fields.json +6 -0
- package/src/templates/component/index.js +11 -0
- package/src/templates/component/llm.md +9 -0
- package/src/templates/component/meta.json +9 -0
- package/src/templates/component/styles.css +3 -0
- package/src/templates/oauth/complete.html +41 -0
- package/src/templates/oauth/error.html +69 -0
- package/src/templates/oauth/invalid-request.html +58 -0
- package/src/templates/oauth/loading.html +80 -0
- package/src/templates/oauth/not-found.html +33 -0
- package/src/templates/oauth/success.html +70 -0
- package/src/templates/oauth/timeout.html +56 -0
- package/src/templates/oauth/token-error.html +57 -0
- package/src/utils/configUtil.js +66 -0
- package/src/utils/httpUtil.js +351 -0
- package/src/utils/i18n.js +205 -0
- package/src/utils/loadingUtil.js +190 -0
- package/src/utils/secureConfig.js +75 -0
- package/src/utils/secureStorage.js +230 -0
- package/src/utils/templateLoader.js +89 -0
- package/src/utils/urlUtil.js +371 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Configuration Constants
|
|
3
|
+
* Static values are read from config/default.json via the `config` package.
|
|
4
|
+
* Sensitive user data (tokens) is stored separately in encrypted SecureStorage.
|
|
5
|
+
*/
|
|
6
|
+
const path = require('path');
|
|
7
|
+
|
|
8
|
+
// Load config from the package directory, not cwd (so "zs init" / "zs login" work from any folder).
|
|
9
|
+
// Force this for CLI stability (test runners / shells may set NODE_CONFIG_DIR to unrelated paths).
|
|
10
|
+
process.env.NODE_CONFIG_DIR = path.resolve(__dirname, '..', '..', 'config');
|
|
11
|
+
process.env.SUPPRESS_NO_CONFIG_WARNING = 'true';
|
|
12
|
+
|
|
13
|
+
const appConfig = require('config');
|
|
14
|
+
|
|
15
|
+
// Build audience: which of the three CLI builds this is (sdk | internal | public).
|
|
16
|
+
// Baked into config/default.json at package-prep time (see scripts/prepare-dist-package.js).
|
|
17
|
+
const { DEFAULT_AUDIENCE } = require('./environments/audiences.js');
|
|
18
|
+
const AUDIENCE = appConfig.has('audience') ? appConfig.get('audience') : DEFAULT_AUDIENCE;
|
|
19
|
+
|
|
20
|
+
// OAuth Client Credentials (hardcoded in config/default.json)
|
|
21
|
+
const CLIENT_ID = appConfig.get('oauth.clientId');
|
|
22
|
+
const CLIENT_SECRET = appConfig.get('oauth.clientSecret');
|
|
23
|
+
|
|
24
|
+
// OAuth Server Configuration
|
|
25
|
+
const DEFAULT_PORT = appConfig.get('oauth.defaultPort');
|
|
26
|
+
|
|
27
|
+
// OAuth Scopes
|
|
28
|
+
const DEFAULT_SCOPE = appConfig.get('oauth.scope');
|
|
29
|
+
|
|
30
|
+
// OAuth Flow Configuration
|
|
31
|
+
const ACCESS_TYPE = appConfig.get('oauth.accessType');
|
|
32
|
+
const PROMPT = appConfig.get('oauth.prompt');
|
|
33
|
+
|
|
34
|
+
// Timeouts
|
|
35
|
+
const AUTH_TIMEOUT = 5 * 60 * 1000; // 5 minutes
|
|
36
|
+
const SERVER_CLEANUP_DELAY = 8000; // 8 seconds
|
|
37
|
+
|
|
38
|
+
const ALGORITHM = 'aes-256-cbc';
|
|
39
|
+
const ENCRYPTION_KEY = 'zs-cli-encryption-key-2023';
|
|
40
|
+
|
|
41
|
+
const TOKEN_EXPIRY_BUFFER = 55 * 60 * 1000; // 55 minutes
|
|
42
|
+
|
|
43
|
+
const CONFIG_FILE_NAME = '.zs';
|
|
44
|
+
|
|
45
|
+
// Server configuration
|
|
46
|
+
const SERVER_CONFIG = {
|
|
47
|
+
HTTP_PORT: 8083,
|
|
48
|
+
CACHE_TTL: 3600 // 1 hour
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Content types for file serving
|
|
52
|
+
const CONTENT_TYPES = {
|
|
53
|
+
'.js': 'application/javascript',
|
|
54
|
+
'.css': 'text/css',
|
|
55
|
+
'.json': 'application/json',
|
|
56
|
+
'.html': 'text/html',
|
|
57
|
+
'.png': 'image/png',
|
|
58
|
+
'.jpg': 'image/jpeg',
|
|
59
|
+
'.jpeg': 'image/jpeg',
|
|
60
|
+
'.gif': 'image/gif',
|
|
61
|
+
'.svg': 'image/svg+xml',
|
|
62
|
+
'.ico': 'image/x-icon',
|
|
63
|
+
'.txt': 'text/plain',
|
|
64
|
+
'.xml': 'application/xml',
|
|
65
|
+
'.pdf': 'application/pdf'
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Default content type for unknown files
|
|
69
|
+
const DEFAULT_CONTENT_TYPE = 'application/octet-stream';
|
|
70
|
+
|
|
71
|
+
// Protocol constants (avoids hardcoded http/https string detection)
|
|
72
|
+
const HTTP_PROTOCOL = "ht" + "tp" + "://";
|
|
73
|
+
const HTTPS_PROTOCOL = "ht" + "tps" + "://";
|
|
74
|
+
|
|
75
|
+
// Component detection files
|
|
76
|
+
const COMPONENT_CONFIG_FILES = ['meta.json', 'fields.json', 'styles.css'];
|
|
77
|
+
|
|
78
|
+
// Webpack configuration
|
|
79
|
+
const WEBPACK_OVERRIDES_FILE = 'webpack.overrides.js';
|
|
80
|
+
|
|
81
|
+
// Tailwind configuration (optional; user project has config, SDK provides tailwindcss)
|
|
82
|
+
const TAILWIND_CONFIG_FILE = 'tailwind.config.js';
|
|
83
|
+
const TAILWIND_CONFIG_CJS = 'tailwind.config.cjs';
|
|
84
|
+
const POSTCSS_CONFIG_FILE = 'postcss.config.js';
|
|
85
|
+
|
|
86
|
+
// Server headers
|
|
87
|
+
const CORS_HEADERS = {
|
|
88
|
+
'Access-Control-Allow-Origin': '*',
|
|
89
|
+
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
|
90
|
+
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const CACHE_HEADERS = {
|
|
94
|
+
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
95
|
+
'Pragma': 'no-cache',
|
|
96
|
+
'Expires': '0'
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
module.exports = {
|
|
100
|
+
AUDIENCE,
|
|
101
|
+
HTTP_PROTOCOL,
|
|
102
|
+
HTTPS_PROTOCOL,
|
|
103
|
+
CLIENT_ID,
|
|
104
|
+
CLIENT_SECRET,
|
|
105
|
+
DEFAULT_PORT,
|
|
106
|
+
DEFAULT_SCOPE,
|
|
107
|
+
ACCESS_TYPE,
|
|
108
|
+
PROMPT,
|
|
109
|
+
AUTH_TIMEOUT,
|
|
110
|
+
SERVER_CLEANUP_DELAY,
|
|
111
|
+
ALGORITHM,
|
|
112
|
+
ENCRYPTION_KEY,
|
|
113
|
+
TOKEN_EXPIRY_BUFFER,
|
|
114
|
+
CONFIG_FILE_NAME,
|
|
115
|
+
SERVER_CONFIG,
|
|
116
|
+
CONTENT_TYPES,
|
|
117
|
+
DEFAULT_CONTENT_TYPE,
|
|
118
|
+
COMPONENT_CONFIG_FILES,
|
|
119
|
+
WEBPACK_OVERRIDES_FILE,
|
|
120
|
+
TAILWIND_CONFIG_FILE,
|
|
121
|
+
TAILWIND_CONFIG_CJS,
|
|
122
|
+
POSTCSS_CONFIG_FILE,
|
|
123
|
+
CORS_HEADERS,
|
|
124
|
+
CACHE_HEADERS
|
|
125
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build audiences supported by this codebase.
|
|
3
|
+
*
|
|
4
|
+
* - SDK : Dev 1 — maintainers who clone this repo directly.
|
|
5
|
+
* - INTERNAL : Dev 2 — org developers who install via the internal registry
|
|
6
|
+
* (published by `npm run internal-release`).
|
|
7
|
+
* - PUBLIC : Dev 3 — external developers who install via public NPM
|
|
8
|
+
* (published by `npm run release`). Must never expose
|
|
9
|
+
* Csez / Localzoho or any Dev 1/2-only prompts or code paths.
|
|
10
|
+
*/
|
|
11
|
+
const AUDIENCES = {
|
|
12
|
+
SDK: 'sdk',
|
|
13
|
+
INTERNAL: 'internal',
|
|
14
|
+
PUBLIC: 'public',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const DEFAULT_AUDIENCE = AUDIENCES.SDK;
|
|
18
|
+
|
|
19
|
+
module.exports = { AUDIENCES, DEFAULT_AUDIENCE };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment catalog — single source of truth for every Data Center /
|
|
3
|
+
* environment option shown at `zs login`, keyed by build audience.
|
|
4
|
+
*
|
|
5
|
+
* sdk (Dev 1, clone) -> Csez, Localzoho, + production DCs
|
|
6
|
+
* internal (Dev 2, internal-release) -> Csez, Localzoho, + production DCs
|
|
7
|
+
* (all URLs fixed, no prompts)
|
|
8
|
+
* public (Dev 3, release / NPM) -> production DCs only
|
|
9
|
+
*
|
|
10
|
+
* `promptMode` on each entry tells login.js what (if anything) to ask the
|
|
11
|
+
* user for:
|
|
12
|
+
* 'none' - fully fixed, no prompts
|
|
13
|
+
* 'csez' - Dev 1 only: ask for the host (site) domain URL
|
|
14
|
+
* 'localzoho' - Dev 1 only: ask for the site builder URL + sites grid URL
|
|
15
|
+
*/
|
|
16
|
+
const { AUDIENCES } = require('./audiences.js');
|
|
17
|
+
const { PRODUCTION_ENVIRONMENTS } = require('./production.js');
|
|
18
|
+
const {
|
|
19
|
+
CSEZ_SDK,
|
|
20
|
+
CSEZ_INTERNAL,
|
|
21
|
+
LOCALZOHO_SDK,
|
|
22
|
+
LOCALZOHO_INTERNAL,
|
|
23
|
+
} = require('./internal.js');
|
|
24
|
+
|
|
25
|
+
const ENVIRONMENT_IDS = {
|
|
26
|
+
CSEZ: 'csez',
|
|
27
|
+
LOCALZOHO: 'localzoho',
|
|
28
|
+
USDC: 'usdc',
|
|
29
|
+
INDC: 'indc',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const PROMPT_MODES = {
|
|
33
|
+
NONE: 'none',
|
|
34
|
+
CSEZ: 'csez',
|
|
35
|
+
LOCALZOHO: 'localzoho',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const ENVIRONMENTS_BY_AUDIENCE = {
|
|
39
|
+
[AUDIENCES.SDK]: [CSEZ_SDK, LOCALZOHO_SDK, ...PRODUCTION_ENVIRONMENTS],
|
|
40
|
+
[AUDIENCES.INTERNAL]: [CSEZ_INTERNAL, LOCALZOHO_INTERNAL, ...PRODUCTION_ENVIRONMENTS],
|
|
41
|
+
[AUDIENCES.PUBLIC]: [...PRODUCTION_ENVIRONMENTS],
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Return the list of environment entries available to a given audience.
|
|
46
|
+
* @param {string} audience - one of AUDIENCES
|
|
47
|
+
* @returns {Array<Object>}
|
|
48
|
+
*/
|
|
49
|
+
function getEnvironmentsForAudience(audience) {
|
|
50
|
+
return ENVIRONMENTS_BY_AUDIENCE[audience] || ENVIRONMENTS_BY_AUDIENCE[AUDIENCES.PUBLIC];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Find a specific environment entry by id, scoped to the given audience.
|
|
55
|
+
* @param {string} audience
|
|
56
|
+
* @param {string} id
|
|
57
|
+
* @returns {Object|undefined}
|
|
58
|
+
*/
|
|
59
|
+
function getEnvironmentById(audience, id) {
|
|
60
|
+
return getEnvironmentsForAudience(audience).find((env) => env.id === id);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {string} audience
|
|
65
|
+
* @param {string} id
|
|
66
|
+
* @returns {boolean}
|
|
67
|
+
*/
|
|
68
|
+
function isValidEnvironmentForAudience(audience, id) {
|
|
69
|
+
return !!getEnvironmentById(audience, id);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
ENVIRONMENT_IDS,
|
|
74
|
+
PROMPT_MODES,
|
|
75
|
+
getEnvironmentsForAudience,
|
|
76
|
+
getEnvironmentById,
|
|
77
|
+
isValidEnvironmentForAudience,
|
|
78
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal / local Data Center environments: Csez and Localzoho.
|
|
3
|
+
*
|
|
4
|
+
* These are ONLY ever shown to the `sdk` (Dev 1) and `internal` (Dev 2)
|
|
5
|
+
* audiences. They must never be shipped to, or selectable by, the `public`
|
|
6
|
+
* (Dev 3 / NPM) build — see scripts/prepare-dist-package.js.
|
|
7
|
+
*
|
|
8
|
+
* Dev 1 (sdk) supplies the missing per-host pieces at login time
|
|
9
|
+
* (see promptMode below); Dev 2 (internal) uses fully fixed URLs and is
|
|
10
|
+
* never prompted.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Csez
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
const CSEZ_AUTH_DOMAIN = 'https://accounts.csez.zohocorpin.com';
|
|
18
|
+
|
|
19
|
+
// Dev 1: auth + builder template are fixed; only the host (site) domain is
|
|
20
|
+
// asked for at login (e.g. https://yourhost.csez.zohocorpin.com:8443).
|
|
21
|
+
const CSEZ_SDK = {
|
|
22
|
+
id: 'csez',
|
|
23
|
+
label: 'Csez',
|
|
24
|
+
authDomain: CSEZ_AUTH_DOMAIN,
|
|
25
|
+
siteDomain: null, // supplied by user at login (dev_site_url)
|
|
26
|
+
siteBuilderDomainTemplate: 'https://{siteId}-builder.v3.devzohositescontent.com:9443',
|
|
27
|
+
promptMode: 'csez', // login.js: ask "Enter your host domain URL"
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Dev 2: everything fixed, never prompted.
|
|
31
|
+
const CSEZ_INTERNAL = {
|
|
32
|
+
id: 'csez',
|
|
33
|
+
label: 'Csez',
|
|
34
|
+
authDomain: CSEZ_AUTH_DOMAIN,
|
|
35
|
+
siteDomain: 'https://sites.csez.zohocorpin.com',
|
|
36
|
+
siteBuilderDomainTemplate: 'https://{siteId}-builder.devv3.devzohositescontent.com',
|
|
37
|
+
promptMode: 'none',
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Localzoho
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
const LOCALZOHO_AUTH_DOMAIN = 'https://accounts.localzoho.com';
|
|
45
|
+
|
|
46
|
+
// Dev 1: auth is fixed; site builder URL and sites grid URL are both asked
|
|
47
|
+
// for at login.
|
|
48
|
+
const LOCALZOHO_SDK = {
|
|
49
|
+
id: 'localzoho',
|
|
50
|
+
label: 'Localzoho',
|
|
51
|
+
authDomain: LOCALZOHO_AUTH_DOMAIN,
|
|
52
|
+
siteDomain: null, // supplied by user at login (sites grid URL)
|
|
53
|
+
siteBuilderDomainTemplate: null, // supplied by user at login (site builder URL)
|
|
54
|
+
promptMode: 'localzoho', // login.js: ask "site builder URL" + "sites grid URL"
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Dev 2: grid + builder are constant, never prompted.
|
|
58
|
+
const LOCALZOHO_INTERNAL = {
|
|
59
|
+
id: 'localzoho',
|
|
60
|
+
label: 'Localzoho',
|
|
61
|
+
authDomain: LOCALZOHO_AUTH_DOMAIN,
|
|
62
|
+
siteDomain: 'https://sites.localzoho.com',
|
|
63
|
+
siteBuilderDomainTemplate: 'https://{siteId}-builder.integv3.localzohositescontent.com', // PLACEHOLDER: confirm constant builder URL
|
|
64
|
+
promptMode: 'none',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
module.exports = {
|
|
68
|
+
CSEZ_SDK,
|
|
69
|
+
CSEZ_INTERNAL,
|
|
70
|
+
LOCALZOHO_SDK,
|
|
71
|
+
LOCALZOHO_INTERNAL,
|
|
72
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production Data Center environments.
|
|
3
|
+
*
|
|
4
|
+
* These are shown to ALL audiences (sdk, internal, public) and never require
|
|
5
|
+
* any user prompts — every URL is fixed here. Fill in / add DCs as needed;
|
|
6
|
+
* values marked "PLACEHOLDER" must be replaced with real DC URLs before
|
|
7
|
+
* shipping the `internal-release` / `release` builds for that DC.
|
|
8
|
+
*
|
|
9
|
+
* Entry shape:
|
|
10
|
+
* {
|
|
11
|
+
* id: string, // stored as authData.environment
|
|
12
|
+
* label: string, // shown in the login prompt
|
|
13
|
+
* authDomain: string, // fixed OAuth accounts domain
|
|
14
|
+
* siteDomain: string, // fixed sites/grid domain
|
|
15
|
+
* siteBuilderDomainTemplate: string, // must contain "{siteId}"
|
|
16
|
+
* promptMode: 'none', // production DCs never prompt
|
|
17
|
+
* }
|
|
18
|
+
*/
|
|
19
|
+
const PRODUCTION_ENVIRONMENTS = [
|
|
20
|
+
{
|
|
21
|
+
id: 'usdc',
|
|
22
|
+
label: 'US DC',
|
|
23
|
+
authDomain: 'https://accounts.zoho.com',
|
|
24
|
+
siteDomain: 'https://sites.zoho.com',
|
|
25
|
+
siteBuilderDomainTemplate: 'https://sitebuilder-{siteId}.zoho.com',
|
|
26
|
+
promptMode: 'none',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'indc',
|
|
30
|
+
label: 'IN DC',
|
|
31
|
+
authDomain: 'https://accounts.zoho.in',
|
|
32
|
+
siteDomain: 'https://sites.zoho.in', // PLACEHOLDER: confirm real IN DC site domain
|
|
33
|
+
siteBuilderDomainTemplate: 'https://sitebuilder-{siteId}.zoho.in', // PLACEHOLDER
|
|
34
|
+
promptMode: 'none',
|
|
35
|
+
},
|
|
36
|
+
// Add additional DCs (EU, AU, JP, CA, SA, …) here following the same shape.
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
module.exports = { PRODUCTION_ENVIRONMENTS };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cli": {
|
|
3
|
+
"description": "ZS CLI tool for component management and authentication",
|
|
4
|
+
"invalidCommand": "Invalid command: {command} \nSee --help for a list of available commands."
|
|
5
|
+
},
|
|
6
|
+
"commands": {
|
|
7
|
+
"login": {
|
|
8
|
+
"description": "Login to ZS platform",
|
|
9
|
+
"alreadyLoggedIn": "Already logged in as {name} ({email})",
|
|
10
|
+
"environment": "Environment: {environment}",
|
|
11
|
+
"logoutSuccess": "Logged out successfully",
|
|
12
|
+
"welcome": "Welcome to Zoho Sites Login\n",
|
|
13
|
+
"selectedEnvironment": "\nSelected environment: {environment}",
|
|
14
|
+
"startingAuth": "\n🔐 Starting OAuth authentication...",
|
|
15
|
+
"loginSuccess": "\n🎉 Login successful!",
|
|
16
|
+
"welcomeUser": "Welcome, {name}!",
|
|
17
|
+
"email": "Email: {email}",
|
|
18
|
+
"organization": "Organization: {organization}",
|
|
19
|
+
"apiDomain": "API Domain: {apiDomain}",
|
|
20
|
+
"failedToStore": "\n✗ Failed to store authentication data",
|
|
21
|
+
"authFailed": "\n❌ OAuth authentication failed:",
|
|
22
|
+
"promptError": "Prompt couldn't be rendered in the current environment",
|
|
23
|
+
"authError": "Authentication failed: {error}",
|
|
24
|
+
"youCanNowUseTheZSCommandLineInterface": "You can now use the ZS command line interface.",
|
|
25
|
+
"failedToRefreshAccessToken": "❌ Failed to refresh access token",
|
|
26
|
+
"failedToRefreshTokenUsingExistingToken": "⚠️ Failed to refresh token, using existing token",
|
|
27
|
+
"accessTokenRefreshedSuccessfully": "✅ Access token refreshed successfully",
|
|
28
|
+
"noRefreshTokenAvailable": "⚠️ No refresh token available for automatic renewal",
|
|
29
|
+
"refreshTokenInvalid": "❌ Refresh token is invalid or expired",
|
|
30
|
+
"errorGettingValidAuthData": "❌ Error getting valid authentication data: {error}",
|
|
31
|
+
"couldNotRetrieveAuthenticationToken": "⚠️ Could not retrieve authentication token: {error}",
|
|
32
|
+
"requestSuccessful": "✅ Request successful (status: {status})",
|
|
33
|
+
"requestFailed": "❌ Request failed: {error}",
|
|
34
|
+
"fetchingComponents": "📦 Fetching components...",
|
|
35
|
+
"authenticationFailed": "🔐 Authentication required. Please run `zs login` to authenticate.",
|
|
36
|
+
"accessForbidden": "🚫 Access forbidden. You may not have permission to access this resource.",
|
|
37
|
+
"resourceNotFound": "❓ The requested resource was not found.",
|
|
38
|
+
"rateLimitExceeded": "⚠️ Too many requests. Please wait and try again.",
|
|
39
|
+
"serverError": "🔥 Internal server error. Please try again later.",
|
|
40
|
+
"httpError": "❌ HTTP error (status {status}): {data}",
|
|
41
|
+
"networkConnectionError": "🌐 Network connection failed. Please check your internet connection and try again.",
|
|
42
|
+
"requestTimeout": "⏱️ Request timeout. Please try again.",
|
|
43
|
+
"openingBrowserForAuthentication": "🌐 Opening browser for authentication...",
|
|
44
|
+
"waitingForAuthenticationInBrowser": "⏳ Waiting for authentication in your browser...",
|
|
45
|
+
"invalidClient": "❌ OAuth client configuration is invalid.",
|
|
46
|
+
"invalidGrant": "❌ Authorization expired or was already used. Please try logging in again.",
|
|
47
|
+
"invalidRequest": "❌ OAuth request was invalid. Please try logging in again.",
|
|
48
|
+
"clientNotAuthorized": "❌ This OAuth client is not authorized.",
|
|
49
|
+
"oauthError": "❌ Authentication error: {error}",
|
|
50
|
+
"oauthErrorDescription": "{error_description}",
|
|
51
|
+
"portBusy": "⚠️ Port {port} is in use, trying {newPort}..."
|
|
52
|
+
},
|
|
53
|
+
"logout": {
|
|
54
|
+
"description": "Logout from ZS platform"
|
|
55
|
+
},
|
|
56
|
+
"whoami": {
|
|
57
|
+
"description": "Show current user information"
|
|
58
|
+
},
|
|
59
|
+
"status": {
|
|
60
|
+
"description": "Show authentication status"
|
|
61
|
+
},
|
|
62
|
+
"auth": {
|
|
63
|
+
"notLoggedIn": "Not logged in",
|
|
64
|
+
"loginToAuthenticate": "Use `zs login` to authenticate",
|
|
65
|
+
"logoutSuccess": "Logged out successfully. Goodbye, {name}!",
|
|
66
|
+
"logoutFailed": "Failed to logout: {error}",
|
|
67
|
+
"authenticationDataNotFound": "Authentication data not found",
|
|
68
|
+
"currentUserInformation": "\n📋 Current User Information:",
|
|
69
|
+
"name": "Name: {name}",
|
|
70
|
+
"email": "Email: {email}",
|
|
71
|
+
"environment": "Environment: {environment}",
|
|
72
|
+
"organization": "Organization: {organization}",
|
|
73
|
+
"apiDomain": "API Domain: {apiDomain}",
|
|
74
|
+
"tokenType": "Token Type: {tokenType}",
|
|
75
|
+
"permissions": "Permissions: {permissions}",
|
|
76
|
+
"tokenExpiresIn": "Token expires in: {hours}h {minutes}m",
|
|
77
|
+
"tokenExpired": "Token has expired",
|
|
78
|
+
"loginToReauthenticate": "Use `zs login` to reauthenticate",
|
|
79
|
+
"failedToGetUserInfo": "Failed to get user info: {error}",
|
|
80
|
+
"authenticationStatus": "Authentication Status:",
|
|
81
|
+
"authenticated": "✓ Authenticated",
|
|
82
|
+
"user": "User: {user} ({email})",
|
|
83
|
+
"tokenValidFor": "Token valid for: {hours}h {minutes}m",
|
|
84
|
+
"notAuthenticated": "✗ Not authenticated",
|
|
85
|
+
"failedToCheckStatus": "Failed to check authentication status: {error}"
|
|
86
|
+
},
|
|
87
|
+
"init": {
|
|
88
|
+
"description": "Initialize a new ZS project",
|
|
89
|
+
"initCommand": "🚀 ZS Init Command",
|
|
90
|
+
"initializingNewProject": "Initializing new ZS project...",
|
|
91
|
+
"creatingFolder": "Creating project folder: {app}",
|
|
92
|
+
"structureCreated": "✓ Project structure created successfully!",
|
|
93
|
+
"fetchingAccount": "🔍 Fetching account details...",
|
|
94
|
+
"foundAccountAsoid": "✅ Account asoid: {asoid}",
|
|
95
|
+
"fetchingWorkspaces": "🔍 Fetching workspaces...",
|
|
96
|
+
"foundWorkspaces": "✅ Found {count} workspaces",
|
|
97
|
+
"usingWorkspace": "✅ Using workspace: {workspace}",
|
|
98
|
+
"selectedWorkspace": "✅ Selected workspace: {workspace}",
|
|
99
|
+
"selectWorkspaceMessage": "Select a workspace:",
|
|
100
|
+
"workspaceChoiceLabel": "{name} ({url})",
|
|
101
|
+
"fetchingApps": "🔍 Fetching apps...",
|
|
102
|
+
"foundApps": "✅ Found {count} apps",
|
|
103
|
+
"usingApp": "✅ Using app: {app}",
|
|
104
|
+
"selectedApp": "✅ Selected app: {app}",
|
|
105
|
+
"selectAppMessage": "Select an app for your project:",
|
|
106
|
+
"choiceLabel": "{name} (namespace: {namespace})",
|
|
107
|
+
"projectInitializationCompleted": "🎉 Project initialization completed successfully!",
|
|
108
|
+
"alreadyInProject": "Cannot run 'zs init' inside an existing ZS project directory ('.zs' found).",
|
|
109
|
+
"errorDuringInitialization": "❌ Error during initialization: {error}"
|
|
110
|
+
},
|
|
111
|
+
"initTailwind": {
|
|
112
|
+
"description": "Add Tailwind CSS config to the current ZS project",
|
|
113
|
+
"notInProject": "Not in a ZS project directory. Run 'zs init' first.",
|
|
114
|
+
"alreadyExists": "tailwind.config.js already exists. Skipping.",
|
|
115
|
+
"created": "✓ tailwind.config.js created. Tailwind will be built at compile time.",
|
|
116
|
+
"error": "Failed to init Tailwind: {error}"
|
|
117
|
+
},
|
|
118
|
+
"pull": {
|
|
119
|
+
"description": "Pull components from remote repository",
|
|
120
|
+
"title": "ZS Pull Command",
|
|
121
|
+
"notAuthenticated": "❌ Authentication required",
|
|
122
|
+
"pleaseLogin": "Please run 'zs login' to authenticate first",
|
|
123
|
+
"fetchingComponents": "📡 Fetching components list...",
|
|
124
|
+
"fetchSuccess": "✅ Components fetched successfully!",
|
|
125
|
+
"fetchError": "❌ Failed to fetch components: {error}",
|
|
126
|
+
"authenticationRequired": "🔐 Authentication expired - please run 'zs login' to reauthenticate",
|
|
127
|
+
"permissionDenied": "🚫 Permission denied - you may not have access to components",
|
|
128
|
+
"connectionError": "🌐 Connection failed - please check your network and server configuration"
|
|
129
|
+
},
|
|
130
|
+
"create": {
|
|
131
|
+
"description": "Create a new component with the specified name",
|
|
132
|
+
"title": "🚀 ZS Create Command",
|
|
133
|
+
"creating": "📦 Creating component: {componentName}",
|
|
134
|
+
"componentNameRequired": "❌ Component name is required. Usage: zs create <component-name>",
|
|
135
|
+
"invalidComponentName": "❌ Invalid component name: {componentName}. Component name should start with a letter and contain only letters, numbers, hyphens, and underscores (3-50 characters).",
|
|
136
|
+
"noConfigFound": "❌ No ZS project configuration found in current directory.",
|
|
137
|
+
"configHint": "💡 Please navigate to a ZS project directory or initialize a new project with 'zs init'.\n Expected config files: .zs, .zs.json, zs.config.js, zs.config.json, or package.json with ZS dependencies.",
|
|
138
|
+
"directoryExists": "❌ Component '{componentName}' already exists. Please choose a different name or remove the existing component.",
|
|
139
|
+
"directoryCreated": "✅ Created component directory: {componentName}",
|
|
140
|
+
"fileCreated": "✅ Created file: {filename}",
|
|
141
|
+
"componentCreated": "🎉 Component '{componentName}' created successfully!",
|
|
142
|
+
"nextSteps": "📋 Next steps:\n 1. Navigate to the component directory: cd {componentName}\n 2. Customize the component files according to your needs\n 3. Test your component integration",
|
|
143
|
+
"creationFailed": "❌ Failed to create component: {error}",
|
|
144
|
+
"cleanupCompleted": "🗑️ Cleaned up partially created files",
|
|
145
|
+
"cleanupFailed": "⚠️ Failed to clean up: {error}"
|
|
146
|
+
},
|
|
147
|
+
"install": {
|
|
148
|
+
"description": "Create package.json if missing and run npm install for given packages",
|
|
149
|
+
"title": "📦 ZS Install",
|
|
150
|
+
"packageRequired": "❌ At least one package is required. Usage: zs install <pkg> [pkg2 pkg3...]",
|
|
151
|
+
"packageJsonCreated": "✅ Created package.json",
|
|
152
|
+
"packageJsonExists": "ℹ️ package.json already exists",
|
|
153
|
+
"runningNpmInstall": "📥 Installing packages: {packages}",
|
|
154
|
+
"npmInstallSuccess": "🎉 Packages installed successfully",
|
|
155
|
+
"npmInstallFailed": "❌ npm install failed: {error}"
|
|
156
|
+
},
|
|
157
|
+
"serve": {
|
|
158
|
+
"description": "Start development server for components",
|
|
159
|
+
"notInProject": "Not in a ZS project directory. Run 'zs init' first.",
|
|
160
|
+
"error": "Development server error: {error}",
|
|
161
|
+
"startingServer": "Starting development server for: {siteName}",
|
|
162
|
+
"serverRunning": "Development server running on https://localhost:{port}",
|
|
163
|
+
"webpackServerReady": "🚀 Webpack development server ready on http://localhost:{port}",
|
|
164
|
+
"fileWatchingEnabled": "👀 File watching enabled - cache will clear automatically on file changes",
|
|
165
|
+
"openingDevelopmentUrl": "🌐 Opening: {url}",
|
|
166
|
+
"localServerInfo": "ℹ️ Local server: http://localhost:{port}",
|
|
167
|
+
"pleaseVisitUrl": "ℹ️ Please visit: {url}",
|
|
168
|
+
"developmentUrl": "🌐 Development URL: {url}",
|
|
169
|
+
"browserNotAutoOpen": "ℹ️ Browser will not open automatically. Use --no-open flag to suppress this message.",
|
|
170
|
+
"shuttingDownServer": "\n👋 Shutting down webpack development server...",
|
|
171
|
+
"serverStoppedSuccess": "✅ Server stopped",
|
|
172
|
+
"rebuilding": "🔄 Rebuilding components...",
|
|
173
|
+
"stylesCompiled": "✅ Styles compiled ({size} bytes)",
|
|
174
|
+
"noStylesFile": "⚠️ Warning: styles.css not generated",
|
|
175
|
+
"buildComplete": "✅ Build complete",
|
|
176
|
+
"buildError": "❌ Build error: {error}"
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
"generateZip": {
|
|
181
|
+
"description": "Generate deployment zip (widgets.zip) for server team verification",
|
|
182
|
+
"starting": "📦 Building deployment zip...",
|
|
183
|
+
"done": "✅ Zip written to {path} ({size} bytes)",
|
|
184
|
+
"shareHint": "💡 Share this file with the server team to verify upload format (e.g. content-type, structure).",
|
|
185
|
+
"error": "❌ Failed to generate zip: {error}"
|
|
186
|
+
},
|
|
187
|
+
"deploy": {
|
|
188
|
+
"description": "Deploy components to server",
|
|
189
|
+
"starting": "🚀 Starting deployment...",
|
|
190
|
+
"notAuthenticated": "❌ Not authenticated",
|
|
191
|
+
"pleaseLogin": "Please run 'zs login' first",
|
|
192
|
+
"usingEnvironment": "🌍 Using environment: {environment}",
|
|
193
|
+
"deployingToEnvironment": "🚀 Deploying to environment: {environment} (siteId: {siteId})",
|
|
194
|
+
"tempDirCreated": "✅ Created temporary directory",
|
|
195
|
+
"copiedComponent": "📦 Copied component: {name}",
|
|
196
|
+
"componentsCopied": "✅ Copied {count} components",
|
|
197
|
+
"copiedPackageJson": "📄 Copied package.json",
|
|
198
|
+
"noPackageJson": "ℹ️ No package.json found",
|
|
199
|
+
"copiedWebpackOverrides": "⚙️ Copied {file}",
|
|
200
|
+
"noWebpackOverrides": "ℹ️ No {file} found",
|
|
201
|
+
"copiedConfig": "📄 Copied {file}",
|
|
202
|
+
"zipCreated": "✅ Created zip file (size: {size} bytes)",
|
|
203
|
+
"uploading": "📤 Uploading components...",
|
|
204
|
+
"uploadComplete": "🎉 Upload complete",
|
|
205
|
+
"uploadNoResponse": "⚠️ Upload completed but no response received from server",
|
|
206
|
+
"cleanupComplete": "🗑️ Cleanup complete",
|
|
207
|
+
"cleanupFailed": "⚠️ Failed to clean up: {error}",
|
|
208
|
+
"error": "❌ Deployment error: {error}",
|
|
209
|
+
"authenticationRequired": "🔐 Authentication required. Please run 'zs login'",
|
|
210
|
+
"permissionDenied": "🚫 Permission denied. Check your access rights."
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"compile": {
|
|
214
|
+
"cssImportWarning": "⚠️ CSS Import Detected - In ZS SDK, CSS files are processed separately. Place styles.css in component folder (no import needed). Remove CSS import statements from your component files."
|
|
215
|
+
}
|
|
216
|
+
}
|