@onfido/api 2.9.0 → 3.1.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.
Files changed (58) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +138 -132
  3. package/dist/api.d.ts +12036 -0
  4. package/dist/api.js +5284 -0
  5. package/dist/base.d.ts +66 -0
  6. package/dist/base.js +65 -0
  7. package/dist/common.d.ts +66 -0
  8. package/dist/common.js +162 -0
  9. package/dist/configuration.d.ts +93 -0
  10. package/dist/configuration.js +53 -0
  11. package/dist/esm/api.d.ts +12036 -0
  12. package/dist/esm/api.js +5277 -0
  13. package/dist/esm/base.d.ts +66 -0
  14. package/dist/esm/base.js +60 -0
  15. package/dist/esm/common.d.ts +66 -0
  16. package/dist/esm/common.js +150 -0
  17. package/dist/esm/configuration.d.ts +93 -0
  18. package/dist/esm/configuration.js +49 -0
  19. package/dist/esm/file-transfer.d.ts +10 -0
  20. package/dist/esm/file-transfer.js +13 -0
  21. package/dist/esm/index.d.ts +15 -0
  22. package/dist/esm/index.js +17 -0
  23. package/dist/esm/webhook-event-verifier.d.ts +9 -0
  24. package/dist/esm/webhook-event-verifier.js +31 -0
  25. package/dist/file-transfer.d.ts +10 -0
  26. package/dist/file-transfer.js +17 -0
  27. package/dist/index.d.ts +15 -19
  28. package/dist/index.js +32 -553
  29. package/dist/webhook-event-verifier.d.ts +9 -0
  30. package/dist/webhook-event-verifier.js +36 -0
  31. package/package.json +30 -31
  32. package/CHANGELOG.md +0 -121
  33. package/dist/Onfido.d.ts +0 -40
  34. package/dist/OnfidoDownload.d.ts +0 -9
  35. package/dist/Resource.d.ts +0 -22
  36. package/dist/WebhookEventVerifier.d.ts +0 -17
  37. package/dist/errors/OnfidoApiError.d.ts +0 -10
  38. package/dist/errors/OnfidoError.d.ts +0 -3
  39. package/dist/formatting.d.ts +0 -16
  40. package/dist/index.es.js +0 -544
  41. package/dist/index.es.js.map +0 -1
  42. package/dist/index.js.map +0 -1
  43. package/dist/resources/Addresses.d.ts +0 -27
  44. package/dist/resources/Applicants.d.ts +0 -44
  45. package/dist/resources/Autofill.d.ts +0 -37
  46. package/dist/resources/Checks.d.ts +0 -42
  47. package/dist/resources/ConsentsRequest.d.ts +0 -4
  48. package/dist/resources/Documents.d.ts +0 -34
  49. package/dist/resources/IdNumbers.d.ts +0 -10
  50. package/dist/resources/LivePhotos.d.ts +0 -25
  51. package/dist/resources/LiveVideos.d.ts +0 -19
  52. package/dist/resources/Location.d.ts +0 -8
  53. package/dist/resources/MotionCaptures.d.ts +0 -19
  54. package/dist/resources/Reports.d.ts +0 -24
  55. package/dist/resources/SdkTokens.d.ts +0 -12
  56. package/dist/resources/Webhooks.d.ts +0 -26
  57. package/dist/resources/WorkflowRuns.d.ts +0 -48
  58. package/dist/types/formData.d.ts +0 -27
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/errors/OnfidoError.ts","../src/errors/OnfidoApiError.ts","../src/formatting.ts","../src/OnfidoDownload.ts","../src/Resource.ts","../src/resources/Addresses.ts","../src/resources/Applicants.ts","../src/resources/Autofill.ts","../src/resources/Checks.ts","../src/resources/Documents.ts","../src/resources/LivePhotos.ts","../src/resources/LiveVideos.ts","../src/resources/MotionCaptures.ts","../src/resources/Reports.ts","../src/resources/SdkTokens.ts","../src/resources/Webhooks.ts","../src/resources/WorkflowRuns.ts","../src/Onfido.ts","../src/WebhookEventVerifier.ts"],"sourcesContent":["export class OnfidoError extends Error {\n constructor(message?: string) {\n super(message);\n this.name = \"OnfidoError\";\n }\n}\n","import { OnfidoError } from \"./OnfidoError\";\n\nexport class OnfidoApiError extends OnfidoError {\n public readonly responseBody: unknown;\n public readonly statusCode: number;\n public readonly type: string;\n public readonly fields: unknown;\n\n private constructor(\n message: string,\n responseBody: unknown,\n statusCode: number,\n type: string,\n fields: unknown\n ) {\n super(message);\n this.name = \"OnfidoApiError\";\n\n this.responseBody = responseBody;\n this.statusCode = statusCode;\n this.type = type;\n this.fields = fields;\n }\n\n public static fromResponse(\n responseBody: unknown,\n statusCode: number\n ): OnfidoApiError {\n const innerErrorData: unknown =\n responseBody instanceof Object ? (responseBody as any).error : {};\n\n const innerError: {\n type?: unknown;\n message?: unknown;\n fields?: unknown;\n } = innerErrorData instanceof Object ? innerErrorData : {};\n\n const type = `${innerError.type || \"unknown\"}`;\n const message = `${innerError.message || responseBody}`;\n const fields = innerError.fields;\n\n const fullMessage =\n `${message} (status code ${statusCode})` +\n (fields ? ` | ${JSON.stringify(fields)}` : \"\");\n\n return new OnfidoApiError(\n fullMessage,\n responseBody,\n statusCode,\n type,\n fields\n );\n }\n\n public isClientError(): boolean {\n return this.statusCode < 500;\n }\n}\n","import { Readable } from \"stream\";\nimport { IFormData } from \"./types/formData\";\n\n// Using require because \"form-data\" exports this object as a default export which breaks integration when esModuleInterop: false\n// tslint:disable-next-line: no-var-requires\nconst FormData = require(\"form-data\");\n\nexport type SimpleObject = { [key: string]: unknown };\n\ntype ContentsAndOptions = {\n contents: Readable;\n filepath: string;\n contentType?: string;\n};\n\nexport type FileLike = Readable | ContentsAndOptions;\n\nconst snakeCase = (camelCaseString: string): string =>\n camelCaseString.replace(/[A-Z]/g, char => `_${char.toLowerCase()}`);\n\nconst formatValue = (value: any): string => {\n if (typeof value === 'boolean') {\n return String(value);\n } else {\n return value;\n }\n};\n\nconst camelCase = (snakeCaseString: string): string =>\n snakeCaseString\n .replace(/_[0-9]/g, underscoreDigit => underscoreDigit[1])\n .replace(/_[a-z]/g, underscoreChar => underscoreChar[1].toUpperCase());\n\nconst deepMapObjectKeys = (value: unknown, f: (key: string) => string): any => {\n if (!(value instanceof Object)) {\n return value;\n } else if (Array.isArray(value)) {\n return value.map(item => deepMapObjectKeys(item, f));\n } else {\n return Object.keys(value).reduce<SimpleObject>((acc, key) => {\n acc[f(key)] = deepMapObjectKeys((value as SimpleObject)[key], f);\n return acc;\n }, {});\n }\n};\n\nexport const convertObjectToSnakeCase = (requestBody: unknown): unknown => {\n // Converting to JSON and back first handles things like dates, circular references etc.\n requestBody = JSON.parse(JSON.stringify(requestBody));\n\n return deepMapObjectKeys(requestBody, snakeCase);\n};\n\nexport const convertObjectToCamelCase = (\n responseBody: SimpleObject\n): SimpleObject => deepMapObjectKeys(responseBody, camelCase);\n\nexport const toFormData = (object: SimpleObject): IFormData => {\n return Object.entries(object).reduce((formData, [key, value]) => {\n if (value instanceof Object && \"contents\" in value) {\n const { contents, ...options } = value as ContentsAndOptions;\n formData.append(snakeCase(key), contents, options);\n } else if (value !== undefined && value !== null) {\n if (value instanceof Object) {\n for (const [elementKey, elementValue] of Object.entries(value)) {\n formData.append(snakeCase(key + \"[\" + elementKey + \"]\"), elementValue);\n }\n } else {\n formData.append(snakeCase(key), formatValue(value));\n }\n }\n return formData;\n }, new FormData());\n};\n","import { IncomingMessage } from \"http\";\nimport { PassThrough, Readable } from \"stream\";\n\nexport class OnfidoDownload {\n private readonly incomingMessage: IncomingMessage;\n\n constructor(incomingMessage: IncomingMessage) {\n this.incomingMessage = incomingMessage;\n }\n\n public asStream(): Readable {\n // Use a PassThrough stream so the IncomingMessage isn't exposed.\n const passThroughStream = new PassThrough();\n this.incomingMessage.pipe(passThroughStream);\n return passThroughStream;\n }\n\n public get contentType(): string {\n return this.incomingMessage.headers[\"content-type\"]!;\n }\n}\n","import { AxiosInstance, AxiosPromise, AxiosResponse } from \"axios\";\nimport { IncomingMessage } from \"http\";\nimport { Readable } from \"stream\";\nimport { OnfidoApiError } from \"./errors/OnfidoApiError\";\nimport { OnfidoError } from \"./errors/OnfidoError\";\nimport {\n convertObjectToCamelCase,\n convertObjectToSnakeCase,\n SimpleObject,\n toFormData\n} from \"./formatting\";\nimport { OnfidoDownload } from \"./OnfidoDownload\";\n\nexport enum Method {\n GET = \"get\",\n POST = \"post\",\n PUT = \"put\",\n DELETE = \"delete\"\n}\n\nconst isJson = (response: AxiosResponse<unknown>): boolean =>\n (response.headers[\"content-type\"] || \"\").includes(\"application/json\");\n\nconst readFullStream = (stream: Readable): Promise<unknown> =>\n new Promise((resolve): void => {\n let all = \"\";\n\n stream.on(\"data\", data => (all += data));\n stream.on(\"error\", () => resolve(\"An error occurred reading the response\"));\n stream.on(\"end\", () => {\n // Try to parse as JSON, but fall back to just returning the raw text.\n try {\n resolve(JSON.parse(all));\n } catch {\n resolve(all);\n }\n });\n });\n\nconst convertAxiosErrorToOnfidoError = async (\n error: any\n): Promise<OnfidoError> => {\n if (!error.response) {\n return new OnfidoError(\n error.message || \"An unknown error occurred making the request\"\n );\n }\n\n // Received a 4XX or 5XX response.\n const response: AxiosResponse = error.response;\n const data = response.data;\n\n // If we were downloading a file, we will have a stream instead of a string.\n const body = data instanceof Readable ? await readFullStream(data) : data;\n\n return OnfidoApiError.fromResponse(body, response.status);\n};\n\nconst handleResponse = async (request: AxiosPromise<any>): Promise<any> => {\n try {\n const response = await request;\n const data = response.data;\n return isJson(response) ? convertObjectToCamelCase(data) : data;\n } catch (error) {\n throw await convertAxiosErrorToOnfidoError(error);\n }\n};\n\nexport class Resource<T extends SimpleObject> {\n private readonly name: string;\n private readonly axiosInstance: AxiosInstance;\n\n protected constructor(name: string, axiosInstance: AxiosInstance) {\n this.name = name;\n this.axiosInstance = axiosInstance;\n }\n\n protected async request({\n method,\n path = \"\",\n body,\n query\n }: {\n method: Method;\n path?: string;\n body?: T;\n query?: SimpleObject;\n }): Promise<any> {\n const url = path === null ? `${this.name}` : `${this.name}/${path}`;\n const request = this.axiosInstance({\n method,\n url: url,\n data: body && convertObjectToSnakeCase(body),\n params: query && convertObjectToSnakeCase(query)\n });\n\n return handleResponse(request);\n }\n\n protected async upload(body: T): Promise<any> {\n const formData = toFormData(body);\n\n const request = this.axiosInstance({\n method: Method.POST,\n url: `${this.name}/`,\n data: formData,\n headers: formData.getHeaders()\n });\n\n return handleResponse(request);\n }\n\n protected async download(path: string): Promise<OnfidoDownload> {\n const request = this.axiosInstance({\n method: Method.GET,\n url: `${this.name}/${path}`,\n responseType: \"stream\",\n // Accept a response with any content type (e.g. image/png, application/pdf, video/mp4)\n headers: { Accept: \"*/*\" }\n });\n\n const stream: IncomingMessage = await handleResponse(request);\n return new OnfidoDownload(stream);\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { Method, Resource } from \"../Resource\";\n\ntype AddressOptional = {\n flatNumber: string | null;\n buildingNumber: string | null;\n buildingName: string | null;\n street: string | null;\n subStreet: string | null;\n town: string | null;\n state: string | null;\n line1: string | null;\n line2: string | null;\n line3: string | null;\n};\n\nexport type AddressRequest = {\n postcode: string;\n country: string;\n} & Partial<AddressOptional>;\n\nexport type Address = {\n postcode: string;\n country: string;\n} & Partial<AddressOptional>;\n\nexport class Addresses extends Resource<never> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"addresses\", axiosInstance);\n }\n\n public async pick(postcode: string): Promise<Address[]> {\n const { addresses } = await this.request({\n method: Method.GET,\n path: \"pick\",\n query: { postcode }\n });\n\n return addresses;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { Method, Resource } from \"../Resource\";\nimport { Address, AddressRequest } from \"./Addresses\";\nimport { IdNumber, IdNumberRequest } from \"./IdNumbers\";\nimport { Location, LocationRequest } from \"./Location\";\nimport { ConsentsRequest } from \"./ConsentsRequest\";\n\n// firstName and lastName are also optional, to allow updating.\nexport type ApplicantRequest = {\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n dob?: string | null;\n address?: AddressRequest | null;\n idNumbers?: IdNumberRequest[] | null;\n phoneNumber?: string | null;\n location?: LocationRequest | null;\n consents?: ConsentsRequest[] | null;\n};\n\nexport type Applicant = {\n id: string;\n createdAt: string;\n deleteAt: string | null;\n href: string;\n firstName: string;\n lastName: string;\n email: string | null;\n dob: string | null;\n address: Address | null;\n idNumbers: IdNumber[] | null;\n phoneNumber: string | null;\n location: Location | null;\n};\n\nexport class Applicants extends Resource<ApplicantRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"applicants\", axiosInstance);\n }\n\n public async create(applicantRequest: ApplicantRequest): Promise<Applicant> {\n return this.request({ method: Method.POST, body: applicantRequest });\n }\n\n public async find(id: string): Promise<Applicant> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async update(\n id: string,\n applicantRequest: ApplicantRequest\n ): Promise<Applicant> {\n return this.request({\n method: Method.PUT,\n path: id,\n body: applicantRequest\n });\n }\n\n public async delete(id: string): Promise<void> {\n await this.request({ method: Method.DELETE, path: id });\n }\n\n public async restore(id: string): Promise<void> {\n await this.request({ method: Method.POST, path: `${id}/restore` });\n }\n\n public async list({\n page,\n perPage,\n includeDeleted\n }: {\n page?: number;\n perPage?: number;\n includeDeleted?: boolean;\n } = {}): Promise<Applicant[]> {\n const { applicants } = await this.request({\n method: Method.GET,\n query: { page, perPage, includeDeleted }\n });\n\n return applicants;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type ExtractionResult = {\n documentId: string;\n documentClassification: {\n issuingCountry: string;\n documentType: string;\n issuingState?: string;\n };\n extractedData: {\n documentNumber?: string;\n firstName?: string;\n lastName?: string;\n middleName?: string;\n fullName?: string;\n gender?: string;\n dateOfBirth?: string;\n dateOfExpiry?: string;\n nationality?: string;\n mrzLine1?: string;\n mrzLine2?: string;\n mrzLine3?: string;\n addressLine1?: string;\n addressLine2?: string;\n addressLine3?: string;\n addressLine4?: string;\n addressLine5?: string;\n };\n};\n\ntype AutofillResource = {\n documentId: string;\n};\n\nexport class Autofill extends Resource<AutofillResource> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"extractions\", axiosInstance);\n }\n\n public async perform(documentId: string): Promise<ExtractionResult> {\n return this.request({\n method: Method.POST,\n body: { documentId }\n });\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { OnfidoDownload } from \"../OnfidoDownload\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type CheckRequest = {\n applicantId: string;\n reportNames: string[];\n documentIds?: string[] | null;\n applicantProvidesData?: boolean;\n asynchronous?: boolean;\n tags?: string[] | null;\n suppressFormEmails?: boolean;\n redirectUri?: string | null;\n privacyNoticesReadConsentGiven?: boolean;\n webhookIds?: string[] | null;\n subResult?: string;\n consider?: string[];\n};\n\nexport type Check = {\n id: string;\n reportIds: string[];\n createdAt: string;\n href: string;\n applicantId: string;\n applicantProvidesData: boolean;\n sandbox: boolean;\n status: string;\n tags: string[];\n result: string | null;\n formUri: string | null;\n redirectUri: string | null;\n resultsUri: string;\n privacyNoticesReadConsentGiven: boolean;\n webhookIds: string[] | null;\n};\n\nexport class Checks extends Resource<CheckRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"checks\", axiosInstance);\n }\n\n public async create(checkRequest: CheckRequest): Promise<Check> {\n return this.request({ method: Method.POST, body: checkRequest });\n }\n\n public async find(id: string): Promise<Check> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(applicantId: string): Promise<Check[]> {\n const { checks } = await this.request({\n method: Method.GET,\n query: { applicantId }\n });\n\n return checks;\n }\n\n public async resume(id: string): Promise<void> {\n await this.request({ method: Method.POST, path: `${id}/resume` });\n }\n\n public async download(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/download`);\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { FileLike } from \"../formatting\";\nimport { OnfidoDownload } from \"../OnfidoDownload\";\nimport { Method, Resource } from \"../Resource\";\nimport { LocationRequest } from \"./Location\";\n\nexport type DocumentRequest = {\n applicantId?: string | null;\n file: FileLike;\n type: string;\n side?: string | null;\n issuingCountry?: string | null;\n validateImageQuality?: boolean | null | string;\n location?: LocationRequest | null;\n};\n\nexport type Document = {\n id: string;\n applicantId: string | null;\n createdAt: string;\n href: string;\n downloadHref: string;\n fileName: string;\n fileType: string;\n fileSize: number;\n type: string;\n side: string | null;\n issuingCountry: string | null;\n};\n\nexport class Documents extends Resource<DocumentRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"documents\", axiosInstance);\n }\n\n public async upload(documentRequest: DocumentRequest): Promise<Document> {\n return super.upload(documentRequest);\n }\n\n public async download(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/download`);\n }\n\n public async find(id: string): Promise<Document> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(applicantId: string): Promise<Document[]> {\n const { documents } = await this.request({\n method: Method.GET,\n query: { applicantId }\n });\n\n return documents;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { FileLike } from \"../formatting\";\nimport { OnfidoDownload } from \"../OnfidoDownload\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type LivePhotoRequest = {\n applicantId: string;\n file: FileLike;\n advancedValidation?: string;\n};\n\nexport type LivePhoto = {\n id: string;\n createdAt: string;\n href: string;\n downloadHref: string;\n fileName: string;\n fileType: string;\n fileSize: number;\n};\n\nexport class LivePhotos extends Resource<LivePhotoRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"live_photos\", axiosInstance);\n }\n\n public async upload(livePhotoRequest: LivePhotoRequest): Promise<LivePhoto> {\n return super.upload(livePhotoRequest);\n }\n\n public async download(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/download`);\n }\n\n public async find(id: string): Promise<LivePhoto> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(applicantId: string): Promise<LivePhoto[]> {\n const { livePhotos } = await this.request({\n method: Method.GET,\n query: { applicantId }\n });\n\n return livePhotos;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { OnfidoDownload } from \"../OnfidoDownload\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type LiveVideo = {\n id: string;\n createdAt: string;\n href: string;\n downloadHref: string;\n fileName: string;\n fileType: string;\n fileSize: number;\n};\n\nexport class LiveVideos extends Resource<never> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"live_videos\", axiosInstance);\n }\n\n public async download(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/download`);\n }\n\n public async frame(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/frame`);\n }\n\n public async find(id: string): Promise<LiveVideo> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(applicantId: string): Promise<LiveVideo[]> {\n const { liveVideos } = await this.request({\n method: Method.GET,\n query: { applicantId }\n });\n\n return liveVideos;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { OnfidoDownload } from \"../OnfidoDownload\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type MotionCapture = {\n id: string;\n createdAt: string;\n href: string;\n downloadHref: string;\n fileName: string;\n fileType: string;\n fileSize: number;\n};\n\nexport class MotionCaptures extends Resource<never> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"motion_captures\", axiosInstance);\n }\n\n public async download(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/download`);\n }\n\n public async frame(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/frame`);\n }\n\n public async find(id: string): Promise<MotionCapture> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(applicantId: string): Promise<MotionCapture[]> {\n const { motionCaptures } = await this.request({\n method: Method.GET,\n query: { applicantId }\n });\n\n return motionCaptures;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type Report = {\n id: string;\n createdAt: string;\n name: string;\n href: string;\n status: string;\n result: string | null;\n subResult: string | null;\n properties: object | null;\n breakdown: object | null;\n documents: Array<{ id: string }>;\n checkId: string;\n};\n\nexport class Reports extends Resource<never> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"reports\", axiosInstance);\n }\n\n public async find(id: string): Promise<Report> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(checkId: string): Promise<Report[]> {\n const { reports } = await this.request({\n method: Method.GET,\n query: { checkId }\n });\n\n return reports;\n }\n\n public async resume(id: string): Promise<void> {\n await this.request({ method: Method.POST, path: `${id}/resume` });\n }\n\n public async cancel(id: string): Promise<void> {\n await this.request({ method: Method.POST, path: `${id}/cancel` });\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type SdkTokenRequest = {\n applicantId: string;\n applicationId?: string | null;\n referrer?: string | null;\n crossDeviceUrl?: string | null;\n};\n\nexport class SdkTokens extends Resource<SdkTokenRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"sdk_token\", axiosInstance);\n }\n\n public async generate(sdkTokenRequest: SdkTokenRequest): Promise<string> {\n const { token } = await this.request({\n method: Method.POST,\n body: sdkTokenRequest\n });\n\n return token;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { Method, Resource } from \"../Resource\";\n\n// url is also optional to allow updating.\nexport type WebhookRequest = {\n url?: string | null;\n enabled?: boolean;\n environments?: string[];\n events?: string[] | null;\n};\n\nexport type Webhook = {\n id: string;\n url: string;\n enabled: boolean;\n events: string[];\n token: string;\n href: string;\n environments: string[];\n payloadVersion: number;\n};\n\nexport class Webhooks extends Resource<WebhookRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"webhooks\", axiosInstance);\n }\n\n public async create(webhookRequest: WebhookRequest): Promise<Webhook> {\n return this.request({ method: Method.POST, body: webhookRequest });\n }\n\n public async find(id: string): Promise<Webhook> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async update(\n id: string,\n webhookRequest: WebhookRequest\n ): Promise<Webhook> {\n return this.request({\n method: Method.PUT,\n path: id,\n body: webhookRequest\n });\n }\n\n public async delete(id: string): Promise<void> {\n await this.request({ method: Method.DELETE, path: id });\n }\n\n public async list(): Promise<Webhook[]> {\n const { webhooks } = await this.request({ method: Method.GET });\n\n return webhooks;\n }\n}\n","import { AxiosInstance } from \"axios\";\nimport { OnfidoDownload } from \"../OnfidoDownload\";\nimport { Method, Resource } from \"../Resource\";\n\nexport type WorkflowRunRequest = {\n applicantId: string;\n workflowId: string;\n customData?: any;\n};\n\ntype WorkflowRunError = {\n type: string;\n message: string;\n}\n\ntype WorkflowRunLink = {\n url: string;\n completed_redirect_url: string;\n expired_redirect_url: string;\n expires_at: string;\n language: string;\n}\n\nexport type WorkflowRun = {\n id: string;\n applicantId: string;\n workflowId: string;\n workflowVersionId: number;\n dashboardUrl: string;\n status: string;\n output: any;\n reasons: string[] | null;\n error: WorkflowRunError | null;\n link: WorkflowRunLink | null;\n createdAt: string;\n updatedAt: string;\n tags: string[] | null;\n};\n\nexport type WorkflowRunListRequest = {\n page?: number;\n status?: string;\n created_at_gt?: string;\n created_at_lt?: string;\n}\n\nexport class WorkflowRuns extends Resource<WorkflowRunRequest> {\n constructor(axiosInstance: AxiosInstance) {\n super(\"workflow_runs\", axiosInstance);\n }\n\n public async create(workflowRunRequest: WorkflowRunRequest): Promise<WorkflowRun> {\n return this.request({ method: Method.POST, body: workflowRunRequest });\n }\n\n public async find(id: string): Promise<WorkflowRun> {\n return this.request({ method: Method.GET, path: id });\n }\n\n public async list(queryParams?: WorkflowRunListRequest): Promise<WorkflowRun[]> {\n const workflowRuns = await this.request({\n method: Method.GET,\n query: queryParams\n });\n\n return workflowRuns;\n }\n\n public async evidence(id: string): Promise<OnfidoDownload> {\n return super.download(`${id}/signed_evidence_file`);\n }\n}\n","import axios, { AxiosInstance } from \"axios\";\nimport { version } from \"../package.json\";\nimport { Addresses } from \"./resources/Addresses\";\nimport { Applicants } from \"./resources/Applicants\";\nimport { Autofill } from \"./resources/Autofill\";\nimport { Checks } from \"./resources/Checks\";\nimport { Documents } from \"./resources/Documents\";\nimport { LivePhotos } from \"./resources/LivePhotos\";\nimport { LiveVideos } from \"./resources/LiveVideos\";\nimport { MotionCaptures } from \"./resources/MotionCaptures\";\nimport { Reports } from \"./resources/Reports\";\nimport { SdkTokens } from \"./resources/SdkTokens\";\nimport { Webhooks } from \"./resources/Webhooks\";\nimport { WorkflowRuns } from \"./resources/WorkflowRuns\";\n\nexport enum Region {\n EU = \"EU\",\n US = \"US\",\n CA = \"CA\"\n}\n\nexport type OnfidoOptions = {\n apiToken: string;\n region: Region;\n timeout?: number;\n unknownApiUrl?: string;\n};\n\nexport class Onfido {\n public readonly axiosInstance: AxiosInstance;\n // Core resources\n public readonly applicant: Applicants;\n public readonly document: Documents;\n public readonly livePhoto: LivePhotos;\n public readonly liveVideo: LiveVideos;\n public readonly motionCapture: MotionCaptures;\n public readonly check: Checks;\n public readonly report: Reports;\n public readonly workflowRun: WorkflowRuns;\n // Other endpoints\n public readonly address: Addresses;\n public readonly webhook: Webhooks;\n public readonly sdkToken: SdkTokens;\n public readonly autofill: Autofill;\n\n constructor({\n apiToken,\n region,\n timeout = 30_000,\n unknownApiUrl\n }: OnfidoOptions) {\n if (!apiToken) {\n throw new Error(\"No apiToken provided\");\n }\n if (!region || !Object.values(Region).includes(region)) {\n throw new Error(\n `Unknown or missing region '${region}'. ` +\n \"We previously defaulted to region 'EU', so if you previously didn’t \" +\n \"set a region or used api.onfido.com, please set your region to 'EU'\"\n );\n }\n\n const regionUrl = `https://api.${region.toLowerCase()}.onfido.com/v3.6/`;\n\n this.axiosInstance = axios.create({\n baseURL: unknownApiUrl || regionUrl,\n headers: {\n Authorization: `Token token=${apiToken}`,\n Accept: \"application/json\",\n \"User-Agent\": `onfido-node/${version}`\n },\n timeout\n });\n\n // Core resources\n this.applicant = new Applicants(this.axiosInstance);\n this.document = new Documents(this.axiosInstance);\n this.livePhoto = new LivePhotos(this.axiosInstance);\n this.liveVideo = new LiveVideos(this.axiosInstance);\n this.motionCapture = new MotionCaptures(this.axiosInstance);\n this.check = new Checks(this.axiosInstance);\n this.report = new Reports(this.axiosInstance);\n this.workflowRun = new WorkflowRuns(this.axiosInstance);\n // Other endpoints\n this.address = new Addresses(this.axiosInstance);\n this.webhook = new Webhooks(this.axiosInstance);\n this.sdkToken = new SdkTokens(this.axiosInstance);\n this.autofill = new Autofill(this.axiosInstance);\n }\n}\n","import { OnfidoError } from \"./errors/OnfidoError\";\nimport { convertObjectToCamelCase } from \"./formatting\";\n\n// Require crypto instead of importing, because Node can be built without crypto support.\nlet crypto: typeof import(\"crypto\") | undefined;\ntry {\n // tslint:disable-next-line: no-var-requires\n crypto = require(\"crypto\");\n} catch {\n // We throw an error when verifying webhooks instead.\n}\n\nexport type WebhookEvent = {\n resourceType: string;\n action: string;\n object: {\n id: string;\n status: string;\n href: string;\n completedAtIso8601: string;\n };\n resource?: object;\n};\n\nexport class WebhookEventVerifier {\n private readonly webhookToken: string;\n\n constructor(webhookToken: string) {\n this.webhookToken = webhookToken;\n }\n\n public readPayload(\n rawEventBody: string | Buffer,\n hexSignature: string\n ): WebhookEvent {\n if (!crypto) {\n throw new Error(\"Verifying webhook events requires crypto support\");\n }\n\n const givenSignature = Buffer.from(hexSignature, \"hex\");\n\n // Compute the the actual HMAC signature from the raw request body.\n const hmac = crypto.createHmac(\"sha256\", this.webhookToken);\n hmac.update(rawEventBody);\n const eventSignature = hmac.digest();\n\n // Use timingSafeEqual to prevent against timing attacks.\n if (!crypto.timingSafeEqual(givenSignature, eventSignature)) {\n throw new OnfidoError(\"Invalid signature for webhook event\");\n }\n\n const { payload } = JSON.parse(rawEventBody.toString());\n return convertObjectToCamelCase(payload) as WebhookEvent;\n }\n}\n"],"names":["PassThrough","Readable","Region"],"mappings":";;;;;;;;;;;MAAa,WAAY,SAAQ,KAAK;IACpC,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;KAC3B;CACF;;MCHY,cAAe,SAAQ,WAAW;IAM7C,YACE,OAAe,EACf,YAAqB,EACrB,UAAkB,EAClB,IAAY,EACZ,MAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAE7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACtB;IAEM,OAAO,YAAY,CACxB,YAAqB,EACrB,UAAkB;QAElB,MAAM,cAAc,GAClB,YAAY,YAAY,MAAM,GAAI,YAAo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,CAAiB,CAAC;KAC1D;CACF;;;;;;;;;"}
@@ -1,27 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Resource } from "../Resource";
3
- declare type AddressOptional = {
4
- flatNumber: string | null;
5
- buildingNumber: string | null;
6
- buildingName: string | null;
7
- street: string | null;
8
- subStreet: string | null;
9
- town: string | null;
10
- state: string | null;
11
- line1: string | null;
12
- line2: string | null;
13
- line3: string | null;
14
- };
15
- export declare type AddressRequest = {
16
- postcode: string;
17
- country: string;
18
- } & Partial<AddressOptional>;
19
- export declare type Address = {
20
- postcode: string;
21
- country: string;
22
- } & Partial<AddressOptional>;
23
- export declare class Addresses extends Resource<never> {
24
- constructor(axiosInstance: AxiosInstance);
25
- pick(postcode: string): Promise<Address[]>;
26
- }
27
- export {};
@@ -1,44 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Resource } from "../Resource";
3
- import { Address, AddressRequest } from "./Addresses";
4
- import { IdNumber, IdNumberRequest } from "./IdNumbers";
5
- import { Location, LocationRequest } from "./Location";
6
- import { ConsentsRequest } from "./ConsentsRequest";
7
- export declare type ApplicantRequest = {
8
- firstName?: string | null;
9
- lastName?: string | null;
10
- email?: string | null;
11
- dob?: string | null;
12
- address?: AddressRequest | null;
13
- idNumbers?: IdNumberRequest[] | null;
14
- phoneNumber?: string | null;
15
- location?: LocationRequest | null;
16
- consents?: ConsentsRequest[] | null;
17
- };
18
- export declare type Applicant = {
19
- id: string;
20
- createdAt: string;
21
- deleteAt: string | null;
22
- href: string;
23
- firstName: string;
24
- lastName: string;
25
- email: string | null;
26
- dob: string | null;
27
- address: Address | null;
28
- idNumbers: IdNumber[] | null;
29
- phoneNumber: string | null;
30
- location: Location | null;
31
- };
32
- export declare class Applicants extends Resource<ApplicantRequest> {
33
- constructor(axiosInstance: AxiosInstance);
34
- create(applicantRequest: ApplicantRequest): Promise<Applicant>;
35
- find(id: string): Promise<Applicant>;
36
- update(id: string, applicantRequest: ApplicantRequest): Promise<Applicant>;
37
- delete(id: string): Promise<void>;
38
- restore(id: string): Promise<void>;
39
- list({ page, perPage, includeDeleted }?: {
40
- page?: number;
41
- perPage?: number;
42
- includeDeleted?: boolean;
43
- }): Promise<Applicant[]>;
44
- }
@@ -1,37 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Resource } from "../Resource";
3
- export declare type ExtractionResult = {
4
- documentId: string;
5
- documentClassification: {
6
- issuingCountry: string;
7
- documentType: string;
8
- issuingState?: string;
9
- };
10
- extractedData: {
11
- documentNumber?: string;
12
- firstName?: string;
13
- lastName?: string;
14
- middleName?: string;
15
- fullName?: string;
16
- gender?: string;
17
- dateOfBirth?: string;
18
- dateOfExpiry?: string;
19
- nationality?: string;
20
- mrzLine1?: string;
21
- mrzLine2?: string;
22
- mrzLine3?: string;
23
- addressLine1?: string;
24
- addressLine2?: string;
25
- addressLine3?: string;
26
- addressLine4?: string;
27
- addressLine5?: string;
28
- };
29
- };
30
- declare type AutofillResource = {
31
- documentId: string;
32
- };
33
- export declare class Autofill extends Resource<AutofillResource> {
34
- constructor(axiosInstance: AxiosInstance);
35
- perform(documentId: string): Promise<ExtractionResult>;
36
- }
37
- export {};
@@ -1,42 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { OnfidoDownload } from "../OnfidoDownload";
3
- import { Resource } from "../Resource";
4
- export declare type CheckRequest = {
5
- applicantId: string;
6
- reportNames: string[];
7
- documentIds?: string[] | null;
8
- applicantProvidesData?: boolean;
9
- asynchronous?: boolean;
10
- tags?: string[] | null;
11
- suppressFormEmails?: boolean;
12
- redirectUri?: string | null;
13
- privacyNoticesReadConsentGiven?: boolean;
14
- webhookIds?: string[] | null;
15
- subResult?: string;
16
- consider?: string[];
17
- };
18
- export declare type Check = {
19
- id: string;
20
- reportIds: string[];
21
- createdAt: string;
22
- href: string;
23
- applicantId: string;
24
- applicantProvidesData: boolean;
25
- sandbox: boolean;
26
- status: string;
27
- tags: string[];
28
- result: string | null;
29
- formUri: string | null;
30
- redirectUri: string | null;
31
- resultsUri: string;
32
- privacyNoticesReadConsentGiven: boolean;
33
- webhookIds: string[] | null;
34
- };
35
- export declare class Checks extends Resource<CheckRequest> {
36
- constructor(axiosInstance: AxiosInstance);
37
- create(checkRequest: CheckRequest): Promise<Check>;
38
- find(id: string): Promise<Check>;
39
- list(applicantId: string): Promise<Check[]>;
40
- resume(id: string): Promise<void>;
41
- download(id: string): Promise<OnfidoDownload>;
42
- }
@@ -1,4 +0,0 @@
1
- export declare type ConsentsRequest = {
2
- name: string;
3
- granted: Boolean;
4
- };
@@ -1,34 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { FileLike } from "../formatting";
3
- import { OnfidoDownload } from "../OnfidoDownload";
4
- import { Resource } from "../Resource";
5
- import { LocationRequest } from "./Location";
6
- export declare type DocumentRequest = {
7
- applicantId?: string | null;
8
- file: FileLike;
9
- type: string;
10
- side?: string | null;
11
- issuingCountry?: string | null;
12
- validateImageQuality?: boolean | null | string;
13
- location?: LocationRequest | null;
14
- };
15
- export declare type Document = {
16
- id: string;
17
- applicantId: string | null;
18
- createdAt: string;
19
- href: string;
20
- downloadHref: string;
21
- fileName: string;
22
- fileType: string;
23
- fileSize: number;
24
- type: string;
25
- side: string | null;
26
- issuingCountry: string | null;
27
- };
28
- export declare class Documents extends Resource<DocumentRequest> {
29
- constructor(axiosInstance: AxiosInstance);
30
- upload(documentRequest: DocumentRequest): Promise<Document>;
31
- download(id: string): Promise<OnfidoDownload>;
32
- find(id: string): Promise<Document>;
33
- list(applicantId: string): Promise<Document[]>;
34
- }
@@ -1,10 +0,0 @@
1
- export declare type IdNumberRequest = {
2
- type: string;
3
- value: string;
4
- stateCode?: string | null;
5
- };
6
- export declare type IdNumber = {
7
- type: string;
8
- value: string;
9
- stateCode: string | null;
10
- };
@@ -1,25 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { FileLike } from "../formatting";
3
- import { OnfidoDownload } from "../OnfidoDownload";
4
- import { Resource } from "../Resource";
5
- export declare type LivePhotoRequest = {
6
- applicantId: string;
7
- file: FileLike;
8
- advancedValidation?: string;
9
- };
10
- export declare type LivePhoto = {
11
- id: string;
12
- createdAt: string;
13
- href: string;
14
- downloadHref: string;
15
- fileName: string;
16
- fileType: string;
17
- fileSize: number;
18
- };
19
- export declare class LivePhotos extends Resource<LivePhotoRequest> {
20
- constructor(axiosInstance: AxiosInstance);
21
- upload(livePhotoRequest: LivePhotoRequest): Promise<LivePhoto>;
22
- download(id: string): Promise<OnfidoDownload>;
23
- find(id: string): Promise<LivePhoto>;
24
- list(applicantId: string): Promise<LivePhoto[]>;
25
- }
@@ -1,19 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { OnfidoDownload } from "../OnfidoDownload";
3
- import { Resource } from "../Resource";
4
- export declare type LiveVideo = {
5
- id: string;
6
- createdAt: string;
7
- href: string;
8
- downloadHref: string;
9
- fileName: string;
10
- fileType: string;
11
- fileSize: number;
12
- };
13
- export declare class LiveVideos extends Resource<never> {
14
- constructor(axiosInstance: AxiosInstance);
15
- download(id: string): Promise<OnfidoDownload>;
16
- frame(id: string): Promise<OnfidoDownload>;
17
- find(id: string): Promise<LiveVideo>;
18
- list(applicantId: string): Promise<LiveVideo[]>;
19
- }
@@ -1,8 +0,0 @@
1
- export declare type LocationRequest = {
2
- ipAddress?: string | null;
3
- countryOfResidence?: string | null;
4
- };
5
- export declare type Location = {
6
- ipAddress: string;
7
- countryOfResidence: string;
8
- };
@@ -1,19 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { OnfidoDownload } from "../OnfidoDownload";
3
- import { Resource } from "../Resource";
4
- export declare type MotionCapture = {
5
- id: string;
6
- createdAt: string;
7
- href: string;
8
- downloadHref: string;
9
- fileName: string;
10
- fileType: string;
11
- fileSize: number;
12
- };
13
- export declare class MotionCaptures extends Resource<never> {
14
- constructor(axiosInstance: AxiosInstance);
15
- download(id: string): Promise<OnfidoDownload>;
16
- frame(id: string): Promise<OnfidoDownload>;
17
- find(id: string): Promise<MotionCapture>;
18
- list(applicantId: string): Promise<MotionCapture[]>;
19
- }
@@ -1,24 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Resource } from "../Resource";
3
- export declare type Report = {
4
- id: string;
5
- createdAt: string;
6
- name: string;
7
- href: string;
8
- status: string;
9
- result: string | null;
10
- subResult: string | null;
11
- properties: object | null;
12
- breakdown: object | null;
13
- documents: Array<{
14
- id: string;
15
- }>;
16
- checkId: string;
17
- };
18
- export declare class Reports extends Resource<never> {
19
- constructor(axiosInstance: AxiosInstance);
20
- find(id: string): Promise<Report>;
21
- list(checkId: string): Promise<Report[]>;
22
- resume(id: string): Promise<void>;
23
- cancel(id: string): Promise<void>;
24
- }
@@ -1,12 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Resource } from "../Resource";
3
- export declare type SdkTokenRequest = {
4
- applicantId: string;
5
- applicationId?: string | null;
6
- referrer?: string | null;
7
- crossDeviceUrl?: string | null;
8
- };
9
- export declare class SdkTokens extends Resource<SdkTokenRequest> {
10
- constructor(axiosInstance: AxiosInstance);
11
- generate(sdkTokenRequest: SdkTokenRequest): Promise<string>;
12
- }
@@ -1,26 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { Resource } from "../Resource";
3
- export declare type WebhookRequest = {
4
- url?: string | null;
5
- enabled?: boolean;
6
- environments?: string[];
7
- events?: string[] | null;
8
- };
9
- export declare type Webhook = {
10
- id: string;
11
- url: string;
12
- enabled: boolean;
13
- events: string[];
14
- token: string;
15
- href: string;
16
- environments: string[];
17
- payloadVersion: number;
18
- };
19
- export declare class Webhooks extends Resource<WebhookRequest> {
20
- constructor(axiosInstance: AxiosInstance);
21
- create(webhookRequest: WebhookRequest): Promise<Webhook>;
22
- find(id: string): Promise<Webhook>;
23
- update(id: string, webhookRequest: WebhookRequest): Promise<Webhook>;
24
- delete(id: string): Promise<void>;
25
- list(): Promise<Webhook[]>;
26
- }
@@ -1,48 +0,0 @@
1
- import { AxiosInstance } from "axios";
2
- import { OnfidoDownload } from "../OnfidoDownload";
3
- import { Resource } from "../Resource";
4
- export declare type WorkflowRunRequest = {
5
- applicantId: string;
6
- workflowId: string;
7
- customData?: any;
8
- };
9
- declare type WorkflowRunError = {
10
- type: string;
11
- message: string;
12
- };
13
- declare type WorkflowRunLink = {
14
- url: string;
15
- completed_redirect_url: string;
16
- expired_redirect_url: string;
17
- expires_at: string;
18
- language: string;
19
- };
20
- export declare type WorkflowRun = {
21
- id: string;
22
- applicantId: string;
23
- workflowId: string;
24
- workflowVersionId: number;
25
- dashboardUrl: string;
26
- status: string;
27
- output: any;
28
- reasons: string[] | null;
29
- error: WorkflowRunError | null;
30
- link: WorkflowRunLink | null;
31
- createdAt: string;
32
- updatedAt: string;
33
- tags: string[] | null;
34
- };
35
- export declare type WorkflowRunListRequest = {
36
- page?: number;
37
- status?: string;
38
- created_at_gt?: string;
39
- created_at_lt?: string;
40
- };
41
- export declare class WorkflowRuns extends Resource<WorkflowRunRequest> {
42
- constructor(axiosInstance: AxiosInstance);
43
- create(workflowRunRequest: WorkflowRunRequest): Promise<WorkflowRun>;
44
- find(id: string): Promise<WorkflowRun>;
45
- list(queryParams?: WorkflowRunListRequest): Promise<WorkflowRun[]>;
46
- evidence(id: string): Promise<OnfidoDownload>;
47
- }
48
- export {};
@@ -1,27 +0,0 @@
1
- /// <reference types="node" />
2
- import * as http from "http";
3
- import * as stream from "stream";
4
- export interface IFormData extends stream.Readable {
5
- append(key: string, value: any, options?: IAppendOptions | string): void;
6
- getHeaders(userHeaders?: IHeaders): IHeaders;
7
- submit(params: string | ISubmitOptions, callback?: (error: Error | null, response: http.IncomingMessage) => void): http.ClientRequest;
8
- getBuffer(): Buffer;
9
- getBoundary(): string;
10
- getLength(callback: (err: Error | null, length: number) => void): void;
11
- getLengthSync(): number;
12
- hasKnownLength(): boolean;
13
- }
14
- interface IHeaders {
15
- [key: string]: any;
16
- }
17
- interface IAppendOptions {
18
- header?: string | IHeaders;
19
- knownLength?: number;
20
- filename?: string;
21
- filepath?: string;
22
- contentType?: string;
23
- }
24
- interface ISubmitOptions extends http.RequestOptions {
25
- protocol?: "https:" | "http:";
26
- }
27
- export {};