@hailer/app-sdk 2.5.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +92 -1
- package/lib/tools/publish.cjs +24 -10
- package/lib/tools/publish.cjs.map +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ Provide one of:
|
|
|
73
73
|
- `--user-api-key <key>` (or `USER_API_KEY` / `HAILER_USER_API_KEY` env vars)
|
|
74
74
|
- `--email <email>` (will prompt for password)
|
|
75
75
|
|
|
76
|
-
The publish script will also load `~/.env` via `dotenv`, so a key set there works automatically — handy for AI agents.
|
|
76
|
+
The publish script will also load `~/.env` via `dotenv`, so a key set there works automatically — handy for AI agents. To use a different env file, pass `--env-file <path>`; values from that file take precedence over `~/.env`, and real environment variables take precedence over both.
|
|
77
77
|
|
|
78
78
|
### Flags
|
|
79
79
|
|
|
@@ -87,6 +87,7 @@ The publish script will also load `~/.env` via `dotenv`, so a key set there work
|
|
|
87
87
|
| `--market` | Also publish to the Hailer marketplace. |
|
|
88
88
|
| `--force` | Skip confirmation prompt. |
|
|
89
89
|
| `--host <url>` | Override target host URL. |
|
|
90
|
+
| `--env-file <path>` | Load env vars from a specific file, falling back to `~/.env`. |
|
|
90
91
|
| `--development` / `--staging` / `--production` / `--local` | Pick a default host. |
|
|
91
92
|
|
|
92
93
|
### Workflow
|
|
@@ -114,6 +115,49 @@ npm test # Run vitest test suite
|
|
|
114
115
|
npm run docs # Generate typedoc and open it
|
|
115
116
|
```
|
|
116
117
|
|
|
118
|
+
### Developing against a local app
|
|
119
|
+
|
|
120
|
+
When you're changing the SDK and want to test it inside a real app without publishing to npm, point that app at your local clone.
|
|
121
|
+
|
|
122
|
+
1. **Build the SDK at least once**, then keep it rebuilding while you work:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
cd hailer-app-sdk
|
|
126
|
+
npm install
|
|
127
|
+
npm run watch # rebuilds lib/ on every change (tsc + esbuild)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The package's entry points (`lib/app-sdk.js` and the `.d.ts` files) live in `lib/`, so the consuming app always imports the freshly built output.
|
|
131
|
+
|
|
132
|
+
2. **Link the local SDK into your app.** Two ways — pick one:
|
|
133
|
+
|
|
134
|
+
**Option A — `file:` dependency (recommended).** In the app's `package.json`, point the dependency at your clone, then install:
|
|
135
|
+
|
|
136
|
+
```jsonc
|
|
137
|
+
// app/package.json
|
|
138
|
+
"dependencies": {
|
|
139
|
+
"@hailer/app-sdk": "file:../hailer-app-sdk"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
cd my-app
|
|
145
|
+
npm install
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
npm symlinks the clone into `node_modules/@hailer/app-sdk`, so each `npm run watch` rebuild is picked up live. (This is the same mechanism the integration test in [`__tests__/publish.test.ts`](./__tests__/publish.test.ts) uses.)
|
|
149
|
+
|
|
150
|
+
**Option B — `npm link`.** Register a global link from the SDK, then consume it from the app:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
cd hailer-app-sdk && npm link
|
|
154
|
+
cd ../my-app && npm link @hailer/app-sdk
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
3. **Run your app's dev server** (`npm run dev`). Because the SDK is symlinked, edits → `watch` rebuild → the app's bundler reloads.
|
|
158
|
+
|
|
159
|
+
> When you're done, restore the real dependency in the app (`"@hailer/app-sdk": "^x.y.z"` + `npm install`, or `npm unlink`) so you don't accidentally ship the local path.
|
|
160
|
+
|
|
117
161
|
### Releasing
|
|
118
162
|
|
|
119
163
|
This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Pick the script that matches the kind of change:
|
|
@@ -128,3 +172,50 @@ This project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
128
172
|
| `npm run release:beta-major` | Pre-release major | `1.1.1` → `2.0.0-beta.0` |
|
|
129
173
|
|
|
130
174
|
Each script runs `npm version <type>`, creates a commit + tag (`chore: release vX.Y.Z`), and pushes both to the remote. Tagging every release means we can check out and patch any historical version cleanly.
|
|
175
|
+
|
|
176
|
+
#### Publishing to npm
|
|
177
|
+
|
|
178
|
+
`@hailer/app-sdk` is published to the **public npm registry**. There is no CI publish step — a maintainer runs it by hand. Releases are cut from `master`, so the `release:*` script tags the version there.
|
|
179
|
+
|
|
180
|
+
**One-time setup:** you must be a member of the `@hailer` npm org with publish rights. Authenticate once per machine:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npm login # opens npmjs.com to authenticate
|
|
184
|
+
npm whoami # confirm you're logged in
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Each release:**
|
|
188
|
+
|
|
189
|
+
1. **Land your change on `master`** (merge the branch) and pull the latest:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
git checkout master && git pull
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
2. **Update [`CHANGELOG.md`](./CHANGELOG.md)** — add a new version heading describing what changed if not done already, (see the format under [Publishing an app → Workflow](#workflow)). Commit it.
|
|
196
|
+
|
|
197
|
+
3. **Bump the version, tag, and push** with the matching release script (this updates `package.json`, commits `chore: release vX.Y.Z`, tags it, and pushes the commit + tag to GitLab):
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
npm run release:patch # or release:minor / release:major
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
4. **Publish to npm.** The `prepublishOnly` hook rebuilds automatically, and only the files in `package.json`'s `files` array (`lib/**`) are published:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npm publish
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
For a pre-release (any `release:beta-*` version), publish it under the `beta` dist-tag so it doesn't become the default `latest`:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
npm publish --tag beta
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
5. **Verify** the new version is live:
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
npm view @hailer/app-sdk version
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
> **Order matters:** always run the `release:*` script (step 3) *before* `npm publish` (step 4) — the script sets the version that `npm publish` then ships. If `npm publish` fails after the tag was already pushed, fix the issue and re-run `npm publish` for the same version (don't bump again).
|
package/lib/tools/publish.cjs
CHANGED
|
@@ -19,7 +19,7 @@ var releaseStdin = (onData) => {
|
|
|
19
19
|
stdin.setRawMode(false);
|
|
20
20
|
stdout.write("\n");
|
|
21
21
|
};
|
|
22
|
-
var prompt = (question, { hidden = true, ctrlcExits = true } = {}) => new Promise((
|
|
22
|
+
var prompt = (question, { hidden = true, ctrlcExits = true } = {}) => new Promise((resolve2, reject) => {
|
|
23
23
|
let input = "";
|
|
24
24
|
const onData = (data) => {
|
|
25
25
|
switch (data) {
|
|
@@ -29,7 +29,7 @@ var prompt = (question, { hidden = true, ctrlcExits = true } = {}) => new Promis
|
|
|
29
29
|
// \r
|
|
30
30
|
case "":
|
|
31
31
|
releaseStdin(onData);
|
|
32
|
-
|
|
32
|
+
resolve2(input);
|
|
33
33
|
break;
|
|
34
34
|
case "":
|
|
35
35
|
releaseStdin(onData);
|
|
@@ -65,7 +65,6 @@ var import_readline = require("readline");
|
|
|
65
65
|
var import_dotenv = require("dotenv");
|
|
66
66
|
var import_os = require("os");
|
|
67
67
|
var import_path = require("path");
|
|
68
|
-
(0, import_dotenv.config)({ path: (0, import_path.join)((0, import_os.homedir)(), ".env") });
|
|
69
68
|
function getArgValue(flag) {
|
|
70
69
|
const index = process.argv.indexOf(flag);
|
|
71
70
|
if (index === -1 || index + 1 >= process.argv.length) {
|
|
@@ -76,8 +75,15 @@ function getArgValue(flag) {
|
|
|
76
75
|
function hasFlag(flag) {
|
|
77
76
|
return process.argv.includes(flag);
|
|
78
77
|
}
|
|
79
|
-
var
|
|
80
|
-
|
|
78
|
+
var customEnvPath = getArgValue("--env-file");
|
|
79
|
+
if (customEnvPath && (0, import_fs.existsSync)((0, import_path.resolve)(customEnvPath))) {
|
|
80
|
+
(0, import_dotenv.config)({ path: (0, import_path.resolve)(customEnvPath) });
|
|
81
|
+
}
|
|
82
|
+
(0, import_dotenv.config)({ path: (0, import_path.join)((0, import_os.homedir)(), ".env") });
|
|
83
|
+
var explicitEmail = getArgValue("--email");
|
|
84
|
+
var explicitApiKey = getArgValue("--user-api-key");
|
|
85
|
+
var userApiKey = explicitEmail ? void 0 : explicitApiKey || process.env.USER_API_KEY || process.env.HAILER_USER_API_KEY;
|
|
86
|
+
var email = explicitEmail || (explicitApiKey ? void 0 : process.env.EMAIL);
|
|
81
87
|
if (!userApiKey && !email && !process.env.LOCAL) {
|
|
82
88
|
console.log("Please provide authentication: --email, --user-api-key, or EMAIL env var.");
|
|
83
89
|
console.log("");
|
|
@@ -100,6 +106,7 @@ if (!userApiKey && !email && !process.env.LOCAL) {
|
|
|
100
106
|
console.log(" --yes Skip confirmation prompt (going to be deprecated, use --force instead)");
|
|
101
107
|
console.log(" --force Skip confirmation prompt");
|
|
102
108
|
console.log(" --host <host> Specify the host URL");
|
|
109
|
+
console.log(" --env-file <path> Load env vars from this file, in addition to ~/.env");
|
|
103
110
|
process.exit(10);
|
|
104
111
|
}
|
|
105
112
|
(async () => {
|
|
@@ -206,7 +213,11 @@ if (!userApiKey && !email && !process.env.LOCAL) {
|
|
|
206
213
|
process.exit(10);
|
|
207
214
|
}
|
|
208
215
|
}
|
|
209
|
-
const info = await cli.request("v2.core.init", [["network", "networks", "apps"]])
|
|
216
|
+
const info = await cli.request("v2.core.init", [["network", "networks", "apps"]]).catch((error) => {
|
|
217
|
+
console.log("Failed to authenticate. Check that your API key is valid and has access to this app.");
|
|
218
|
+
console.log("Server response:", (0, import_util.inspect)(error, { depth: 10 }));
|
|
219
|
+
process.exit(8);
|
|
220
|
+
});
|
|
210
221
|
const getAppById = (manifestAppId) => {
|
|
211
222
|
for (const appMap of Object.values(info.apps)) {
|
|
212
223
|
for (const [id, app2] of Object.entries(appMap)) {
|
|
@@ -241,15 +252,15 @@ if (!userApiKey && !email && !process.env.LOCAL) {
|
|
|
241
252
|
if (hasFlag("--yes") || hasFlag("--force")) {
|
|
242
253
|
return true;
|
|
243
254
|
}
|
|
244
|
-
return new Promise((
|
|
255
|
+
return new Promise((resolve2) => {
|
|
245
256
|
const rl = (0, import_readline.createInterface)(process.stdin, process.stdout);
|
|
246
257
|
rl.setPrompt("Overwrite the app? (Y/n): ");
|
|
247
258
|
rl.prompt();
|
|
248
259
|
rl.on("line", (line) => {
|
|
249
260
|
if (line.trim().toLocaleLowerCase().startsWith("n")) {
|
|
250
|
-
|
|
261
|
+
resolve2(false);
|
|
251
262
|
} else {
|
|
252
|
-
|
|
263
|
+
resolve2(true);
|
|
253
264
|
}
|
|
254
265
|
rl.close();
|
|
255
266
|
});
|
|
@@ -321,5 +332,8 @@ if (!userApiKey && !email && !process.env.LOCAL) {
|
|
|
321
332
|
}
|
|
322
333
|
console.log("Published successfully!");
|
|
323
334
|
cli.disconnect();
|
|
324
|
-
})()
|
|
335
|
+
})().catch((error) => {
|
|
336
|
+
console.log("Publish failed:", (0, import_util.inspect)(error, { depth: 10 }));
|
|
337
|
+
process.exit(1);
|
|
338
|
+
});
|
|
325
339
|
//# sourceMappingURL=publish.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../tools/publish.ts", "../../tools/minimal-password-prompt.ts"],
|
|
4
|
-
"sourcesContent": ["import { Client } from '@hailer/cli';\nimport { existsSync, readFileSync, writeFileSync } from 'fs';\nimport { prompt } from './minimal-password-prompt';\nimport { inspect } from 'util';\nimport { createInterface } from 'readline';\nimport { config as loadEnv } from 'dotenv';\nimport { homedir } from 'os';\nimport { join } from 'path';\n\n// Load ~/.env as fallback (doesn't overwrite existing env vars)\nloadEnv({ path: join(homedir(), '.env') });\n\n/** Get the value following a named flag, e.g. getArgValue('--user-api-key') */\nfunction getArgValue(flag: string): string | undefined {\n const index = process.argv.indexOf(flag);\n if (index === -1 || index + 1 >= process.argv.length) {\n return undefined;\n }\n return process.argv[index + 1];\n}\n\nfunction hasFlag(flag: string): boolean {\n return process.argv.includes(flag);\n}\n\nconst userApiKey = getArgValue('--user-api-key') || process.env.USER_API_KEY || process.env.HAILER_USER_API_KEY;\n\nlet email = getArgValue('--email') || process.env.EMAIL;\n\nif (!userApiKey && !email && !process.env.LOCAL) {\n console.log('Please provide authentication: --email, --user-api-key, or EMAIL env var.');\n console.log('');\n console.log('Usage:');\n console.log(' npm run publish-production -- --email user@mail.com (will prompt for password)');\n console.log(' npm run publish-production -- --user-api-key <key>');\n console.log(' EMAIL=user@mail.com npm run publish-production (going to be deprecated, use --email instead)');\n console.log(' USER_API_KEY=<key> npm run publish-production (going to be deprecated, use --user-api-key instead)');\n console.log('');\n console.log('Create and publish new app:');\n console.log(' npm run publish-production -- --create --app-name \"My App\" --workspace <id> --user-api-key <key> --yes');\n console.log('');\n console.log('Options:');\n console.log(' --email <email> User email for authentication');\n console.log(' --user-api-key <key> API key for authentication');\n console.log(' --create Create a new app before publishing');\n console.log(' --app-name <name> App name (with --create)');\n console.log(' --workspace <id> Workspace ID (with --create)');\n console.log(' --market Also publish to Hailer marketplace');\n console.log(' --yes Skip confirmation prompt (going to be deprecated, use --force instead)');\n console.log(' --force Skip confirmation prompt');\n console.log(' --host <host> Specify the host URL');\n process.exit(10);\n}\n\n(async () => {\n\n let password: string | undefined;\n\n const market = hasFlag('--market') || process.env.MARKET === 'true';\n\n const appPackageFile = process.argv[2];\n\n /** Detect mode from any position in argv */\n const mode = ['--development', '--staging', '--production', '--local']\n .find(m => process.argv.includes(m));\n\n let host = getArgValue('--host') || process.env.HOST || 'https://localhost:9443';\n\n switch (mode) {\n case '--development':\n host = getArgValue('--host') || process.env.HOST || 'https://testapi.hailer.biz';\n break;\n case '--staging':\n host = getArgValue('--host') || process.env.HOST || 'https://api.hailer.biz';\n break;\n case '--production':\n host = getArgValue('--host') || process.env.HOST || 'https://api.hailer.com';\n break;\n }\n\n if (process.env.LOCAL || mode === '--local') {\n host = getArgValue('--host') || process.env.HOST || 'https://api.hailer.local.gd';\n if (!userApiKey) {\n console.log('Overriding credentials with local settings!');\n email = 'el@hailero.es';\n password = 'el@hailero.es';\n }\n }\n\n const isLocal = !!(process.env.LOCAL || mode === '--local');\n\n if (isLocal) {\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n }\n\n // Authenticate\n let cli: Client;\n\n if (userApiKey) {\n cli = await Client.create({ host, userApiKey, rejectUnauthorized: !isLocal }).catch(\n (error) => {\n console.log('Hailer Cli Error (API key auth):', error);\n process.exit(8);\n }\n );\n } else {\n if (!password) {\n password = await prompt(`enter password for ${ email }: `);\n }\n\n cli = await Client.create({ host, username: email, password, rejectUnauthorized: !isLocal }).catch(\n (error) => {\n if (error.msg === 'Invalid Login Data') {\n console.log('Invalid username or password when logging into Hailer.');\n } else {\n console.log('Hailer Cli Error:', error);\n }\n\n process.exit(8);\n }\n );\n }\n\n // Validate .tgz file\n if (!appPackageFile?.endsWith('.tgz')) {\n console.log('Failed getting .tgz file, found:', appPackageFile);\n process.exit(7);\n }\n\n const content = readFileSync(appPackageFile);\n let appId: string;\n\n // --create: Create a new app, then publish it\n if (hasFlag('--create')) {\n let appName = getArgValue('--app-name');\n let workspaceId = getArgValue('--workspace');\n\n if (!appName) {\n appName = await prompt('App name: ', { hidden: false });\n }\n\n if (!workspaceId) {\n workspaceId = await prompt('Workspace ID: ', { hidden: false });\n }\n\n if (!appName) {\n console.log('Error: --create requires --app-name <name>');\n process.exit(11);\n }\n if (!workspaceId) {\n console.log('Error: --create requires --workspace <id>');\n process.exit(12);\n }\n\n console.log('Creating new app...');\n console.log(' Name:', appName);\n console.log(' Workspace:', workspaceId);\n console.log(' Environment:', host);\n console.log();\n\n const appDoc = await cli.request('v3.app.create', [{\n name: appName,\n cid: workspaceId,\n }]).catch((error: any) => {\n console.log('Failed to create app:', error);\n process.exit(13);\n });\n\n appId = appDoc._id;\n console.log('App created with id:', appId);\n console.log();\n\n } else {\n // Normal publish: read appId from manifest\n const manifest = JSON.parse(readFileSync('./dist/manifest.json').toString());\n\n // Market code\n if (market) {\n if (!manifest.version) {\n manifest.version = '';\n manifest.versionDescription = '';\n\n const updatedManifestContent = JSON.stringify(manifest, null, 2);\n writeFileSync('./public/manifest.json', updatedManifestContent, 'utf-8');\n\n console.log('');\n console.log('Please set version in format (x.y.z) & versionDescription in file public/manifest.json! You have added MARKET=true or --market in your publish string.');\n console.log('');\n process.exit(10);\n }\n }\n\n const info = await cli.request('v2.core.init', [['network', 'networks', 'apps']]);\n\n const getAppById = (manifestAppId: string): { _id: string, name: string, cid: string } | null => {\n for (const appMap of Object.values(info.apps)) {\n for (const [id, app] of Object.entries(appMap as any)) {\n if (id === manifestAppId) {\n return app as any;\n }\n }\n }\n return null;\n };\n\n const app = getAppById(manifest.appId);\n\n if (!app) {\n const authInfo = userApiKey ? 'the provided API key' : email;\n console.log('The app was not found using:', authInfo);\n process.exit(2);\n }\n\n const personalApp = !app.cid;\n\n console.log('Publishing App');\n console.log(' Id:', manifest.appId);\n console.log(' Name:', app.name);\n if (personalApp) {\n console.log(' Workspace: any (personal app)');\n } else {\n console.log(' Workspace:', info.networks[app.cid]?.name, `(${ app.cid })`);\n }\n console.log(' Environment:', host);\n console.log();\n\n // Market code\n if (market) {\n console.log(' Note: Also publishing app to Hailer market');\n }\n\n /** Default to publish (yes) */\n const promptOverwriteQuestion = async () => {\n if (hasFlag('--yes') || hasFlag('--force')) {\n return true;\n }\n\n return new Promise<boolean>(resolve => {\n const rl = createInterface(process.stdin, process.stdout);\n\n rl.setPrompt('Overwrite the app? (Y/n): ');\n rl.prompt();\n rl.on('line', (line) => {\n if (line.trim().toLocaleLowerCase().startsWith('n')) {\n resolve(false);\n } else {\n resolve(true);\n }\n rl.close();\n });\n });\n };\n\n const shouldOverwrite = await promptOverwriteQuestion();\n\n if (!shouldOverwrite) {\n console.log('Aborted publishing app.');\n process.exit(0);\n }\n\n appId = manifest.appId;\n }\n\n // Upload\n const formData = new FormData();\n formData.append('file', new Blob([content]), appPackageFile);\n formData.append('appId', appId);\n // Market code\n formData.append('publishMarket', market.toString());\n\n const headers: Record<string, string> = {};\n\n if (cli.sessionKey) {\n headers.hlrkey = cli.sessionKey;\n } else if (cli.userApiKey) {\n headers.hlrkey = cli.userApiKey;\n }\n\n const resp = await fetch(`${host }/app/publish`, {\n method: 'POST',\n headers,\n body: formData,\n }).catch((error) => {\n console.log('Publish error uploading file:', error);\n process.exit(9);\n });\n\n if (!resp.ok) {\n console.log('Publish failed with status:', resp.status, resp.statusText);\n const body = await resp.text();\n console.log('Response:', body);\n process.exit(9);\n }\n\n const body = await resp.text();\n let response;\n let infoMarket = '';\n\n try {\n response = JSON.parse(body);\n } catch (error) {\n console.log('Failed to parse publish response:', error);\n console.log('Response body:', body);\n process.exit(6);\n }\n\n // Update manifest.json with appId (--create) and/or targetId (--market)\n const manifestPath = './public/manifest.json';\n if (existsSync(manifestPath)) {\n const publicManifest = JSON.parse(readFileSync(manifestPath).toString());\n let manifestUpdated = false;\n\n if (hasFlag('--create')) {\n publicManifest.appId = appId;\n manifestUpdated = true;\n console.log('Updated', manifestPath, 'with appId:', appId);\n }\n\n if (response.manifest?.targetId) {\n publicManifest.targetId = response.manifest.targetId;\n manifestUpdated = true;\n infoMarket = 'Note! Use targetId in public/manifest.json file when creating the product in market!';\n }\n\n if (manifestUpdated) {\n writeFileSync(manifestPath, JSON.stringify(publicManifest, null, 2), 'utf-8');\n }\n }\n\n console.log('App info:', inspect(response, { depth: 10, colors: true }));\n console.log();\n if (infoMarket) {\n console.log(infoMarket);\n }\n console.log('Published successfully!');\n\n cli.disconnect();\n})();\n", "// Re-written to TypeScript to fix typing issue, see: https://www.npmjs.com/package/minimal-password-prompt/v/1.1.0\n\nconst stdin = process.stdin;\nconst stdout = process.stdout;\n\nconst captureStdin = (onData: (data: string) => void) => {\n stdin.setEncoding('utf-8');\n stdin.setRawMode(true);\n stdin.on('data', onData);\n stdin.resume();\n};\n\nconst releaseStdin = (onData: (data: string) => void) => {\n stdin.pause();\n stdin.removeListener('data', onData);\n stdin.setRawMode(false);\n stdout.write('\\n');\n};\n\nexport const prompt = (question: string, { hidden = true, ctrlcExits = true } = {}): Promise<string> => (\n new Promise((resolve, reject) => {\n let input = '';\n const onData = (data: string) => {\n switch (data) {\n case '\\u000A': // \\n\n case '\\u000D': // \\r\n case '\\u0004': // Ctrl+D\n releaseStdin(onData);\n resolve(input);\n break;\n case '\\u0003': // Ctrl+C\n releaseStdin(onData);\n if (ctrlcExits) { // exit or raise error\n process.exit();\n } else {\n reject(new Error('Ctrl+C'));\n }\n break;\n case '\\u0008': // Backspace\n case '\\u007F': // Delete\n input = input.slice(0, -1);\n if (!hidden) {\n stdout.write('\\b \\b');\n }\n break;\n default: // any other\n input += data;\n if (!hidden) {\n stdout.write(data);\n }\n };\n };\n captureStdin(onData);\n stdout.write(question);\n })\n);\n"],
|
|
5
|
-
"mappings": ";;;AAAA,iBAAuB;AACvB,gBAAwD;;;ACCxD,IAAM,QAAQ,QAAQ;AACtB,IAAM,SAAS,QAAQ;AAEvB,IAAM,eAAe,CAAC,WAAmC;AACrD,QAAM,YAAY,OAAO;AACzB,QAAM,WAAW,IAAI;AACrB,QAAM,GAAG,QAAQ,MAAM;AACvB,QAAM,OAAO;AACjB;AAEA,IAAM,eAAe,CAAC,WAAmC;AACrD,QAAM,MAAM;AACZ,QAAM,eAAe,QAAQ,MAAM;AACnC,QAAM,WAAW,KAAK;AACtB,SAAO,MAAM,IAAI;AACrB;AAEO,IAAM,SAAS,CAAC,UAAkB,EAAE,SAAS,MAAM,aAAa,KAAK,IAAI,CAAC,MAC7E,IAAI,QAAQ,
|
|
6
|
-
"names": ["loadEnv", "app", "body"]
|
|
4
|
+
"sourcesContent": ["import { Client } from '@hailer/cli';\nimport { existsSync, readFileSync, writeFileSync } from 'fs';\nimport { prompt } from './minimal-password-prompt';\nimport { inspect } from 'util';\nimport { createInterface } from 'readline';\nimport { config as loadEnv } from 'dotenv';\nimport { homedir } from 'os';\nimport { join, resolve } from 'path';\n\n\n/** Get the value following a named flag, e.g. getArgValue('--user-api-key') */\nfunction getArgValue(flag: string): string | undefined {\n const index = process.argv.indexOf(flag);\n if (index === -1 || index + 1 >= process.argv.length) {\n return undefined;\n }\n return process.argv[index + 1];\n}\n\nfunction hasFlag(flag: string): boolean {\n return process.argv.includes(flag);\n}\n\n\n// Load env files dotenv never overwrites variables already set in the real environment and loading an earlier file means its values persist\nconst customEnvPath = getArgValue('--env-file');\nif (customEnvPath && existsSync(resolve(customEnvPath))) {\n loadEnv({ path: resolve(customEnvPath) });\n}\nloadEnv({ path: join(homedir(), '.env') });\n\nconst explicitEmail = getArgValue('--email');\nconst explicitApiKey = getArgValue('--user-api-key');\n\n// An explicit auth flag wins. Only fall back to env vars when neither flag is given\nconst userApiKey = explicitEmail\n ? undefined\n : (explicitApiKey || process.env.USER_API_KEY || process.env.HAILER_USER_API_KEY);\n\nlet email = explicitEmail || (explicitApiKey ? undefined : process.env.EMAIL);\n\nif (!userApiKey && !email && !process.env.LOCAL) {\n console.log('Please provide authentication: --email, --user-api-key, or EMAIL env var.');\n console.log('');\n console.log('Usage:');\n console.log(' npm run publish-production -- --email user@mail.com (will prompt for password)');\n console.log(' npm run publish-production -- --user-api-key <key>');\n console.log(' EMAIL=user@mail.com npm run publish-production (going to be deprecated, use --email instead)');\n console.log(' USER_API_KEY=<key> npm run publish-production (going to be deprecated, use --user-api-key instead)');\n console.log('');\n console.log('Create and publish new app:');\n console.log(' npm run publish-production -- --create --app-name \"My App\" --workspace <id> --user-api-key <key> --yes');\n console.log('');\n console.log('Options:');\n console.log(' --email <email> User email for authentication');\n console.log(' --user-api-key <key> API key for authentication');\n console.log(' --create Create a new app before publishing');\n console.log(' --app-name <name> App name (with --create)');\n console.log(' --workspace <id> Workspace ID (with --create)');\n console.log(' --market Also publish to Hailer marketplace');\n console.log(' --yes Skip confirmation prompt (going to be deprecated, use --force instead)');\n console.log(' --force Skip confirmation prompt');\n console.log(' --host <host> Specify the host URL');\n console.log(' --env-file <path> Load env vars from this file, in addition to ~/.env');\n process.exit(10);\n}\n\n(async () => {\n\n let password: string | undefined;\n\n const market = hasFlag('--market') || process.env.MARKET === 'true';\n\n const appPackageFile = process.argv[2];\n\n /** Detect mode from any position in argv */\n const mode = ['--development', '--staging', '--production', '--local']\n .find(m => process.argv.includes(m));\n\n let host = getArgValue('--host') || process.env.HOST || 'https://localhost:9443';\n\n switch (mode) {\n case '--development':\n host = getArgValue('--host') || process.env.HOST || 'https://testapi.hailer.biz';\n break;\n case '--staging':\n host = getArgValue('--host') || process.env.HOST || 'https://api.hailer.biz';\n break;\n case '--production':\n host = getArgValue('--host') || process.env.HOST || 'https://api.hailer.com';\n break;\n }\n\n if (process.env.LOCAL || mode === '--local') {\n host = getArgValue('--host') || process.env.HOST || 'https://api.hailer.local.gd';\n if (!userApiKey) {\n console.log('Overriding credentials with local settings!');\n email = 'el@hailero.es';\n password = 'el@hailero.es';\n }\n }\n\n const isLocal = !!(process.env.LOCAL || mode === '--local');\n\n if (isLocal) {\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n }\n\n // Authenticate\n let cli: Client;\n\n if (userApiKey) {\n cli = await Client.create({ host, userApiKey, rejectUnauthorized: !isLocal }).catch(\n (error) => {\n console.log('Hailer Cli Error (API key auth):', error);\n process.exit(8);\n }\n );\n } else {\n if (!password) {\n password = await prompt(`enter password for ${ email }: `);\n }\n\n cli = await Client.create({ host, username: email, password, rejectUnauthorized: !isLocal }).catch(\n (error) => {\n if (error.msg === 'Invalid Login Data') {\n console.log('Invalid username or password when logging into Hailer.');\n } else {\n console.log('Hailer Cli Error:', error);\n }\n\n process.exit(8);\n }\n );\n }\n\n // Validate .tgz file\n if (!appPackageFile?.endsWith('.tgz')) {\n console.log('Failed getting .tgz file, found:', appPackageFile);\n process.exit(7);\n }\n\n const content = readFileSync(appPackageFile);\n let appId: string;\n\n // --create: Create a new app, then publish it\n if (hasFlag('--create')) {\n let appName = getArgValue('--app-name');\n let workspaceId = getArgValue('--workspace');\n\n if (!appName) {\n appName = await prompt('App name: ', { hidden: false });\n }\n\n if (!workspaceId) {\n workspaceId = await prompt('Workspace ID: ', { hidden: false });\n }\n\n if (!appName) {\n console.log('Error: --create requires --app-name <name>');\n process.exit(11);\n }\n if (!workspaceId) {\n console.log('Error: --create requires --workspace <id>');\n process.exit(12);\n }\n\n console.log('Creating new app...');\n console.log(' Name:', appName);\n console.log(' Workspace:', workspaceId);\n console.log(' Environment:', host);\n console.log();\n\n const appDoc = await cli.request('v3.app.create', [{\n name: appName,\n cid: workspaceId,\n }]).catch((error: any) => {\n console.log('Failed to create app:', error);\n process.exit(13);\n });\n\n appId = appDoc._id;\n console.log('App created with id:', appId);\n console.log();\n\n } else {\n // Normal publish: read appId from manifest\n const manifest = JSON.parse(readFileSync('./dist/manifest.json').toString());\n\n // Market code\n if (market) {\n if (!manifest.version) {\n manifest.version = '';\n manifest.versionDescription = '';\n\n const updatedManifestContent = JSON.stringify(manifest, null, 2);\n writeFileSync('./public/manifest.json', updatedManifestContent, 'utf-8');\n\n console.log('');\n console.log('Please set version in format (x.y.z) & versionDescription in file public/manifest.json! You have added MARKET=true or --market in your publish string.');\n console.log('');\n process.exit(10);\n }\n }\n\n const info = await cli.request('v2.core.init', [['network', 'networks', 'apps']]).catch((error: any) => {\n console.log('Failed to authenticate. Check that your API key is valid and has access to this app.');\n console.log('Server response:', inspect(error, { depth: 10 }));\n process.exit(8);\n });\n\n const getAppById = (manifestAppId: string): { _id: string, name: string, cid: string } | null => {\n for (const appMap of Object.values(info.apps)) {\n for (const [id, app] of Object.entries(appMap as any)) {\n if (id === manifestAppId) {\n return app as any;\n }\n }\n }\n return null;\n };\n\n const app = getAppById(manifest.appId);\n\n if (!app) {\n const authInfo = userApiKey ? 'the provided API key' : email;\n console.log('The app was not found using:', authInfo);\n process.exit(2);\n }\n\n const personalApp = !app.cid;\n\n console.log('Publishing App');\n console.log(' Id:', manifest.appId);\n console.log(' Name:', app.name);\n if (personalApp) {\n console.log(' Workspace: any (personal app)');\n } else {\n console.log(' Workspace:', info.networks[app.cid]?.name, `(${ app.cid })`);\n }\n console.log(' Environment:', host);\n console.log();\n\n // Market code\n if (market) {\n console.log(' Note: Also publishing app to Hailer market');\n }\n\n /** Default to publish (yes) */\n const promptOverwriteQuestion = async () => {\n if (hasFlag('--yes') || hasFlag('--force')) {\n return true;\n }\n\n return new Promise<boolean>(resolve => {\n const rl = createInterface(process.stdin, process.stdout);\n\n rl.setPrompt('Overwrite the app? (Y/n): ');\n rl.prompt();\n rl.on('line', (line) => {\n if (line.trim().toLocaleLowerCase().startsWith('n')) {\n resolve(false);\n } else {\n resolve(true);\n }\n rl.close();\n });\n });\n };\n\n const shouldOverwrite = await promptOverwriteQuestion();\n\n if (!shouldOverwrite) {\n console.log('Aborted publishing app.');\n process.exit(0);\n }\n\n appId = manifest.appId;\n }\n\n // Upload\n const formData = new FormData();\n formData.append('file', new Blob([content]), appPackageFile);\n formData.append('appId', appId);\n // Market code\n formData.append('publishMarket', market.toString());\n\n const headers: Record<string, string> = {};\n\n if (cli.sessionKey) {\n headers.hlrkey = cli.sessionKey;\n } else if (cli.userApiKey) {\n headers.hlrkey = cli.userApiKey;\n }\n\n const resp = await fetch(`${host }/app/publish`, {\n method: 'POST',\n headers,\n body: formData,\n }).catch((error) => {\n console.log('Publish error uploading file:', error);\n process.exit(9);\n });\n\n if (!resp.ok) {\n console.log('Publish failed with status:', resp.status, resp.statusText);\n const body = await resp.text();\n console.log('Response:', body);\n process.exit(9);\n }\n\n const body = await resp.text();\n let response;\n let infoMarket = '';\n\n try {\n response = JSON.parse(body);\n } catch (error) {\n console.log('Failed to parse publish response:', error);\n console.log('Response body:', body);\n process.exit(6);\n }\n\n // Update manifest.json with appId (--create) and/or targetId (--market)\n const manifestPath = './public/manifest.json';\n if (existsSync(manifestPath)) {\n const publicManifest = JSON.parse(readFileSync(manifestPath).toString());\n let manifestUpdated = false;\n\n if (hasFlag('--create')) {\n publicManifest.appId = appId;\n manifestUpdated = true;\n console.log('Updated', manifestPath, 'with appId:', appId);\n }\n\n if (response.manifest?.targetId) {\n publicManifest.targetId = response.manifest.targetId;\n manifestUpdated = true;\n infoMarket = 'Note! Use targetId in public/manifest.json file when creating the product in market!';\n }\n\n if (manifestUpdated) {\n writeFileSync(manifestPath, JSON.stringify(publicManifest, null, 2), 'utf-8');\n }\n }\n\n console.log('App info:', inspect(response, { depth: 10, colors: true }));\n console.log();\n if (infoMarket) {\n console.log(infoMarket);\n }\n console.log('Published successfully!');\n\n cli.disconnect();\n})().catch((error) => {\n console.log('Publish failed:', inspect(error, { depth: 10 }));\n process.exit(1);\n});\n", "// Re-written to TypeScript to fix typing issue, see: https://www.npmjs.com/package/minimal-password-prompt/v/1.1.0\n\nconst stdin = process.stdin;\nconst stdout = process.stdout;\n\nconst captureStdin = (onData: (data: string) => void) => {\n stdin.setEncoding('utf-8');\n stdin.setRawMode(true);\n stdin.on('data', onData);\n stdin.resume();\n};\n\nconst releaseStdin = (onData: (data: string) => void) => {\n stdin.pause();\n stdin.removeListener('data', onData);\n stdin.setRawMode(false);\n stdout.write('\\n');\n};\n\nexport const prompt = (question: string, { hidden = true, ctrlcExits = true } = {}): Promise<string> => (\n new Promise((resolve, reject) => {\n let input = '';\n const onData = (data: string) => {\n switch (data) {\n case '\\u000A': // \\n\n case '\\u000D': // \\r\n case '\\u0004': // Ctrl+D\n releaseStdin(onData);\n resolve(input);\n break;\n case '\\u0003': // Ctrl+C\n releaseStdin(onData);\n if (ctrlcExits) { // exit or raise error\n process.exit();\n } else {\n reject(new Error('Ctrl+C'));\n }\n break;\n case '\\u0008': // Backspace\n case '\\u007F': // Delete\n input = input.slice(0, -1);\n if (!hidden) {\n stdout.write('\\b \\b');\n }\n break;\n default: // any other\n input += data;\n if (!hidden)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