teamx-projects 1.0.0 → 1.1.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/LICENSE +21 -0
- package/README.md +48 -7
- package/package.json +30 -5
- package/{index.js → projects-api-client.js} +8 -5
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 TeamX
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,17 +1,49 @@
|
|
|
1
|
-
#
|
|
1
|
+
# teamx-projects-api-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A small CLI client for the **TeamX Discord Services Projects API**.
|
|
4
|
+
|
|
5
|
+
- Node **18+** (uses built-in `fetch`)
|
|
6
|
+
- CommonJS (`.js` + `"type": "commonjs"`)
|
|
7
|
+
- Can **create** projects by zipping a local folder and POSTing to `/api/projects`
|
|
8
|
+
- Can **deploy**, check **status**, and fetch **artifacts**
|
|
4
9
|
|
|
5
10
|
## Install
|
|
6
11
|
|
|
7
12
|
```bash
|
|
8
|
-
npm i
|
|
13
|
+
npm i -g teamx-projects-api-client
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or use without installing:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx teamx-projects-api-client list
|
|
9
20
|
```
|
|
10
21
|
|
|
11
|
-
##
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
The CLI command is:
|
|
12
25
|
|
|
13
26
|
```bash
|
|
14
|
-
|
|
27
|
+
teamx-projects <command> [...args]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# list projects
|
|
34
|
+
BASE_URL=https://teamx-discord-services.fly.dev teamx-projects list
|
|
35
|
+
|
|
36
|
+
# create project from a local folder (zips -> base64 -> POST /api/projects)
|
|
37
|
+
teamx-projects create --name my-bot --path ./my-bot --lang ts
|
|
38
|
+
|
|
39
|
+
# status
|
|
40
|
+
teamx-projects status <projectId>
|
|
41
|
+
|
|
42
|
+
# artifacts
|
|
43
|
+
teamx-projects artifacts <projectId>
|
|
44
|
+
|
|
45
|
+
# deploy
|
|
46
|
+
teamx-projects deploy <projectId> --env production --by someone@teamx.com
|
|
15
47
|
```
|
|
16
48
|
|
|
17
49
|
## Commands
|
|
@@ -24,7 +56,16 @@ deploy <projectId> --env production|staging|dev --by someone@teamx.com
|
|
|
24
56
|
create --name <projectName> --path <folderPath> --lang ts|js
|
|
25
57
|
```
|
|
26
58
|
|
|
27
|
-
##
|
|
59
|
+
## Environment variables
|
|
28
60
|
|
|
29
61
|
- `BASE_URL` (optional) default: `https://teamx-discord-services.fly.dev`
|
|
30
|
-
- `TEAMX_API_KEY` (optional) Bearer token
|
|
62
|
+
- `TEAMX_API_KEY` (optional) sends `Authorization: Bearer <token>`
|
|
63
|
+
|
|
64
|
+
## Publishing (public)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm login
|
|
68
|
+
npm publish --access public
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
If you use a scoped package (like `@teamx/teamx-projects-api-client`), you still need `--access public` the first time.
|
package/package.json
CHANGED
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamx-projects",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
|
-
"description": "
|
|
6
|
-
"
|
|
5
|
+
"description": "CLI client for TeamX Discord Services Projects API (CommonJS, Node 18+).",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"teamx",
|
|
8
|
+
"projects",
|
|
9
|
+
"flyio",
|
|
10
|
+
"discord",
|
|
11
|
+
"cli",
|
|
12
|
+
"api"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://teamx-discord-services.fly.dev/",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": ""
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://teamx-discord-services.fly.dev/"
|
|
22
|
+
},
|
|
23
|
+
"main": "projects-api-client.js",
|
|
7
24
|
"bin": {
|
|
8
|
-
"teamx-projects": "
|
|
25
|
+
"teamx-projects": "projects-api-client.js"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"projects-api-client.js",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
9
34
|
},
|
|
10
35
|
"scripts": {
|
|
11
|
-
"
|
|
36
|
+
"start": "node projects-api-client.js"
|
|
12
37
|
},
|
|
13
38
|
"dependencies": {
|
|
14
39
|
"yazl": "^2.5.1"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
\
|
|
2
|
+
#!/usr/bin/env node
|
|
2
3
|
/**
|
|
3
|
-
* TeamX Projects
|
|
4
|
+
* TeamX Projects API Client (CommonJS, .js)
|
|
4
5
|
* Node 18+ (built-in fetch)
|
|
5
6
|
*
|
|
6
7
|
* Commands:
|
|
@@ -19,13 +20,12 @@ const fs = require("node:fs");
|
|
|
19
20
|
const path = require("node:path");
|
|
20
21
|
const yazl = require("yazl");
|
|
21
22
|
|
|
22
|
-
const
|
|
23
|
-
const BASE_URL = BASEFIX.replace(/\/$/, "");
|
|
23
|
+
const BASE_URL = (process.env.BASE_URL || "https://teamx-discord-services.fly.dev").replace(/\/$/, "");
|
|
24
24
|
const API_KEY = process.env.TEAMX_API_KEY || "";
|
|
25
25
|
|
|
26
26
|
function usage(exitCode = 1) {
|
|
27
27
|
console.log(`
|
|
28
|
-
TeamX Projects API Client
|
|
28
|
+
TeamX Projects API Client
|
|
29
29
|
|
|
30
30
|
Commands:
|
|
31
31
|
list
|
|
@@ -34,6 +34,9 @@ Commands:
|
|
|
34
34
|
deploy <projectId> [--env production|staging|dev] [--by email]
|
|
35
35
|
create --name <projectName> --path <folderPath> [--lang ts|js]
|
|
36
36
|
|
|
37
|
+
Env:
|
|
38
|
+
BASE_URL=${BASE_URL}
|
|
39
|
+
TEAMX_API_KEY=${API_KEY ? "(set)" : "(not set)"}
|
|
37
40
|
`);
|
|
38
41
|
process.exit(exitCode);
|
|
39
42
|
}
|