@trinsic/api 1.0.0 → 1.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.
@@ -9,7 +9,7 @@ src/apis/SessionsApi.ts
9
9
  src/apis/index.ts
10
10
  src/index.ts
11
11
  src/models/Address.ts
12
- src/models/Attachments.ts
12
+ src/models/AttachmentAccessKeys.ts
13
13
  src/models/CancelSessionResponse.ts
14
14
  src/models/CreateSessionRequest.ts
15
15
  src/models/CreateSessionResponse.ts
@@ -18,6 +18,7 @@ src/models/DisclosedFieldsRequest.ts
18
18
  src/models/DocumentData.ts
19
19
  src/models/FailureMessage.ts
20
20
  src/models/GetAttachmentRequest.ts
21
+ src/models/GetAttachmentResponse.ts
21
22
  src/models/GetSessionResponse.ts
22
23
  src/models/GetSessionResultRequest.ts
23
24
  src/models/GetSessionResultResponse.ts
package/README.md CHANGED
@@ -3,8 +3,7 @@
3
3
  [![Version](https://img.shields.io/npm/v/@trinsic/api.svg)](https://www.npmjs.org/package/@trinsic/api)
4
4
  [![Build Status](https://github.com/trinsic-id/sdk/actions/workflows/api-typescript-release.yml/badge.svg)](https://github.com/trinsic-id/sdk/actions?query=branch%main)
5
5
 
6
- The Trinsic API TypeScript library provides convenient access to the Trinsic API from
7
- applications written in server-side JavaScript/TypeScript.
6
+ The Trinsic API TypeScript library provides convenient access to the Trinsic API from applications written in server-side JavaScript/TypeScript.
8
7
 
9
8
  ## Documentation
10
9
 
@@ -36,21 +35,23 @@ const sessions = new SessionsApi(config);
36
35
  const session = await sessionsApi.createSession();
37
36
  ```
38
37
 
39
- You can find a full TS server example in the [samples](https://github.com/trinsic-id/sdk/tree/main/api-typescript/samples) folder.
38
+ You can find a full TypeScript server example in the [samples](https://github.com/trinsic-id/sdk/tree/main/api-typescript/samples) folder.
40
39
 
41
40
  ## SDK Versioning
42
41
 
43
- Trinsic follows a Semantic Versioning (SemVer) process where all releases will have a version X.Y.Z (like 1.0.0) pattern wherein Z would be a bug fix (e.g., 1.0.1), Y would be a minor release (1.1.0) and X would be a major release (2.0.0). We permit any breaking changes to only be released in major versions and strongly recommend reading changelogs before making any major version upgrades.
42
+ var configuration = new Configuration { AccessToken = "your-access-token" };
44
43
 
45
- ## Support
44
+ var attachments = new AttachmentsApi(configuration);
45
+ var network = new NetworkApi(configuration);
46
+ var sessions = new SessionsApi(configuration);
46
47
 
47
- New features and bug fixes are released on the latest major version of the package. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.
48
+ ## Support
48
49
 
49
50
  Any issues, inquiries, and feature requests can be sent to [support@trinsic.id](mailto:support@trinsic.id), or feel free to open a GitHub issue [here](https://github.com/trinsic-id/sdk/issues).
50
51
 
51
52
  ## More Information
52
53
 
53
54
  - [API Reference](https://docs.trinsic.id/reference)
54
- - [Developer Guide](https://github.com/stripe/stripe-node/wiki/Passing-Options)
55
+ - [Developer Guide](https://docs.trinsic.id/docs/developer-tools)
55
56
  - [Our Blog](https://trinsic.id/blog/)
56
57
  - [Schedule a demo](https://trinsic.id/contact/)
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { GetAttachmentRequest } from '../models/index';
13
+ import type { GetAttachmentRequest, GetAttachmentResponse } from '../models/index';
14
14
  export interface GetAttachmentOperationRequest {
15
15
  getAttachmentRequest?: GetAttachmentRequest;
16
16
  }
@@ -22,32 +22,32 @@ export interface GetAttachmentOperationRequest {
22
22
  */
23
23
  export interface AttachmentsApiInterface {
24
24
  /**
25
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
25
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
26
26
  * @summary Get Attachment
27
27
  * @param {GetAttachmentRequest} [getAttachmentRequest]
28
28
  * @param {*} [options] Override http request option.
29
29
  * @throws {RequiredError}
30
30
  * @memberof AttachmentsApiInterface
31
31
  */
32
- getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
32
+ getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAttachmentResponse>>;
33
33
  /**
34
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
34
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
35
35
  * Get Attachment
36
36
  */
37
- getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
37
+ getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAttachmentResponse>;
38
38
  }
39
39
  /**
40
40
  *
41
41
  */
42
42
  export declare class AttachmentsApi extends runtime.BaseAPI implements AttachmentsApiInterface {
43
43
  /**
44
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
44
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
45
45
  * Get Attachment
46
46
  */
47
- getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
47
+ getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAttachmentResponse>>;
48
48
  /**
49
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
49
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
50
50
  * Get Attachment
51
51
  */
52
- getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
52
+ getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAttachmentResponse>;
53
53
  }
@@ -30,7 +30,7 @@ const index_1 = require("../models/index");
30
30
  */
31
31
  class AttachmentsApi extends runtime.BaseAPI {
32
32
  /**
33
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
33
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
34
34
  * Get Attachment
35
35
  */
36
36
  getAttachmentRaw(requestParameters, initOverrides) {
@@ -52,16 +52,17 @@ class AttachmentsApi extends runtime.BaseAPI {
52
52
  query: queryParameters,
53
53
  body: (0, index_1.GetAttachmentRequestToJSON)(requestParameters['getAttachmentRequest']),
54
54
  }, initOverrides);
55
- return new runtime.VoidApiResponse(response);
55
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetAttachmentResponseFromJSON)(jsonValue));
56
56
  });
57
57
  }
58
58
  /**
59
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
59
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
60
60
  * Get Attachment
61
61
  */
62
62
  getAttachment(getAttachmentRequest, initOverrides) {
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
- yield this.getAttachmentRaw({ getAttachmentRequest: getAttachmentRequest }, initOverrides);
64
+ const response = yield this.getAttachmentRaw({ getAttachmentRequest: getAttachmentRequest }, initOverrides);
65
+ return yield response.value();
65
66
  });
66
67
  }
67
68
  }
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { GetAttachmentRequest } from '../models/index';
13
+ import type { GetAttachmentRequest, GetAttachmentResponse } from '../models/index';
14
14
  export interface GetAttachmentOperationRequest {
15
15
  getAttachmentRequest?: GetAttachmentRequest;
16
16
  }
@@ -22,32 +22,32 @@ export interface GetAttachmentOperationRequest {
22
22
  */
23
23
  export interface AttachmentsApiInterface {
24
24
  /**
25
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
25
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
26
26
  * @summary Get Attachment
27
27
  * @param {GetAttachmentRequest} [getAttachmentRequest]
28
28
  * @param {*} [options] Override http request option.
29
29
  * @throws {RequiredError}
30
30
  * @memberof AttachmentsApiInterface
31
31
  */
32
- getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
32
+ getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAttachmentResponse>>;
33
33
  /**
34
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
34
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
35
35
  * Get Attachment
36
36
  */
37
- getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
37
+ getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAttachmentResponse>;
38
38
  }
39
39
  /**
40
40
  *
41
41
  */
42
42
  export declare class AttachmentsApi extends runtime.BaseAPI implements AttachmentsApiInterface {
43
43
  /**
44
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
44
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
45
45
  * Get Attachment
46
46
  */
47
- getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
47
+ getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAttachmentResponse>>;
48
48
  /**
49
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
49
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
50
50
  * Get Attachment
51
51
  */
52
- getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
52
+ getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAttachmentResponse>;
53
53
  }
@@ -21,13 +21,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { GetAttachmentRequestToJSON, } from '../models/index';
24
+ import { GetAttachmentRequestToJSON, GetAttachmentResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class AttachmentsApi extends runtime.BaseAPI {
29
29
  /**
30
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
30
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
31
31
  * Get Attachment
32
32
  */
33
33
  getAttachmentRaw(requestParameters, initOverrides) {
@@ -49,16 +49,17 @@ export class AttachmentsApi extends runtime.BaseAPI {
49
49
  query: queryParameters,
50
50
  body: GetAttachmentRequestToJSON(requestParameters['getAttachmentRequest']),
51
51
  }, initOverrides);
52
- return new runtime.VoidApiResponse(response);
52
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetAttachmentResponseFromJSON(jsonValue));
53
53
  });
54
54
  }
55
55
  /**
56
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
56
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
57
57
  * Get Attachment
58
58
  */
59
59
  getAttachment(getAttachmentRequest, initOverrides) {
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
- yield this.getAttachmentRaw({ getAttachmentRequest: getAttachmentRequest }, initOverrides);
61
+ const response = yield this.getAttachmentRaw({ getAttachmentRequest: getAttachmentRequest }, initOverrides);
62
+ return yield response.value();
62
63
  });
63
64
  }
64
65
  }
@@ -12,25 +12,25 @@
12
12
  /**
13
13
  * Attachment Access Keys for attachments (eg document / selfie images)
14
14
  * @export
15
- * @interface Attachments
15
+ * @interface AttachmentAccessKeys
16
16
  */
17
- export interface Attachments {
17
+ export interface AttachmentAccessKeys {
18
18
  /**
19
19
  * Key to access the selfie image (if relevant) for this verification
20
20
  * @type {string}
21
- * @memberof Attachments
21
+ * @memberof AttachmentAccessKeys
22
22
  */
23
23
  selfie?: string;
24
24
  /**
25
25
  * Key to access the document front image (if relevant) for this verification
26
26
  * @type {string}
27
- * @memberof Attachments
27
+ * @memberof AttachmentAccessKeys
28
28
  */
29
29
  documentFront?: string;
30
30
  /**
31
31
  * Key to access the document back image (if relevant) for this verification
32
32
  * @type {string}
33
- * @memberof Attachments
33
+ * @memberof AttachmentAccessKeys
34
34
  */
35
35
  documentBack?: string;
36
36
  /**
@@ -38,14 +38,14 @@ export interface Attachments {
38
38
  *
39
39
  * Specifically, this is a cropped version of the document front image which includes only the portrait on the document.
40
40
  * @type {string}
41
- * @memberof Attachments
41
+ * @memberof AttachmentAccessKeys
42
42
  */
43
43
  documentPortrait?: string;
44
44
  }
45
45
  /**
46
- * Check if a given object implements the Attachments interface.
46
+ * Check if a given object implements the AttachmentAccessKeys interface.
47
47
  */
48
- export declare function instanceOfAttachments(value: object): value is Attachments;
49
- export declare function AttachmentsFromJSON(json: any): Attachments;
50
- export declare function AttachmentsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachments;
51
- export declare function AttachmentsToJSON(value?: Attachments | null): any;
48
+ export declare function instanceOfAttachmentAccessKeys(value: object): value is AttachmentAccessKeys;
49
+ export declare function AttachmentAccessKeysFromJSON(json: any): AttachmentAccessKeys;
50
+ export declare function AttachmentAccessKeysFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentAccessKeys;
51
+ export declare function AttachmentAccessKeysToJSON(value?: AttachmentAccessKeys | null): any;
@@ -12,15 +12,15 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  /**
15
- * Check if a given object implements the Attachments interface.
15
+ * Check if a given object implements the AttachmentAccessKeys interface.
16
16
  */
17
- export function instanceOfAttachments(value) {
17
+ export function instanceOfAttachmentAccessKeys(value) {
18
18
  return true;
19
19
  }
20
- export function AttachmentsFromJSON(json) {
21
- return AttachmentsFromJSONTyped(json, false);
20
+ export function AttachmentAccessKeysFromJSON(json) {
21
+ return AttachmentAccessKeysFromJSONTyped(json, false);
22
22
  }
23
- export function AttachmentsFromJSONTyped(json, ignoreDiscriminator) {
23
+ export function AttachmentAccessKeysFromJSONTyped(json, ignoreDiscriminator) {
24
24
  if (json == null) {
25
25
  return json;
26
26
  }
@@ -31,7 +31,7 @@ export function AttachmentsFromJSONTyped(json, ignoreDiscriminator) {
31
31
  'documentPortrait': json['documentPortrait'] == null ? undefined : json['documentPortrait'],
32
32
  };
33
33
  }
34
- export function AttachmentsToJSON(value) {
34
+ export function AttachmentAccessKeysToJSON(value) {
35
35
  if (value == null) {
36
36
  return value;
37
37
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Connect API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface GetAttachmentResponse
16
+ */
17
+ export interface GetAttachmentResponse {
18
+ /**
19
+ * The raw file contents of the Attachment
20
+ * @type {string}
21
+ * @memberof GetAttachmentResponse
22
+ */
23
+ content: string;
24
+ /**
25
+ * The MIME type of the Attachment data
26
+ * @type {string}
27
+ * @memberof GetAttachmentResponse
28
+ */
29
+ contentType: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the GetAttachmentResponse interface.
33
+ */
34
+ export declare function instanceOfGetAttachmentResponse(value: object): value is GetAttachmentResponse;
35
+ export declare function GetAttachmentResponseFromJSON(json: any): GetAttachmentResponse;
36
+ export declare function GetAttachmentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAttachmentResponse;
37
+ export declare function GetAttachmentResponseToJSON(value?: GetAttachmentResponse | null): any;
@@ -0,0 +1,44 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Connect API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: v1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the GetAttachmentResponse interface.
16
+ */
17
+ export function instanceOfGetAttachmentResponse(value) {
18
+ if (!('content' in value) || value['content'] === undefined)
19
+ return false;
20
+ if (!('contentType' in value) || value['contentType'] === undefined)
21
+ return false;
22
+ return true;
23
+ }
24
+ export function GetAttachmentResponseFromJSON(json) {
25
+ return GetAttachmentResponseFromJSONTyped(json, false);
26
+ }
27
+ export function GetAttachmentResponseFromJSONTyped(json, ignoreDiscriminator) {
28
+ if (json == null) {
29
+ return json;
30
+ }
31
+ return {
32
+ 'content': json['content'],
33
+ 'contentType': json['contentType'],
34
+ };
35
+ }
36
+ export function GetAttachmentResponseToJSON(value) {
37
+ if (value == null) {
38
+ return value;
39
+ }
40
+ return {
41
+ 'content': value['content'],
42
+ 'contentType': value['contentType'],
43
+ };
44
+ }
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import type { DocumentData } from './DocumentData';
13
13
  import type { PersonData } from './PersonData';
14
- import type { Attachments } from './Attachments';
14
+ import type { AttachmentAccessKeys } from './AttachmentAccessKeys';
15
15
  /**
16
16
  *
17
17
  * @export
@@ -37,11 +37,11 @@ export interface IdentityData {
37
37
  */
38
38
  document?: DocumentData;
39
39
  /**
40
- * Access keys for attachments (eg document/selfie images)
41
- * @type {Attachments}
40
+ * Attachment Access Keys for attachments (eg document / selfie images)
41
+ * @type {AttachmentAccessKeys}
42
42
  * @memberof IdentityData
43
43
  */
44
- attachments?: Attachments;
44
+ attachmentAccessKeys?: AttachmentAccessKeys;
45
45
  }
46
46
  /**
47
47
  * Check if a given object implements the IdentityData interface.
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { DocumentDataFromJSON, DocumentDataToJSON, } from './DocumentData';
15
15
  import { PersonDataFromJSON, PersonDataToJSON, } from './PersonData';
16
- import { AttachmentsFromJSON, AttachmentsToJSON, } from './Attachments';
16
+ import { AttachmentAccessKeysFromJSON, AttachmentAccessKeysToJSON, } from './AttachmentAccessKeys';
17
17
  /**
18
18
  * Check if a given object implements the IdentityData interface.
19
19
  */
@@ -31,7 +31,7 @@ export function IdentityDataFromJSONTyped(json, ignoreDiscriminator) {
31
31
  'originatingProviderId': json['originatingProviderId'] == null ? undefined : json['originatingProviderId'],
32
32
  'person': json['person'] == null ? undefined : PersonDataFromJSON(json['person']),
33
33
  'document': json['document'] == null ? undefined : DocumentDataFromJSON(json['document']),
34
- 'attachments': json['attachments'] == null ? undefined : AttachmentsFromJSON(json['attachments']),
34
+ 'attachmentAccessKeys': json['attachmentAccessKeys'] == null ? undefined : AttachmentAccessKeysFromJSON(json['attachmentAccessKeys']),
35
35
  };
36
36
  }
37
37
  export function IdentityDataToJSON(value) {
@@ -42,6 +42,6 @@ export function IdentityDataToJSON(value) {
42
42
  'originatingProviderId': value['originatingProviderId'],
43
43
  'person': PersonDataToJSON(value['person']),
44
44
  'document': DocumentDataToJSON(value['document']),
45
- 'attachments': AttachmentsToJSON(value['attachments']),
45
+ 'attachmentAccessKeys': AttachmentAccessKeysToJSON(value['attachmentAccessKeys']),
46
46
  };
47
47
  }
@@ -1,5 +1,5 @@
1
1
  export * from './Address';
2
- export * from './Attachments';
2
+ export * from './AttachmentAccessKeys';
3
3
  export * from './CancelSessionResponse';
4
4
  export * from './CreateSessionRequest';
5
5
  export * from './CreateSessionResponse';
@@ -8,6 +8,7 @@ export * from './DisclosedFieldsRequest';
8
8
  export * from './DocumentData';
9
9
  export * from './FailureMessage';
10
10
  export * from './GetAttachmentRequest';
11
+ export * from './GetAttachmentResponse';
11
12
  export * from './GetSessionResponse';
12
13
  export * from './GetSessionResultRequest';
13
14
  export * from './GetSessionResultResponse';
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export * from './Address';
4
- export * from './Attachments';
4
+ export * from './AttachmentAccessKeys';
5
5
  export * from './CancelSessionResponse';
6
6
  export * from './CreateSessionRequest';
7
7
  export * from './CreateSessionResponse';
@@ -10,6 +10,7 @@ export * from './DisclosedFieldsRequest';
10
10
  export * from './DocumentData';
11
11
  export * from './FailureMessage';
12
12
  export * from './GetAttachmentRequest';
13
+ export * from './GetAttachmentResponse';
13
14
  export * from './GetSessionResponse';
14
15
  export * from './GetSessionResultRequest';
15
16
  export * from './GetSessionResultResponse';
@@ -12,25 +12,25 @@
12
12
  /**
13
13
  * Attachment Access Keys for attachments (eg document / selfie images)
14
14
  * @export
15
- * @interface Attachments
15
+ * @interface AttachmentAccessKeys
16
16
  */
17
- export interface Attachments {
17
+ export interface AttachmentAccessKeys {
18
18
  /**
19
19
  * Key to access the selfie image (if relevant) for this verification
20
20
  * @type {string}
21
- * @memberof Attachments
21
+ * @memberof AttachmentAccessKeys
22
22
  */
23
23
  selfie?: string;
24
24
  /**
25
25
  * Key to access the document front image (if relevant) for this verification
26
26
  * @type {string}
27
- * @memberof Attachments
27
+ * @memberof AttachmentAccessKeys
28
28
  */
29
29
  documentFront?: string;
30
30
  /**
31
31
  * Key to access the document back image (if relevant) for this verification
32
32
  * @type {string}
33
- * @memberof Attachments
33
+ * @memberof AttachmentAccessKeys
34
34
  */
35
35
  documentBack?: string;
36
36
  /**
@@ -38,14 +38,14 @@ export interface Attachments {
38
38
  *
39
39
  * Specifically, this is a cropped version of the document front image which includes only the portrait on the document.
40
40
  * @type {string}
41
- * @memberof Attachments
41
+ * @memberof AttachmentAccessKeys
42
42
  */
43
43
  documentPortrait?: string;
44
44
  }
45
45
  /**
46
- * Check if a given object implements the Attachments interface.
46
+ * Check if a given object implements the AttachmentAccessKeys interface.
47
47
  */
48
- export declare function instanceOfAttachments(value: object): value is Attachments;
49
- export declare function AttachmentsFromJSON(json: any): Attachments;
50
- export declare function AttachmentsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachments;
51
- export declare function AttachmentsToJSON(value?: Attachments | null): any;
48
+ export declare function instanceOfAttachmentAccessKeys(value: object): value is AttachmentAccessKeys;
49
+ export declare function AttachmentAccessKeysFromJSON(json: any): AttachmentAccessKeys;
50
+ export declare function AttachmentAccessKeysFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentAccessKeys;
51
+ export declare function AttachmentAccessKeysToJSON(value?: AttachmentAccessKeys | null): any;
@@ -13,20 +13,20 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.instanceOfAttachments = instanceOfAttachments;
17
- exports.AttachmentsFromJSON = AttachmentsFromJSON;
18
- exports.AttachmentsFromJSONTyped = AttachmentsFromJSONTyped;
19
- exports.AttachmentsToJSON = AttachmentsToJSON;
16
+ exports.instanceOfAttachmentAccessKeys = instanceOfAttachmentAccessKeys;
17
+ exports.AttachmentAccessKeysFromJSON = AttachmentAccessKeysFromJSON;
18
+ exports.AttachmentAccessKeysFromJSONTyped = AttachmentAccessKeysFromJSONTyped;
19
+ exports.AttachmentAccessKeysToJSON = AttachmentAccessKeysToJSON;
20
20
  /**
21
- * Check if a given object implements the Attachments interface.
21
+ * Check if a given object implements the AttachmentAccessKeys interface.
22
22
  */
23
- function instanceOfAttachments(value) {
23
+ function instanceOfAttachmentAccessKeys(value) {
24
24
  return true;
25
25
  }
26
- function AttachmentsFromJSON(json) {
27
- return AttachmentsFromJSONTyped(json, false);
26
+ function AttachmentAccessKeysFromJSON(json) {
27
+ return AttachmentAccessKeysFromJSONTyped(json, false);
28
28
  }
29
- function AttachmentsFromJSONTyped(json, ignoreDiscriminator) {
29
+ function AttachmentAccessKeysFromJSONTyped(json, ignoreDiscriminator) {
30
30
  if (json == null) {
31
31
  return json;
32
32
  }
@@ -37,7 +37,7 @@ function AttachmentsFromJSONTyped(json, ignoreDiscriminator) {
37
37
  'documentPortrait': json['documentPortrait'] == null ? undefined : json['documentPortrait'],
38
38
  };
39
39
  }
40
- function AttachmentsToJSON(value) {
40
+ function AttachmentAccessKeysToJSON(value) {
41
41
  if (value == null) {
42
42
  return value;
43
43
  }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Connect API
3
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ *
5
+ * The version of the OpenAPI document: v1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface GetAttachmentResponse
16
+ */
17
+ export interface GetAttachmentResponse {
18
+ /**
19
+ * The raw file contents of the Attachment
20
+ * @type {string}
21
+ * @memberof GetAttachmentResponse
22
+ */
23
+ content: string;
24
+ /**
25
+ * The MIME type of the Attachment data
26
+ * @type {string}
27
+ * @memberof GetAttachmentResponse
28
+ */
29
+ contentType: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the GetAttachmentResponse interface.
33
+ */
34
+ export declare function instanceOfGetAttachmentResponse(value: object): value is GetAttachmentResponse;
35
+ export declare function GetAttachmentResponseFromJSON(json: any): GetAttachmentResponse;
36
+ export declare function GetAttachmentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAttachmentResponse;
37
+ export declare function GetAttachmentResponseToJSON(value?: GetAttachmentResponse | null): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Connect API
6
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+ *
8
+ * The version of the OpenAPI document: v1
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfGetAttachmentResponse = instanceOfGetAttachmentResponse;
17
+ exports.GetAttachmentResponseFromJSON = GetAttachmentResponseFromJSON;
18
+ exports.GetAttachmentResponseFromJSONTyped = GetAttachmentResponseFromJSONTyped;
19
+ exports.GetAttachmentResponseToJSON = GetAttachmentResponseToJSON;
20
+ /**
21
+ * Check if a given object implements the GetAttachmentResponse interface.
22
+ */
23
+ function instanceOfGetAttachmentResponse(value) {
24
+ if (!('content' in value) || value['content'] === undefined)
25
+ return false;
26
+ if (!('contentType' in value) || value['contentType'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ function GetAttachmentResponseFromJSON(json) {
31
+ return GetAttachmentResponseFromJSONTyped(json, false);
32
+ }
33
+ function GetAttachmentResponseFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'content': json['content'],
39
+ 'contentType': json['contentType'],
40
+ };
41
+ }
42
+ function GetAttachmentResponseToJSON(value) {
43
+ if (value == null) {
44
+ return value;
45
+ }
46
+ return {
47
+ 'content': value['content'],
48
+ 'contentType': value['contentType'],
49
+ };
50
+ }
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import type { DocumentData } from './DocumentData';
13
13
  import type { PersonData } from './PersonData';
14
- import type { Attachments } from './Attachments';
14
+ import type { AttachmentAccessKeys } from './AttachmentAccessKeys';
15
15
  /**
16
16
  *
17
17
  * @export
@@ -37,11 +37,11 @@ export interface IdentityData {
37
37
  */
38
38
  document?: DocumentData;
39
39
  /**
40
- * Access keys for attachments (eg document/selfie images)
41
- * @type {Attachments}
40
+ * Attachment Access Keys for attachments (eg document / selfie images)
41
+ * @type {AttachmentAccessKeys}
42
42
  * @memberof IdentityData
43
43
  */
44
- attachments?: Attachments;
44
+ attachmentAccessKeys?: AttachmentAccessKeys;
45
45
  }
46
46
  /**
47
47
  * Check if a given object implements the IdentityData interface.
@@ -19,7 +19,7 @@ exports.IdentityDataFromJSONTyped = IdentityDataFromJSONTyped;
19
19
  exports.IdentityDataToJSON = IdentityDataToJSON;
20
20
  const DocumentData_1 = require("./DocumentData");
21
21
  const PersonData_1 = require("./PersonData");
22
- const Attachments_1 = require("./Attachments");
22
+ const AttachmentAccessKeys_1 = require("./AttachmentAccessKeys");
23
23
  /**
24
24
  * Check if a given object implements the IdentityData interface.
25
25
  */
@@ -37,7 +37,7 @@ function IdentityDataFromJSONTyped(json, ignoreDiscriminator) {
37
37
  'originatingProviderId': json['originatingProviderId'] == null ? undefined : json['originatingProviderId'],
38
38
  'person': json['person'] == null ? undefined : (0, PersonData_1.PersonDataFromJSON)(json['person']),
39
39
  'document': json['document'] == null ? undefined : (0, DocumentData_1.DocumentDataFromJSON)(json['document']),
40
- 'attachments': json['attachments'] == null ? undefined : (0, Attachments_1.AttachmentsFromJSON)(json['attachments']),
40
+ 'attachmentAccessKeys': json['attachmentAccessKeys'] == null ? undefined : (0, AttachmentAccessKeys_1.AttachmentAccessKeysFromJSON)(json['attachmentAccessKeys']),
41
41
  };
42
42
  }
43
43
  function IdentityDataToJSON(value) {
@@ -48,6 +48,6 @@ function IdentityDataToJSON(value) {
48
48
  'originatingProviderId': value['originatingProviderId'],
49
49
  'person': (0, PersonData_1.PersonDataToJSON)(value['person']),
50
50
  'document': (0, DocumentData_1.DocumentDataToJSON)(value['document']),
51
- 'attachments': (0, Attachments_1.AttachmentsToJSON)(value['attachments']),
51
+ 'attachmentAccessKeys': (0, AttachmentAccessKeys_1.AttachmentAccessKeysToJSON)(value['attachmentAccessKeys']),
52
52
  };
53
53
  }
@@ -1,5 +1,5 @@
1
1
  export * from './Address';
2
- export * from './Attachments';
2
+ export * from './AttachmentAccessKeys';
3
3
  export * from './CancelSessionResponse';
4
4
  export * from './CreateSessionRequest';
5
5
  export * from './CreateSessionResponse';
@@ -8,6 +8,7 @@ export * from './DisclosedFieldsRequest';
8
8
  export * from './DocumentData';
9
9
  export * from './FailureMessage';
10
10
  export * from './GetAttachmentRequest';
11
+ export * from './GetAttachmentResponse';
11
12
  export * from './GetSessionResponse';
12
13
  export * from './GetSessionResultRequest';
13
14
  export * from './GetSessionResultResponse';
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./Address"), exports);
20
- __exportStar(require("./Attachments"), exports);
20
+ __exportStar(require("./AttachmentAccessKeys"), exports);
21
21
  __exportStar(require("./CancelSessionResponse"), exports);
22
22
  __exportStar(require("./CreateSessionRequest"), exports);
23
23
  __exportStar(require("./CreateSessionResponse"), exports);
@@ -26,6 +26,7 @@ __exportStar(require("./DisclosedFieldsRequest"), exports);
26
26
  __exportStar(require("./DocumentData"), exports);
27
27
  __exportStar(require("./FailureMessage"), exports);
28
28
  __exportStar(require("./GetAttachmentRequest"), exports);
29
+ __exportStar(require("./GetAttachmentResponse"), exports);
29
30
  __exportStar(require("./GetSessionResponse"), exports);
30
31
  __exportStar(require("./GetSessionResultRequest"), exports);
31
32
  __exportStar(require("./GetSessionResultResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trinsic/api",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Trinsic API TypeScript library.",
5
5
  "author": "Trinsic",
6
6
  "repository": {
@@ -17,6 +17,7 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  FailureMessage,
19
19
  GetAttachmentRequest,
20
+ GetAttachmentResponse,
20
21
  ValidationResult,
21
22
  } from '../models/index';
22
23
  import {
@@ -24,6 +25,8 @@ import {
24
25
  FailureMessageToJSON,
25
26
  GetAttachmentRequestFromJSON,
26
27
  GetAttachmentRequestToJSON,
28
+ GetAttachmentResponseFromJSON,
29
+ GetAttachmentResponseToJSON,
27
30
  ValidationResultFromJSON,
28
31
  ValidationResultToJSON,
29
32
  } from '../models/index';
@@ -40,20 +43,20 @@ export interface GetAttachmentOperationRequest {
40
43
  */
41
44
  export interface AttachmentsApiInterface {
42
45
  /**
43
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
46
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
44
47
  * @summary Get Attachment
45
48
  * @param {GetAttachmentRequest} [getAttachmentRequest]
46
49
  * @param {*} [options] Override http request option.
47
50
  * @throws {RequiredError}
48
51
  * @memberof AttachmentsApiInterface
49
52
  */
50
- getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
53
+ getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAttachmentResponse>>;
51
54
 
52
55
  /**
53
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
56
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
54
57
  * Get Attachment
55
58
  */
56
- getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
59
+ getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAttachmentResponse>;
57
60
 
58
61
  }
59
62
 
@@ -63,10 +66,10 @@ export interface AttachmentsApiInterface {
63
66
  export class AttachmentsApi extends runtime.BaseAPI implements AttachmentsApiInterface {
64
67
 
65
68
  /**
66
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
69
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
67
70
  * Get Attachment
68
71
  */
69
- async getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
72
+ async getAttachmentRaw(requestParameters: GetAttachmentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAttachmentResponse>> {
70
73
  const queryParameters: any = {};
71
74
 
72
75
  const headerParameters: runtime.HTTPHeaders = {};
@@ -89,15 +92,16 @@ export class AttachmentsApi extends runtime.BaseAPI implements AttachmentsApiInt
89
92
  body: GetAttachmentRequestToJSON(requestParameters['getAttachmentRequest']),
90
93
  }, initOverrides);
91
94
 
92
- return new runtime.VoidApiResponse(response);
95
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetAttachmentResponseFromJSON(jsonValue));
93
96
  }
94
97
 
95
98
  /**
96
- * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 202 code, and you should try again later.
99
+ * Exchange an Attachment Access Key (from `IdentityData.Attachments`) for the raw contents of the attachment. Use this API to fetch document (front, back, portrait) or other (selfie) images from a verification, if relevant. In some cases, attachments may not be immediately available after a verification is completed. If so, this endpoint will return an HTTP 503 code, and you should try again later.
97
100
  * Get Attachment
98
101
  */
99
- async getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
100
- await this.getAttachmentRaw({ getAttachmentRequest: getAttachmentRequest }, initOverrides);
102
+ async getAttachment(getAttachmentRequest?: GetAttachmentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAttachmentResponse> {
103
+ const response = await this.getAttachmentRaw({ getAttachmentRequest: getAttachmentRequest }, initOverrides);
104
+ return await response.value();
101
105
  }
102
106
 
103
107
  }
@@ -16,25 +16,25 @@ import { mapValues } from '../runtime';
16
16
  /**
17
17
  * Attachment Access Keys for attachments (eg document / selfie images)
18
18
  * @export
19
- * @interface Attachments
19
+ * @interface AttachmentAccessKeys
20
20
  */
21
- export interface Attachments {
21
+ export interface AttachmentAccessKeys {
22
22
  /**
23
23
  * Key to access the selfie image (if relevant) for this verification
24
24
  * @type {string}
25
- * @memberof Attachments
25
+ * @memberof AttachmentAccessKeys
26
26
  */
27
27
  selfie?: string;
28
28
  /**
29
29
  * Key to access the document front image (if relevant) for this verification
30
30
  * @type {string}
31
- * @memberof Attachments
31
+ * @memberof AttachmentAccessKeys
32
32
  */
33
33
  documentFront?: string;
34
34
  /**
35
35
  * Key to access the document back image (if relevant) for this verification
36
36
  * @type {string}
37
- * @memberof Attachments
37
+ * @memberof AttachmentAccessKeys
38
38
  */
39
39
  documentBack?: string;
40
40
  /**
@@ -42,23 +42,23 @@ export interface Attachments {
42
42
  *
43
43
  * Specifically, this is a cropped version of the document front image which includes only the portrait on the document.
44
44
  * @type {string}
45
- * @memberof Attachments
45
+ * @memberof AttachmentAccessKeys
46
46
  */
47
47
  documentPortrait?: string;
48
48
  }
49
49
 
50
50
  /**
51
- * Check if a given object implements the Attachments interface.
51
+ * Check if a given object implements the AttachmentAccessKeys interface.
52
52
  */
53
- export function instanceOfAttachments(value: object): value is Attachments {
53
+ export function instanceOfAttachmentAccessKeys(value: object): value is AttachmentAccessKeys {
54
54
  return true;
55
55
  }
56
56
 
57
- export function AttachmentsFromJSON(json: any): Attachments {
58
- return AttachmentsFromJSONTyped(json, false);
57
+ export function AttachmentAccessKeysFromJSON(json: any): AttachmentAccessKeys {
58
+ return AttachmentAccessKeysFromJSONTyped(json, false);
59
59
  }
60
60
 
61
- export function AttachmentsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachments {
61
+ export function AttachmentAccessKeysFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentAccessKeys {
62
62
  if (json == null) {
63
63
  return json;
64
64
  }
@@ -71,7 +71,7 @@ export function AttachmentsFromJSONTyped(json: any, ignoreDiscriminator: boolean
71
71
  };
72
72
  }
73
73
 
74
- export function AttachmentsToJSON(value?: Attachments | null): any {
74
+ export function AttachmentAccessKeysToJSON(value?: AttachmentAccessKeys | null): any {
75
75
  if (value == null) {
76
76
  return value;
77
77
  }
@@ -0,0 +1,70 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Connect API
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: v1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface GetAttachmentResponse
20
+ */
21
+ export interface GetAttachmentResponse {
22
+ /**
23
+ * The raw file contents of the Attachment
24
+ * @type {string}
25
+ * @memberof GetAttachmentResponse
26
+ */
27
+ content: string;
28
+ /**
29
+ * The MIME type of the Attachment data
30
+ * @type {string}
31
+ * @memberof GetAttachmentResponse
32
+ */
33
+ contentType: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the GetAttachmentResponse interface.
38
+ */
39
+ export function instanceOfGetAttachmentResponse(value: object): value is GetAttachmentResponse {
40
+ if (!('content' in value) || value['content'] === undefined) return false;
41
+ if (!('contentType' in value) || value['contentType'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function GetAttachmentResponseFromJSON(json: any): GetAttachmentResponse {
46
+ return GetAttachmentResponseFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function GetAttachmentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetAttachmentResponse {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'content': json['content'],
56
+ 'contentType': json['contentType'],
57
+ };
58
+ }
59
+
60
+ export function GetAttachmentResponseToJSON(value?: GetAttachmentResponse | null): any {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+
66
+ 'content': value['content'],
67
+ 'contentType': value['contentType'],
68
+ };
69
+ }
70
+
@@ -25,12 +25,12 @@ import {
25
25
  PersonDataFromJSONTyped,
26
26
  PersonDataToJSON,
27
27
  } from './PersonData';
28
- import type { Attachments } from './Attachments';
28
+ import type { AttachmentAccessKeys } from './AttachmentAccessKeys';
29
29
  import {
30
- AttachmentsFromJSON,
31
- AttachmentsFromJSONTyped,
32
- AttachmentsToJSON,
33
- } from './Attachments';
30
+ AttachmentAccessKeysFromJSON,
31
+ AttachmentAccessKeysFromJSONTyped,
32
+ AttachmentAccessKeysToJSON,
33
+ } from './AttachmentAccessKeys';
34
34
 
35
35
  /**
36
36
  *
@@ -57,11 +57,11 @@ export interface IdentityData {
57
57
  */
58
58
  document?: DocumentData;
59
59
  /**
60
- * Access keys for attachments (eg document/selfie images)
61
- * @type {Attachments}
60
+ * Attachment Access Keys for attachments (eg document / selfie images)
61
+ * @type {AttachmentAccessKeys}
62
62
  * @memberof IdentityData
63
63
  */
64
- attachments?: Attachments;
64
+ attachmentAccessKeys?: AttachmentAccessKeys;
65
65
  }
66
66
 
67
67
  /**
@@ -84,7 +84,7 @@ export function IdentityDataFromJSONTyped(json: any, ignoreDiscriminator: boolea
84
84
  'originatingProviderId': json['originatingProviderId'] == null ? undefined : json['originatingProviderId'],
85
85
  'person': json['person'] == null ? undefined : PersonDataFromJSON(json['person']),
86
86
  'document': json['document'] == null ? undefined : DocumentDataFromJSON(json['document']),
87
- 'attachments': json['attachments'] == null ? undefined : AttachmentsFromJSON(json['attachments']),
87
+ 'attachmentAccessKeys': json['attachmentAccessKeys'] == null ? undefined : AttachmentAccessKeysFromJSON(json['attachmentAccessKeys']),
88
88
  };
89
89
  }
90
90
 
@@ -97,7 +97,7 @@ export function IdentityDataToJSON(value?: IdentityData | null): any {
97
97
  'originatingProviderId': value['originatingProviderId'],
98
98
  'person': PersonDataToJSON(value['person']),
99
99
  'document': DocumentDataToJSON(value['document']),
100
- 'attachments': AttachmentsToJSON(value['attachments']),
100
+ 'attachmentAccessKeys': AttachmentAccessKeysToJSON(value['attachmentAccessKeys']),
101
101
  };
102
102
  }
103
103
 
@@ -1,7 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export * from './Address';
4
- export * from './Attachments';
4
+ export * from './AttachmentAccessKeys';
5
5
  export * from './CancelSessionResponse';
6
6
  export * from './CreateSessionRequest';
7
7
  export * from './CreateSessionResponse';
@@ -10,6 +10,7 @@ export * from './DisclosedFieldsRequest';
10
10
  export * from './DocumentData';
11
11
  export * from './FailureMessage';
12
12
  export * from './GetAttachmentRequest';
13
+ export * from './GetAttachmentResponse';
13
14
  export * from './GetSessionResponse';
14
15
  export * from './GetSessionResultRequest';
15
16
  export * from './GetSessionResultResponse';