@noresponse/node 4.0.1 → 5.0.0
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/CHANGELOG.md +35 -0
- package/README.md +9 -9
- package/dist/commonjs/client.d.ts +2 -2
- package/dist/commonjs/client.js +2 -2
- package/dist/commonjs/funcs/accounts-list-assessments.d.ts +1 -1
- package/dist/commonjs/funcs/accounts-list-assessments.js +1 -1
- package/dist/commonjs/funcs/assessments-create.d.ts +1 -1
- package/dist/commonjs/funcs/assessments-create.js +1 -1
- package/dist/commonjs/funcs/assessments-get.d.ts +1 -1
- package/dist/commonjs/funcs/assessments-get.js +1 -1
- package/dist/commonjs/funcs/assessments-query.d.ts +1 -1
- package/dist/commonjs/funcs/assessments-query.js +1 -1
- package/dist/commonjs/funcs/integrations-list.d.ts +1 -1
- package/dist/commonjs/funcs/integrations-list.js +1 -1
- package/dist/commonjs/funcs/key-usage-record.d.ts +2 -2
- package/dist/commonjs/funcs/key-usage-record.js +2 -2
- package/dist/commonjs/funcs/webhook-endpoints-list-deliveries.d.ts +1 -1
- package/dist/commonjs/funcs/webhook-endpoints-list-deliveries.js +1 -1
- package/dist/commonjs/funcs/webhook-endpoints-list.d.ts +1 -1
- package/dist/commonjs/funcs/webhook-endpoints-list.js +1 -1
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/issued-credential.d.ts +1 -1
- package/dist/commonjs/issued-credential.js +1 -1
- package/dist/commonjs/key-usage.js +2 -2
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/account-decisions-by-flow.d.ts +2 -2
- package/dist/commonjs/models/account-decisions-by-flow.d.ts.map +1 -1
- package/dist/commonjs/models/account-decisions-by-flow.js +8 -3
- package/dist/commonjs/models/account-decisions-by-flow.js.map +1 -1
- package/dist/commonjs/models/account-deletion.d.ts +1 -1
- package/dist/commonjs/models/account.d.ts +3 -3
- package/dist/commonjs/models/assessment-deletion.d.ts +1 -1
- package/dist/commonjs/models/assessment-detail-auth-context.d.ts +1 -1
- package/dist/commonjs/models/assessment-detail.d.ts +4 -4
- package/dist/commonjs/models/assessment-list.d.ts +3 -3
- package/dist/commonjs/models/assessment-outcome-request.d.ts +2 -2
- package/dist/commonjs/models/assessment-outcome.d.ts +3 -3
- package/dist/commonjs/models/assessment-query.d.ts +2 -2
- package/dist/commonjs/models/assessment-request-client-context.d.ts +4 -4
- package/dist/commonjs/models/assessment-request-identifiers.d.ts +1 -1
- package/dist/commonjs/models/assessment-request-issued-credential.d.ts +1 -1
- package/dist/commonjs/models/assessment-request-policy-context.d.ts +1 -1
- package/dist/commonjs/models/assessment-request.d.ts +5 -5
- package/dist/commonjs/models/assessment.d.ts +2 -2
- package/dist/commonjs/models/auth-context.d.ts +1 -1
- package/dist/commonjs/models/flow.d.ts +3 -3
- package/dist/commonjs/models/flow.js +2 -2
- package/dist/commonjs/models/flow.js.map +1 -1
- package/dist/commonjs/models/integration-list.d.ts +1 -1
- package/dist/commonjs/models/integration-request.d.ts +1 -1
- package/dist/commonjs/models/integration.d.ts +1 -1
- package/dist/commonjs/models/ip-summary.d.ts +3 -3
- package/dist/commonjs/models/ip-summary.d.ts.map +1 -1
- package/dist/commonjs/models/ip-summary.js +2 -2
- package/dist/commonjs/models/ip-summary.js.map +1 -1
- package/dist/commonjs/models/key-rotation-request.d.ts +1 -1
- package/dist/commonjs/models/key-usage-batch-request.d.ts +1 -1
- package/dist/commonjs/models/operations/create-assessment.d.ts +1 -1
- package/dist/commonjs/models/operations/delete-account.d.ts +1 -1
- package/dist/commonjs/models/operations/delete-integration.d.ts +1 -1
- package/dist/commonjs/models/operations/delete-webhook-endpoint.d.ts +1 -1
- package/dist/commonjs/models/operations/get-account.d.ts +1 -1
- package/dist/commonjs/models/operations/list-account-assessments.d.ts +1 -1
- package/dist/commonjs/models/operations/list-webhook-deliveries.d.ts +1 -1
- package/dist/commonjs/models/operations/record-assessment-outcome.d.ts +1 -1
- package/dist/commonjs/models/operations/record-key-usage.d.ts +1 -1
- package/dist/commonjs/models/operations/replay-webhook-delivery.d.ts +2 -2
- package/dist/commonjs/models/operations/rotate-integration-secret.d.ts +1 -1
- package/dist/commonjs/models/operations/rotate-webhook-signing-key.d.ts +1 -1
- package/dist/commonjs/models/operations/send-webhook-test-event.d.ts +1 -1
- package/dist/commonjs/models/outcome.d.ts +2 -2
- package/dist/commonjs/models/outcome.js +1 -1
- package/dist/commonjs/models/permission-denied-error-code.d.ts +1 -1
- package/dist/commonjs/models/permission-denied-error-code.js +1 -1
- package/dist/commonjs/models/permission-denied-error-code.js.map +1 -1
- package/dist/commonjs/models/reason-code.d.ts +1 -1
- package/dist/commonjs/models/reason-code.js +1 -1
- package/dist/commonjs/models/reason-code.js.map +1 -1
- package/dist/commonjs/models/risk-summary.d.ts +1 -1
- package/dist/commonjs/models/risk.d.ts +3 -3
- package/dist/commonjs/models/signal.d.ts +1 -1
- package/dist/commonjs/models/webhook-delivery-list.d.ts +2 -2
- package/dist/commonjs/models/webhook-endpoint-created.d.ts +1 -1
- package/dist/commonjs/models/webhook-endpoint-list.d.ts +1 -1
- package/dist/commonjs/models/webhook-endpoint-request.d.ts +1 -1
- package/dist/commonjs/models/webhook-endpoint.d.ts +1 -1
- package/dist/commonjs/sdk/accounts.d.ts +1 -1
- package/dist/commonjs/sdk/accounts.js +1 -1
- package/dist/commonjs/sdk/assessments.d.ts +3 -3
- package/dist/commonjs/sdk/assessments.js +3 -3
- package/dist/commonjs/sdk/integrations.d.ts +1 -1
- package/dist/commonjs/sdk/integrations.js +1 -1
- package/dist/commonjs/sdk/key-usage.d.ts +2 -2
- package/dist/commonjs/sdk/key-usage.js +2 -2
- package/dist/commonjs/sdk/webhook-endpoints.d.ts +2 -2
- package/dist/commonjs/sdk/webhook-endpoints.js +2 -2
- package/dist/commonjs/webhooks.d.ts +5 -5
- package/dist/commonjs/webhooks.d.ts.map +1 -1
- package/dist/commonjs/webhooks.js +2 -2
- package/dist/commonjs/webhooks.js.map +1 -1
- package/dist/esm/client.d.ts +2 -2
- package/dist/esm/client.js +2 -2
- package/dist/esm/funcs/accounts-list-assessments.d.ts +1 -1
- package/dist/esm/funcs/accounts-list-assessments.js +1 -1
- package/dist/esm/funcs/assessments-create.d.ts +1 -1
- package/dist/esm/funcs/assessments-create.js +1 -1
- package/dist/esm/funcs/assessments-get.d.ts +1 -1
- package/dist/esm/funcs/assessments-get.js +1 -1
- package/dist/esm/funcs/assessments-query.d.ts +1 -1
- package/dist/esm/funcs/assessments-query.js +1 -1
- package/dist/esm/funcs/integrations-list.d.ts +1 -1
- package/dist/esm/funcs/integrations-list.js +1 -1
- package/dist/esm/funcs/key-usage-record.d.ts +2 -2
- package/dist/esm/funcs/key-usage-record.js +2 -2
- package/dist/esm/funcs/webhook-endpoints-list-deliveries.d.ts +1 -1
- package/dist/esm/funcs/webhook-endpoints-list-deliveries.js +1 -1
- package/dist/esm/funcs/webhook-endpoints-list.d.ts +1 -1
- package/dist/esm/funcs/webhook-endpoints-list.js +1 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/issued-credential.d.ts +1 -1
- package/dist/esm/issued-credential.js +1 -1
- package/dist/esm/key-usage.js +2 -2
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/account-decisions-by-flow.d.ts +2 -2
- package/dist/esm/models/account-decisions-by-flow.d.ts.map +1 -1
- package/dist/esm/models/account-decisions-by-flow.js +8 -3
- package/dist/esm/models/account-decisions-by-flow.js.map +1 -1
- package/dist/esm/models/account-deletion.d.ts +1 -1
- package/dist/esm/models/account.d.ts +3 -3
- package/dist/esm/models/assessment-deletion.d.ts +1 -1
- package/dist/esm/models/assessment-detail-auth-context.d.ts +1 -1
- package/dist/esm/models/assessment-detail.d.ts +4 -4
- package/dist/esm/models/assessment-list.d.ts +3 -3
- package/dist/esm/models/assessment-outcome-request.d.ts +2 -2
- package/dist/esm/models/assessment-outcome.d.ts +3 -3
- package/dist/esm/models/assessment-query.d.ts +2 -2
- package/dist/esm/models/assessment-request-client-context.d.ts +4 -4
- package/dist/esm/models/assessment-request-identifiers.d.ts +1 -1
- package/dist/esm/models/assessment-request-issued-credential.d.ts +1 -1
- package/dist/esm/models/assessment-request-policy-context.d.ts +1 -1
- package/dist/esm/models/assessment-request.d.ts +5 -5
- package/dist/esm/models/assessment.d.ts +2 -2
- package/dist/esm/models/auth-context.d.ts +1 -1
- package/dist/esm/models/flow.d.ts +3 -3
- package/dist/esm/models/flow.js +2 -2
- package/dist/esm/models/flow.js.map +1 -1
- package/dist/esm/models/integration-list.d.ts +1 -1
- package/dist/esm/models/integration-request.d.ts +1 -1
- package/dist/esm/models/integration.d.ts +1 -1
- package/dist/esm/models/ip-summary.d.ts +3 -3
- package/dist/esm/models/ip-summary.d.ts.map +1 -1
- package/dist/esm/models/ip-summary.js +2 -2
- package/dist/esm/models/ip-summary.js.map +1 -1
- package/dist/esm/models/key-rotation-request.d.ts +1 -1
- package/dist/esm/models/key-usage-batch-request.d.ts +1 -1
- package/dist/esm/models/operations/create-assessment.d.ts +1 -1
- package/dist/esm/models/operations/delete-account.d.ts +1 -1
- package/dist/esm/models/operations/delete-integration.d.ts +1 -1
- package/dist/esm/models/operations/delete-webhook-endpoint.d.ts +1 -1
- package/dist/esm/models/operations/get-account.d.ts +1 -1
- package/dist/esm/models/operations/list-account-assessments.d.ts +1 -1
- package/dist/esm/models/operations/list-webhook-deliveries.d.ts +1 -1
- package/dist/esm/models/operations/record-assessment-outcome.d.ts +1 -1
- package/dist/esm/models/operations/record-key-usage.d.ts +1 -1
- package/dist/esm/models/operations/replay-webhook-delivery.d.ts +2 -2
- package/dist/esm/models/operations/rotate-integration-secret.d.ts +1 -1
- package/dist/esm/models/operations/rotate-webhook-signing-key.d.ts +1 -1
- package/dist/esm/models/operations/send-webhook-test-event.d.ts +1 -1
- package/dist/esm/models/outcome.d.ts +2 -2
- package/dist/esm/models/outcome.js +1 -1
- package/dist/esm/models/permission-denied-error-code.d.ts +1 -1
- package/dist/esm/models/permission-denied-error-code.js +1 -1
- package/dist/esm/models/permission-denied-error-code.js.map +1 -1
- package/dist/esm/models/reason-code.d.ts +1 -1
- package/dist/esm/models/reason-code.js +1 -1
- package/dist/esm/models/reason-code.js.map +1 -1
- package/dist/esm/models/risk-summary.d.ts +1 -1
- package/dist/esm/models/risk.d.ts +3 -3
- package/dist/esm/models/signal.d.ts +1 -1
- package/dist/esm/models/webhook-delivery-list.d.ts +2 -2
- package/dist/esm/models/webhook-endpoint-created.d.ts +1 -1
- package/dist/esm/models/webhook-endpoint-list.d.ts +1 -1
- package/dist/esm/models/webhook-endpoint-request.d.ts +1 -1
- package/dist/esm/models/webhook-endpoint.d.ts +1 -1
- package/dist/esm/sdk/accounts.d.ts +1 -1
- package/dist/esm/sdk/accounts.js +1 -1
- package/dist/esm/sdk/assessments.d.ts +3 -3
- package/dist/esm/sdk/assessments.js +3 -3
- package/dist/esm/sdk/integrations.d.ts +1 -1
- package/dist/esm/sdk/integrations.js +1 -1
- package/dist/esm/sdk/key-usage.d.ts +2 -2
- package/dist/esm/sdk/key-usage.js +2 -2
- package/dist/esm/sdk/webhook-endpoints.d.ts +2 -2
- package/dist/esm/sdk/webhook-endpoints.js +2 -2
- package/dist/esm/webhooks.d.ts +5 -5
- package/dist/esm/webhooks.d.ts.map +1 -1
- package/dist/esm/webhooks.js +2 -2
- package/dist/esm/webhooks.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0
|
|
4
|
+
|
|
5
|
+
* `sdk.assessments.create()`:
|
|
6
|
+
* `request.body.flow` **Changed** (Breaking ⚠️)
|
|
7
|
+
* `response` **Changed** (Breaking ⚠️)
|
|
8
|
+
* `error.code` **Changed** (Breaking ⚠️)
|
|
9
|
+
* `sdk.assessments.get()`:
|
|
10
|
+
* `response` **Changed** (Breaking ⚠️)
|
|
11
|
+
* `error.code` **Changed** (Breaking ⚠️)
|
|
12
|
+
* `sdk.assessments.delete()`: `error.code` **Changed** (Breaking ⚠️)
|
|
13
|
+
* `sdk.assessments.recordOutcome()`: `error.code` **Changed** (Breaking ⚠️)
|
|
14
|
+
* `sdk.assessments.query()`:
|
|
15
|
+
* `response.items[].risk` **Changed** (Breaking ⚠️)
|
|
16
|
+
* `error.code` **Changed** (Breaking ⚠️)
|
|
17
|
+
* `sdk.accounts.get()`:
|
|
18
|
+
* `response` **Changed** (Breaking ⚠️)
|
|
19
|
+
* `error.code` **Changed** (Breaking ⚠️)
|
|
20
|
+
* `sdk.accounts.delete()`: `error.code` **Changed** (Breaking ⚠️)
|
|
21
|
+
* `sdk.accounts.listAssessments()`:
|
|
22
|
+
* `response.items[].risk` **Changed** (Breaking ⚠️)
|
|
23
|
+
* `error.code` **Changed** (Breaking ⚠️)
|
|
24
|
+
* `sdk.keyUsage.record()`: `error.code` **Changed** (Breaking ⚠️)
|
|
25
|
+
* `sdk.keys.rotate()`: `error.code` **Changed** (Breaking ⚠️)
|
|
26
|
+
* `sdk.integrations.create()`: `error.code` **Changed** (Breaking ⚠️)
|
|
27
|
+
* `sdk.integrations.list()`: `error.code` **Changed** (Breaking ⚠️)
|
|
28
|
+
* `sdk.integrations.delete()`: `error.code` **Changed** (Breaking ⚠️)
|
|
29
|
+
* `sdk.integrations.rotate()`: `error.code` **Changed** (Breaking ⚠️)
|
|
30
|
+
* `sdk.webhookEndpoints.list()`: `error.code` **Changed** (Breaking ⚠️)
|
|
31
|
+
* `sdk.webhookEndpoints.create()`: `error.code` **Changed** (Breaking ⚠️)
|
|
32
|
+
* `sdk.webhookEndpoints.delete()`: `error.code` **Changed** (Breaking ⚠️)
|
|
33
|
+
* `sdk.webhookEndpoints.rotateSigningKey()`: `error.code` **Changed** (Breaking ⚠️)
|
|
34
|
+
* `sdk.webhookEndpoints.sendTestEvent()`: `error.code` **Changed** (Breaking ⚠️)
|
|
35
|
+
* `sdk.webhookEndpoints.listDeliveries()`: `error.code` **Changed** (Breaking ⚠️)
|
|
36
|
+
* `sdk.webhookEndpoints.replayDelivery()`: `error.code` **Changed** (Breaking ⚠️)
|
|
37
|
+
|
|
3
38
|
## 4.0.1
|
|
4
39
|
|
|
5
40
|
No changes detected.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# @noresponse/node
|
|
4
4
|
|
|
5
|
-
The NoResponse client for Node.js. It assesses
|
|
5
|
+
The NoResponse client for Node.js. It assesses an account creation, login or purchase, polls a pending assessment, pages through an account's history, records what you later learned, rotates your API key and verifies webhooks.
|
|
6
6
|
|
|
7
7
|
Node.js 20 or later. ESM and CommonJS. TypeScript types included. The client is generated from the NoResponse OpenAPI document; webhooks, auth adapters and the wait helper are hand-written.
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ const nr = new NoResponse(); // reads NORESPONSE_API_KEY, or new NoResponse("nrk
|
|
|
19
19
|
|
|
20
20
|
const assessment = await nr.assessments.create({
|
|
21
21
|
accountId: "usr_8f2k1",
|
|
22
|
-
flow: "
|
|
22
|
+
flow: "account_creation",
|
|
23
23
|
identifiers: { email: "jordan.lee@example.com", name: "Jordan Lee", ip: "81.2.69.160" },
|
|
24
24
|
});
|
|
25
25
|
|
|
@@ -66,15 +66,15 @@ Every method takes request options as its last argument: `{ timeoutMs, signal, h
|
|
|
66
66
|
const assessment = await nr.assessments.create(
|
|
67
67
|
{
|
|
68
68
|
accountId: "usr_8f2k1", // your opaque account id
|
|
69
|
-
flow: "
|
|
70
|
-
depth: "full", // quick or full; full for
|
|
69
|
+
flow: "account_creation", // account_creation, login or purchase
|
|
70
|
+
depth: "full", // quick or full; full for account_creation and purchase, quick for login by default
|
|
71
71
|
identifiers: { email: "jordan.lee@example.com" }, // email, username or phone; name and ip refine the match
|
|
72
72
|
policyContext: { region: "AU" },
|
|
73
73
|
clientContext: { timezone: "Australia/Sydney", platform: "web", formDurationMs: 1800 },
|
|
74
74
|
authContext: fromClerk(claims, { sessionCreatedAt }), // see Auth adapters
|
|
75
75
|
responseMode: "standard", // detailed adds detail.signals and detail.risk.details (detailed scope)
|
|
76
76
|
},
|
|
77
|
-
{ idempotencyKey: "
|
|
77
|
+
{ idempotencyKey: "account-usr_8f2k1-0001" },
|
|
78
78
|
);
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -112,7 +112,7 @@ An account is the `accountId` you send with your assessments. It holds one curre
|
|
|
112
112
|
const account = await nr.accounts.get("usr_8f2k1");
|
|
113
113
|
account.risk.score; // 0 (safe) to 100 (risky)
|
|
114
114
|
account.risk.decision; // allow, step_up, review or block
|
|
115
|
-
account.decisionsByFlow.login; // a decision for
|
|
115
|
+
account.decisionsByFlow.login; // a decision for account_creation, login and purchase
|
|
116
116
|
account.assessmentId; // the assessment the risk comes from
|
|
117
117
|
|
|
118
118
|
const history = await nr.accounts.listAssessments("usr_8f2k1", { limit: 20 });
|
|
@@ -229,7 +229,7 @@ await nr.assessments.create(params, { retries: { strategy: "none" } });
|
|
|
229
229
|
|
|
230
230
|
## Issued keys
|
|
231
231
|
|
|
232
|
-
When your
|
|
232
|
+
When your platform issues an API key to the new account, send only its hash, as `issued_credential.sha256`; the key itself never leaves your backend.
|
|
233
233
|
|
|
234
234
|
```ts
|
|
235
235
|
import { hashIssuedCredential } from "@noresponse/node";
|
|
@@ -294,7 +294,7 @@ async function handler(req, res) {
|
|
|
294
294
|
forgetAccount(event.data.accountId, event.data.deletedAt);
|
|
295
295
|
return res.status(204).end();
|
|
296
296
|
}
|
|
297
|
-
if (event.type === "
|
|
297
|
+
if (event.type === "workspace.deleted") {
|
|
298
298
|
// The workspace is deleted: the last event this endpoint receives, once per environment.
|
|
299
299
|
forgetEnvironment(event.data.environment);
|
|
300
300
|
return res.status(204).end();
|
|
@@ -325,7 +325,7 @@ async function handler(req, res) {
|
|
|
325
325
|
|
|
326
326
|
### Late results
|
|
327
327
|
|
|
328
|
-
An assessment can be revised after you allowed the
|
|
328
|
+
An assessment can be revised after you allowed the account creation. `handleLateResult` verifies the delivery with `constructEvent`, applies your policy and acts through your auth provider's admin API:
|
|
329
329
|
|
|
330
330
|
```ts
|
|
331
331
|
import { clerkActions, handleLateResult } from "@noresponse/node"; // or workosActions, auth0Actions
|
|
@@ -78,7 +78,7 @@ export declare class Assessments {
|
|
|
78
78
|
private readonly inner;
|
|
79
79
|
constructor(inner: GeneratedAssessments);
|
|
80
80
|
/**
|
|
81
|
-
* Assess
|
|
81
|
+
* Assess an account creation, login or purchase. Returns the assessment whether the
|
|
82
82
|
* answer was 200 (complete or partial) or 202 (pending; see meta.retryAfter
|
|
83
83
|
* and assessments.wait). The idempotency key is generated when omitted and
|
|
84
84
|
* reused on every retry of this call.
|
|
@@ -131,7 +131,7 @@ export declare class Accounts {
|
|
|
131
131
|
listAssessments(accountId: string, options?: ListAssessmentsOptions): Promise<AssessmentPage>;
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
* Usage of the API keys your
|
|
134
|
+
* Usage of the API keys your platform issued to your accounts. Needs the
|
|
135
135
|
* `assess` scope. Most callers use `buffer()`, which batches facts and sends
|
|
136
136
|
* them in the background; `record` sends one batch now.
|
|
137
137
|
*/
|
package/dist/commonjs/client.js
CHANGED
|
@@ -139,7 +139,7 @@ class Assessments {
|
|
|
139
139
|
this.inner = inner;
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
-
* Assess
|
|
142
|
+
* Assess an account creation, login or purchase. Returns the assessment whether the
|
|
143
143
|
* answer was 200 (complete or partial) or 202 (pending; see meta.retryAfter
|
|
144
144
|
* and assessments.wait). The idempotency key is generated when omitted and
|
|
145
145
|
* reused on every retry of this call.
|
|
@@ -255,7 +255,7 @@ class Accounts {
|
|
|
255
255
|
}
|
|
256
256
|
exports.Accounts = Accounts;
|
|
257
257
|
/**
|
|
258
|
-
* Usage of the API keys your
|
|
258
|
+
* Usage of the API keys your platform issued to your accounts. Needs the
|
|
259
259
|
* `assess` scope. Most callers use `buffer()`, which batches facts and sends
|
|
260
260
|
* them in the background; `record` sends one batch now.
|
|
261
261
|
*/
|
|
@@ -13,7 +13,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
13
13
|
* Page through one account's unexpired assessments.
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* The account's history: the same page as POST /v1/assessments/query for this account_id, newest first, each at its latest assessment_version. Requires the history scope. Read-only and safe to retry. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your
|
|
16
|
+
* The account's history: the same page as POST /v1/assessments/query for this account_id, newest first, each at its latest assessment_version. Requires the history scope. Read-only and safe to retry. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your workspace and the account; a tampered or expired cursor answers 400 invalid_cursor. response_mode=detailed needs the detailed scope. The account_id travels in the URL; use POST /v1/assessments/query to keep it out of access logs.
|
|
17
17
|
*/
|
|
18
18
|
export declare function accountsListAssessments(client: NoResponseCore, request: operations.ListAccountAssessmentsRequest, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListAccountAssessmentsResponse, errors.BadRequestError | errors.AuthenticationError | errors.PermissionDeniedError | errors.NotFoundError | errors.ConflictError | errors.RateLimitError | NoResponseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
cursor: string;
|
|
@@ -50,7 +50,7 @@ const operations_js_1 = require("../types/operations.js");
|
|
|
50
50
|
* Page through one account's unexpired assessments.
|
|
51
51
|
*
|
|
52
52
|
* @remarks
|
|
53
|
-
* The account's history: the same page as POST /v1/assessments/query for this account_id, newest first, each at its latest assessment_version. Requires the history scope. Read-only and safe to retry. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your
|
|
53
|
+
* The account's history: the same page as POST /v1/assessments/query for this account_id, newest first, each at its latest assessment_version. Requires the history scope. Read-only and safe to retry. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your workspace and the account; a tampered or expired cursor answers 400 invalid_cursor. response_mode=detailed needs the detailed scope. The account_id travels in the URL; use POST /v1/assessments/query to keep it out of access logs.
|
|
54
54
|
*/
|
|
55
55
|
function accountsListAssessments(client, request, options) {
|
|
56
56
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Assess identifiers for a signup or gateway decision.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Assesses one
|
|
15
|
+
* Assesses one account creation, login or purchase (flow) and answers with the account's one current risk: account.risk.decision is the decision for this flow (allow, step_up, review or block, where block means your block threshold was reached), and detail holds this assessment's own facts. depth sets how long the answer waits for sources: quick waits only for the fast ones (500 ms), full for the whole budget (3000 ms at most); it defaults to full for account_creation and purchase and quick for login. 200 carries complete or partial, 202 carries pending with Location and Retry-After. While the account's first assessment is pending, account is absent: apply your own fallback for that, 429, 503 or a timeout. NoResponse blocks nothing itself; you decide. Requires the assess scope. Idempotency-Key is required and is bound to the body for 24 hours: the same key with the same body replays the latest assessment with Idempotent-Replayed: true and starts no new work; the same key with a different body answers 409 idempotency_key_reused. response_mode defaults to standard; detailed needs the detailed scope.
|
|
16
16
|
*/
|
|
17
17
|
export declare function assessmentsCreate(client: NoResponseCore, request: operations.CreateAssessmentRequest, options?: RequestOptions): APIPromise<Result<operations.CreateAssessmentResponse, errors.BadRequestError | errors.AuthenticationError | errors.PermissionDeniedError | errors.NotFoundError | errors.ConflictError | errors.RateLimitError | NoResponseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=assessments-create.d.ts.map
|
|
@@ -49,7 +49,7 @@ const async_js_1 = require("../types/async.js");
|
|
|
49
49
|
* Assess identifiers for a signup or gateway decision.
|
|
50
50
|
*
|
|
51
51
|
* @remarks
|
|
52
|
-
* Assesses one
|
|
52
|
+
* Assesses one account creation, login or purchase (flow) and answers with the account's one current risk: account.risk.decision is the decision for this flow (allow, step_up, review or block, where block means your block threshold was reached), and detail holds this assessment's own facts. depth sets how long the answer waits for sources: quick waits only for the fast ones (500 ms), full for the whole budget (3000 ms at most); it defaults to full for account_creation and purchase and quick for login. 200 carries complete or partial, 202 carries pending with Location and Retry-After. While the account's first assessment is pending, account is absent: apply your own fallback for that, 429, 503 or a timeout. NoResponse blocks nothing itself; you decide. Requires the assess scope. Idempotency-Key is required and is bound to the body for 24 hours: the same key with the same body replays the latest assessment with Idempotent-Replayed: true and starts no new work; the same key with a different body answers 409 idempotency_key_reused. response_mode defaults to standard; detailed needs the detailed scope.
|
|
53
53
|
*/
|
|
54
54
|
function assessmentsCreate(client, request, options) {
|
|
55
55
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -12,7 +12,7 @@ import { Result } from "../types/fp.js";
|
|
|
12
12
|
* Poll the authoritative assessment of one assessment.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Returns the highest assessment_version, with the account's current risk. Requires the assess or history scope. While status is pending, or partial with a source still running, the response carries Retry-After; poll no faster than it says. Another
|
|
15
|
+
* Returns the highest assessment_version, with the account's current risk. Requires the assess or history scope. While status is pending, or partial with a source still running, the response carries Retry-After; poll no faster than it says. Another workspace's assessment, an unknown or expired assessment and a malformed assessment_id all answer 404 not_found. response_mode=detailed needs the detailed scope.
|
|
16
16
|
*/
|
|
17
17
|
export declare function assessmentsGet(client: NoResponseCore, request: operations.GetAssessmentRequest, options?: RequestOptions): APIPromise<Result<operations.GetAssessmentResponse, errors.BadRequestError | errors.AuthenticationError | errors.PermissionDeniedError | errors.NotFoundError | errors.ConflictError | errors.RateLimitError | NoResponseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=assessments-get.d.ts.map
|
|
@@ -49,7 +49,7 @@ const async_js_1 = require("../types/async.js");
|
|
|
49
49
|
* Poll the authoritative assessment of one assessment.
|
|
50
50
|
*
|
|
51
51
|
* @remarks
|
|
52
|
-
* Returns the highest assessment_version, with the account's current risk. Requires the assess or history scope. While status is pending, or partial with a source still running, the response carries Retry-After; poll no faster than it says. Another
|
|
52
|
+
* Returns the highest assessment_version, with the account's current risk. Requires the assess or history scope. While status is pending, or partial with a source still running, the response carries Retry-After; poll no faster than it says. Another workspace's assessment, an unknown or expired assessment and a malformed assessment_id all answer 404 not_found. response_mode=detailed needs the detailed scope.
|
|
53
53
|
*/
|
|
54
54
|
function assessmentsGet(client, request, options) {
|
|
55
55
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -14,7 +14,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
14
14
|
* Page through one account's unexpired assessments.
|
|
15
15
|
*
|
|
16
16
|
* @remarks
|
|
17
|
-
* History is a POST with account_id in the body so an account identifier stays out of URLs and access logs. Requires the history scope. Read-only and safe to retry. Newest first, each at its latest assessment_version. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your
|
|
17
|
+
* History is a POST with account_id in the body so an account identifier stays out of URLs and access logs. Requires the history scope. Read-only and safe to retry. Newest first, each at its latest assessment_version. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your workspace and the account; a tampered or expired cursor answers 400 invalid_cursor. response_mode=detailed needs the detailed scope.
|
|
18
18
|
*/
|
|
19
19
|
export declare function assessmentsQuery(client: NoResponseCore, request: models.AssessmentQuery, options?: RequestOptions): APIPromise<PageIterator<Result<operations.QueryAccountAssessmentsResponse, errors.BadRequestError | errors.AuthenticationError | errors.PermissionDeniedError | errors.NotFoundError | errors.ConflictError | errors.RateLimitError | NoResponseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
20
20
|
cursor: string;
|
|
@@ -51,7 +51,7 @@ const operations_js_1 = require("../types/operations.js");
|
|
|
51
51
|
* Page through one account's unexpired assessments.
|
|
52
52
|
*
|
|
53
53
|
* @remarks
|
|
54
|
-
* History is a POST with account_id in the body so an account identifier stays out of URLs and access logs. Requires the history scope. Read-only and safe to retry. Newest first, each at its latest assessment_version. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your
|
|
54
|
+
* History is a POST with account_id in the body so an account identifier stays out of URLs and access logs. Requires the history scope. Read-only and safe to retry. Newest first, each at its latest assessment_version. An account with no assessments answers 200 with empty items. The cursor is opaque and bound to your workspace and the account; a tampered or expired cursor answers 400 invalid_cursor. response_mode=detailed needs the detailed scope.
|
|
55
55
|
*/
|
|
56
56
|
function assessmentsQuery(client, request, options) {
|
|
57
57
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -9,7 +9,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
9
9
|
import { APIPromise } from "../types/async.js";
|
|
10
10
|
import { Result } from "../types/fp.js";
|
|
11
11
|
/**
|
|
12
|
-
* List the
|
|
12
|
+
* List the workspace's integrations.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* Every integration, oldest first. Listings carry no secrets. Requires the integrations scope.
|
|
@@ -43,7 +43,7 @@ const errors = __importStar(require("../models/errors/index.js"));
|
|
|
43
43
|
const operations = __importStar(require("../models/operations/index.js"));
|
|
44
44
|
const async_js_1 = require("../types/async.js");
|
|
45
45
|
/**
|
|
46
|
-
* List the
|
|
46
|
+
* List the workspace's integrations.
|
|
47
47
|
*
|
|
48
48
|
* @remarks
|
|
49
49
|
* Every integration, oldest first. Listings carry no secrets. Requires the integrations scope.
|
|
@@ -9,10 +9,10 @@ import * as operations from "../models/operations/index.js";
|
|
|
9
9
|
import { APIPromise } from "../types/async.js";
|
|
10
10
|
import { Result } from "../types/fp.js";
|
|
11
11
|
/**
|
|
12
|
-
* Report requests made with API keys your
|
|
12
|
+
* Report requests made with API keys your platform issued.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Records requests made with API keys your
|
|
15
|
+
* Records requests made with API keys your platform issued to your accounts, one event per request: the key's SHA-256 (the issued_credential.sha256 the account's assessment carried), the client IP, the time and optionally the user agent, model and token counts. Most callers use the SDK's usage buffer, which batches events and sends them in the background. Sampling is allowed: sample_rate weights an event's request and token counts. Requires the assess scope. Idempotency-Key is required and handled as on POST /v1/assessments: a retry with the same key and body answers the same record with Idempotent-Replayed: true and counts nothing again; a different body answers 409. A batch holds 1 to 500 events and at most 256 KiB. No raw event is kept: usage is aggregated per key, and IPs, user agents and models are kept only as keyed digests, with the IP's country, for 24 hours. When one key is used from 20 or more IP addresses, or 3 or more countries, within 24 hours, every account whose assessment carried that key gets the shared_api_key reason for 30 days.
|
|
16
16
|
*/
|
|
17
17
|
export declare function keyUsageRecord(client: NoResponseCore, request: operations.RecordKeyUsageRequest, options?: RequestOptions): APIPromise<Result<operations.RecordKeyUsageResponse, errors.BadRequestError | errors.AuthenticationError | errors.PermissionDeniedError | errors.NotFoundError | errors.ConflictError | errors.RateLimitError | NoResponseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
18
18
|
//# sourceMappingURL=key-usage-record.d.ts.map
|
|
@@ -46,10 +46,10 @@ const errors = __importStar(require("../models/errors/index.js"));
|
|
|
46
46
|
const operations = __importStar(require("../models/operations/index.js"));
|
|
47
47
|
const async_js_1 = require("../types/async.js");
|
|
48
48
|
/**
|
|
49
|
-
* Report requests made with API keys your
|
|
49
|
+
* Report requests made with API keys your platform issued.
|
|
50
50
|
*
|
|
51
51
|
* @remarks
|
|
52
|
-
* Records requests made with API keys your
|
|
52
|
+
* Records requests made with API keys your platform issued to your accounts, one event per request: the key's SHA-256 (the issued_credential.sha256 the account's assessment carried), the client IP, the time and optionally the user agent, model and token counts. Most callers use the SDK's usage buffer, which batches events and sends them in the background. Sampling is allowed: sample_rate weights an event's request and token counts. Requires the assess scope. Idempotency-Key is required and handled as on POST /v1/assessments: a retry with the same key and body answers the same record with Idempotent-Replayed: true and counts nothing again; a different body answers 409. A batch holds 1 to 500 events and at most 256 KiB. No raw event is kept: usage is aggregated per key, and IPs, user agents and models are kept only as keyed digests, with the IP's country, for 24 hours. When one key is used from 20 or more IP addresses, or 3 or more countries, within 24 hours, every account whose assessment carried that key gets the shared_api_key reason for 30 days.
|
|
53
53
|
*/
|
|
54
54
|
function keyUsageRecord(client, request, options) {
|
|
55
55
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -13,7 +13,7 @@ import { PageIterator } from "../types/operations.js";
|
|
|
13
13
|
* List an endpoint's delivery attempts.
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
|
-
* Every POST the endpoint received, newest first: the event id and type, which attempt it was, whether it was a replay, delivered or failed, the response code, why it failed and how long it took. Attempts are kept for 30 days, or your retention_days when that is shorter, and are deleted with the assessment they carried. Requires the webhooks scope. Read-only and safe to retry. The cursor is opaque and bound to your
|
|
16
|
+
* Every POST the endpoint received, newest first: the event id and type, which attempt it was, whether it was a replay, delivered or failed, the response code, why it failed and how long it took. Attempts are kept for 30 days, or your retention_days when that is shorter, and are deleted with the assessment they carried. Requires the webhooks scope. Read-only and safe to retry. The cursor is opaque and bound to your workspace and the endpoint; a tampered or expired cursor answers 400 invalid_cursor.
|
|
17
17
|
*/
|
|
18
18
|
export declare function webhookEndpointsListDeliveries(client: NoResponseCore, request: operations.ListWebhookDeliveriesRequest, options?: RequestOptions): APIPromise<PageIterator<Result<operations.ListWebhookDeliveriesResponse, errors.BadRequestError | errors.AuthenticationError | errors.PermissionDeniedError | errors.NotFoundError | errors.ConflictError | errors.RateLimitError | NoResponseError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>, {
|
|
19
19
|
cursor: string;
|
|
@@ -50,7 +50,7 @@ const operations_js_1 = require("../types/operations.js");
|
|
|
50
50
|
* List an endpoint's delivery attempts.
|
|
51
51
|
*
|
|
52
52
|
* @remarks
|
|
53
|
-
* Every POST the endpoint received, newest first: the event id and type, which attempt it was, whether it was a replay, delivered or failed, the response code, why it failed and how long it took. Attempts are kept for 30 days, or your retention_days when that is shorter, and are deleted with the assessment they carried. Requires the webhooks scope. Read-only and safe to retry. The cursor is opaque and bound to your
|
|
53
|
+
* Every POST the endpoint received, newest first: the event id and type, which attempt it was, whether it was a replay, delivered or failed, the response code, why it failed and how long it took. Attempts are kept for 30 days, or your retention_days when that is shorter, and are deleted with the assessment they carried. Requires the webhooks scope. Read-only and safe to retry. The cursor is opaque and bound to your workspace and the endpoint; a tampered or expired cursor answers 400 invalid_cursor.
|
|
54
54
|
*/
|
|
55
55
|
function webhookEndpointsListDeliveries(client, request, options) {
|
|
56
56
|
return new async_js_1.APIPromise($do(client, request, options));
|
|
@@ -9,7 +9,7 @@ import * as operations from "../models/operations/index.js";
|
|
|
9
9
|
import { APIPromise } from "../types/async.js";
|
|
10
10
|
import { Result } from "../types/fp.js";
|
|
11
11
|
/**
|
|
12
|
-
* List the
|
|
12
|
+
* List the workspace's webhook endpoints.
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
15
|
* Lists your webhook endpoints in every state, ordered by endpoint_id, with the ids of their signing keys and without secrets. Requires the webhooks scope.
|
|
@@ -43,7 +43,7 @@ const errors = __importStar(require("../models/errors/index.js"));
|
|
|
43
43
|
const operations = __importStar(require("../models/operations/index.js"));
|
|
44
44
|
const async_js_1 = require("../types/async.js");
|
|
45
45
|
/**
|
|
46
|
-
* List the
|
|
46
|
+
* List the workspace's webhook endpoints.
|
|
47
47
|
*
|
|
48
48
|
* @remarks
|
|
49
49
|
* Lists your webhook endpoints in every state, ordered by endpoint_id, with the ids of their signing keys and without secrets. Requires the webhooks scope.
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { NoResponse, Assessments, Accounts, Keys, KeyUsage, WebhookEndpoints, Integrations, DEFAULT_BASE_URL, DEFAULT_TIMEOUT_MS, type NoResponseOptions, type CreateOptions, type GetOptions, type ListAssessmentsOptions, type AssessmentPage, type ListDeliveriesOptions, type DeliveryPage, type ResponseMeta, type WithMeta, type WaitOptions, } from "./client.js";
|
|
6
6
|
export * from "./errors.js";
|
|
7
|
-
export { constructEvent, verificationResponse, isExpiredEvent, WebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, type WebhookEvent, type AssessmentUpdatedEvent, type AssessmentExpiredEvent, type EndpointVerificationEvent, type AccountDeletedEvent, type
|
|
7
|
+
export { constructEvent, verificationResponse, isExpiredEvent, WebhookVerificationError, DEFAULT_TOLERANCE_SECONDS, type WebhookEvent, type AssessmentUpdatedEvent, type AssessmentExpiredEvent, type EndpointVerificationEvent, type AccountDeletedEvent, type WorkspaceDeletedEvent, type EndpointDisabledEvent, type AccountRiskChangedEvent, type AssessmentExpired, type EndpointVerification, type AccountDeleted, type WorkspaceDeleted, type EndpointDisabled, type AccountRiskChanged, type ConstructEventOptions, type HeaderInput, type WebhookSecrets, type WebhookErrorCode, } from "./webhooks.js";
|
|
8
8
|
export { handleLateResult, lateResultAction, clerkActions, workosActions, auth0Actions, logOnlyActions, ProviderActionError, DEFAULT_LATE_RESULT_POLICY, type LateResult, type LateResultAction, type LateResultOptions, type LateResultPolicy, type LateResultActor, type LateResultProvider, type ClerkActionsOptions, type WorkOSActionsOptions, type Auth0ActionsOptions, type LogOnlyActionsOptions, } from "./late-results.js";
|
|
9
9
|
export { fromAuth0, fromClerk, fromCognito, fromEntra, fromFirebase, fromKeycloak, fromOIDC, fromOry, fromOryOAuth2, fromSupabase, fromWorkOS, type VerifiedClaims, type AuthContextOverrides, } from "./auth.js";
|
|
10
10
|
export { DEFAULT_WAIT_TIMEOUT_MS, MIN_POLL_INTERVAL_MS } from "./wait.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,0BAA0B,EAC1B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,SAAS,EACT,SAAS,EACT,WAAW,EACX,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,OAAO,EACP,aAAa,EACb,YAAY,EACZ,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,YAAY,EACV,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACjF,YAAY,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* SHA-256 of an API key your
|
|
2
|
+
* SHA-256 of an API key your platform issued to the new account, as 64
|
|
3
3
|
* lower-case hex characters. The key never leaves your backend: send only this
|
|
4
4
|
* hash, as `issuedCredential.sha256` on the assessment request. The key is
|
|
5
5
|
* hashed as its UTF-8 bytes exactly as given, with no trimming or
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.hashIssuedCredential = hashIssuedCredential;
|
|
4
4
|
const node_crypto_1 = require("node:crypto");
|
|
5
5
|
/**
|
|
6
|
-
* SHA-256 of an API key your
|
|
6
|
+
* SHA-256 of an API key your platform issued to the new account, as 64
|
|
7
7
|
* lower-case hex characters. The key never leaves your backend: send only this
|
|
8
8
|
* hash, as `issuedCredential.sha256` on the assessment request. The key is
|
|
9
9
|
* hashed as its UTF-8 bytes exactly as given, with no trimming or
|
|
@@ -4,8 +4,8 @@ exports.KeyUsageBuffer = exports.DEFAULT_MAX_QUEUE = exports.DEFAULT_FLUSH_INTER
|
|
|
4
4
|
/**
|
|
5
5
|
* The key usage buffer. Hand-written; not generated.
|
|
6
6
|
*
|
|
7
|
-
* Your API gateway calls `record` once per request made with a key your
|
|
8
|
-
*
|
|
7
|
+
* Your API gateway calls `record` once per request made with a key your platform
|
|
8
|
+
* issued. The buffer keeps the facts in memory and sends them to POST
|
|
9
9
|
* /v1/key_usage/batches in the background: when `batchSize` facts are queued,
|
|
10
10
|
* every `flushIntervalMs`, and on `flush()` or `close()`. `record` never
|
|
11
11
|
* blocks and never throws. When the queue is full the oldest fact is dropped
|
|
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
31
31
|
export declare const SDK_METADATA: {
|
|
32
32
|
readonly language: "typescript";
|
|
33
33
|
readonly openapiDocVersion: "1";
|
|
34
|
-
readonly sdkVersion: "
|
|
34
|
+
readonly sdkVersion: "5.0.0";
|
|
35
35
|
readonly genVersion: "internal";
|
|
36
|
-
readonly userAgent: "noresponse-sdk/typescript
|
|
36
|
+
readonly userAgent: "noresponse-sdk/typescript 5.0.0 internal 1 @noresponse/node";
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -28,8 +28,8 @@ function serverURLFromOptions(options) {
|
|
|
28
28
|
exports.SDK_METADATA = {
|
|
29
29
|
language: "typescript",
|
|
30
30
|
openapiDocVersion: "1",
|
|
31
|
-
sdkVersion: "
|
|
31
|
+
sdkVersion: "5.0.0",
|
|
32
32
|
genVersion: "internal",
|
|
33
|
-
userAgent: "noresponse-sdk/typescript
|
|
33
|
+
userAgent: "noresponse-sdk/typescript 5.0.0 internal 1 @noresponse/node",
|
|
34
34
|
};
|
|
35
35
|
//# sourceMappingURL=config.js.map
|
|
@@ -3,13 +3,13 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
3
3
|
import { AccountDecision } from "./account-decision.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
5
|
/**
|
|
6
|
-
* The decision for each flow: the account's score under that flow's thresholds. A flow the workspace has not set uses its
|
|
6
|
+
* The decision for each flow: the account's score under that flow's thresholds. A flow the workspace has not set uses its account_creation thresholds, so the flows differ only where it set them.
|
|
7
7
|
*/
|
|
8
8
|
export type AccountDecisionsByFlow = {
|
|
9
9
|
/**
|
|
10
10
|
* block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
accountCreation: AccountDecision;
|
|
13
13
|
/**
|
|
14
14
|
* block when the score reached your block threshold (risk.block of the assessment), otherwise the assessment's recommendation. Your application applies it.
|
|
15
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-decisions-by-flow.d.ts","sourceRoot":"","sources":["../../../src/models/account-decisions-by-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"account-decisions-by-flow.d.ts","sourceRoot":"","sources":["../../../src/models/account-decisions-by-flow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAGjC,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,eAAe,EAAE,eAAe,CAAC;IACjC;;OAEG;IACH,KAAK,EAAE,eAAe,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,oCAAoC,EAAE,CAAC,CAAC,WAAW,CAC9D,sBAAsB,EACtB,OAAO,CAYR,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAM7D"}
|
|
@@ -36,14 +36,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.AccountDecisionsByFlow$inboundSchema = void 0;
|
|
37
37
|
exports.accountDecisionsByFlowFromJSON = accountDecisionsByFlowFromJSON;
|
|
38
38
|
const z = __importStar(require("zod/v4-mini"));
|
|
39
|
+
const primitives_js_1 = require("../lib/primitives.js");
|
|
39
40
|
const schemas_js_1 = require("../lib/schemas.js");
|
|
40
41
|
const account_decision_js_1 = require("./account-decision.js");
|
|
41
42
|
/** @internal */
|
|
42
|
-
exports.AccountDecisionsByFlow$inboundSchema = z.object({
|
|
43
|
-
|
|
43
|
+
exports.AccountDecisionsByFlow$inboundSchema = z.pipe(z.object({
|
|
44
|
+
account_creation: account_decision_js_1.AccountDecision$inboundSchema,
|
|
44
45
|
login: account_decision_js_1.AccountDecision$inboundSchema,
|
|
45
46
|
purchase: account_decision_js_1.AccountDecision$inboundSchema,
|
|
46
|
-
})
|
|
47
|
+
}), z.transform((v) => {
|
|
48
|
+
return (0, primitives_js_1.remap)(v, {
|
|
49
|
+
"account_creation": "accountCreation",
|
|
50
|
+
});
|
|
51
|
+
}));
|
|
47
52
|
function accountDecisionsByFlowFromJSON(jsonString) {
|
|
48
53
|
return (0, schemas_js_1.safeParse)(jsonString, (x) => exports.AccountDecisionsByFlow$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountDecisionsByFlow' from JSON`);
|
|
49
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-decisions-by-flow.js","sourceRoot":"","sources":["../../../src/models/account-decisions-by-flow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,wCAAoB;AACjC,kDAA8C;AAE9C,+DAG+B;AAqB/B,gBAAgB;AACH,QAAA,oCAAoC,GAG7C,CAAC,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"account-decisions-by-flow.js","sourceRoot":"","sources":["../../../src/models/account-decisions-by-flow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,CAAC,wCAAoB;AACjC,wDAAuD;AACvD,kDAA8C;AAE9C,+DAG+B;AAqB/B,gBAAgB;AACH,QAAA,oCAAoC,GAG7C,CAAC,CAAC,IAAI,CACR,CAAC,CAAC,MAAM,CAAC;IACP,gBAAgB,EAAE,mDAA6B;IAC/C,KAAK,EAAE,mDAA6B;IACpC,QAAQ,EAAE,mDAA6B;CACxC,CAAC,EACF,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACjB,OAAO,IAAA,qBAAM,EAAC,CAAC,EAAE;QACf,kBAAkB,EAAE,iBAAiB;KACtC,CAAC,CAAC;AAAA,CACJ,CAAC,CACH,CAAC;AAEF,wCACE,UAAkB,EAC2C;IAC7D,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,QAAA,oCAAoC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAChE,oDAAoD,CACrD,CAAC;AAAA,CACH"}
|
|
@@ -2,7 +2,7 @@ import * as z from "zod/v4-mini";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
3
3
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
4
4
|
/**
|
|
5
|
-
* Body of the 200 answer to DELETE /v1/accounts/{account_id}: the calling
|
|
5
|
+
* Body of the 200 answer to DELETE /v1/accounts/{account_id}: the calling workspace's account was erased in the environment of the calling key. Every assessment of the account went, with its revisions, evidence, outcomes and the identity-graph marks its outcomes set, and an assessment that was still running when the call arrived is stopped. Afterwards GET /v1/accounts/{account_id} and GET /v1/assessments/{assessment_id} of each erased assessment answer 404, and the history page is empty. The call is idempotent: a repeat, or an account with nothing to erase, answers 200 with assessments_deleted 0. The account_id can be assessed again later, as a new account.
|
|
6
6
|
*/
|
|
7
7
|
export type AccountDeletion = {
|
|
8
8
|
/**
|
|
@@ -4,7 +4,7 @@ import { AccountDecisionsByFlow } from "./account-decisions-by-flow.js";
|
|
|
4
4
|
import { AccountRisk } from "./account-risk.js";
|
|
5
5
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
6
6
|
/**
|
|
7
|
-
* Body of the 200 answer to GET /v1/accounts/{account_id}: the one current risk of one of the calling
|
|
7
|
+
* Body of the 200 answer to GET /v1/accounts/{account_id}: the one current risk of one of the calling workspace's accounts. It is the risk of the account's latest assessment that has a decision (status complete or partial), by created_at and then assessment_id, scored exactly as GET /v1/assessments/{assessment_id} scores that assessment, plus the account's own reason shared_api_key when a key issued to the account was used from many IP addresses or countries (POST /v1/key_usage/batches). Its assessments are the account's history (GET /v1/accounts/{account_id}/assessments).
|
|
8
8
|
*/
|
|
9
9
|
export type Account = {
|
|
10
10
|
/**
|
|
@@ -12,12 +12,12 @@ export type Account = {
|
|
|
12
12
|
*/
|
|
13
13
|
schemaVersion: "1";
|
|
14
14
|
/**
|
|
15
|
-
* The account_id the
|
|
15
|
+
* The account_id the workspace sends with its assessments.
|
|
16
16
|
*/
|
|
17
17
|
id: string;
|
|
18
18
|
risk: AccountRisk;
|
|
19
19
|
/**
|
|
20
|
-
* The decision for each flow: the account's score under that flow's thresholds. A flow the workspace has not set uses its
|
|
20
|
+
* The decision for each flow: the account's score under that flow's thresholds. A flow the workspace has not set uses its account_creation thresholds, so the flows differ only where it set them.
|
|
21
21
|
*/
|
|
22
22
|
decisionsByFlow: AccountDecisionsByFlow;
|
|
23
23
|
/**
|
|
@@ -3,7 +3,7 @@ import { Result as SafeParseResult } from "../types/fp.js";
|
|
|
3
3
|
import { AssessmentDeletionAccount } from "./assessment-deletion-account.js";
|
|
4
4
|
import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
5
5
|
/**
|
|
6
|
-
* Body of the 200 answer to DELETE /v1/assessments/{assessment_id}: one of the calling
|
|
6
|
+
* Body of the 200 answer to DELETE /v1/assessments/{assessment_id}: one of the calling workspace's assessments was deleted, with its versions, evidence, outcomes and the identity-graph marks its outcomes set. Afterwards GET /v1/assessments/{assessment_id} answers 404 and the assessment leaves the account's history. The account is scored again from what remains: account.current_assessment_id names the assessment GET /v1/accounts/{account_id} now serves its risk from, and is absent when the account has no assessment with a decision left. Deleting an assessment that is already gone answers 404.
|
|
7
7
|
*/
|
|
8
8
|
export type AssessmentDeletion = {
|
|
9
9
|
/**
|
|
@@ -4,7 +4,7 @@ import { SDKValidationError } from "./errors/sdk-validation-error.js";
|
|
|
4
4
|
import { HookPoint } from "./hook-point.js";
|
|
5
5
|
import { Transport } from "./transport.js";
|
|
6
6
|
/**
|
|
7
|
-
* The identity fields of the auth context the assessment was made with, echoed for the
|
|
7
|
+
* The identity fields of the auth context the assessment was made with, echoed for the workspace's own correlation: the request's auth_context, or the one a hosted provider hook (POST /hooks/{integration_id}) built, with transport provider_hook and its hook_point. Present exactly when the request carried an auth_context, and the same on every revision of the assessment. Values are as the request or the hook sent them; tokens, timestamps, roles and scopes are not echoed, and the echo does not change the score.
|
|
8
8
|
*/
|
|
9
9
|
export type AssessmentDetailAuthContext = {
|
|
10
10
|
/**
|
|
@@ -18,11 +18,11 @@ export type AssessmentDetail = {
|
|
|
18
18
|
*/
|
|
19
19
|
schemaVersion: "1";
|
|
20
20
|
/**
|
|
21
|
-
* Opaque, server-assigned assessment id: 'asm_' and a 26-character Crockford base32 ULID. Unique within the
|
|
21
|
+
* Opaque, server-assigned assessment id: 'asm_' and a 26-character Crockford base32 ULID. Unique within the workspace; another workspace's assessment id answers 404.
|
|
22
22
|
*/
|
|
23
23
|
assessmentId: string;
|
|
24
24
|
/**
|
|
25
|
-
* Your own opaque identifier for the account being checked, scoped to your
|
|
25
|
+
* Your own opaque identifier for the account being checked, scoped to your workspace. Use an id you mint, with no direct identifier (email, phone, name or national id) in it. '|' is accepted so an Auth0 user id such as 'auth0|64abc' passes unchanged; '@', '+', '$' and whitespace are refused by the pattern, as is an exact-shape JWT; a hex digest such as a SHA-256 is allowed, because hashing an internal id is a common pseudonymous scheme. A value such as '07700900123' or 'jane.doe.gmail.com' cannot be told apart from an opaque id. It travels in bodies, and in a URL only as the path segment of GET /v1/accounts/{account_id} and its /assessments. An assessment requested by a provider hook at pre_registration, which has no account yet, carries the server-issued account_id pre: followed by its assessment_id.
|
|
26
26
|
*/
|
|
27
27
|
accountId: string;
|
|
28
28
|
/**
|
|
@@ -54,7 +54,7 @@ export type AssessmentDetail = {
|
|
|
54
54
|
*/
|
|
55
55
|
incompleteSources: Array<IncompleteSource>;
|
|
56
56
|
/**
|
|
57
|
-
* Version of the hand-authored heuristic weights that produced the recommendation, for example 'risk-2026-10.7'. A
|
|
57
|
+
* Version of the hand-authored heuristic weights that produced the recommendation, for example 'risk-2026-10.7'. A workspace threshold override adds a +t<N> suffix, e.g. 'risk-2026-10.7+t3'.
|
|
58
58
|
*/
|
|
59
59
|
policyVersion: string;
|
|
60
60
|
/**
|
|
@@ -80,7 +80,7 @@ export type AssessmentDetail = {
|
|
|
80
80
|
assessmentUrl?: string | undefined;
|
|
81
81
|
timing: AssessmentDetailTiming;
|
|
82
82
|
/**
|
|
83
|
-
* The identity fields of the auth context the assessment was made with, echoed for the
|
|
83
|
+
* The identity fields of the auth context the assessment was made with, echoed for the workspace's own correlation: the request's auth_context, or the one a hosted provider hook (POST /hooks/{integration_id}) built, with transport provider_hook and its hook_point. Present exactly when the request carried an auth_context, and the same on every revision of the assessment. Values are as the request or the hook sent them; tokens, timestamps, roles and scopes are not echoed, and the echo does not change the score.
|
|
84
84
|
*/
|
|
85
85
|
authContext?: AssessmentDetailAuthContext | undefined;
|
|
86
86
|
};
|