# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!--
  If you think there are missing entries, go to:
  https://gitlab.com/raytio/raytio-client-v2/-/commits/master/packages/core
  to see all commits that touched this package.
-->

## [Unreleased]

## 11.5.0 (2025-3-30)

- Export TAG_DENYLIST
- Include `verification_type_id` in RealVer object
- Migrate to new API for AA keys

## 11.4.0 (2024-12-18)

- 💥 BREAKING CHANGE: The `createAA` function now requires the application object to include a `customer_id` instead of `org_id`

## 11.3.0 (2023-12-05)

- Migrate to the v3 API for instances

## 11.2.0 (2023-07-03)

- Support key rotation
- Support the new Schema API format

## 11.1.0 (2023-04-20)

- Move `expandSchema` into core

## 11.0.0 (2023-04-20)

- 💥 BREAKING CHANGE: Changed the input arguments of `convertInstanceToRuleInput` to only require a list of `ProfileObject`s, instead of the whole `Instance` object.
- Any profile object with an expired field is now considered `Expired`, even if other fields are verified.
- Fix the `valid_until` attribute being ignored on verifications

## 10.1.0 (2022-07-06)

- move `repairDate` into core, and use it when processing verifications

## 10.0.1 (2022-07-06)

- added 2 methods (`isScoreResultValid` and `isScoreConfigValid`) to verify if stored score-data is valid

## 10.0.0 (2022-04-11)

- 💥 BREAKING CHANGE: `calculateScore` is now an async function, and returns extra diagnostics.

## 9.0.3 (2022-02-22)

- fixed a bug which caused valid live persons to show up as Not Verified.

## 9.0.2 (2022-02-10)

- removed the `UNSAFE_treatNoValueAsVerified` option. This option was never documented or officially supported, so this is not considered a breaking change.
- use the `date_component` schema field tag in date-related code

## 9.0.1 (2022-02-09)

- update `@raytio/types` to v6

## 9.0.0 (2022-02-01)

- 💥 BREAKING CHANGE: the value returned by `getPOVerification` has changed slightly: the `details` property is now an object
- 💥 BREAKING CHANGE: `getRealVerifications` has been removed. It has been replaced by the following two methods:
  - `getSomeoneElsesRealVerifications` is identical to the former `getRealVerifications` - it requires calling the API
  - `getOwnRealVerifications` verifies the signature locally, but can only be used if you're verifying your own data.
- create the `calculateScore` and `convertInstanceToRuleInput` for working with SubmissionRules
- support 1 level of sub-fields in SubmissionRules
- 💥 BREAKING CHANGE: `getSomeoneElsesRealVerifications` now requires you to supply the `aId` of the submission

## 8.1.3 (2021-10-05)

- published updated README.md

## 8.1.2 (2021-09-24)

- update API format for `nId`s that start with `HASHED::`
- move `cleanInstance` to `@raytio/core`

## 8.1.1 (2021-09-15)

- fix a bug with `nId`s that start with `HASHED::`

## 8.1.0 (2021-08-31)

- update `getRealVerifications` to support `nId`s that start with `HASHED::`
- changed the behaviour of `isConditionMet` when the condition is an empty object. It now returns false in this case
- use new format for verify_check API

## 8.0.0 (2021-07-28)

- support conditionally verifiable fields. This only works if the schema is processed by `processSchema`
- added `isConditionMet` to assit conditionally hidden/required/verifiable fields
- 💥 BREAKING CHANGE: `getPOVerification` no longer accepts `allSchema` and `schemaName` as an argument, this has been replaced with `schema`.
- 💥 BREAKING CHANGE: `calcSafeHarbourScore` is now async and no longer accepts `allSchema`, ths has been replaced with an argumnet called `getSchema`.

## 7.0.0 (2021-04-07)

- 💥 BREAKING CHANGE: (TS) `POVerification` and `FieldVerification` are now enums, not string unions
- fixed a commonjs export bug in v6.0.1

## 6.0.1 (2021-04-06)

- update `calcSafeHarbourScore` to ignore duplicate verifications

## 6.0.0 (2021-03-05)

- 💥 BREAKING CHANGE: `decryptSharedData` now return `instance` and `applicationDecryptor`

## 5.0.0 (2021-03-03)

- deps: upgrade maxcryptor to `0.3.0`
- 💥 BREAKING CHANGE: (TS) all IDs (e.g. `n_id`, `a_id`) now use nominal types (e.g. `NId`, `AId`)
- 💥 BREAKING CHANGE: require TypeScipt@4.2 or later

## 4.0.1 (2021-02-05)

- fixed an npm publishing issue with `v4.0.0`

## 4.0.0 (2021-02-04)

- 💥 BREAKING CHANGE: `LABELS_DENYLIST` is no longer exported. It was never documented and there should be no reason to use it. Use `findSchemaLabel` instead.
- 💥 BREAKING CHANGE: `createAA` should be supplied an `org_id` within the `application` attribute, not as a seperate attribute called `orgId`.
- 💥 BREAKING CHANGE: `decryptSharedData` no longer needs an `aId` attribute since it can get that information from the `instance` attribute. This isn't a breaking change per-se, but will cause type errors.
- use `unknown` instead of `any` in some predominantly internal types.

## 3.2.2 (2021-01-19)

- reverted a bug fix from v3.2.1 which was a work-around for badly formatted data.

## 3.2.1 (2021-01-18)

- fixed a bug where verified numbers weren't showing up as verified (reverted in v3.2.2)
- added `onCorruptedData` option to `decryptSharedData`

## 3.2.0 (2021-01-06)

- added `toCognitoAttributes` and `fromCognitoAttributes`
- properly handle errors from all API requests

## 3.1.0 (2020-12-19)

- add function to create an access application (`createAA`)

## 3.0.0 (2020-12-17)

- 💥 BREAKING CHANGE: change safe harbour calculation to compare against a base person, instead of using relationships

## 2.2.0 (2020-12-16)

- add Safe Harbour Compliance calculation (`calcSafeHarbourScore`)

## 2.1.0 (2020-12-11)

- add a new type of [`FieldVerification`](https://www.npmjs.com/package/@raytio/types#fieldverification): `Expired`
- add a new type of [`POVerification`](https://www.npmjs.com/package/@raytio/types#poverification): `Expired`
- add a `expired` attribute to [`RealVer`](https://www.npmjs.com/package/@raytio/types#realver).
- update `getPOVerification` to return `Expired` for verifications where all fields are expired
- [internal] snapshot tests for auto generated documentation

## 2.0.0 (2020-12-07)

- 💥 BREAKING CHANGE: support multiple verifications for the same data. This means that the `details` attribute returned by `getPOVerification` is now an array of [`VerificationProvider`](https://www.npmjs.com/package/@raytio/types#verificationprovider), instead of one [`VerificationProvider`](https://www.npmjs.com/package/@raytio/types#verificationprovider).

## 1.0.4 (2020-12-06)

- fixed a bug where verification details were wrong if the same field name and value were verified by two sources
- include metadata from the verifier in `RealVer`s
- fix a bug where verifications for referenced files weren't working

## 1.0.3 (2020-11-23)

- add `UNSAFE_treatNoValueAsVerified` option to getRealVerifications
- add `date` to `RealVer` type.

## 1.0.2 (2020-11-20)

- `findSchemaLabel` can cope with it's argument being undefined.
- added `"receiverCreated"` to the list of internal labels

## 1.0.1 (2020-11-18)

- `getRealVerifications` no longer requires an `apiToken` argument, since the API is available without authentication.

## 1.0.0 (2020-11-11)

First stable release
