requestshield 1.0.0-stg.276 → 1.1.0-stg.283
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
CHANGED
|
@@ -224,14 +224,17 @@ and nullable `reason`. Reasons are `timeout`, `network_error`, `http_error` and
|
|
|
224
224
|
your application integration.
|
|
225
225
|
|
|
226
226
|
Usage requires sign-in and an owned App Key. It defaults to the last 24 hours;
|
|
227
|
-
provide both `--from` and `--to` for a range within the last
|
|
227
|
+
provide both `--from` and `--to` for a range within the last 90 days. Use UTC
|
|
228
228
|
times ending in `Z`, with seconds and optionally up to three fractional digits.
|
|
229
|
-
The end must follow the start and cannot be in the future.
|
|
229
|
+
The end must follow the start and cannot be in the future. The range includes
|
|
230
|
+
requests completed at the start and excludes requests completed at the end.
|
|
230
231
|
|
|
231
232
|
Counts are approximate monitoring data, not billing totals. Data may be delayed
|
|
232
233
|
or incomplete. Retries count separately; successful challenge verifications are
|
|
233
234
|
attempts, not unique challenges. Zero means no recorded requests, not proof of no
|
|
234
|
-
traffic. A failed query returns an error.
|
|
235
|
+
traffic. A failed query returns an error. The report preserves your requested
|
|
236
|
+
range and includes only available recorded activity, even if collection began
|
|
237
|
+
after the start. The 90-day query window does not guarantee complete history.
|
|
235
238
|
|
|
236
239
|
Usage reports cover API v2 requests only. API v1 activity is not included.
|
|
237
240
|
If your browser and backend use different API versions, the report may show
|
package/package.json
CHANGED
|
@@ -292,9 +292,11 @@ Before retrieving usage / request volume, complete the
|
|
|
292
292
|
Uses the saved authenticated session and existing application-read permission.
|
|
293
293
|
Requires an exact owned App Key, including disabled or revoked apps. Default:
|
|
294
294
|
last 24 hours. Both optional UTC bounds must end in Z (seconds, optionally one to
|
|
295
|
-
three fractional digits), with from before to, and fall within the last
|
|
296
|
-
according to the server's clock. No future end, buckets
|
|
295
|
+
three fractional digits), with from before to, and fall within the last 90 days
|
|
296
|
+
according to the server's clock. No future end, buckets or account-wide
|
|
297
297
|
view. `usage challenges` and `--granularity` are not supported.
|
|
298
|
+
Counts use completion time, including the start and excluding the end. The report
|
|
299
|
+
preserves requested bounds even when collection began later.
|
|
298
300
|
|
|
299
301
|
The single JSON document is `{data: {appKey, from, to, approximate: true, operations}}`.
|
|
300
302
|
Operations has three fixed keys: `challenge_create`, `challenge_verify` and
|
|
@@ -304,7 +306,8 @@ created, verification issued a token, or a token was consumed for the first time
|
|
|
304
306
|
Replay is rejected. Retries count separately; verifies are not unique challenges.
|
|
305
307
|
Requests without an identified app are excluded.
|
|
306
308
|
|
|
307
|
-
These are approximate monitoring counts
|
|
309
|
+
These are approximate monitoring counts over available recorded history in the
|
|
310
|
+
requested range. Data may be delayed or incomplete. Zero means no recorded events,
|
|
308
311
|
not proof of no traffic. Query failures return errors, never zeros. Do not infer
|
|
309
312
|
billing, service health or backend enforcement from usage. Report unavailable-query
|
|
310
313
|
errors without fabricating counts.
|
|
@@ -106,8 +106,8 @@ backend connectivity and service health through established monitoring when it r
|
|
|
106
106
|
Troubleshooting reads evidence the user already has; exercising the endpoint belongs to
|
|
107
107
|
the explicit Test flow in `SKILL.md`. There, use browser network observations and
|
|
108
108
|
existing safe backend metrics in an authorized environment. Do not record raw tokens or secrets. `requestshield usage <app-key>`
|
|
109
|
-
provides approximate recent request totals, defaulting to 24 hours within
|
|
110
|
-
|
|
109
|
+
provides approximate recent request totals, defaulting to 24 hours within a 90-day
|
|
110
|
+
query window over available history. Missing or delayed observations can hide traffic; a zero count does not prove
|
|
111
111
|
enforcement or lack of traffic. Application status is not a traffic measurement. Report static correctness,
|
|
112
112
|
observed requests and backend enforcement separately. Use the controlled negative
|
|
113
113
|
test in `SKILL.md` to demonstrate enforcement.
|
package/src/command-registry.mjs
CHANGED
|
@@ -76,7 +76,7 @@ export const COMMAND_REGISTRY = [
|
|
|
76
76
|
{id:"update-apply",order:20,path:["update","apply"],handler:"update-apply",requiresApiSession:false,availability:"implemented",arguments:[],flags:[yes,json],summary:"Check and install the available version into the global npm installation.",examples:["update apply","update apply --yes"],notes:["Requires confirmation unless --yes is supplied."]},
|
|
77
77
|
{id:"contract",order:10,category:"developer",icon:"📖",navigationSummary:"View integration settings and SDK versions",path:["contract"],handler:"contract",requiresApiSession:false,availability:"implemented",arguments:[],flags:[json],summary:"Get the public integration contract and SDK versions.",examples:["contract","contract --json"],notes:["Reads public integration settings without signing in or accessing a saved session.","Returns published integration metadata; it does not install SDKs, modify project files or verify your application integration."]},
|
|
78
78
|
{id:"service-status",order:10,path:["service","status"],handler:"service-status",requiresApiSession:false,availability:"implemented",arguments:[],flags:[json],summary:"Check Management API and Challenge Service availability.",examples:["service status","service status --json"],notes:["Checks both public /health endpoints without signing in or reading a saved session.","Each request has a five-second deadline. No retries or redirects are followed.","Test a protected request to verify your application integration.","Exits 0 when both checks pass, 1 when either check fails, or 2 for invalid configuration."]},
|
|
79
|
-
{id:"usage",order:30,category:"applications",navigationSummary:"Monitor recent application requests",path:["usage"],handler:"usage",requiresApiSession:true,availability:"implemented",arguments:[appKey],flags:[{name:"--from",kind:"value",value:"UTC-time",description:"Start of the time range; provide together with --to."},{name:"--to",kind:"value",value:"UTC-time",description:"End of the time range; provide together with --from."},json],summary:"Monitor recent request totals for an app.",examples:["usage pk_example","usage pk_example --json"],notes:["Defaults to the last 24 hours. Requested times must fall within the last
|
|
79
|
+
{id:"usage",order:30,category:"applications",navigationSummary:"Monitor recent application requests",path:["usage"],handler:"usage",requiresApiSession:true,availability:"implemented",arguments:[appKey],flags:[{name:"--from",kind:"value",value:"UTC-time",description:"Start of the time range; provide together with --to."},{name:"--to",kind:"value",value:"UTC-time",description:"End of the time range; provide together with --from."},json],summary:"Monitor recent request totals for an app.",examples:["usage pk_example","usage pk_example --json"],notes:["Defaults to the last 24 hours. Requested times must fall within the last 90 days and end in Z, with at most three fractional digits.","Requests are counted by completion time, including the start and excluding the end. Only available recorded activity is included; the 90-day query window does not guarantee complete history.","Counts are approximate monitoring data; data can be delayed or incomplete. They are not billing totals. Usage reports cover API v2 requests only. API v1 activity is not included.","Retries count separately. Successful verifies are successful attempts, not unique challenges. Requests without an identified app are excluded."]},
|
|
80
80
|
{id:"billing-get",order:10,path:["billing","get"],handler:"billing-get",requiresApiSession:true,availability:"implemented",arguments:[appKey],flags:[json],summary:"Show account billing for an owned App Key.",examples:["billing get pk_example","billing get pk_example --json"],notes:["Uses your saved session. All applications in your account share the plan, billing period, allowance and totals shown here.","Counts authenticated API v2 token verification requests, including rejected requests and retries. API v1 and service errors are excluded.","Usage, remaining quota and overage are approximate. Data may be delayed or incomplete; the usage cutoff is not a guarantee of complete reporting.","Estimated cost includes the period's base charge and usage reported so far, before taxes. It is not a final invoice.","Missing current-period data is shown as Unavailable (null in JSON), never as zero."]},
|
|
81
81
|
];
|
|
82
82
|
|
package/src/commands/usage.mjs
CHANGED
|
@@ -44,7 +44,7 @@ export async function showUsage(options, deps) {
|
|
|
44
44
|
export function parseUsageResponse(body, options) {
|
|
45
45
|
const data = responseObject(responseObject(body).data);
|
|
46
46
|
const from = utcTimestamp(data.from), to = utcTimestamp(data.to);
|
|
47
|
-
if (data.appKey !== options.appKey || data.approximate !== true || from === undefined || to === undefined || from >= to || to - from >
|
|
47
|
+
if (data.appKey !== options.appKey || data.approximate !== true || from === undefined || to === undefined || from >= to || to - from > 90 * DAY_MS) throw invalidUsage();
|
|
48
48
|
if (options.from !== undefined && (from !== utcTimestamp(options.from) || to !== utcTimestamp(options.to))) throw invalidUsage();
|
|
49
49
|
if (options.from === undefined && to - from !== DAY_MS) throw invalidUsage();
|
|
50
50
|
const operations = responseObject(data.operations);
|
package/src/usage-time.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export function utcTimestamp(value) {
|
|
|
13
13
|
return new Date(time).toISOString() === normalized ? time : undefined;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/** Validate syntax and ordering only; the server owns the current
|
|
16
|
+
/** Validate syntax and ordering only; the server owns the current query window.
|
|
17
17
|
* @param {{from?: string, to?: string}} options
|
|
18
18
|
*/
|
|
19
19
|
export function validateUsageRange({from, to}) {
|