dodopayments-cli 3.1.0 → 3.2.3
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/.github/workflows/publish.yml +70 -4
- package/README.md +1 -0
- package/SECURITY.md +3 -2
- package/dist/index.js +76 -76
- package/fetch-cross-deps.ts +16 -0
- package/package.json +1 -1
|
@@ -5,12 +5,78 @@ on:
|
|
|
5
5
|
types: [published]
|
|
6
6
|
|
|
7
7
|
permissions:
|
|
8
|
-
contents:
|
|
8
|
+
contents: write
|
|
9
9
|
id-token: write
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
|
+
binaries:
|
|
13
|
+
name: Build and upload release binaries
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Bun
|
|
20
|
+
uses: oven-sh/setup-bun@v2
|
|
21
|
+
with:
|
|
22
|
+
bun-version: 'latest'
|
|
23
|
+
|
|
24
|
+
- name: Update package.json version from release tag
|
|
25
|
+
env:
|
|
26
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
27
|
+
run: |
|
|
28
|
+
TAG_STRIPPED="${TAG_NAME#v}"
|
|
29
|
+
node -e "
|
|
30
|
+
const fs = require('fs');
|
|
31
|
+
const pkg = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
32
|
+
pkg.version = '${TAG_STRIPPED}';
|
|
33
|
+
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
34
|
+
"
|
|
35
|
+
|
|
36
|
+
- name: Install dependencies
|
|
37
|
+
env:
|
|
38
|
+
NODE_ENV: development # For devDependencies to be present
|
|
39
|
+
run: bun install --frozen-lockfile
|
|
40
|
+
|
|
41
|
+
- name: Fetch cross-platform dependencies
|
|
42
|
+
run: bun run fetch-cross-deps.ts
|
|
43
|
+
|
|
44
|
+
- name: Build cross-platform binaries
|
|
45
|
+
env:
|
|
46
|
+
NODE_ENV: development # For devDependencies to be present
|
|
47
|
+
run: bun run build-native
|
|
48
|
+
|
|
49
|
+
- name: Generate SHA256SUMS
|
|
50
|
+
working-directory: dist
|
|
51
|
+
run: |
|
|
52
|
+
shasum -a 256 \
|
|
53
|
+
dodo-cli-darwin-arm64 \
|
|
54
|
+
dodo-cli-darwin-x64 \
|
|
55
|
+
dodo-cli-linux-arm64 \
|
|
56
|
+
dodo-cli-linux-x64 \
|
|
57
|
+
dodo-cli-windows-x64.exe \
|
|
58
|
+
> SHA256SUMS.txt
|
|
59
|
+
echo "--- SHA256SUMS.txt ---"
|
|
60
|
+
cat SHA256SUMS.txt
|
|
61
|
+
|
|
62
|
+
- name: Upload binaries to release
|
|
63
|
+
env:
|
|
64
|
+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
65
|
+
TAG_NAME: ${{ github.ref_name }}
|
|
66
|
+
run: |
|
|
67
|
+
gh release upload "${TAG_NAME}" \
|
|
68
|
+
dist/dodo-cli-darwin-arm64 \
|
|
69
|
+
dist/dodo-cli-darwin-x64 \
|
|
70
|
+
dist/dodo-cli-linux-arm64 \
|
|
71
|
+
dist/dodo-cli-linux-x64 \
|
|
72
|
+
dist/dodo-cli-windows-x64.exe \
|
|
73
|
+
dist/SHA256SUMS.txt \
|
|
74
|
+
--clobber
|
|
75
|
+
|
|
12
76
|
publish:
|
|
77
|
+
name: Publish to npm
|
|
13
78
|
runs-on: ubuntu-latest
|
|
79
|
+
needs: binaries
|
|
14
80
|
steps:
|
|
15
81
|
- name: Checkout
|
|
16
82
|
uses: actions/checkout@v4
|
|
@@ -33,7 +99,7 @@ jobs:
|
|
|
33
99
|
echo "TAG_NAME=${TAG_NAME}"
|
|
34
100
|
TAG_STRIPPED="${TAG_NAME#v}"
|
|
35
101
|
echo "Updating package.json version to: ${TAG_STRIPPED}"
|
|
36
|
-
|
|
102
|
+
|
|
37
103
|
# Update package.json version using node
|
|
38
104
|
node -e "
|
|
39
105
|
const fs = require('fs');
|
|
@@ -42,7 +108,7 @@ jobs:
|
|
|
42
108
|
fs.writeFileSync('./package.json', JSON.stringify(pkg, null, 2) + '\n');
|
|
43
109
|
console.log('Updated package.json version to:', pkg.version);
|
|
44
110
|
"
|
|
45
|
-
|
|
111
|
+
|
|
46
112
|
# Verify the update
|
|
47
113
|
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
48
114
|
echo "package.json version after update: ${PKG_VERSION}"
|
|
@@ -52,7 +118,7 @@ jobs:
|
|
|
52
118
|
fi
|
|
53
119
|
|
|
54
120
|
- name: Install dependencies
|
|
55
|
-
run: bun install
|
|
121
|
+
run: bun install --frozen-lockfile
|
|
56
122
|
|
|
57
123
|
- name: Build
|
|
58
124
|
run: bun run build
|
package/README.md
CHANGED
|
@@ -200,6 +200,7 @@ The assistant respects your active environment (Test / Live).
|
|
|
200
200
|
| `/customers list <page>` | List customers |
|
|
201
201
|
| `/customers create` | Create a new customer (TUI only) |
|
|
202
202
|
| `/customers update <id>` | Update an existing customer (TUI only) |
|
|
203
|
+
| `/customers portal <id>` | Create a temporary customer portal session |
|
|
203
204
|
|
|
204
205
|
### Discounts
|
|
205
206
|
|
package/SECURITY.md
CHANGED
|
@@ -64,11 +64,12 @@ When using Dodo Payments CLI, please follow these security best practices:
|
|
|
64
64
|
|
|
65
65
|
## Local Storage
|
|
66
66
|
|
|
67
|
-
The CLI stores the following data locally:
|
|
67
|
+
The CLI stores the following data locally within the `~/.dodopayments/` directory (created with strict `0o700` permissions):
|
|
68
68
|
|
|
69
69
|
| Data | Location | Purpose |
|
|
70
70
|
|------|----------|---------|
|
|
71
|
-
| API Key |
|
|
71
|
+
| API Key | `~/.dodopayments/config.json` | Encrypted authentication credentials (AES-256-GCM encrypted using a machine-derived key, stored with strict `0o600` permissions) |
|
|
72
|
+
| Active Mode / Session State | `~/.dodopayments/state.json` | Remembers the active environment mode (`test_mode` or `live_mode`) for the session |
|
|
72
73
|
|
|
73
74
|
## Vulnerability Disclosure Policy
|
|
74
75
|
|