diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index d8c7267..63923bb 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -16,7 +16,8 @@ on: release: types: - published - + schedule: + - cron: "0 12 * * 0" # Every Sunday, at midday jobs: integration-tests: runs-on: ubuntu-latest diff --git a/.release.json b/.release.json index 3e5a1de..ce1ecde 100644 --- a/.release.json +++ b/.release.json @@ -1,9 +1,9 @@ { "source": { "repo_url": "https://github.com/onfido/onfido-openapi-spec", - "short_sha": "08508b9", - "long_sha": "08508b9517238b3becb4265130633a418a8ee319", - "version": "v3.5.0" + "short_sha": "10f8380", + "long_sha": "10f83806efa080edbf022ac48d5eeac90fbceb0c", + "version": "" }, "release": "v3.6.0" } diff --git a/api.ts b/api.ts index c2b72b3..dec02ed 100644 --- a/api.ts +++ b/api.ts @@ -423,11 +423,11 @@ export interface ApplicantBuilder { */ 'phone_number'?: string; /** - * - * @type {ConsentsBuilder} + * The applicant\'s consents + * @type {Array} * @memberof ApplicantBuilder */ - 'consents'?: ConsentsBuilder; + 'consents'?: Array; /** * * @type {AddressBuilder} @@ -453,6 +453,43 @@ export interface ApplicantBuilder { */ 'last_name': string; } +/** + * + * @export + * @interface ApplicantConsentBuilder + */ +export interface ApplicantConsentBuilder { + /** + * + * @type {ApplicantConsentName} + * @memberof ApplicantConsentBuilder + */ + 'name': ApplicantConsentName; + /** + * + * @type {boolean} + * @memberof ApplicantConsentBuilder + */ + 'granted': boolean; +} + + +/** + * + * @export + * @enum {string} + */ + +export const ApplicantConsentName = { + PrivacyNoticesRead: 'privacy_notices_read', + SsnVerification: 'ssn_verification', + PhoneNumberVerification: 'phone_number_verification', + UnknownDefaultOpenApi: '11184809' +} as const; + +export type ApplicantConsentName = typeof ApplicantConsentName[keyof typeof ApplicantConsentName]; + + /** * * @export @@ -479,11 +516,11 @@ export interface ApplicantCreate { */ export interface ApplicantRequest { /** - * - * @type {ConsentsBuilder} + * The applicant\'s consents + * @type {Array} * @memberof ApplicantRequest */ - 'consents'?: ConsentsBuilder; + 'consents'?: Array; /** * * @type {AddressBuilder} @@ -639,11 +676,11 @@ export interface ApplicantUpdater { */ 'phone_number'?: string; /** - * - * @type {ConsentsBuilder} + * The applicant\'s consents + * @type {Array} * @memberof ApplicantUpdater */ - 'consents'?: ConsentsBuilder; + 'consents'?: Array; /** * * @type {AddressBuilder} @@ -718,6 +755,12 @@ export interface Check { * @memberof Check */ 'redirect_uri'?: string; + /** + * + * @type {boolean} + * @memberof Check + */ + 'privacy_notices_read_consent_given'?: boolean; /** * The unique identifier for the check. * @type {string} @@ -737,11 +780,11 @@ export interface Check { */ 'href'?: string; /** - * The current state of the check in the checking process. - * @type {string} + * + * @type {CheckStatus} * @memberof Check */ - 'status'?: CheckStatusEnum; + 'status'?: CheckStatus; /** * The overall result of the check, based on the results of the constituent reports. * @type {string} @@ -772,19 +815,20 @@ export interface Check { * @memberof Check */ 'sandbox'?: boolean; + /** + * + * @type {boolean} + * @memberof Check + */ + 'paused'?: boolean; + /** + * + * @type {string} + * @memberof Check + */ + 'version'?: string; } -export const CheckStatusEnum = { - InProgress: 'in_progress', - AwaitingApplicant: 'awaiting_applicant', - Complete: 'complete', - Withdrawn: 'withdrawn', - Paused: 'paused', - Reopened: 'reopened', - UnknownDefaultOpenApi: '11184809' -} as const; - -export type CheckStatusEnum = typeof CheckStatusEnum[keyof typeof CheckStatusEnum]; export const CheckResultEnum = { Clear: 'clear', Consider: 'consider', @@ -829,6 +873,12 @@ export interface CheckBuilder { * @memberof CheckBuilder */ 'redirect_uri'?: string; + /** + * + * @type {boolean} + * @memberof CheckBuilder + */ + 'privacy_notices_read_consent_given'?: boolean; /** * An array of report names (strings). * @type {Array} @@ -952,11 +1002,11 @@ export interface CheckResponse { */ 'href'?: string; /** - * The current state of the check in the checking process. - * @type {string} + * + * @type {CheckStatus} * @memberof CheckResponse */ - 'status'?: CheckResponseStatusEnum; + 'status'?: CheckStatus; /** * The overall result of the check, based on the results of the constituent reports. * @type {string} @@ -987,19 +1037,20 @@ export interface CheckResponse { * @memberof CheckResponse */ 'sandbox'?: boolean; + /** + * + * @type {boolean} + * @memberof CheckResponse + */ + 'paused'?: boolean; + /** + * + * @type {string} + * @memberof CheckResponse + */ + 'version'?: string; } -export const CheckResponseStatusEnum = { - InProgress: 'in_progress', - AwaitingApplicant: 'awaiting_applicant', - Complete: 'complete', - Withdrawn: 'withdrawn', - Paused: 'paused', - Reopened: 'reopened', - UnknownDefaultOpenApi: '11184809' -} as const; - -export type CheckResponseStatusEnum = typeof CheckResponseStatusEnum[keyof typeof CheckResponseStatusEnum]; export const CheckResponseResultEnum = { Clear: 'clear', Consider: 'consider', @@ -1044,7 +1095,32 @@ export interface CheckShared { * @memberof CheckShared */ 'redirect_uri'?: string; + /** + * + * @type {boolean} + * @memberof CheckShared + */ + 'privacy_notices_read_consent_given'?: boolean; } +/** + * The current state of the check in the checking process. + * @export + * @enum {string} + */ + +export const CheckStatus = { + InProgress: 'in_progress', + AwaitingApplicant: 'awaiting_applicant', + Complete: 'complete', + Withdrawn: 'withdrawn', + Paused: 'paused', + Reopened: 'reopened', + UnknownDefaultOpenApi: '11184809' +} as const; + +export type CheckStatus = typeof CheckStatus[keyof typeof CheckStatus]; + + /** * * @export @@ -1078,42 +1154,6 @@ export interface CompleteTaskBuilder { */ export type CompleteTaskDataBuilder = Array | object; -/** - * The applicant\'s consents - * @export - * @interface ConsentItem - */ -export interface ConsentItem { - /** - * - * @type {string} - * @memberof ConsentItem - */ - 'name': ConsentItemNameEnum; - /** - * - * @type {boolean} - * @memberof ConsentItem - */ - 'granted': boolean; -} - -export const ConsentItemNameEnum = { - PrivacyNoticesRead: 'privacy_notices_read', - SsnVerification: 'ssn_verification', - PhoneNumberVerification: 'phone_number_verification', - UnknownDefaultOpenApi: '11184809' -} as const; - -export type ConsentItemNameEnum = typeof ConsentItemNameEnum[keyof typeof ConsentItemNameEnum]; - -/** - * - * @export - * @interface ConsentsBuilder - */ -export interface ConsentsBuilder { -} /** * * @export @@ -1532,34 +1572,6 @@ export interface DeviceIntelligenceBreakdownPropertiesDevice { * @memberof DeviceIntelligenceBreakdownPropertiesDevice */ 'fake_network_request'?: boolean; - /** - * The true operating system of the device. - * @type {string} - * @memberof DeviceIntelligenceBreakdownPropertiesDevice - * @deprecated - */ - 'true_os'?: string; - /** - * The likelihood of an operating system anomaly between the true OS and the OS sent by the device. - * @type {string} - * @memberof DeviceIntelligenceBreakdownPropertiesDevice - * @deprecated - */ - 'os_anomaly'?: string; - /** - * Whether the device is rooted. - * @type {boolean} - * @memberof DeviceIntelligenceBreakdownPropertiesDevice - * @deprecated - */ - 'rooted'?: boolean; - /** - * Whether the device is controlled via remote software. - * @type {boolean} - * @memberof DeviceIntelligenceBreakdownPropertiesDevice - * @deprecated - */ - 'remote_software'?: boolean; /** * Whether there is highly suspicious traffic related to the IP address. The risk depends on the overall ratio of clear checks on a given IP. * @type {string} @@ -1670,27 +1682,6 @@ export interface DeviceIntelligenceBreakdownPropertiesIp { * @memberof DeviceIntelligenceBreakdownPropertiesIp */ 'address'?: string; - /** - * The likelihood of the network connection being a VPN. - * @type {string} - * @memberof DeviceIntelligenceBreakdownPropertiesIp - * @deprecated - */ - 'vpn_detection'?: string; - /** - * The likelihood of the network connection being a Proxy. - * @type {string} - * @memberof DeviceIntelligenceBreakdownPropertiesIp - * @deprecated - */ - 'proxy_detection'?: string; - /** - * The type of organization that owns this IP address. - * @type {string} - * @memberof DeviceIntelligenceBreakdownPropertiesIp - * @deprecated - */ - 'type'?: string; } /** * @@ -1775,10 +1766,10 @@ export interface Document { 'file_type'?: DocumentFileTypeEnum; /** * The type of document - * @type {string} + * @type {DocumentTypes} * @memberof Document */ - 'type'?: string; + 'type'?: DocumentTypes; /** * The side of the document, if applicable. The possible values are front and back * @type {string} @@ -3754,10 +3745,10 @@ export interface DocumentShared { 'file_type'?: DocumentSharedFileTypeEnum; /** * The type of document - * @type {string} + * @type {DocumentTypes} * @memberof DocumentShared */ - 'type'?: string; + 'type'?: DocumentTypes; /** * The side of the document, if applicable. The possible values are front and back * @type {string} @@ -3827,6 +3818,11 @@ export const DocumentTypes = { ProfessionalQualificationCard: 'professional_qualification_card', ConsularId: 'consular_id', InternationalDrivingLicence: 'international_driving_licence', + HomeOfficeLetter: 'home_office_letter', + BirthCertificate: 'birth_certificate', + VehicleRegistrationCertificate: 'vehicle_registration_certificate', + FormForAffixingTheVisa: 'form_for_affixing_the_visa', + IdentificationNumberDocument: 'identification_number_document', UnknownDefaultOpenApi: '11184809' } as const; @@ -8044,12 +8040,24 @@ export interface TaskItem { * @memberof TaskItem */ 'id'?: string; + /** + * The workflow run id the task belongs to. + * @type {string} + * @memberof TaskItem + */ + 'workflow_run_id'?: string; /** * The identifier for the Task Definition. * @type {string} * @memberof TaskItem */ 'task_def_id'?: string; + /** + * The task definition version. + * @type {string} + * @memberof TaskItem + */ + 'task_def_version'?: string | null; /** * The date and time when the Task was created. * @type {string} @@ -8814,6 +8822,7 @@ export interface WatchlistAmlProperties { * Returns any matches including, but not limited to, name and date of birth of match, aliases and associates, and relevant events and sources. * @type {Array} * @memberof WatchlistAmlProperties + * @deprecated */ 'records'?: Array; } @@ -9685,6 +9694,7 @@ export interface WatchlistStandardProperties { * Returns any matches including, but not limited to, name and date of birth of match, aliases and associates, and relevant events and sources. * @type {Array} * @memberof WatchlistStandardProperties + * @deprecated */ 'records'?: Array; } @@ -9881,6 +9891,38 @@ export interface WebhookEvent { */ 'payload'?: WebhookEventPayload; } +/** + * The current state of the object, if available. + * @export + * @enum {string} + */ + +export const WebhookEventObjectStatus = { + Processing: 'processing', + AwaitingInput: 'awaiting_input', + AwaitingClientInput: 'awaiting_client_input', + Approved: 'approved', + Declined: 'declined', + Review: 'review', + Abandoned: 'abandoned', + Error: 'error', + Started: 'started', + Cancelled: 'cancelled', + Completed: 'completed', + AwaitingData: 'awaiting_data', + AwaitingApproval: 'awaiting_approval', + Complete: 'complete', + Withdrawn: 'withdrawn', + InProgress: 'in_progress', + AwaitingApplicant: 'awaiting_applicant', + Paused: 'paused', + Reopened: 'reopened', + UnknownDefaultOpenApi: '11184809' +} as const; + +export type WebhookEventObjectStatus = typeof WebhookEventObjectStatus[keyof typeof WebhookEventObjectStatus]; + + /** * * @export @@ -9889,10 +9931,10 @@ export interface WebhookEvent { export interface WebhookEventPayload { /** * Indicates the resource affected by this event. - * @type {string} + * @type {WebhookEventResourceType} * @memberof WebhookEventPayload */ - 'resource_type': string; + 'resource_type': WebhookEventResourceType; /** * The event that triggered this webhook. * @type {WebhookEventType} @@ -9906,11 +9948,11 @@ export interface WebhookEventPayload { */ 'object'?: WebhookEventPayloadObject; /** - * The resource affected by this event. - * @type {object} + * + * @type {WebhookEventPayloadResource} * @memberof WebhookEventPayload */ - 'resource'?: object; + 'resource'?: WebhookEventPayloadResource; } @@ -9927,11 +9969,11 @@ export interface WebhookEventPayloadObject { */ 'id': string; /** - * The current state of the object, if available. - * @type {string} + * + * @type {WebhookEventObjectStatus} * @memberof WebhookEventPayloadObject */ - 'status'?: string; + 'status'?: WebhookEventObjectStatus; /** * The date and time when the operation was started, if available. * @type {string} @@ -9951,6 +9993,124 @@ export interface WebhookEventPayloadObject { */ 'href': string; } + + +/** + * The resource affected by this event. + * @export + * @interface WebhookEventPayloadResource + */ +export interface WebhookEventPayloadResource { + /** + * The identifier of the resource. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'id'?: string; + /** + * The unique identifier for the Applicant. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'applicant_id'?: string; + /** + * The date and time when the resource was created. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'created_at'?: string; + /** + * The date and time when the resource was last updated. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'updated_at'?: string; + /** + * The URL for viewing the resource on Onfido Dashboard. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'dashboard_url'?: string; + /** + * The unique identifier for the Workflow. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'workflow_id'?: string; + /** + * + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'workflow_run_id'?: string; + /** + * The identifier for the Workflow version. + * @type {number} + * @memberof WebhookEventPayloadResource + */ + 'workflow_version_id'?: number; + /** + * The identifier for the Task Definition. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'task_def_id'?: string; + /** + * The task definition version. + * @type {string} + * @memberof WebhookEventPayloadResource + */ + 'task_def_version'?: string | null; + /** + * Input object with the fields used by the Task execution. + * @type {object} + * @memberof WebhookEventPayloadResource + */ + 'input'?: object; + /** + * Output object with the fields produced by the Task execution. + * @type {object} + * @memberof WebhookEventPayloadResource + */ + 'output'?: object | null; + /** + * The reasons the Workflow Run outcome was reached. Configurable when creating the Workflow Version. + * @type {Array} + * @memberof WebhookEventPayloadResource + */ + 'reasons'?: Array; + /** + * Object for the configuration of the Workflow Run link. + * @type {WorkflowRunLink} + * @memberof WebhookEventPayloadResource + */ + 'link'?: WorkflowRunLink; + /** + * Error object that details why a Workflow Run is in Error status. + * @type {WorkflowRunError} + * @memberof WebhookEventPayloadResource + */ + 'error'?: WorkflowRunError; +} +/** + * + * @export + * @enum {string} + */ + +export const WebhookEventResourceType = { + Check: 'check', + Report: 'report', + AuditLog: 'audit_log', + WorkflowRun: 'workflow_run', + WorkflowTask: 'workflow_task', + WatchlistMonitor: 'watchlist_monitor', + UnknownDefaultOpenApi: '11184809' +} as const; + +export type WebhookEventResourceType = typeof WebhookEventResourceType[keyof typeof WebhookEventResourceType]; + + /** * * @export @@ -10171,11 +10331,11 @@ export interface WorkflowRun { */ 'customer_user_id'?: string; /** - * - * @type {WorkflowRunSharedLink} + * Object for the configuration of the Workflow Run link. + * @type {WorkflowRunLink} * @memberof WorkflowRun */ - 'link'?: WorkflowRunSharedLink; + 'link'?: WorkflowRunLink; /** * The date and time when the Workflow Run was created. * @type {string} @@ -10208,10 +10368,10 @@ export interface WorkflowRun { 'dashboard_url'?: string; /** * The status of the Workflow Run. - * @type {string} + * @type {WorkflowRunStatus} * @memberof WorkflowRun */ - 'status'?: WorkflowRunStatusEnum; + 'status'?: WorkflowRunStatus; /** * Output object contains all of the properties configured on the Workflow version. * @type {object} @@ -10225,11 +10385,11 @@ export interface WorkflowRun { */ 'reasons'?: Array; /** - * - * @type {WorkflowRunResponseError} + * Error object. Only set when the Workflow Run status is \'error\'. + * @type {WorkflowRunError} * @memberof WorkflowRun */ - 'error'?: WorkflowRunResponseError; + 'error'?: WorkflowRunError; /** * Client token to use when loading this workflow run in the Onfido SDK. * @type {string} @@ -10238,18 +10398,6 @@ export interface WorkflowRun { 'sdk_token'?: string | null; } -export const WorkflowRunStatusEnum = { - AwaitingInput: 'awaiting_input', - Processing: 'processing', - Abandoned: 'abandoned', - Error: 'error', - Approved: 'approved', - Review: 'review', - Declined: 'declined', - UnknownDefaultOpenApi: '11184809' -} as const; - -export type WorkflowRunStatusEnum = typeof WorkflowRunStatusEnum[keyof typeof WorkflowRunStatusEnum]; /** * @@ -10282,11 +10430,11 @@ export interface WorkflowRunBuilder { */ 'customer_user_id'?: string; /** - * - * @type {WorkflowRunSharedLink} + * Object for the configuration of the Workflow Run link. + * @type {WorkflowRunLink} * @memberof WorkflowRunBuilder */ - 'link'?: WorkflowRunSharedLink; + 'link'?: WorkflowRunLink; /** * The date and time when the Workflow Run was created. * @type {string} @@ -10306,6 +10454,76 @@ export interface WorkflowRunBuilder { */ 'custom_data'?: { [key: string]: any; }; } +/** + * + * @export + * @interface WorkflowRunError + */ +export interface WorkflowRunError { + /** + * The type of error. + * @type {string} + * @memberof WorkflowRunError + */ + 'type'?: string; + /** + * A textual description of the error. + * @type {string} + * @memberof WorkflowRunError + */ + 'message'?: string; +} +/** + * + * @export + * @interface WorkflowRunLink + */ +export interface WorkflowRunLink { + /** + * Link to access the Workflow Run without the need to integrate with Onfido\'s SDKs. + * @type {string} + * @memberof WorkflowRunLink + */ + 'url'?: string; + /** + * When the interactive section of the Workflow Run has completed successfully, the user will be redirected to this URL instead of seeing the default Onfido \'thank you\' page. + * @type {string} + * @memberof WorkflowRunLink + */ + 'completed_redirect_url'?: string | null; + /** + * When the link has expired, the user will be immediately redirected to this URL instead of seeing the default Onfido error message. + * @type {string} + * @memberof WorkflowRunLink + */ + 'expired_redirect_url'?: string | null; + /** + * Date and time when the link will expire. + * @type {string} + * @memberof WorkflowRunLink + */ + 'expires_at'?: string | null; + /** + * The code for the language when the workflow run is acessed using the link. + * @type {string} + * @memberof WorkflowRunLink + */ + 'language'?: WorkflowRunLinkLanguageEnum | null; +} + +export const WorkflowRunLinkLanguageEnum = { + EnUs: 'en_US', + DeDe: 'de_DE', + EsEs: 'es_ES', + FrFr: 'fr_FR', + ItIt: 'it_IT', + PtPt: 'pt_PT', + NlNl: 'nl_NL', + UnknownDefaultOpenApi: '11184809' +} as const; + +export type WorkflowRunLinkLanguageEnum = typeof WorkflowRunLinkLanguageEnum[keyof typeof WorkflowRunLinkLanguageEnum]; + /** * * @export @@ -10345,10 +10563,10 @@ export interface WorkflowRunResponse { 'dashboard_url'?: string; /** * The status of the Workflow Run. - * @type {string} + * @type {WorkflowRunStatus} * @memberof WorkflowRunResponse */ - 'status'?: WorkflowRunResponseStatusEnum; + 'status'?: WorkflowRunStatus; /** * Output object contains all of the properties configured on the Workflow version. * @type {object} @@ -10362,11 +10580,11 @@ export interface WorkflowRunResponse { */ 'reasons'?: Array; /** - * - * @type {WorkflowRunResponseError} + * Error object. Only set when the Workflow Run status is \'error\'. + * @type {WorkflowRunError} * @memberof WorkflowRunResponse */ - 'error'?: WorkflowRunResponseError; + 'error'?: WorkflowRunError; /** * Client token to use when loading this workflow run in the Onfido SDK. * @type {string} @@ -10375,38 +10593,7 @@ export interface WorkflowRunResponse { 'sdk_token'?: string | null; } -export const WorkflowRunResponseStatusEnum = { - AwaitingInput: 'awaiting_input', - Processing: 'processing', - Abandoned: 'abandoned', - Error: 'error', - Approved: 'approved', - Review: 'review', - Declined: 'declined', - UnknownDefaultOpenApi: '11184809' -} as const; - -export type WorkflowRunResponseStatusEnum = typeof WorkflowRunResponseStatusEnum[keyof typeof WorkflowRunResponseStatusEnum]; -/** - * Error object. Only set when the Workflow Run status is \'error\'. - * @export - * @interface WorkflowRunResponseError - */ -export interface WorkflowRunResponseError { - /** - * The type of error. - * @type {string} - * @memberof WorkflowRunResponseError - */ - 'type'?: string; - /** - * A textual description of the error. - * @type {string} - * @memberof WorkflowRunResponseError - */ - 'message'?: string; -} /** * * @export @@ -10438,11 +10625,11 @@ export interface WorkflowRunShared { */ 'customer_user_id'?: string; /** - * - * @type {WorkflowRunSharedLink} + * Object for the configuration of the Workflow Run link. + * @type {WorkflowRunLink} * @memberof WorkflowRunShared */ - 'link'?: WorkflowRunSharedLink; + 'link'?: WorkflowRunLink; /** * The date and time when the Workflow Run was created. * @type {string} @@ -10457,55 +10644,25 @@ export interface WorkflowRunShared { 'updated_at'?: string; } /** - * Object for the configuration of the Workflow Run link. + * * @export - * @interface WorkflowRunSharedLink + * @enum {string} */ -export interface WorkflowRunSharedLink { - /** - * Link to access the Workflow Run without the need to integrate with Onfido\'s SDKs. - * @type {string} - * @memberof WorkflowRunSharedLink - */ - 'url'?: string; - /** - * When the interactive section of the Workflow Run has completed successfully, the user will be redirected to this URL instead of seeing the default Onfido \'thank you\' page. - * @type {string} - * @memberof WorkflowRunSharedLink - */ - 'completed_redirect_url'?: string; - /** - * When the link has expired, the user will be immediately redirected to this URL instead of seeing the default Onfido error message. - * @type {string} - * @memberof WorkflowRunSharedLink - */ - 'expired_redirect_url'?: string; - /** - * Date and time when the link will expire. - * @type {string} - * @memberof WorkflowRunSharedLink - */ - 'expires_at'?: string; - /** - * The code for the language when the workflow run is acessed using the link. - * @type {string} - * @memberof WorkflowRunSharedLink - */ - 'language'?: WorkflowRunSharedLinkLanguageEnum; -} -export const WorkflowRunSharedLinkLanguageEnum = { - EnUs: 'en_US', - DeDe: 'de_DE', - EsEs: 'es_ES', - FrFr: 'fr_FR', - ItIt: 'it_IT', - PtPt: 'pt_PT', - NlNl: 'nl_NL', +export const WorkflowRunStatus = { + Processing: 'processing', + AwaitingInput: 'awaiting_input', + AwaitingClientInput: 'awaiting_client_input', + Approved: 'approved', + Declined: 'declined', + Review: 'review', + Abandoned: 'abandoned', + Error: 'error', UnknownDefaultOpenApi: '11184809' } as const; -export type WorkflowRunSharedLinkLanguageEnum = typeof WorkflowRunSharedLinkLanguageEnum[keyof typeof WorkflowRunSharedLinkLanguageEnum]; +export type WorkflowRunStatus = typeof WorkflowRunStatus[keyof typeof WorkflowRunStatus]; + /** @@ -12935,7 +13092,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati /** * Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB. * @summary Upload a document - * @param {string} type The type of document + * @param {DocumentTypes} type The type of document * @param {string} applicantId The ID of the applicant whose document is being uploaded. * @param {FileTransfer} file The file to be uploaded. * @param {UploadDocumentFileTypeEnum} [fileType] The file type of the uploaded file @@ -12946,7 +13103,7 @@ export const DefaultApiAxiosParamCreator = function (configuration?: Configurati * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadDocument: async (type: string, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options: RawAxiosRequestConfig = {}): Promise => { + uploadDocument: async (type: DocumentTypes, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'type' is not null or undefined assertParamExists('uploadDocument', 'type', type) // verify required parameter 'applicantId' is not null or undefined @@ -13946,7 +14103,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { /** * Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB. * @summary Upload a document - * @param {string} type The type of document + * @param {DocumentTypes} type The type of document * @param {string} applicantId The ID of the applicant whose document is being uploaded. * @param {FileTransfer} file The file to be uploaded. * @param {UploadDocumentFileTypeEnum} [fileType] The file type of the uploaded file @@ -13957,7 +14114,7 @@ export const DefaultApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async uploadDocument(type: string, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + async uploadDocument(type: DocumentTypes, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.uploadDocument(type, applicantId, file, fileType, side, issuingCountry, validateImageQuality, location, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['DefaultApi.uploadDocument']?.[localVarOperationServerIndex]?.url; @@ -14638,7 +14795,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa /** * Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB. * @summary Upload a document - * @param {string} type The type of document + * @param {DocumentTypes} type The type of document * @param {string} applicantId The ID of the applicant whose document is being uploaded. * @param {FileTransfer} file The file to be uploaded. * @param {UploadDocumentFileTypeEnum} [fileType] The file type of the uploaded file @@ -14649,7 +14806,7 @@ export const DefaultApiFactory = function (configuration?: Configuration, basePa * @param {*} [options] Override http request option. * @throws {RequiredError} */ - uploadDocument(type: string, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options?: any): AxiosPromise { + uploadDocument(type: DocumentTypes, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options?: any): AxiosPromise { return localVarFp.uploadDocument(type, applicantId, file, fileType, side, issuingCountry, validateImageQuality, location, options).then((request) => request(axios, basePath)); }, /** @@ -15445,7 +15602,7 @@ export class DefaultApi extends BaseAPI { /** * Documents are uploaded using this endpoint. Along with the file upload the relevant document type must be specified. Documents must be uploaded as a multipart form. The valid file types are: jpg, png and pdf. The file size must be between 2KB and 3MB. * @summary Upload a document - * @param {string} type The type of document + * @param {DocumentTypes} type The type of document * @param {string} applicantId The ID of the applicant whose document is being uploaded. * @param {FileTransfer} file The file to be uploaded. * @param {UploadDocumentFileTypeEnum} [fileType] The file type of the uploaded file @@ -15457,7 +15614,7 @@ export class DefaultApi extends BaseAPI { * @throws {RequiredError} * @memberof DefaultApi */ - public uploadDocument(type: string, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options?: RawAxiosRequestConfig) { + public uploadDocument(type: DocumentTypes, applicantId: string, file: FileTransfer, fileType?: UploadDocumentFileTypeEnum, side?: UploadDocumentSideEnum, issuingCountry?: CountryCodes, validateImageQuality?: boolean, location?: LocationBuilder, options?: RawAxiosRequestConfig) { return DefaultApiFp(this.configuration).uploadDocument(type, applicantId, file, fileType, side, issuingCountry, validateImageQuality, location, options).then((request) => request(this.axios, this.basePath)); } diff --git a/package-lock.json b/package-lock.json index 7cc0c93..62102f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,12 +36,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", - "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", + "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", "dev": true, "dependencies": { - "@babel/highlight": "^7.24.7", + "@babel/highlight": "^7.25.7", "picocolors": "^1.0.0" }, "engines": { @@ -49,30 +49,30 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.4.tgz", - "integrity": "sha512-+LGRog6RAsCJrrrg/IO6LGmpphNe5DiK30dGjCoxxeGv49B10/3XYGxPsAwrDlMFcFEvdAUavDT8r9k/hSyQqQ==", + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.25.8.tgz", + "integrity": "sha512-ZsysZyXY4Tlx+Q53XdnOFmqwfB9QDTHYxaZYajWRoBLuLEAwI2UIbtxOjWh/cFaa9IKUlcB+DDuoskLuKu56JA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.2.tgz", - "integrity": "sha512-BBt3opiCOxUr9euZ5/ro/Xv8/V7yJ5bjYMqG/C1YAo8MIKAnumZalCN+msbci3Pigy4lIQfPUpfMM27HMGaYEA==", + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.25.8.tgz", + "integrity": "sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.0", - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.0", - "@babel/helper-compilation-targets": "^7.25.2", - "@babel/helper-module-transforms": "^7.25.2", - "@babel/helpers": "^7.25.0", - "@babel/parser": "^7.25.0", - "@babel/template": "^7.25.0", - "@babel/traverse": "^7.25.2", - "@babel/types": "^7.25.2", + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/helper-compilation-targets": "^7.25.7", + "@babel/helper-module-transforms": "^7.25.7", + "@babel/helpers": "^7.25.7", + "@babel/parser": "^7.25.8", + "@babel/template": "^7.25.7", + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.8", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -94,29 +94,29 @@ "dev": true }, "node_modules/@babel/generator": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.6.tgz", - "integrity": "sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", + "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", "dev": true, "dependencies": { - "@babel/types": "^7.25.6", + "@babel/types": "^7.25.7", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", - "jsesc": "^2.5.1" + "jsesc": "^3.0.2" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.2.tgz", - "integrity": "sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.7.tgz", + "integrity": "sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.25.2", - "@babel/helper-validator-option": "^7.24.8", - "browserslist": "^4.23.1", + "@babel/compat-data": "^7.25.7", + "@babel/helper-validator-option": "^7.25.7", + "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" }, @@ -125,28 +125,28 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz", - "integrity": "sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", + "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.2", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.2.tgz", - "integrity": "sha512-BjyRAbix6j/wv83ftcVJmBt72QtHI56C7JXZoG2xATiLpmoC7dpd8WnkikExHDVPpi/3qCmO6WY1EaXOluiecQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", + "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.24.7", - "@babel/helper-simple-access": "^7.24.7", - "@babel/helper-validator-identifier": "^7.24.7", - "@babel/traverse": "^7.25.2" + "@babel/helper-module-imports": "^7.25.7", + "@babel/helper-simple-access": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", + "@babel/traverse": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -156,74 +156,74 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.8.tgz", - "integrity": "sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", + "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz", - "integrity": "sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", + "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", "dev": true, "dependencies": { - "@babel/traverse": "^7.24.7", - "@babel/types": "^7.24.7" + "@babel/traverse": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.8.tgz", - "integrity": "sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", + "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", - "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", + "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.24.8", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.24.8.tgz", - "integrity": "sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", + "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.6.tgz", - "integrity": "sha512-Xg0tn4HcfTijTwfDwYlvVCl43V6h4KyVVX2aEm4qdO/PC6L2YvzLHFdmxhoeSA3eslcE6+ZVXHgWwopXYLNq4Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.25.7.tgz", + "integrity": "sha512-Sv6pASx7Esm38KQpF/U/OXLwPPrdGHNKoeblRxgZRLXnAtnkEe4ptJPDtAZM7fBLadbc1Q07kQpSiGQ0Jg6tRA==", "dev": true, "dependencies": { - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.6" + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.24.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", - "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", + "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.24.7", + "@babel/helper-validator-identifier": "^7.25.7", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -304,12 +304,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", - "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", + "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", "dev": true, "dependencies": { - "@babel/types": "^7.25.6" + "@babel/types": "^7.25.8" }, "bin": { "parser": "bin/babel-parser.js" @@ -370,12 +370,12 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.6.tgz", - "integrity": "sha512-sXaDXaJN9SNLymBdlWFA+bjzBhFD617ZaFiY13dGt7TVslVvVgA6fkZOP7Ki3IGElC45lwHdOTrCtKZGVAWeLQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.25.7.tgz", + "integrity": "sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.24.8" + "@babel/helper-plugin-utils": "^7.25.7" }, "engines": { "node": ">=6.9.0" @@ -511,30 +511,30 @@ } }, "node_modules/@babel/template": { - "version": "7.25.0", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.0.tgz", - "integrity": "sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", + "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/parser": "^7.25.0", - "@babel/types": "^7.25.0" + "@babel/code-frame": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/types": "^7.25.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.6.tgz", - "integrity": "sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==", + "version": "7.25.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", + "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.24.7", - "@babel/generator": "^7.25.6", - "@babel/parser": "^7.25.6", - "@babel/template": "^7.25.0", - "@babel/types": "^7.25.6", + "@babel/code-frame": "^7.25.7", + "@babel/generator": "^7.25.7", + "@babel/parser": "^7.25.7", + "@babel/template": "^7.25.7", + "@babel/types": "^7.25.7", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -543,13 +543,13 @@ } }, "node_modules/@babel/types": { - "version": "7.25.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", - "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", + "version": "7.25.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", + "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.24.8", - "@babel/helper-validator-identifier": "^7.24.7", + "@babel/helper-string-parser": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1052,9 +1052,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "version": "8.13.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.13.0.tgz", + "integrity": "sha512-8zSiw54Oxrdym50NlZ9sUusyO1Z1ZchgRLWRaK6c86XJFClyCgFKetdowBg5bKxyp/u+CDBJG4Mpp0m3HLZl9w==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1415,9 +1415,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.23.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.3.tgz", - "integrity": "sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==", + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.0.tgz", + "integrity": "sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==", "dev": true, "funding": [ { @@ -1434,8 +1434,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001646", - "electron-to-chromium": "^1.5.4", + "caniuse-lite": "^1.0.30001663", + "electron-to-chromium": "^1.5.28", "node-releases": "^2.0.18", "update-browserslist-db": "^1.1.0" }, @@ -1512,9 +1512,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001662", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001662.tgz", - "integrity": "sha512-sgMUVwLmGseH8ZIrm1d51UbrhqMCH3jvS7gF/M6byuHOnKyLOBL7W8yz5V02OHwgLGA36o/AFhWzzh4uc5aqTA==", + "version": "1.0.30001669", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001669.tgz", + "integrity": "sha512-DlWzFDJqstqtIVx1zeSpIMLjunf5SmwOw0N2Ck/QSQdS8PLS4+9HrLaYei4w8BIAL7IB/UEDu889d8vhCTPA0w==", "dev": true, "funding": [ { @@ -1895,9 +1895,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.25", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.25.tgz", - "integrity": "sha512-kMb204zvK3PsSlgvvwzI3wBIcAw15tRkYk+NQdsjdDtcQWTp2RABbMQ9rUBy8KNEOM+/E6ep+XC3AykiWZld4g==", + "version": "1.5.41", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.41.tgz", + "integrity": "sha512-dfdv/2xNjX0P8Vzme4cfzHqnPm5xsZXwsolTYr0eyW18IUmNyG08vL+fttvinTfhKfIKdRoqkDIC9e9iWQCNYQ==", "dev": true }, "node_modules/emittery": { @@ -2274,9 +2274,9 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3523,9 +3523,9 @@ } }, "node_modules/jsdom/node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.2.tgz", + "integrity": "sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ==", "dev": true, "dependencies": { "asynckit": "^0.4.0", @@ -3537,15 +3537,15 @@ } }, "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", + "integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==", "dev": true, "bin": { "jsesc": "bin/jsesc" }, "engines": { - "node": ">=4" + "node": ">=6" } }, "node_modules/json-parse-even-better-errors": { @@ -3905,9 +3905,9 @@ } }, "node_modules/nwsapi": { - "version": "2.2.12", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.12.tgz", - "integrity": "sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w==", + "version": "2.2.13", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.13.tgz", + "integrity": "sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ==", "dev": true }, "node_modules/object-copy": { @@ -4133,9 +4133,9 @@ "dev": true }, "node_modules/picocolors": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", - "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", "dev": true }, "node_modules/picomatch": { @@ -5552,9 +5552,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", - "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", + "integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==", "dev": true, "funding": [ { @@ -5571,8 +5571,8 @@ } ], "dependencies": { - "escalade": "^3.1.2", - "picocolors": "^1.0.1" + "escalade": "^3.2.0", + "picocolors": "^1.1.0" }, "bin": { "update-browserslist-db": "cli.js" diff --git a/test/webhook-event-verifier.test.ts b/test/classic-webhook-event-verifier.test.ts similarity index 83% rename from test/webhook-event-verifier.test.ts rename to test/classic-webhook-event-verifier.test.ts index a620440..0277291 100644 --- a/test/webhook-event-verifier.test.ts +++ b/test/classic-webhook-event-verifier.test.ts @@ -1,4 +1,10 @@ -import { OnfidoInvalidSignatureError, WebhookEventVerifier } from "onfido-node"; +import { + OnfidoInvalidSignatureError, + WebhookEventVerifier, + WebhookEventType, + WebhookEventResourceType, + WebhookEventObjectStatus +} from "onfido-node"; const webhookToken = "_ABC123abc123ABC123abc123ABC123_"; const verifier = new WebhookEventVerifier(webhookToken); @@ -7,12 +13,12 @@ const rawEvent = `{"payload":{"resource_type":"check","action":"check.completed" const expectedEvent = { payload: { - action: "check.completed", - resource_type: "check", + action: WebhookEventType.CheckCompleted, + resource_type: WebhookEventResourceType.Check, object: { id: "check-123", href: "https://api.onfido.com/v3/checks/check-123", - status: "complete", + status: WebhookEventObjectStatus.Complete, completed_at_iso8601: "2020-01-01T00:00:00Z" } } diff --git a/test/resources/applicants.test.ts b/test/resources/applicants.test.ts index a9ccb41..1bae13a 100644 --- a/test/resources/applicants.test.ts +++ b/test/resources/applicants.test.ts @@ -1,4 +1,4 @@ -import { Applicant } from "onfido-node"; +import { Applicant, ApplicantConsentName } from "onfido-node"; import { onfido, @@ -66,7 +66,15 @@ it("restores an applicant", async () => { it("lists applicants", async () => { const anotherApplicant = { ...exampleApplicant, first_name: "Another" }; - await createApplicant({ first_name: "Another" }); + await createApplicant({ + first_name: "Another", + consents: [ + { + name: ApplicantConsentName.PrivacyNoticesRead, + granted: true + } + ] + }); const applicants = await onfido.listApplicants(1, 20, false); diff --git a/test/resources/checks.test.ts b/test/resources/checks.test.ts index 3b26cd7..2b366e2 100644 --- a/test/resources/checks.test.ts +++ b/test/resources/checks.test.ts @@ -1,4 +1,4 @@ -import { Applicant, Check, Document, Webhook } from "onfido-node"; +import { Applicant, Check, Document, Webhook, CheckStatus } from "onfido-node"; import { onfido, @@ -54,14 +54,16 @@ afterAll(() => { it("creates a check", async () => { const check = await createCheck(applicant, document, { - webhook_ids: [webhook1.id, webhook2.id] + webhook_ids: [webhook1.id, webhook2.id], + privacy_notices_read_consent_given: true }); expect(check.data).toEqual( getExpectedCheck(exampleCheck, { applicant_id: applicant.id, result: null, - status: "in_progress" + status: CheckStatus.InProgress, + privacy_notices_read_consent_given: true }) ); }); @@ -76,7 +78,7 @@ it("creates a check for generating a rejected sub-result for document report in getExpectedCheck(exampleCheck, { applicant_id: applicant.id, result: null, - status: "in_progress" + status: CheckStatus.InProgress }) ); }); @@ -91,7 +93,7 @@ it("creates a check for generating a consider result for a report in the sandbox getExpectedCheck(exampleCheck, { applicant_id: applicant.id, result: null, - status: "in_progress" + status: CheckStatus.InProgress }) ); }); diff --git a/test/resources/documents.test.ts b/test/resources/documents.test.ts index 5182f52..5d230ac 100644 --- a/test/resources/documents.test.ts +++ b/test/resources/documents.test.ts @@ -1,4 +1,4 @@ -import { Applicant, Document } from "onfido-node"; +import { Applicant, Document, DocumentTypes } from "onfido-node"; import { onfido, @@ -39,7 +39,7 @@ it("uploads a document", async () => { it("uploads a document with location", async () => { document = ( - await uploadDocument(applicant, "driving_licence", { + await uploadDocument(applicant, DocumentTypes.DrivingLicence, { country_of_residence: "FRA" }) ).data; @@ -61,7 +61,9 @@ it("finds a document", async () => { }); it("lists documents", async () => { - const anotherDocument = (await uploadDocument(applicant, "passport")).data; + const anotherDocument = ( + await uploadDocument(applicant, DocumentTypes.Passport) + ).data; const documents = ( await onfido.listDocuments(applicant.id) ).data.documents.sort(sortByDocumentType); diff --git a/test/resources/qualified-electronic-signature.test.ts b/test/resources/qualified-electronic-signature.test.ts index 4a52e1d..6c3f1c4 100644 --- a/test/resources/qualified-electronic-signature.test.ts +++ b/test/resources/qualified-electronic-signature.test.ts @@ -42,7 +42,7 @@ it("downloads a signed document file", async () => { const workflowRun = await createWorkflowRunWithCustomInputs( workflowRunBuilder ); - const taskId = (await onfido.listTasks(workflowRun.data.id)).data[0].id; + const taskId = (await onfido.listTasks(workflowRun.data.id)).data[1].id; const output = ( await repeatRequestUntilTaskOutputChanges( diff --git a/test/resources/tasks.test.ts b/test/resources/tasks.test.ts index e9d0b1f..ca46976 100644 --- a/test/resources/tasks.test.ts +++ b/test/resources/tasks.test.ts @@ -51,7 +51,10 @@ it("finds a task", async () => { const task = await onfido.findTask(workflowRunId, taskId); expect(task.data).toEqual( - getExpectedTask(exampleTask, { input: expect.anything(), output: null }) + getExpectedTask(exampleTask, { + input: expect.anything(), + output: expect.anything() + }) ); }); diff --git a/test/studio-webhook-event-verifier.test.ts b/test/studio-webhook-event-verifier.test.ts new file mode 100644 index 0000000..38e53f6 --- /dev/null +++ b/test/studio-webhook-event-verifier.test.ts @@ -0,0 +1,72 @@ +import { + OnfidoInvalidSignatureError, + WebhookEventVerifier, + WebhookEventType, + WebhookEventResourceType, + WebhookEventObjectStatus +} from "onfido-node"; + +const webhookToken = "YKOC6mkBxi6yK2zlUIrLMvsJMFEZObP5"; +const verifier = new WebhookEventVerifier(webhookToken); + +const rawEvent = `{"payload":{"resource_type":"workflow_task","action":"workflow_task.started","object":{"id":"profile_1eb92","task_spec_id":"profile_1eb92","task_def_id":"profile_data","workflow_run_id":"bc77c6e5-753a-4580-96a6-aaed3e5a8d19","status":"started","started_at_iso8601":"2024-07-10T12:49:09Z","href":"https://api.eu.onfido.com/v3.6/workflow_runs/bc77c6e5-753a-4580-96a6-aaed3e5a8d19/tasks/profile_1eb92"},"resource":{"created_at":"2024-07-10T12:49:09Z","id":"profile_1eb92","workflow_run_id":"bc77c6e5-753a-4580-96a6-aaed3e5a8d19","updated_at":"2024-07-10T12:49:09Z","input":{},"task_def_version":null,"task_def_id":"profile_data","output":null}}}`; + +const expectedEvent = { + payload: { + action: WebhookEventType.WorkflowTaskStarted, + resource_type: WebhookEventResourceType.WorkflowTask, + object: { + id: "profile_1eb92", + href: + "https://api.eu.onfido.com/v3.6/workflow_runs/bc77c6e5-753a-4580-96a6-aaed3e5a8d19/tasks/profile_1eb92", + status: WebhookEventObjectStatus.Started, + started_at_iso8601: "2024-07-10T12:49:09Z", + task_def_id: "profile_data", + task_spec_id: "profile_1eb92", + workflow_run_id: "bc77c6e5-753a-4580-96a6-aaed3e5a8d19" + }, + resource: { + created_at: "2024-07-10T12:49:09Z", + id: "profile_1eb92", + input: {}, + output: null, + task_def_id: "profile_data", + task_def_version: null, + updated_at: "2024-07-10T12:49:09Z", + workflow_run_id: "bc77c6e5-753a-4580-96a6-aaed3e5a8d19" + } + } +}; + +it("returns the event if the signature is valid", () => { + const signature = + "c95a5b785484f6fa1bc25f381b5595d66bf85cb442eefb06aa007802ee6a4dfa"; + + const event = verifier.readPayload(rawEvent, signature); + + expect(event).toEqual(expectedEvent); +}); + +it("allows passing the body as a buffer", () => { + const signature = + "c95a5b785484f6fa1bc25f381b5595d66bf85cb442eefb06aa007802ee6a4dfa"; + + const event = verifier.readPayload(Buffer.from(rawEvent), signature); + + expect(event).toEqual(expectedEvent); + expect(event.payload.object.href).toEqual( + "https://api.eu.onfido.com/v3.6/workflow_runs/bc77c6e5-753a-4580-96a6-aaed3e5a8d19/tasks/profile_1eb92" + ); + + // Test alternative way to access fields (it also works for additional properties) + expect(event.payload.object["status"]).toEqual("started"); +}); + +it("throws an error if the signature is invalid", () => { + const signature = + "c95a5b785484f6fa1bc25f381b5595d66bf85cb442eefb06aa007802ee6a4dfb"; + + expect(() => verifier.readPayload(rawEvent, signature)).toThrow( + OnfidoInvalidSignatureError + ); +}); diff --git a/test/test-helpers.ts b/test/test-helpers.ts index b034d06..955c461 100644 --- a/test/test-helpers.ts +++ b/test/test-helpers.ts @@ -16,7 +16,8 @@ import { MotionCapture, Report, WatchlistMonitorReportNameEnum, - WorkflowRunBuilder + WorkflowRunBuilder, + DocumentTypes } from "onfido-node"; export const onfido = new DefaultApi( @@ -91,12 +92,21 @@ export async function cleanUpApplicants() { export async function uploadDocument( applicant: Applicant, - documentType = "driving_licence", + documentType: DocumentTypes = DocumentTypes.DrivingLicence, location?: LocationBuilder ) { let fileTransfer = new FileTransfer("test/media/sample_driving_licence.png"); - return onfido.uploadDocument(documentType, applicant.id, fileTransfer, undefined, undefined, undefined, undefined, location); + return onfido.uploadDocument( + documentType, + applicant.id, + fileTransfer, + undefined, + undefined, + undefined, + undefined, + location + ); } export async function uploadLivePhoto(