@trinsic/api 0.2.4

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 (177) hide show
  1. package/.openapi-generator/FILES +41 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +46 -0
  5. package/dist/apis/AttachmentsApi.d.ts +50 -0
  6. package/dist/apis/AttachmentsApi.js +66 -0
  7. package/dist/apis/NetworkApi.d.ts +70 -0
  8. package/dist/apis/NetworkApi.js +100 -0
  9. package/dist/apis/SessionsApi.d.ts +178 -0
  10. package/dist/apis/SessionsApi.js +252 -0
  11. package/dist/apis/index.d.ts +3 -0
  12. package/dist/apis/index.js +21 -0
  13. package/dist/esm/apis/AttachmentsApi.d.ts +50 -0
  14. package/dist/esm/apis/AttachmentsApi.js +62 -0
  15. package/dist/esm/apis/NetworkApi.d.ts +70 -0
  16. package/dist/esm/apis/NetworkApi.js +96 -0
  17. package/dist/esm/apis/SessionsApi.d.ts +178 -0
  18. package/dist/esm/apis/SessionsApi.js +248 -0
  19. package/dist/esm/apis/index.d.ts +3 -0
  20. package/dist/esm/apis/index.js +5 -0
  21. package/dist/esm/index.d.ts +3 -0
  22. package/dist/esm/index.js +5 -0
  23. package/dist/esm/models/Address.d.ts +73 -0
  24. package/dist/esm/models/Address.js +52 -0
  25. package/dist/esm/models/Attachments.d.ts +51 -0
  26. package/dist/esm/models/Attachments.js +44 -0
  27. package/dist/esm/models/CancelSessionResponse.d.ts +32 -0
  28. package/dist/esm/models/CancelSessionResponse.js +41 -0
  29. package/dist/esm/models/CreateSessionRequest.d.ts +52 -0
  30. package/dist/esm/models/CreateSessionRequest.js +43 -0
  31. package/dist/esm/models/CreateSessionResponse.d.ts +45 -0
  32. package/dist/esm/models/CreateSessionResponse.js +43 -0
  33. package/dist/esm/models/DisclosedFields.d.ts +97 -0
  34. package/dist/esm/models/DisclosedFields.js +84 -0
  35. package/dist/esm/models/DisclosedFieldsRequest.d.ts +97 -0
  36. package/dist/esm/models/DisclosedFieldsRequest.js +60 -0
  37. package/dist/esm/models/DocumentData.d.ts +61 -0
  38. package/dist/esm/models/DocumentData.js +48 -0
  39. package/dist/esm/models/ExchangeAttachmentAccessKeyRequest.d.ts +31 -0
  40. package/dist/esm/models/ExchangeAttachmentAccessKeyRequest.js +40 -0
  41. package/dist/esm/models/ExchangeResultsKeyRequest.d.ts +31 -0
  42. package/dist/esm/models/ExchangeResultsKeyRequest.js +40 -0
  43. package/dist/esm/models/ExchangeResultsKeyResponse.d.ts +39 -0
  44. package/dist/esm/models/ExchangeResultsKeyResponse.js +44 -0
  45. package/dist/esm/models/FailureMessage.d.ts +31 -0
  46. package/dist/esm/models/FailureMessage.js +40 -0
  47. package/dist/esm/models/GetSessionResponse.d.ts +32 -0
  48. package/dist/esm/models/GetSessionResponse.js +41 -0
  49. package/dist/esm/models/IdentityData.d.ts +52 -0
  50. package/dist/esm/models/IdentityData.js +47 -0
  51. package/dist/esm/models/IdentityLookupResponse.d.ts +31 -0
  52. package/dist/esm/models/IdentityLookupResponse.js +40 -0
  53. package/dist/esm/models/ListProvidersResponse.d.ts +32 -0
  54. package/dist/esm/models/ListProvidersResponse.js +41 -0
  55. package/dist/esm/models/ListSessionsResponse.d.ts +44 -0
  56. package/dist/esm/models/ListSessionsResponse.js +49 -0
  57. package/dist/esm/models/OrderDirection.d.ts +24 -0
  58. package/dist/esm/models/OrderDirection.js +40 -0
  59. package/dist/esm/models/PersonData.d.ts +82 -0
  60. package/dist/esm/models/PersonData.js +55 -0
  61. package/dist/esm/models/ProviderInfo.d.ts +43 -0
  62. package/dist/esm/models/ProviderInfo.js +48 -0
  63. package/dist/esm/models/Session.d.ts +71 -0
  64. package/dist/esm/models/Session.js +66 -0
  65. package/dist/esm/models/SessionFailCode.d.ts +29 -0
  66. package/dist/esm/models/SessionFailCode.js +45 -0
  67. package/dist/esm/models/SessionOrdering.d.ts +25 -0
  68. package/dist/esm/models/SessionOrdering.js +41 -0
  69. package/dist/esm/models/SessionState.d.ts +28 -0
  70. package/dist/esm/models/SessionState.js +44 -0
  71. package/dist/esm/models/ValidationResult.d.ts +37 -0
  72. package/dist/esm/models/ValidationResult.js +41 -0
  73. package/dist/esm/models/Verification.d.ts +38 -0
  74. package/dist/esm/models/Verification.js +41 -0
  75. package/dist/esm/models/VerificationFailCode.d.ts +27 -0
  76. package/dist/esm/models/VerificationFailCode.js +43 -0
  77. package/dist/esm/models/index.d.ts +27 -0
  78. package/dist/esm/models/index.js +29 -0
  79. package/dist/esm/runtime.d.ts +181 -0
  80. package/dist/esm/runtime.js +326 -0
  81. package/dist/index.d.ts +3 -0
  82. package/dist/index.js +21 -0
  83. package/dist/models/Address.d.ts +73 -0
  84. package/dist/models/Address.js +58 -0
  85. package/dist/models/Attachments.d.ts +51 -0
  86. package/dist/models/Attachments.js +50 -0
  87. package/dist/models/CancelSessionResponse.d.ts +32 -0
  88. package/dist/models/CancelSessionResponse.js +47 -0
  89. package/dist/models/CreateSessionRequest.d.ts +52 -0
  90. package/dist/models/CreateSessionRequest.js +49 -0
  91. package/dist/models/CreateSessionResponse.d.ts +45 -0
  92. package/dist/models/CreateSessionResponse.js +49 -0
  93. package/dist/models/DisclosedFields.d.ts +97 -0
  94. package/dist/models/DisclosedFields.js +90 -0
  95. package/dist/models/DisclosedFieldsRequest.d.ts +97 -0
  96. package/dist/models/DisclosedFieldsRequest.js +66 -0
  97. package/dist/models/DocumentData.d.ts +61 -0
  98. package/dist/models/DocumentData.js +54 -0
  99. package/dist/models/ExchangeAttachmentAccessKeyRequest.d.ts +31 -0
  100. package/dist/models/ExchangeAttachmentAccessKeyRequest.js +46 -0
  101. package/dist/models/ExchangeResultsKeyRequest.d.ts +31 -0
  102. package/dist/models/ExchangeResultsKeyRequest.js +46 -0
  103. package/dist/models/ExchangeResultsKeyResponse.d.ts +39 -0
  104. package/dist/models/ExchangeResultsKeyResponse.js +50 -0
  105. package/dist/models/FailureMessage.d.ts +31 -0
  106. package/dist/models/FailureMessage.js +46 -0
  107. package/dist/models/GetSessionResponse.d.ts +32 -0
  108. package/dist/models/GetSessionResponse.js +47 -0
  109. package/dist/models/IdentityData.d.ts +52 -0
  110. package/dist/models/IdentityData.js +53 -0
  111. package/dist/models/IdentityLookupResponse.d.ts +31 -0
  112. package/dist/models/IdentityLookupResponse.js +46 -0
  113. package/dist/models/ListProvidersResponse.d.ts +32 -0
  114. package/dist/models/ListProvidersResponse.js +47 -0
  115. package/dist/models/ListSessionsResponse.d.ts +44 -0
  116. package/dist/models/ListSessionsResponse.js +55 -0
  117. package/dist/models/OrderDirection.d.ts +24 -0
  118. package/dist/models/OrderDirection.js +47 -0
  119. package/dist/models/PersonData.d.ts +82 -0
  120. package/dist/models/PersonData.js +61 -0
  121. package/dist/models/ProviderInfo.d.ts +43 -0
  122. package/dist/models/ProviderInfo.js +54 -0
  123. package/dist/models/Session.d.ts +71 -0
  124. package/dist/models/Session.js +72 -0
  125. package/dist/models/SessionFailCode.d.ts +29 -0
  126. package/dist/models/SessionFailCode.js +52 -0
  127. package/dist/models/SessionOrdering.d.ts +25 -0
  128. package/dist/models/SessionOrdering.js +48 -0
  129. package/dist/models/SessionState.d.ts +28 -0
  130. package/dist/models/SessionState.js +51 -0
  131. package/dist/models/ValidationResult.d.ts +37 -0
  132. package/dist/models/ValidationResult.js +47 -0
  133. package/dist/models/Verification.d.ts +38 -0
  134. package/dist/models/Verification.js +47 -0
  135. package/dist/models/VerificationFailCode.d.ts +27 -0
  136. package/dist/models/VerificationFailCode.js +50 -0
  137. package/dist/models/index.d.ts +27 -0
  138. package/dist/models/index.js +45 -0
  139. package/dist/runtime.d.ts +181 -0
  140. package/dist/runtime.js +341 -0
  141. package/package.json +21 -0
  142. package/src/apis/AttachmentsApi.ts +100 -0
  143. package/src/apis/NetworkApi.ts +156 -0
  144. package/src/apis/SessionsApi.ts +444 -0
  145. package/src/apis/index.ts +5 -0
  146. package/src/index.ts +5 -0
  147. package/src/models/Address.ts +116 -0
  148. package/src/models/Attachments.ts +86 -0
  149. package/src/models/CancelSessionResponse.ts +68 -0
  150. package/src/models/CreateSessionRequest.ts +91 -0
  151. package/src/models/CreateSessionResponse.ts +83 -0
  152. package/src/models/DisclosedFields.ts +160 -0
  153. package/src/models/DisclosedFieldsRequest.ts +148 -0
  154. package/src/models/DocumentData.ts +100 -0
  155. package/src/models/ExchangeAttachmentAccessKeyRequest.ts +61 -0
  156. package/src/models/ExchangeResultsKeyRequest.ts +61 -0
  157. package/src/models/ExchangeResultsKeyResponse.ts +82 -0
  158. package/src/models/FailureMessage.ts +61 -0
  159. package/src/models/GetSessionResponse.ts +68 -0
  160. package/src/models/IdentityData.ts +103 -0
  161. package/src/models/IdentityLookupResponse.ts +61 -0
  162. package/src/models/ListProvidersResponse.ts +68 -0
  163. package/src/models/ListSessionsResponse.ts +86 -0
  164. package/src/models/OrderDirection.ts +49 -0
  165. package/src/models/PersonData.ts +133 -0
  166. package/src/models/ProviderInfo.ts +79 -0
  167. package/src/models/Session.ts +139 -0
  168. package/src/models/SessionFailCode.ts +54 -0
  169. package/src/models/SessionOrdering.ts +50 -0
  170. package/src/models/SessionState.ts +53 -0
  171. package/src/models/ValidationResult.ts +68 -0
  172. package/src/models/Verification.ts +75 -0
  173. package/src/models/VerificationFailCode.ts +52 -0
  174. package/src/models/index.ts +29 -0
  175. package/src/runtime.ts +426 -0
  176. package/tsconfig.esm.json +7 -0
  177. package/tsconfig.json +16 -0
@@ -0,0 +1,341 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
26
+ exports.querystring = querystring;
27
+ exports.mapValues = mapValues;
28
+ exports.canConsumeForm = canConsumeForm;
29
+ exports.BASE_PATH = "https://api.trinsic.id".replace(/\/+$/, "");
30
+ class Configuration {
31
+ constructor(configuration = {}) {
32
+ this.configuration = configuration;
33
+ }
34
+ set config(configuration) {
35
+ this.configuration = configuration;
36
+ }
37
+ get basePath() {
38
+ return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
39
+ }
40
+ get fetchApi() {
41
+ return this.configuration.fetchApi;
42
+ }
43
+ get middleware() {
44
+ return this.configuration.middleware || [];
45
+ }
46
+ get queryParamsStringify() {
47
+ return this.configuration.queryParamsStringify || querystring;
48
+ }
49
+ get username() {
50
+ return this.configuration.username;
51
+ }
52
+ get password() {
53
+ return this.configuration.password;
54
+ }
55
+ get apiKey() {
56
+ const apiKey = this.configuration.apiKey;
57
+ if (apiKey) {
58
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
59
+ }
60
+ return undefined;
61
+ }
62
+ get accessToken() {
63
+ const accessToken = this.configuration.accessToken;
64
+ if (accessToken) {
65
+ return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
66
+ }
67
+ return undefined;
68
+ }
69
+ get headers() {
70
+ return this.configuration.headers;
71
+ }
72
+ get credentials() {
73
+ return this.configuration.credentials;
74
+ }
75
+ }
76
+ exports.Configuration = Configuration;
77
+ exports.DefaultConfig = new Configuration();
78
+ /**
79
+ * This is the base class for all generated API classes.
80
+ */
81
+ class BaseAPI {
82
+ constructor(configuration = exports.DefaultConfig) {
83
+ this.configuration = configuration;
84
+ this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
85
+ let fetchParams = { url, init };
86
+ for (const middleware of this.middleware) {
87
+ if (middleware.pre) {
88
+ fetchParams = (yield middleware.pre(Object.assign({ fetch: this.fetchApi }, fetchParams))) || fetchParams;
89
+ }
90
+ }
91
+ let response = undefined;
92
+ try {
93
+ response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
94
+ }
95
+ catch (e) {
96
+ for (const middleware of this.middleware) {
97
+ if (middleware.onError) {
98
+ response = (yield middleware.onError({
99
+ fetch: this.fetchApi,
100
+ url: fetchParams.url,
101
+ init: fetchParams.init,
102
+ error: e,
103
+ response: response ? response.clone() : undefined,
104
+ })) || response;
105
+ }
106
+ }
107
+ if (response === undefined) {
108
+ if (e instanceof Error) {
109
+ throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
110
+ }
111
+ else {
112
+ throw e;
113
+ }
114
+ }
115
+ }
116
+ for (const middleware of this.middleware) {
117
+ if (middleware.post) {
118
+ response = (yield middleware.post({
119
+ fetch: this.fetchApi,
120
+ url: fetchParams.url,
121
+ init: fetchParams.init,
122
+ response: response.clone(),
123
+ })) || response;
124
+ }
125
+ }
126
+ return response;
127
+ });
128
+ this.middleware = configuration.middleware;
129
+ }
130
+ withMiddleware(...middlewares) {
131
+ const next = this.clone();
132
+ next.middleware = next.middleware.concat(...middlewares);
133
+ return next;
134
+ }
135
+ withPreMiddleware(...preMiddlewares) {
136
+ const middlewares = preMiddlewares.map((pre) => ({ pre }));
137
+ return this.withMiddleware(...middlewares);
138
+ }
139
+ withPostMiddleware(...postMiddlewares) {
140
+ const middlewares = postMiddlewares.map((post) => ({ post }));
141
+ return this.withMiddleware(...middlewares);
142
+ }
143
+ /**
144
+ * Check if the given MIME is a JSON MIME.
145
+ * JSON MIME examples:
146
+ * application/json
147
+ * application/json; charset=UTF8
148
+ * APPLICATION/JSON
149
+ * application/vnd.company+json
150
+ * @param mime - MIME (Multipurpose Internet Mail Extensions)
151
+ * @return True if the given MIME is JSON, false otherwise.
152
+ */
153
+ isJsonMime(mime) {
154
+ if (!mime) {
155
+ return false;
156
+ }
157
+ return BaseAPI.jsonRegex.test(mime);
158
+ }
159
+ request(context, initOverrides) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const { url, init } = yield this.createFetchParams(context, initOverrides);
162
+ const response = yield this.fetchApi(url, init);
163
+ if (response && (response.status >= 200 && response.status < 300)) {
164
+ return response;
165
+ }
166
+ throw new ResponseError(response, 'Response returned an error code');
167
+ });
168
+ }
169
+ createFetchParams(context, initOverrides) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ let url = this.configuration.basePath + context.path;
172
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
173
+ // only add the querystring to the URL if there are query parameters.
174
+ // this is done to avoid urls ending with a "?" character which buggy webservers
175
+ // do not handle correctly sometimes.
176
+ url += '?' + this.configuration.queryParamsStringify(context.query);
177
+ }
178
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
179
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
180
+ const initOverrideFn = typeof initOverrides === "function"
181
+ ? initOverrides
182
+ : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
183
+ const initParams = {
184
+ method: context.method,
185
+ headers,
186
+ body: context.body,
187
+ credentials: this.configuration.credentials,
188
+ };
189
+ const overriddenInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
190
+ init: initParams,
191
+ context,
192
+ })));
193
+ let body;
194
+ if (isFormData(overriddenInit.body)
195
+ || (overriddenInit.body instanceof URLSearchParams)
196
+ || isBlob(overriddenInit.body)) {
197
+ body = overriddenInit.body;
198
+ }
199
+ else if (this.isJsonMime(headers['Content-Type'])) {
200
+ body = JSON.stringify(overriddenInit.body);
201
+ }
202
+ else {
203
+ body = overriddenInit.body;
204
+ }
205
+ const init = Object.assign(Object.assign({}, overriddenInit), { body });
206
+ return { url, init };
207
+ });
208
+ }
209
+ /**
210
+ * Create a shallow clone of `this` by constructing a new instance
211
+ * and then shallow cloning data members.
212
+ */
213
+ clone() {
214
+ const constructor = this.constructor;
215
+ const next = new constructor(this.configuration);
216
+ next.middleware = this.middleware.slice();
217
+ return next;
218
+ }
219
+ }
220
+ exports.BaseAPI = BaseAPI;
221
+ BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
222
+ ;
223
+ function isBlob(value) {
224
+ return typeof Blob !== 'undefined' && value instanceof Blob;
225
+ }
226
+ function isFormData(value) {
227
+ return typeof FormData !== "undefined" && value instanceof FormData;
228
+ }
229
+ class ResponseError extends Error {
230
+ constructor(response, msg) {
231
+ super(msg);
232
+ this.response = response;
233
+ this.name = "ResponseError";
234
+ }
235
+ }
236
+ exports.ResponseError = ResponseError;
237
+ class FetchError extends Error {
238
+ constructor(cause, msg) {
239
+ super(msg);
240
+ this.cause = cause;
241
+ this.name = "FetchError";
242
+ }
243
+ }
244
+ exports.FetchError = FetchError;
245
+ class RequiredError extends Error {
246
+ constructor(field, msg) {
247
+ super(msg);
248
+ this.field = field;
249
+ this.name = "RequiredError";
250
+ }
251
+ }
252
+ exports.RequiredError = RequiredError;
253
+ exports.COLLECTION_FORMATS = {
254
+ csv: ",",
255
+ ssv: " ",
256
+ tsv: "\t",
257
+ pipes: "|",
258
+ };
259
+ function querystring(params, prefix = '') {
260
+ return Object.keys(params)
261
+ .map(key => querystringSingleKey(key, params[key], prefix))
262
+ .filter(part => part.length > 0)
263
+ .join('&');
264
+ }
265
+ function querystringSingleKey(key, value, keyPrefix = '') {
266
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
267
+ if (value instanceof Array) {
268
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
269
+ .join(`&${encodeURIComponent(fullKey)}=`);
270
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
271
+ }
272
+ if (value instanceof Set) {
273
+ const valueAsArray = Array.from(value);
274
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
275
+ }
276
+ if (value instanceof Date) {
277
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
278
+ }
279
+ if (value instanceof Object) {
280
+ return querystring(value, fullKey);
281
+ }
282
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
283
+ }
284
+ function mapValues(data, fn) {
285
+ return Object.keys(data).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: fn(data[key]) })), {});
286
+ }
287
+ function canConsumeForm(consumes) {
288
+ for (const consume of consumes) {
289
+ if ('multipart/form-data' === consume.contentType) {
290
+ return true;
291
+ }
292
+ }
293
+ return false;
294
+ }
295
+ class JSONApiResponse {
296
+ constructor(raw, transformer = (jsonValue) => jsonValue) {
297
+ this.raw = raw;
298
+ this.transformer = transformer;
299
+ }
300
+ value() {
301
+ return __awaiter(this, void 0, void 0, function* () {
302
+ return this.transformer(yield this.raw.json());
303
+ });
304
+ }
305
+ }
306
+ exports.JSONApiResponse = JSONApiResponse;
307
+ class VoidApiResponse {
308
+ constructor(raw) {
309
+ this.raw = raw;
310
+ }
311
+ value() {
312
+ return __awaiter(this, void 0, void 0, function* () {
313
+ return undefined;
314
+ });
315
+ }
316
+ }
317
+ exports.VoidApiResponse = VoidApiResponse;
318
+ class BlobApiResponse {
319
+ constructor(raw) {
320
+ this.raw = raw;
321
+ }
322
+ value() {
323
+ return __awaiter(this, void 0, void 0, function* () {
324
+ return yield this.raw.blob();
325
+ });
326
+ }
327
+ ;
328
+ }
329
+ exports.BlobApiResponse = BlobApiResponse;
330
+ class TextApiResponse {
331
+ constructor(raw) {
332
+ this.raw = raw;
333
+ }
334
+ value() {
335
+ return __awaiter(this, void 0, void 0, function* () {
336
+ return yield this.raw.text();
337
+ });
338
+ }
339
+ ;
340
+ }
341
+ exports.TextApiResponse = TextApiResponse;
package/package.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "@trinsic/api",
3
+ "version": "0.2.4",
4
+ "description": "OpenAPI client for @trinsic/api",
5
+ "author": "OpenAPI-Generator",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
9
+ },
10
+ "main": "./dist/index.js",
11
+ "typings": "./dist/index.d.ts",
12
+ "module": "./dist/esm/index.js",
13
+ "sideEffects": false,
14
+ "scripts": {
15
+ "build": "tsc && tsc -p tsconfig.esm.json",
16
+ "prepare": "npm run build"
17
+ },
18
+ "devDependencies": {
19
+ "typescript": "^4.0 || ^5.0"
20
+ }
21
+ }
@@ -0,0 +1,100 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ ExchangeAttachmentAccessKeyRequest,
19
+ FailureMessage,
20
+ ValidationResult,
21
+ } from '../models/index';
22
+ import {
23
+ ExchangeAttachmentAccessKeyRequestFromJSON,
24
+ ExchangeAttachmentAccessKeyRequestToJSON,
25
+ FailureMessageFromJSON,
26
+ FailureMessageToJSON,
27
+ ValidationResultFromJSON,
28
+ ValidationResultToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface ExchangeAttachmentAccessKeyOperationRequest {
32
+ exchangeAttachmentAccessKeyRequest?: ExchangeAttachmentAccessKeyRequest;
33
+ }
34
+
35
+ /**
36
+ * AttachmentsApi - interface
37
+ *
38
+ * @export
39
+ * @interface AttachmentsApiInterface
40
+ */
41
+ export interface AttachmentsApiInterface {
42
+ /**
43
+ *
44
+ * @summary 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.
45
+ * @param {ExchangeAttachmentAccessKeyRequest} [exchangeAttachmentAccessKeyRequest]
46
+ * @param {*} [options] Override http request option.
47
+ * @throws {RequiredError}
48
+ * @memberof AttachmentsApiInterface
49
+ */
50
+ exchangeAttachmentAccessKeyRaw(requestParameters: ExchangeAttachmentAccessKeyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
51
+
52
+ /**
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.
54
+ */
55
+ exchangeAttachmentAccessKey(exchangeAttachmentAccessKeyRequest?: ExchangeAttachmentAccessKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
56
+
57
+ }
58
+
59
+ /**
60
+ *
61
+ */
62
+ export class AttachmentsApi extends runtime.BaseAPI implements AttachmentsApiInterface {
63
+
64
+ /**
65
+ * 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.
66
+ */
67
+ async exchangeAttachmentAccessKeyRaw(requestParameters: ExchangeAttachmentAccessKeyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
68
+ const queryParameters: any = {};
69
+
70
+ const headerParameters: runtime.HTTPHeaders = {};
71
+
72
+ headerParameters['Content-Type'] = 'application/json';
73
+
74
+ if (this.configuration && this.configuration.accessToken) {
75
+ const token = this.configuration.accessToken;
76
+ const tokenString = await token("Bearer", []);
77
+
78
+ if (tokenString) {
79
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
80
+ }
81
+ }
82
+ const response = await this.request({
83
+ path: `/api/v1/attachments/exchange`,
84
+ method: 'POST',
85
+ headers: headerParameters,
86
+ query: queryParameters,
87
+ body: ExchangeAttachmentAccessKeyRequestToJSON(requestParameters['exchangeAttachmentAccessKeyRequest']),
88
+ }, initOverrides);
89
+
90
+ return new runtime.VoidApiResponse(response);
91
+ }
92
+
93
+ /**
94
+ * 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.
95
+ */
96
+ async exchangeAttachmentAccessKey(exchangeAttachmentAccessKeyRequest?: ExchangeAttachmentAccessKeyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
97
+ await this.exchangeAttachmentAccessKeyRaw({ exchangeAttachmentAccessKeyRequest: exchangeAttachmentAccessKeyRequest }, initOverrides);
98
+ }
99
+
100
+ }
@@ -0,0 +1,156 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ FailureMessage,
19
+ IdentityLookupResponse,
20
+ ListProvidersResponse,
21
+ ValidationResult,
22
+ } from '../models/index';
23
+ import {
24
+ FailureMessageFromJSON,
25
+ FailureMessageToJSON,
26
+ IdentityLookupResponseFromJSON,
27
+ IdentityLookupResponseToJSON,
28
+ ListProvidersResponseFromJSON,
29
+ ListProvidersResponseToJSON,
30
+ ValidationResultFromJSON,
31
+ ValidationResultToJSON,
32
+ } from '../models/index';
33
+
34
+ export interface IdentityLookupRequest {
35
+ phoneNumber: string;
36
+ }
37
+
38
+ /**
39
+ * NetworkApi - interface
40
+ *
41
+ * @export
42
+ * @interface NetworkApiInterface
43
+ */
44
+ export interface NetworkApiInterface {
45
+ /**
46
+ *
47
+ * @summary Query the availability of an identity in the Trinsic Network by phone number
48
+ * @param {string} phoneNumber
49
+ * @param {*} [options] Override http request option.
50
+ * @throws {RequiredError}
51
+ * @memberof NetworkApiInterface
52
+ */
53
+ identityLookupRaw(requestParameters: IdentityLookupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IdentityLookupResponse>>;
54
+
55
+ /**
56
+ * Query the availability of an identity in the Trinsic Network by phone number
57
+ */
58
+ identityLookup(phoneNumber: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IdentityLookupResponse>;
59
+
60
+ /**
61
+ *
62
+ * @summary List all identity providers available for use
63
+ * @param {*} [options] Override http request option.
64
+ * @throws {RequiredError}
65
+ * @memberof NetworkApiInterface
66
+ */
67
+ listProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListProvidersResponse>>;
68
+
69
+ /**
70
+ * List all identity providers available for use
71
+ */
72
+ listProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListProvidersResponse>;
73
+
74
+ }
75
+
76
+ /**
77
+ *
78
+ */
79
+ export class NetworkApi extends runtime.BaseAPI implements NetworkApiInterface {
80
+
81
+ /**
82
+ * Query the availability of an identity in the Trinsic Network by phone number
83
+ */
84
+ async identityLookupRaw(requestParameters: IdentityLookupRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IdentityLookupResponse>> {
85
+ if (requestParameters['phoneNumber'] == null) {
86
+ throw new runtime.RequiredError(
87
+ 'phoneNumber',
88
+ 'Required parameter "phoneNumber" was null or undefined when calling identityLookup().'
89
+ );
90
+ }
91
+
92
+ const queryParameters: any = {};
93
+
94
+ const headerParameters: runtime.HTTPHeaders = {};
95
+
96
+ if (this.configuration && this.configuration.accessToken) {
97
+ const token = this.configuration.accessToken;
98
+ const tokenString = await token("Bearer", []);
99
+
100
+ if (tokenString) {
101
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
102
+ }
103
+ }
104
+ const response = await this.request({
105
+ path: `/api/v1/network/identities/{phoneNumber}`.replace(`{${"phoneNumber"}}`, encodeURIComponent(String(requestParameters['phoneNumber']))),
106
+ method: 'GET',
107
+ headers: headerParameters,
108
+ query: queryParameters,
109
+ }, initOverrides);
110
+
111
+ return new runtime.JSONApiResponse(response, (jsonValue) => IdentityLookupResponseFromJSON(jsonValue));
112
+ }
113
+
114
+ /**
115
+ * Query the availability of an identity in the Trinsic Network by phone number
116
+ */
117
+ async identityLookup(phoneNumber: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IdentityLookupResponse> {
118
+ const response = await this.identityLookupRaw({ phoneNumber: phoneNumber }, initOverrides);
119
+ return await response.value();
120
+ }
121
+
122
+ /**
123
+ * List all identity providers available for use
124
+ */
125
+ async listProvidersRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListProvidersResponse>> {
126
+ const queryParameters: any = {};
127
+
128
+ const headerParameters: runtime.HTTPHeaders = {};
129
+
130
+ if (this.configuration && this.configuration.accessToken) {
131
+ const token = this.configuration.accessToken;
132
+ const tokenString = await token("Bearer", []);
133
+
134
+ if (tokenString) {
135
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
136
+ }
137
+ }
138
+ const response = await this.request({
139
+ path: `/api/v1/network/providers`,
140
+ method: 'GET',
141
+ headers: headerParameters,
142
+ query: queryParameters,
143
+ }, initOverrides);
144
+
145
+ return new runtime.JSONApiResponse(response, (jsonValue) => ListProvidersResponseFromJSON(jsonValue));
146
+ }
147
+
148
+ /**
149
+ * List all identity providers available for use
150
+ */
151
+ async listProviders(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListProvidersResponse> {
152
+ const response = await this.listProvidersRaw(initOverrides);
153
+ return await response.value();
154
+ }
155
+
156
+ }