@proappstore/cli 2.6.4 → 2.6.6
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/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrate.d.ts +3 -0
- package/dist/integrate.d.ts.map +1 -0
- package/dist/integrate.js +125 -0
- package/dist/integrate.js.map +1 -0
- package/dist/integrations.json +131 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { whoamiCommand } from './whoami.js';
|
|
|
12
12
|
import { publishApp } from './publish.js';
|
|
13
13
|
import { secretCommand } from './secret.js';
|
|
14
14
|
import { proxyCommand } from './proxy.js';
|
|
15
|
+
import { integrateCommand } from './integrate.js';
|
|
15
16
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
16
17
|
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8'));
|
|
17
18
|
const program = new Command();
|
|
@@ -50,6 +51,7 @@ program.addCommand(checkCommand);
|
|
|
50
51
|
program.addCommand(domainCommand);
|
|
51
52
|
program.addCommand(secretCommand);
|
|
52
53
|
program.addCommand(proxyCommand);
|
|
54
|
+
program.addCommand(integrateCommand);
|
|
53
55
|
program.parseAsync().catch((err) => {
|
|
54
56
|
const msg = err instanceof Error ? err.message : String(err);
|
|
55
57
|
process.stderr.write(`pas: ${msg}\n`);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC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2BAA2B,CAAC;KACxD,MAAM,CAAC,uBAAuB,EAAE,+DAA+D,CAAC;KAChG,MAAM,CAAC,iBAAiB,EAAE,kDAAkD,CAAC;KAC7E,MAAM,CAAC,KAAK,EAAE,IAAsI,EAAE,EAAE;IACvJ,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAErC,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC1C,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrate.d.ts","sourceRoot":"","sources":["../src/integrate.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,eAAO,MAAM,gBAAgB,SAiGzB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { createInterface } from 'node:readline/promises';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { Command } from 'commander';
|
|
6
|
+
import { bearer, dieFromHttp, requireSession, resolveAppIdOrExit } from './secret.js';
|
|
7
|
+
// Load catalog at runtime from the file shipped alongside the compiled JS.
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const catalogPath = join(__dirname, 'integrations.json');
|
|
10
|
+
const integrations = JSON.parse(readFileSync(catalogPath, 'utf8'));
|
|
11
|
+
export const integrateCommand = new Command('integrate')
|
|
12
|
+
.description('Connect a third-party API using pre-configured proxy rules.')
|
|
13
|
+
.argument('[name]', `integration name (run "pas integrate list" to see all)`)
|
|
14
|
+
.option('--app <id>', 'app id (defaults to package.json name in cwd)')
|
|
15
|
+
.action(async (name, opts) => {
|
|
16
|
+
if (!name || name === 'list') {
|
|
17
|
+
process.stdout.write('\nAvailable integrations:\n\n');
|
|
18
|
+
for (const [id, int] of Object.entries(integrations)) {
|
|
19
|
+
process.stdout.write(` ${id.padEnd(20)} ${int.name}\n`);
|
|
20
|
+
}
|
|
21
|
+
process.stdout.write(`\nUsage: pas integrate <name> --app <id>\n`);
|
|
22
|
+
process.stdout.write(`Then follow the prompts to enter your API credentials.\n\n`);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const integration = integrations[name];
|
|
26
|
+
if (!integration) {
|
|
27
|
+
process.stderr.write(`pas: unknown integration "${name}".\n`);
|
|
28
|
+
process.stderr.write(`Available: ${Object.keys(integrations).join(', ')}\n`);
|
|
29
|
+
process.stderr.write(`Run: pas integrate list\n`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const cfg = await requireSession();
|
|
33
|
+
const appId = await resolveAppIdOrExit(opts.app);
|
|
34
|
+
const prefix = name.toUpperCase().replace(/-/g, '_');
|
|
35
|
+
process.stdout.write(`\n Integrating ${integration.name} for ${appId}\n`);
|
|
36
|
+
process.stdout.write(` Docs: ${integration.docs}\n\n`);
|
|
37
|
+
if (integration.note) {
|
|
38
|
+
process.stdout.write(` Note: ${integration.note}\n\n`);
|
|
39
|
+
}
|
|
40
|
+
// Collect secrets interactively
|
|
41
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
42
|
+
const secretValues = {};
|
|
43
|
+
try {
|
|
44
|
+
for (const secretSuffix of integration.secrets) {
|
|
45
|
+
const secretName = `${prefix}_${secretSuffix}`;
|
|
46
|
+
const value = await rl.question(` ${secretName}: `);
|
|
47
|
+
if (!value.trim()) {
|
|
48
|
+
process.stderr.write(`\n Aborted — ${secretName} is required.\n`);
|
|
49
|
+
process.stderr.write(` Get yours at: ${integration.docs}\n\n`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
secretValues[secretName] = value.trim();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
rl.close();
|
|
57
|
+
}
|
|
58
|
+
// Store secrets
|
|
59
|
+
for (const [secretName, value] of Object.entries(secretValues)) {
|
|
60
|
+
const res = await fetch(`${cfg.apiBase}/v1/apps/${appId}/secrets/${secretName}`, {
|
|
61
|
+
method: 'PUT',
|
|
62
|
+
headers: bearer(cfg),
|
|
63
|
+
body: JSON.stringify({ value }),
|
|
64
|
+
});
|
|
65
|
+
if (!res.ok)
|
|
66
|
+
await dieFromHttp(res, `store ${secretName}`);
|
|
67
|
+
process.stdout.write(` [+] Stored ${secretName}\n`);
|
|
68
|
+
}
|
|
69
|
+
// Create proxy allowlist rules
|
|
70
|
+
if (integration.patterns.length === 0) {
|
|
71
|
+
process.stdout.write(`\n Secrets stored. Add proxy rules for your specific API hosts:\n`);
|
|
72
|
+
process.stdout.write(` pas proxy allow 'https://<host>/' --inject ${mapAuth(integration)} --secret ${prefix}_${integration.secrets[0]} --app ${appId}\n\n`);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const secretNames = Object.keys(secretValues);
|
|
76
|
+
for (const pattern of integration.patterns) {
|
|
77
|
+
const body = {
|
|
78
|
+
pattern,
|
|
79
|
+
injectKind: mapInjectKind(integration),
|
|
80
|
+
injectName: mapInjectName(integration),
|
|
81
|
+
secretName: secretNames[0],
|
|
82
|
+
methods: integration.methods,
|
|
83
|
+
};
|
|
84
|
+
if (integration.auth === 'oauth2_cc' && secretNames[1]) {
|
|
85
|
+
body.secretName2 = secretNames[1];
|
|
86
|
+
body.tokenUrl = integration.tokenUrl;
|
|
87
|
+
}
|
|
88
|
+
const res = await fetch(`${cfg.apiBase}/v1/apps/${appId}/allowlist`, {
|
|
89
|
+
method: 'PUT',
|
|
90
|
+
headers: bearer(cfg),
|
|
91
|
+
body: JSON.stringify(body),
|
|
92
|
+
});
|
|
93
|
+
if (!res.ok)
|
|
94
|
+
await dieFromHttp(res, `add rule for ${pattern}`);
|
|
95
|
+
process.stdout.write(` [+] Proxy rule: ${pattern}\n`);
|
|
96
|
+
}
|
|
97
|
+
const exampleHost = new URL(integration.patterns[0]).host;
|
|
98
|
+
const examplePath = new URL(integration.patterns[0]).pathname;
|
|
99
|
+
process.stdout.write(`\n Done! Use in your app:\n`);
|
|
100
|
+
process.stdout.write(` const res = await app.proxy.fetch('${exampleHost}${examplePath}...')\n\n`);
|
|
101
|
+
});
|
|
102
|
+
function mapInjectKind(int) {
|
|
103
|
+
switch (int.auth) {
|
|
104
|
+
case 'bearer': return 'bearer';
|
|
105
|
+
case 'header': return 'header';
|
|
106
|
+
case 'query': return 'query';
|
|
107
|
+
case 'oauth2_cc': return 'oauth2_cc';
|
|
108
|
+
default: return 'bearer';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function mapInjectName(int) {
|
|
112
|
+
if (int.auth === 'header')
|
|
113
|
+
return int.headerName ?? 'X-API-Key';
|
|
114
|
+
if (int.auth === 'query')
|
|
115
|
+
return int.queryParam ?? 'key';
|
|
116
|
+
return '';
|
|
117
|
+
}
|
|
118
|
+
function mapAuth(int) {
|
|
119
|
+
if (int.auth === 'header')
|
|
120
|
+
return `header:${int.headerName ?? 'X-API-Key'}`;
|
|
121
|
+
if (int.auth === 'query')
|
|
122
|
+
return `query:${int.queryParam ?? 'key'}`;
|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AO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,OAAO,CAAC,GAAgB;IAC/B,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,UAAU,GAAG,CAAC,UAAU,IAAI,WAAW,EAAE,CAAC;IAC5E,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,SAAS,GAAG,CAAC,UAAU,IAAI,KAAK,EAAE,CAAC;IACpE,OAAO,GAAG,CAAC,IAAI,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openai": {
|
|
3
|
+
"name": "OpenAI (GPT, DALL-E, Whisper)",
|
|
4
|
+
"auth": "bearer",
|
|
5
|
+
"patterns": ["https://api.openai.com/"],
|
|
6
|
+
"methods": ["GET", "POST"],
|
|
7
|
+
"secrets": ["API_KEY"],
|
|
8
|
+
"docs": "https://platform.openai.com/api-keys"
|
|
9
|
+
},
|
|
10
|
+
"anthropic": {
|
|
11
|
+
"name": "Anthropic (Claude)",
|
|
12
|
+
"auth": "header",
|
|
13
|
+
"headerName": "x-api-key",
|
|
14
|
+
"patterns": ["https://api.anthropic.com/"],
|
|
15
|
+
"methods": ["GET", "POST"],
|
|
16
|
+
"secrets": ["API_KEY"],
|
|
17
|
+
"docs": "https://console.anthropic.com/settings/keys"
|
|
18
|
+
},
|
|
19
|
+
"google-ai": {
|
|
20
|
+
"name": "Google AI (Gemini)",
|
|
21
|
+
"auth": "query",
|
|
22
|
+
"queryParam": "key",
|
|
23
|
+
"patterns": ["https://generativelanguage.googleapis.com/"],
|
|
24
|
+
"methods": ["GET", "POST"],
|
|
25
|
+
"secrets": ["API_KEY"],
|
|
26
|
+
"docs": "https://aistudio.google.com/apikey"
|
|
27
|
+
},
|
|
28
|
+
"openrouter": {
|
|
29
|
+
"name": "OpenRouter (multi-model gateway)",
|
|
30
|
+
"auth": "bearer",
|
|
31
|
+
"patterns": ["https://openrouter.ai/api/"],
|
|
32
|
+
"methods": ["GET", "POST"],
|
|
33
|
+
"secrets": ["API_KEY"],
|
|
34
|
+
"docs": "https://openrouter.ai/keys"
|
|
35
|
+
},
|
|
36
|
+
"replicate": {
|
|
37
|
+
"name": "Replicate (open source models)",
|
|
38
|
+
"auth": "bearer",
|
|
39
|
+
"patterns": ["https://api.replicate.com/"],
|
|
40
|
+
"methods": ["GET", "POST"],
|
|
41
|
+
"secrets": ["API_KEY"],
|
|
42
|
+
"docs": "https://replicate.com/account/api-tokens"
|
|
43
|
+
},
|
|
44
|
+
"stability": {
|
|
45
|
+
"name": "Stability AI (image generation)",
|
|
46
|
+
"auth": "bearer",
|
|
47
|
+
"patterns": ["https://api.stability.ai/"],
|
|
48
|
+
"methods": ["GET", "POST"],
|
|
49
|
+
"secrets": ["API_KEY"],
|
|
50
|
+
"docs": "https://platform.stability.ai/account/keys"
|
|
51
|
+
},
|
|
52
|
+
"elevenlabs": {
|
|
53
|
+
"name": "ElevenLabs (text-to-speech)",
|
|
54
|
+
"auth": "header",
|
|
55
|
+
"headerName": "xi-api-key",
|
|
56
|
+
"patterns": ["https://api.elevenlabs.io/"],
|
|
57
|
+
"methods": ["GET", "POST"],
|
|
58
|
+
"secrets": ["API_KEY"],
|
|
59
|
+
"docs": "https://elevenlabs.io/app/settings/api-keys"
|
|
60
|
+
},
|
|
61
|
+
"amadeus": {
|
|
62
|
+
"name": "Amadeus (flights & hotels)",
|
|
63
|
+
"auth": "oauth2_cc",
|
|
64
|
+
"tokenUrl": "https://test.api.amadeus.com/v1/security/oauth2/token",
|
|
65
|
+
"patterns": ["https://test.api.amadeus.com/v2/"],
|
|
66
|
+
"methods": ["GET", "POST"],
|
|
67
|
+
"secrets": ["CLIENT_ID", "CLIENT_SECRET"],
|
|
68
|
+
"docs": "https://developers.amadeus.com/register"
|
|
69
|
+
},
|
|
70
|
+
"amadeus-prod": {
|
|
71
|
+
"name": "Amadeus Production (flights & hotels)",
|
|
72
|
+
"auth": "oauth2_cc",
|
|
73
|
+
"tokenUrl": "https://api.amadeus.com/v1/security/oauth2/token",
|
|
74
|
+
"patterns": ["https://api.amadeus.com/v2/"],
|
|
75
|
+
"methods": ["GET", "POST"],
|
|
76
|
+
"secrets": ["CLIENT_ID", "CLIENT_SECRET"],
|
|
77
|
+
"docs": "https://developers.amadeus.com/register"
|
|
78
|
+
},
|
|
79
|
+
"spotify": {
|
|
80
|
+
"name": "Spotify (music, playlists)",
|
|
81
|
+
"auth": "oauth2_cc",
|
|
82
|
+
"tokenUrl": "https://accounts.spotify.com/api/token",
|
|
83
|
+
"patterns": ["https://api.spotify.com/v1/"],
|
|
84
|
+
"methods": ["GET", "POST", "PUT", "DELETE"],
|
|
85
|
+
"secrets": ["CLIENT_ID", "CLIENT_SECRET"],
|
|
86
|
+
"docs": "https://developer.spotify.com/dashboard"
|
|
87
|
+
},
|
|
88
|
+
"github": {
|
|
89
|
+
"name": "GitHub API",
|
|
90
|
+
"auth": "bearer",
|
|
91
|
+
"patterns": ["https://api.github.com/"],
|
|
92
|
+
"methods": ["GET", "POST", "PUT", "PATCH", "DELETE"],
|
|
93
|
+
"secrets": ["TOKEN"],
|
|
94
|
+
"docs": "https://github.com/settings/tokens"
|
|
95
|
+
},
|
|
96
|
+
"openweathermap": {
|
|
97
|
+
"name": "OpenWeatherMap",
|
|
98
|
+
"auth": "query",
|
|
99
|
+
"queryParam": "appid",
|
|
100
|
+
"patterns": ["https://api.openweathermap.org/data/2.5/", "https://api.openweathermap.org/data/3.0/"],
|
|
101
|
+
"methods": ["GET"],
|
|
102
|
+
"secrets": ["API_KEY"],
|
|
103
|
+
"docs": "https://home.openweathermap.org/api_keys"
|
|
104
|
+
},
|
|
105
|
+
"rapidapi": {
|
|
106
|
+
"name": "RapidAPI (any API on the hub)",
|
|
107
|
+
"auth": "header",
|
|
108
|
+
"headerName": "X-RapidAPI-Key",
|
|
109
|
+
"patterns": [],
|
|
110
|
+
"methods": ["GET", "POST"],
|
|
111
|
+
"secrets": ["API_KEY"],
|
|
112
|
+
"docs": "https://rapidapi.com/developer/dashboard",
|
|
113
|
+
"note": "After integrating, add proxy rules for the specific RapidAPI host(s) you use."
|
|
114
|
+
},
|
|
115
|
+
"resend": {
|
|
116
|
+
"name": "Resend (email API)",
|
|
117
|
+
"auth": "bearer",
|
|
118
|
+
"patterns": ["https://api.resend.com/"],
|
|
119
|
+
"methods": ["GET", "POST"],
|
|
120
|
+
"secrets": ["API_KEY"],
|
|
121
|
+
"docs": "https://resend.com/api-keys"
|
|
122
|
+
},
|
|
123
|
+
"stripe": {
|
|
124
|
+
"name": "Stripe API",
|
|
125
|
+
"auth": "bearer",
|
|
126
|
+
"patterns": ["https://api.stripe.com/"],
|
|
127
|
+
"methods": ["GET", "POST", "DELETE"],
|
|
128
|
+
"secrets": ["SECRET_KEY"],
|
|
129
|
+
"docs": "https://dashboard.stripe.com/apikeys"
|
|
130
|
+
}
|
|
131
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proappstore/cli",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.6",
|
|
4
4
|
"description": "pas — CLI for publishing paid apps to proappstore.online",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"typescript": "^5.7.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "tsc",
|
|
32
|
+
"build": "tsc && cp src/integrations.json dist/integrations.json",
|
|
33
33
|
"typecheck": "tsc --noEmit"
|
|
34
34
|
}
|
|
35
35
|
}
|