requestshield 0.1.4 → 0.1.5
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 +211 -13
- package/package.json +16 -10
- package/skills/requestshield/SKILL.md +307 -307
- package/skills/requestshield/assets/AGENTS.codex.md +62 -62
- package/skills/requestshield/references/backend-java-core.md +128 -128
- package/skills/requestshield/references/backend-spring-boot.md +145 -145
- package/skills/requestshield/references/browser-manual.md +210 -210
- package/skills/requestshield/references/browser-seamless.md +164 -164
- package/skills/requestshield/references/cli.md +183 -182
- package/skills/requestshield/references/integration-planning.md +389 -389
- package/skills/requestshield/references/troubleshooting.md +118 -118
- package/src/agent-detector.mjs +102 -74
- package/src/api-client.mjs +100 -5
- package/src/args.mjs +182 -79
- package/src/cli.mjs +255 -51
- package/src/commands/agent-setup.mjs +185 -185
- package/src/commands/apps-get.mjs +64 -0
- package/src/commands/apps-list.mjs +90 -0
- package/src/commands/billing-get.mjs +110 -0
- package/src/commands/challenge-volume.mjs +81 -0
- package/src/commands/contract.mjs +106 -0
- package/src/config.mjs +8 -0
- package/src/main.mjs +24 -24
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Customer-facing CLI for IntelliFend RequestShield. It allows customers to sign
|
|
|
4
4
|
in, rotate application credentials, install the RequestShield Skill for Codex
|
|
5
5
|
or Claude, and update an npm-installed CLI.
|
|
6
6
|
|
|
7
|
-
Current package version: `0.1.
|
|
7
|
+
Current package version: `0.1.5`.
|
|
8
8
|
|
|
9
9
|
## Requirements
|
|
10
10
|
|
|
@@ -20,6 +20,11 @@ The management API defaults to `https://api.intellifend.ai`. Set
|
|
|
20
20
|
```console
|
|
21
21
|
requestshield signin
|
|
22
22
|
requestshield keys create [--yes]
|
|
23
|
+
requestshield contract
|
|
24
|
+
requestshield apps list [--json]
|
|
25
|
+
requestshield apps get <app-key>
|
|
26
|
+
requestshield challenge volume <app-key> [--from <time>] [--to <time>] [--granularity <value>]
|
|
27
|
+
requestshield get billing <app-key>
|
|
23
28
|
requestshield agent setup [--force]
|
|
24
29
|
requestshield agent setup --codex [--force]
|
|
25
30
|
requestshield agent setup --claude [--force]
|
|
@@ -57,6 +62,75 @@ the previous credentials and create a new `appKey` and `apiSecret`.
|
|
|
57
62
|
|
|
58
63
|
Store the Secret Key in a backend secret manager immediately after creation.
|
|
59
64
|
|
|
65
|
+
### Get the integration contract
|
|
66
|
+
|
|
67
|
+
```console
|
|
68
|
+
requestshield contract
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Returns the current authoritative integration contract as JSON, including any
|
|
72
|
+
additional SDK-version or CSP fields supplied by the API. The command requires a
|
|
73
|
+
saved sign-in session and validates the core browser, backend, and release fields
|
|
74
|
+
before printing the response.
|
|
75
|
+
|
|
76
|
+
### List applications
|
|
77
|
+
|
|
78
|
+
```console
|
|
79
|
+
requestshield apps list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Lists the applications the signed-in user is allowed to access:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
APP KEY NAME STATUS
|
|
86
|
+
app_123 Production Website pending
|
|
87
|
+
app_456 Staging Website active
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Use `--json` to print the stable `{ "data": [...], "nextCursor": null }`
|
|
91
|
+
response shape. The CLI allowlists `appKey`, `name`, `status`, `createdAt`, and
|
|
92
|
+
`updatedAt`; it never prints an API Secret returned accidentally by the service.
|
|
93
|
+
|
|
94
|
+
### Get an application
|
|
95
|
+
|
|
96
|
+
```console
|
|
97
|
+
requestshield apps get app_123
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Returns `app_key`, `name`, and the application's current status as JSON.
|
|
101
|
+
Valid statuses are:
|
|
102
|
+
|
|
103
|
+
- `ready` — the application key was just created and no traffic has been received.
|
|
104
|
+
- `active` — the application is receiving traffic.
|
|
105
|
+
- `deactivated` — the application has been deactivated.
|
|
106
|
+
|
|
107
|
+
The requested App Key must exactly match the key in the API response.
|
|
108
|
+
|
|
109
|
+
### Get challenge volume
|
|
110
|
+
|
|
111
|
+
```console
|
|
112
|
+
requestshield challenge volume app_123 \
|
|
113
|
+
--from 2026-08-01T00:00:00Z \
|
|
114
|
+
--to 2026-08-27T23:59:59Z \
|
|
115
|
+
--granularity day
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Returns challenge/request volume as JSON. Times must be ISO-8601 timestamps, and
|
|
119
|
+
`--from` cannot be later than `--to`. Granularity values such as `hour` and `day`
|
|
120
|
+
are passed to the API, which owns the supported set.
|
|
121
|
+
|
|
122
|
+
Challenge volume proves that traffic reached the platform; it does not prove
|
|
123
|
+
that the protected backend rejects requests without a valid token.
|
|
124
|
+
|
|
125
|
+
### Get billing information
|
|
126
|
+
|
|
127
|
+
```console
|
|
128
|
+
requestshield get billing app_123
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Returns the selected application's current plan, billing cycle, charges, quota,
|
|
132
|
+
and usage as JSON. The command is read-only and requires a saved sign-in session.
|
|
133
|
+
|
|
60
134
|
### Install the Agent Skill
|
|
61
135
|
|
|
62
136
|
Let the CLI detect the installed coding agent:
|
|
@@ -95,8 +169,9 @@ Restart the selected agent or start a new task after installation.
|
|
|
95
169
|
requestshield update check
|
|
96
170
|
```
|
|
97
171
|
|
|
98
|
-
Checks the npm registry for the latest
|
|
99
|
-
version exists, the CLI displays the current and latest versions
|
|
172
|
+
Checks the npm registry for the latest `@intellifend/requestshield` version.
|
|
173
|
+
When a newer version exists, the CLI displays the current and latest versions
|
|
174
|
+
and asks:
|
|
100
175
|
|
|
101
176
|
```text
|
|
102
177
|
Update to RequestShield <version>? (y/N):
|
|
@@ -105,7 +180,7 @@ Update to RequestShield <version>? (y/N):
|
|
|
105
180
|
Entering `y` runs the equivalent of:
|
|
106
181
|
|
|
107
182
|
```console
|
|
108
|
-
npm install --global requestshield@<latest-version>
|
|
183
|
+
npm install --global @intellifend/requestshield@<latest-version>
|
|
109
184
|
```
|
|
110
185
|
|
|
111
186
|
This command requires an interactive terminal, Node.js, and npm. It updates a
|
|
@@ -116,7 +191,7 @@ global npm installation; it does not replace a standalone Windows executable.
|
|
|
116
191
|
Install globally:
|
|
117
192
|
|
|
118
193
|
```console
|
|
119
|
-
npm install --global requestshield
|
|
194
|
+
npm install --global @intellifend/requestshield
|
|
120
195
|
requestshield --help
|
|
121
196
|
requestshield --version
|
|
122
197
|
```
|
|
@@ -124,14 +199,14 @@ requestshield --version
|
|
|
124
199
|
Run a specific version without installing globally:
|
|
125
200
|
|
|
126
201
|
```console
|
|
127
|
-
npx --yes requestshield@0.1.
|
|
128
|
-
npx --yes requestshield@0.1.
|
|
202
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield --help
|
|
203
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield signin
|
|
129
204
|
```
|
|
130
205
|
|
|
131
206
|
To invoke the update command through npx, include the package name:
|
|
132
207
|
|
|
133
208
|
```console
|
|
134
|
-
npx --yes requestshield@0.1.
|
|
209
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield update check
|
|
135
210
|
```
|
|
136
211
|
|
|
137
212
|
Do not run `npx update check`; npm interprets `update` as the name of a different
|
|
@@ -160,7 +235,7 @@ The manual update test mocks the registry and install operation, so it does not
|
|
|
160
235
|
publish a package or change the installed version:
|
|
161
236
|
|
|
162
237
|
```powershell
|
|
163
|
-
$env:REQUESTSHIELD_MOCK_LATEST_VERSION = "0.1.
|
|
238
|
+
$env:REQUESTSHIELD_MOCK_LATEST_VERSION = "0.1.6"
|
|
164
239
|
npm run test:update-check:manual
|
|
165
240
|
Remove-Item Env:REQUESTSHIELD_MOCK_LATEST_VERSION
|
|
166
241
|
```
|
|
@@ -195,7 +270,7 @@ published version, merge the latest team changes, then choose a new version in
|
|
|
195
270
|
`package.json` before publishing.
|
|
196
271
|
|
|
197
272
|
```console
|
|
198
|
-
npm view requestshield version
|
|
273
|
+
npm view @intellifend/requestshield version
|
|
199
274
|
npm run lint
|
|
200
275
|
npm run typecheck
|
|
201
276
|
npm test
|
|
@@ -206,9 +281,9 @@ npm publish --access public
|
|
|
206
281
|
Verify the published package:
|
|
207
282
|
|
|
208
283
|
```console
|
|
209
|
-
npm view requestshield version
|
|
210
|
-
npm dist-tag ls requestshield
|
|
211
|
-
npx --yes requestshield@0.1.
|
|
284
|
+
npm view @intellifend/requestshield version
|
|
285
|
+
npm dist-tag ls @intellifend/requestshield
|
|
286
|
+
npx --yes --package=@intellifend/requestshield@0.1.5 requestshield --version
|
|
212
287
|
```
|
|
213
288
|
|
|
214
289
|
## Management API contract
|
|
@@ -239,6 +314,129 @@ metadata.
|
|
|
239
314
|
`POST /v1/cli/keys/rotate` with Bearer authentication and an empty JSON body.
|
|
240
315
|
The response contains `appKey` and the one-time `apiSecret`.
|
|
241
316
|
|
|
317
|
+
### List applications
|
|
318
|
+
|
|
319
|
+
`GET /v1/applications` with Bearer authentication and no request body. The API must
|
|
320
|
+
scope results to the authenticated user.
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"data": [
|
|
325
|
+
{
|
|
326
|
+
"appKey": "pk_AAAAAAAAAAAAAAAAAAAAAAAA",
|
|
327
|
+
"name": "Checkout",
|
|
328
|
+
"status": "pending",
|
|
329
|
+
"createdAt": "2026-09-11T00:00:00.000Z",
|
|
330
|
+
"updatedAt": "2026-09-11T00:00:00.000Z"
|
|
331
|
+
}
|
|
332
|
+
],
|
|
333
|
+
"nextCursor": null
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Every application requires `appKey`, `name`, `status`, `createdAt`, and `updatedAt`.
|
|
338
|
+
`nextCursor` must be a non-empty string or `null`. An account with no applications
|
|
339
|
+
returns `200` with an empty `data` array. A missing or rejected session returns
|
|
340
|
+
`401`. The response must never contain an API Secret.
|
|
341
|
+
|
|
342
|
+
### Get an application
|
|
343
|
+
|
|
344
|
+
`GET /v1/applications/{appKey}` with Bearer authentication and no request body.
|
|
345
|
+
The path segment is URL-encoded by the CLI.
|
|
346
|
+
|
|
347
|
+
```json
|
|
348
|
+
{
|
|
349
|
+
"ok": true,
|
|
350
|
+
"data": {
|
|
351
|
+
"app_key": "app_123",
|
|
352
|
+
"name": "Website",
|
|
353
|
+
"status": "active"
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
`status` must be `ready`, `active`, or `deactivated`. The response App Key must
|
|
359
|
+
match the requested key. The CLI rebuilds the output from these three fields so
|
|
360
|
+
unexpected response fields cannot be printed.
|
|
361
|
+
|
|
362
|
+
### Get challenge volume
|
|
363
|
+
|
|
364
|
+
`GET /v1/applications/{appKey}/challenge-volume` with Bearer authentication and
|
|
365
|
+
optional `from`, `to`, and `granularity` query parameters.
|
|
366
|
+
|
|
367
|
+
```json
|
|
368
|
+
{
|
|
369
|
+
"ok": true,
|
|
370
|
+
"data": {
|
|
371
|
+
"app_key": "app_123",
|
|
372
|
+
"from": "2026-08-01T00:00:00Z",
|
|
373
|
+
"to": "2026-08-27T23:59:59Z",
|
|
374
|
+
"granularity": "day",
|
|
375
|
+
"challenge_count": 125430
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
The CLI requires a matching App Key, valid ordered timestamps, a non-empty
|
|
381
|
+
granularity, and a non-negative safe-integer `challenge_count`. It rebuilds the
|
|
382
|
+
output from these fields so unexpected API fields cannot be printed.
|
|
383
|
+
|
|
384
|
+
### Get billing information
|
|
385
|
+
|
|
386
|
+
`GET /v1/applications/{appKey}/billing` with Bearer authentication and no
|
|
387
|
+
request body.
|
|
388
|
+
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"ok": true,
|
|
392
|
+
"data": {
|
|
393
|
+
"plan": {
|
|
394
|
+
"tier": "pro",
|
|
395
|
+
"current_cycle": [
|
|
396
|
+
"2026-07-07T07:07:07",
|
|
397
|
+
"2027-07-07T07:07:07"
|
|
398
|
+
],
|
|
399
|
+
"billing": 1080,
|
|
400
|
+
"next_charge": "2027-07-07T07:07:07"
|
|
401
|
+
},
|
|
402
|
+
"usage": {
|
|
403
|
+
"monthly_quota": 100000,
|
|
404
|
+
"current_usage": 110000,
|
|
405
|
+
"overage_charge": 10
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
The CLI validates all documented fields and rebuilds the nested result so
|
|
412
|
+
unexpected response fields cannot be printed.
|
|
413
|
+
|
|
414
|
+
### Get the integration contract
|
|
415
|
+
|
|
416
|
+
`GET /v1/integration-contract` with Bearer authentication and no request body.
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"ok": true,
|
|
421
|
+
"data": {
|
|
422
|
+
"contract_version": "2026-08-27",
|
|
423
|
+
"browser": {
|
|
424
|
+
"script_url": "https://intellifend.ai/intellifend.js",
|
|
425
|
+
"token_header": "X-IntelliFend-Token",
|
|
426
|
+
"available_modes": ["manual"]
|
|
427
|
+
},
|
|
428
|
+
"backend": {
|
|
429
|
+
"supported_languages": ["java"],
|
|
430
|
+
"min_jdk": 17
|
|
431
|
+
},
|
|
432
|
+
"release_state": "released"
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
The CLI requires these core fields and preserves additional authoritative
|
|
438
|
+
contract fields returned by the API. Credential-shaped fields are rejected.
|
|
439
|
+
|
|
242
440
|
## Security notes
|
|
243
441
|
|
|
244
442
|
- Never place an access token or Secret Key in URLs, command arguments, logs,
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "requestshield",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Customer CLI for IntelliFend RequestShield.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"requestshield": "src/main.mjs"
|
|
8
8
|
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
9
12
|
"files": [
|
|
10
13
|
"src/",
|
|
11
14
|
"skills/",
|
|
@@ -14,18 +17,21 @@
|
|
|
14
17
|
"engines": {
|
|
15
18
|
"node": ">=22.13"
|
|
16
19
|
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "node scripts/check-package.mjs",
|
|
22
|
+
"lint": "node scripts/check-package.mjs",
|
|
23
|
+
"test": "node --test",
|
|
24
|
+
"test:update-check:manual": "node scripts/manual-update-check.mjs",
|
|
25
|
+
"typecheck": "tsc -p jsconfig.json --noEmit",
|
|
26
|
+
"prepack": "node scripts/package-skill.mjs stage",
|
|
27
|
+
"postpack": "node scripts/package-skill.mjs clean",
|
|
28
|
+
"prepublishOnly": "npm run lint && npm run typecheck && npm test"
|
|
29
|
+
},
|
|
17
30
|
"devDependencies": {
|
|
18
31
|
"@types/node": "26.1.1",
|
|
19
32
|
"esbuild": "^0.28.1",
|
|
20
33
|
"postject": "1.0.0-alpha.6",
|
|
21
34
|
"typescript": "^6.0.3"
|
|
22
35
|
},
|
|
23
|
-
"license": "UNLICENSED"
|
|
24
|
-
|
|
25
|
-
"build": "node scripts/check-package.mjs",
|
|
26
|
-
"lint": "node scripts/check-package.mjs",
|
|
27
|
-
"test": "node --test",
|
|
28
|
-
"test:update-check:manual": "node scripts/manual-update-check.mjs",
|
|
29
|
-
"typecheck": "tsc -p jsconfig.json --noEmit"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
36
|
+
"license": "UNLICENSED"
|
|
37
|
+
}
|