@adcp/sdk API Reference - v7.9.0
    Preparing search index...

    Function expectControllerSuccess

    • Narrow a ComplyTestControllerResponse to its success arm and optionally assert which success shape it is ('list', 'transition', or 'simulation'). Throws when the response is an error or when the arm doesn't match.

      Returns the narrowed success value so callers skip the if (result.success) boilerplate and access arm-specific fields directly.

      const result = await handleTestControllerRequest(store, {
      scenario: 'force_account_status',
      params: { account_id: 'acct-1', status: 'suspended' },
      });
      const ok = expectControllerSuccess(result, 'transition');
      assert.strictEqual(ok.current_state, 'suspended');

      Parameters

      • result: ComplyTestControllerResponse
      • Optionalkind: "list"

      Returns ListScenariosSuccess

    • Narrow a ComplyTestControllerResponse to its success arm and optionally assert which success shape it is ('list', 'transition', or 'simulation'). Throws when the response is an error or when the arm doesn't match.

      Returns the narrowed success value so callers skip the if (result.success) boilerplate and access arm-specific fields directly.

      const result = await handleTestControllerRequest(store, {
      scenario: 'force_account_status',
      params: { account_id: 'acct-1', status: 'suspended' },
      });
      const ok = expectControllerSuccess(result, 'transition');
      assert.strictEqual(ok.current_state, 'suspended');

      Parameters

      • result: ComplyTestControllerResponse
      • kind: "transition"

      Returns StateTransitionSuccess

    • Narrow a ComplyTestControllerResponse to its success arm and optionally assert which success shape it is ('list', 'transition', or 'simulation'). Throws when the response is an error or when the arm doesn't match.

      Returns the narrowed success value so callers skip the if (result.success) boilerplate and access arm-specific fields directly.

      const result = await handleTestControllerRequest(store, {
      scenario: 'force_account_status',
      params: { account_id: 'acct-1', status: 'suspended' },
      });
      const ok = expectControllerSuccess(result, 'transition');
      assert.strictEqual(ok.current_state, 'suspended');

      Parameters

      • result: ComplyTestControllerResponse
      • kind: "simulation"

      Returns SimulationSuccess

    • Narrow a ComplyTestControllerResponse to its success arm and optionally assert which success shape it is ('list', 'transition', or 'simulation'). Throws when the response is an error or when the arm doesn't match.

      Returns the narrowed success value so callers skip the if (result.success) boilerplate and access arm-specific fields directly.

      const result = await handleTestControllerRequest(store, {
      scenario: 'force_account_status',
      params: { account_id: 'acct-1', status: 'suspended' },
      });
      const ok = expectControllerSuccess(result, 'transition');
      assert.strictEqual(ok.current_state, 'suspended');

      Parameters

      • result: ComplyTestControllerResponse
      • kind: "forced"

      Returns ForcedDirectiveSuccess

    • Narrow to the SeedSuccess arm (3.0.1+ message-only seed acknowledgement).

      Every seed_* scenario returns SeedSuccess ({ success: true, message? }) — both responses produced by the SDK's own dispatchSeed and responses from third-party sellers. Force_* scenarios continue to return StateTransitionSuccess (previous_state / current_state) under kind: 'transition'.

      Parameters

      • result: ComplyTestControllerResponse
      • kind: "seed"

      Returns SeedSuccess

    • Narrow a ComplyTestControllerResponse to its success arm and optionally assert which success shape it is ('list', 'transition', or 'simulation'). Throws when the response is an error or when the arm doesn't match.

      Returns the narrowed success value so callers skip the if (result.success) boilerplate and access arm-specific fields directly.

      const result = await handleTestControllerRequest(store, {
      scenario: 'force_account_status',
      params: { account_id: 'acct-1', status: 'suspended' },
      });
      const ok = expectControllerSuccess(result, 'transition');
      assert.strictEqual(ok.current_state, 'suspended');

      Parameters

      • result: ComplyTestControllerResponse

      Returns AnyControllerSuccess