@noresponse/node 7.0.1 → 7.0.2

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 7.0.2
4
+
5
+ No changes detected.
6
+
3
7
  ## 7.0.1
4
8
 
5
9
  * `sdk.assessments.create()`: `response.account.risk.decision.enum(held)` **Added**
package/README.md CHANGED
@@ -305,18 +305,14 @@ async function handler(req, res) {
305
305
  return res.status(204).end();
306
306
  }
307
307
  if (event.type === "account.risk_changed") {
308
- // The account's decision for at least one flow changed. data.account is the Account
309
- // accounts.get returns; data.previousDecisionsByFlow holds the decisions it replaced.
310
- applyDecisions(event.data.account.id, event.data.account.decisionsByFlow);
308
+ // The one event to act on: a flow's decision changed, at data.account.riskVersion.
309
+ // This verifier alone does not enforce it: use handleRiskChange (below) as this endpoint's receiver.
311
310
  return res.status(204).end();
312
311
  }
313
312
  if ("assessmentId" in event.data) {
314
313
  forget(event.data.assessmentId); // the terminal expiry notice: GET now answers 404
315
- } else if (event.test) {
316
- // sendTestEvent's fixed example assessment: apply nothing
317
- } else if (isNewer(event.data)) { // keep the highest detail.assessmentVersion per assessment
318
- apply(event.data); // the full assessment, as assessments.get returns it
319
314
  }
315
+ // Any other assessment.updated reports progress only: apply nothing.
320
316
  res.status(204).end();
321
317
  }
322
318
  ```
@@ -352,6 +348,8 @@ if (result.riskVersion !== undefined) await users.update(result.account!.id, { e
352
348
 
353
349
  Nothing deletes a user. Clerk bans (and unbans), Auth0 sets `blocked`, and WorkOS, which has no block, writes `noresponse_state` to the user's metadata (gate sign-in on it) and revokes every session. On an Auth0 plan without the sessions API the revoke blocks the user too and reports `restrict`. Each action, or `none` when nothing is needed, is recorded with `accounts.recordEnforcement` at the `riskVersion` read, and `result.enforcements` lists them. A refused action is recorded as `failed` and throws `ProviderActionError`: answer 5xx so the delivery is retried. A test event, an erased account and an account at or below `enforcedRiskVersion` act on nothing (`result.skipped`). To catch up after dropped deliveries, pass each account of `nr.accounts.listChanged({ unenforced: true })` to `enforceAccount`. For your own user store, `customProvider({ restrict: async (userId) => ..., revoke_sessions: async (userId) => ... })` takes one function per action you support; an action without one is recorded as failed.
354
350
 
351
+ A held flow (workspace settings `admission: held`) answers `held` until its investigation completes or `hold_seconds` pass, and the handler records `none` for it. When the final decision arrives as `account.risk_changed`, an `onboarding` or `provisional` account fails onboarding or is refused activation on `review` or `block`. On `allow` the handler does nothing, so admit the account yourself from the result's account. See https://docs.noresponse.org/guides/late-results.
352
+
355
353
  ## Auth adapters
356
354
 
357
355
  Map a session your backend has already verified into `authContext`:
@@ -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: "7.0.1";
34
+ readonly sdkVersion: "7.0.2";
35
35
  readonly genVersion: "internal";
36
- readonly userAgent: "noresponse-sdk/typescript 7.0.1 internal 1 @noresponse/node";
36
+ readonly userAgent: "noresponse-sdk/typescript 7.0.2 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: "7.0.1",
31
+ sdkVersion: "7.0.2",
32
32
  genVersion: "internal",
33
- userAgent: "noresponse-sdk/typescript 7.0.1 internal 1 @noresponse/node",
33
+ userAgent: "noresponse-sdk/typescript 7.0.2 internal 1 @noresponse/node",
34
34
  };
35
35
  //# sourceMappingURL=config.js.map
@@ -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: "7.0.1";
34
+ readonly sdkVersion: "7.0.2";
35
35
  readonly genVersion: "internal";
36
- readonly userAgent: "noresponse-sdk/typescript 7.0.1 internal 1 @noresponse/node";
36
+ readonly userAgent: "noresponse-sdk/typescript 7.0.2 internal 1 @noresponse/node";
37
37
  };
38
38
  //# sourceMappingURL=config.d.ts.map
@@ -24,8 +24,8 @@ export function serverURLFromOptions(options) {
24
24
  export const SDK_METADATA = {
25
25
  language: "typescript",
26
26
  openapiDocVersion: "1",
27
- sdkVersion: "7.0.1",
27
+ sdkVersion: "7.0.2",
28
28
  genVersion: "internal",
29
- userAgent: "noresponse-sdk/typescript 7.0.1 internal 1 @noresponse/node",
29
+ userAgent: "noresponse-sdk/typescript 7.0.2 internal 1 @noresponse/node",
30
30
  };
31
31
  //# sourceMappingURL=config.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noresponse/node",
3
- "version": "7.0.1",
3
+ "version": "7.0.2",
4
4
  "author": "NoResponse",
5
5
  "bugs": {
6
6
  "url": "https://github.com/noresponsehq/node/issues"