@dockflow/sdk 0.2.0 → 0.3.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 (115) hide show
  1. package/.openapi-generator/FILES +24 -24
  2. package/README.md +28 -23
  3. package/dist/apis/DocumentsApi.d.ts +111 -0
  4. package/dist/apis/{V3DocumentApi.js → DocumentsApi.js} +60 -60
  5. package/dist/apis/TradeflowsApi.d.ts +63 -0
  6. package/dist/apis/{V3DownstreamApi.js → TradeflowsApi.js} +44 -44
  7. package/dist/apis/{V3UpstreamApi.d.ts → UpstreamApi.d.ts} +13 -13
  8. package/dist/apis/{V3UpstreamApi.js → UpstreamApi.js} +13 -13
  9. package/dist/apis/index.d.ts +3 -3
  10. package/dist/apis/index.js +3 -3
  11. package/dist/esm/apis/DocumentsApi.d.ts +111 -0
  12. package/dist/esm/apis/{V3DocumentApi.js → DocumentsApi.js} +58 -58
  13. package/dist/esm/apis/TradeflowsApi.d.ts +63 -0
  14. package/dist/esm/apis/{V3DownstreamApi.js → TradeflowsApi.js} +42 -42
  15. package/dist/esm/apis/{V3UpstreamApi.d.ts → UpstreamApi.d.ts} +13 -13
  16. package/dist/esm/apis/{V3UpstreamApi.js → UpstreamApi.js} +11 -11
  17. package/dist/esm/apis/index.d.ts +3 -3
  18. package/dist/esm/apis/index.js +3 -3
  19. package/dist/esm/models/CreateTradeflows202Response.d.ts +42 -0
  20. package/dist/esm/models/{V3DownstreamPost202Response.js → CreateTradeflows202Response.js} +12 -12
  21. package/dist/esm/models/CreateTradeflows202ResponseTradeflowsInner.d.ts +34 -0
  22. package/dist/esm/models/{V3DownstreamPost202ResponseTradeflowsInner.js → CreateTradeflows202ResponseTradeflowsInner.js} +8 -8
  23. package/dist/esm/models/GetDocument200Response.d.ts +39 -0
  24. package/dist/esm/models/{V3DocumentGet200Response.js → GetDocument200Response.js} +11 -11
  25. package/dist/esm/models/GetDocument200ResponseDataInner.d.ts +63 -0
  26. package/dist/esm/models/{V3DocumentGet200ResponseDataInner.js → GetDocument200ResponseDataInner.js} +11 -11
  27. package/dist/esm/models/GetDocument200ResponseDataInnerDocumentType.d.ts +34 -0
  28. package/dist/esm/models/{V3DocumentGet200ResponseDataInnerDocumentType.js → GetDocument200ResponseDataInnerDocumentType.js} +8 -8
  29. package/dist/esm/models/GetUpstream200Response.d.ts +35 -0
  30. package/dist/esm/models/{V3UpstreamGet200Response.js → GetUpstream200Response.js} +8 -8
  31. package/dist/esm/models/GetUpstream400Response.d.ts +26 -0
  32. package/dist/esm/models/GetUpstream400Response.js +31 -0
  33. package/dist/{models/V3DocumentPost202Response.d.ts → esm/models/UploadDocument202Response.d.ts} +8 -8
  34. package/dist/esm/models/{V3DocumentPost202Response.js → UploadDocument202Response.js} +8 -8
  35. package/dist/esm/models/UploadDocument400Response.d.ts +26 -0
  36. package/dist/esm/models/{V3DocumentPost400Response.js → UploadDocument400Response.js} +8 -8
  37. package/dist/esm/models/index.d.ts +9 -9
  38. package/dist/esm/models/index.js +9 -9
  39. package/dist/models/CreateTradeflows202Response.d.ts +42 -0
  40. package/dist/models/CreateTradeflows202Response.js +64 -0
  41. package/dist/models/CreateTradeflows202ResponseTradeflowsInner.d.ts +34 -0
  42. package/dist/models/{V3DownstreamPost202ResponseTradeflowsInner.js → CreateTradeflows202ResponseTradeflowsInner.js} +13 -13
  43. package/dist/models/GetDocument200Response.d.ts +39 -0
  44. package/dist/models/GetDocument200Response.js +59 -0
  45. package/dist/models/GetDocument200ResponseDataInner.d.ts +63 -0
  46. package/dist/models/{V3DocumentGet200ResponseDataInner.js → GetDocument200ResponseDataInner.js} +16 -16
  47. package/dist/models/GetDocument200ResponseDataInnerDocumentType.d.ts +34 -0
  48. package/dist/models/GetDocument200ResponseDataInnerDocumentType.js +54 -0
  49. package/dist/models/GetUpstream200Response.d.ts +35 -0
  50. package/dist/models/{V3UpstreamGet200Response.js → GetUpstream200Response.js} +13 -13
  51. package/dist/models/GetUpstream400Response.d.ts +26 -0
  52. package/dist/models/GetUpstream400Response.js +38 -0
  53. package/dist/{esm/models/V3DocumentPost202Response.d.ts → models/UploadDocument202Response.d.ts} +8 -8
  54. package/dist/models/{V3DocumentPost202Response.js → UploadDocument202Response.js} +13 -13
  55. package/dist/models/UploadDocument400Response.d.ts +26 -0
  56. package/dist/models/UploadDocument400Response.js +38 -0
  57. package/dist/models/index.d.ts +9 -9
  58. package/dist/models/index.js +9 -9
  59. package/docs/{V3DownstreamPost202Response.md → CreateTradeflows202Response.md} +5 -5
  60. package/docs/{V3DownstreamPost202ResponseTradeflowsInner.md → CreateTradeflows202ResponseTradeflowsInner.md} +4 -4
  61. package/docs/{V3DocumentApi.md → DocumentsApi.md} +63 -63
  62. package/docs/{V3DocumentGet200Response.md → GetDocument200Response.md} +5 -5
  63. package/docs/{V3DocumentGet200ResponseDataInner.md → GetDocument200ResponseDataInner.md} +5 -5
  64. package/docs/{V3DocumentGet200ResponseDataInnerDocumentType.md → GetDocument200ResponseDataInnerDocumentType.md} +4 -4
  65. package/docs/{V3UpstreamGet200Response.md → GetUpstream200Response.md} +4 -4
  66. package/docs/{V3UpstreamGet400Response.md → GetUpstream400Response.md} +4 -4
  67. package/docs/{V3DownstreamApi.md → TradeflowsApi.md} +39 -39
  68. package/docs/{V3DocumentPost202Response.md → UploadDocument202Response.md} +4 -4
  69. package/docs/{V3DocumentPost400Response.md → UploadDocument400Response.md} +4 -4
  70. package/docs/{V3UpstreamApi.md → UpstreamApi.md} +10 -10
  71. package/package.json +1 -1
  72. package/src/apis/{V3DocumentApi.ts → DocumentsApi.ts} +81 -81
  73. package/src/apis/{V3DownstreamApi.ts → TradeflowsApi.ts} +58 -58
  74. package/src/apis/{V3UpstreamApi.ts → UpstreamApi.ts} +23 -23
  75. package/src/apis/index.ts +3 -3
  76. package/src/models/CreateTradeflows202Response.ts +91 -0
  77. package/src/models/{V3DownstreamPost202ResponseTradeflowsInner.ts → CreateTradeflows202ResponseTradeflowsInner.ts} +10 -10
  78. package/src/models/{V3DocumentGet200Response.ts → GetDocument200Response.ts} +19 -19
  79. package/src/models/{V3DocumentGet200ResponseDataInner.ts → GetDocument200ResponseDataInner.ts} +19 -19
  80. package/src/models/GetDocument200ResponseDataInnerDocumentType.ts +71 -0
  81. package/src/models/{V3UpstreamGet200Response.ts → GetUpstream200Response.ts} +10 -10
  82. package/src/models/GetUpstream400Response.ts +46 -0
  83. package/src/models/{V3DocumentPost202Response.ts → UploadDocument202Response.ts} +10 -10
  84. package/src/models/UploadDocument400Response.ts +46 -0
  85. package/src/models/index.ts +9 -9
  86. package/dist/apis/V3DocumentApi.d.ts +0 -111
  87. package/dist/apis/V3DownstreamApi.d.ts +0 -63
  88. package/dist/esm/apis/V3DocumentApi.d.ts +0 -111
  89. package/dist/esm/apis/V3DownstreamApi.d.ts +0 -63
  90. package/dist/esm/models/V3DocumentGet200Response.d.ts +0 -39
  91. package/dist/esm/models/V3DocumentGet200ResponseDataInner.d.ts +0 -63
  92. package/dist/esm/models/V3DocumentGet200ResponseDataInnerDocumentType.d.ts +0 -34
  93. package/dist/esm/models/V3DocumentPost400Response.d.ts +0 -26
  94. package/dist/esm/models/V3DownstreamPost202Response.d.ts +0 -42
  95. package/dist/esm/models/V3DownstreamPost202ResponseTradeflowsInner.d.ts +0 -34
  96. package/dist/esm/models/V3UpstreamGet200Response.d.ts +0 -35
  97. package/dist/esm/models/V3UpstreamGet400Response.d.ts +0 -26
  98. package/dist/esm/models/V3UpstreamGet400Response.js +0 -31
  99. package/dist/models/V3DocumentGet200Response.d.ts +0 -39
  100. package/dist/models/V3DocumentGet200Response.js +0 -59
  101. package/dist/models/V3DocumentGet200ResponseDataInner.d.ts +0 -63
  102. package/dist/models/V3DocumentGet200ResponseDataInnerDocumentType.d.ts +0 -34
  103. package/dist/models/V3DocumentGet200ResponseDataInnerDocumentType.js +0 -54
  104. package/dist/models/V3DocumentPost400Response.d.ts +0 -26
  105. package/dist/models/V3DocumentPost400Response.js +0 -38
  106. package/dist/models/V3DownstreamPost202Response.d.ts +0 -42
  107. package/dist/models/V3DownstreamPost202Response.js +0 -64
  108. package/dist/models/V3DownstreamPost202ResponseTradeflowsInner.d.ts +0 -34
  109. package/dist/models/V3UpstreamGet200Response.d.ts +0 -35
  110. package/dist/models/V3UpstreamGet400Response.d.ts +0 -26
  111. package/dist/models/V3UpstreamGet400Response.js +0 -38
  112. package/src/models/V3DocumentGet200ResponseDataInnerDocumentType.ts +0 -71
  113. package/src/models/V3DocumentPost400Response.ts +0 -46
  114. package/src/models/V3DownstreamPost202Response.ts +0 -91
  115. package/src/models/V3UpstreamGet400Response.ts +0 -46
@@ -1,5 +1,5 @@
1
1
 
2
- # V3DocumentPost202Response
2
+ # UploadDocument202Response
3
3
 
4
4
 
5
5
  ## Properties
@@ -17,7 +17,7 @@ Name | Type
17
17
  ## Example
18
18
 
19
19
  ```typescript
20
- import type { V3DocumentPost202Response } from '@dockflow/sdk'
20
+ import type { UploadDocument202Response } from '@dockflow/sdk'
21
21
 
22
22
  // TODO: Update the object below with actual values
23
23
  const example = {
@@ -28,7 +28,7 @@ const example = {
28
28
  "filetype": null,
29
29
  "containerReference": null,
30
30
  "createdAt": null,
31
- } satisfies V3DocumentPost202Response
31
+ } satisfies UploadDocument202Response
32
32
 
33
33
  console.log(example)
34
34
 
@@ -37,7 +37,7 @@ const exampleJSON: string = JSON.stringify(example)
37
37
  console.log(exampleJSON)
38
38
 
39
39
  // Parse the JSON string back to an object
40
- const exampleParsed = JSON.parse(exampleJSON) as V3DocumentPost202Response
40
+ const exampleParsed = JSON.parse(exampleJSON) as UploadDocument202Response
41
41
  console.log(exampleParsed)
42
42
  ```
43
43
 
@@ -1,5 +1,5 @@
1
1
 
2
- # V3DocumentPost400Response
2
+ # UploadDocument400Response
3
3
 
4
4
 
5
5
  ## Properties
@@ -10,11 +10,11 @@ Name | Type
10
10
  ## Example
11
11
 
12
12
  ```typescript
13
- import type { V3DocumentPost400Response } from '@dockflow/sdk'
13
+ import type { UploadDocument400Response } from '@dockflow/sdk'
14
14
 
15
15
  // TODO: Update the object below with actual values
16
16
  const example = {
17
- } satisfies V3DocumentPost400Response
17
+ } satisfies UploadDocument400Response
18
18
 
19
19
  console.log(example)
20
20
 
@@ -23,7 +23,7 @@ const exampleJSON: string = JSON.stringify(example)
23
23
  console.log(exampleJSON)
24
24
 
25
25
  // Parse the JSON string back to an object
26
- const exampleParsed = JSON.parse(exampleJSON) as V3DocumentPost400Response
26
+ const exampleParsed = JSON.parse(exampleJSON) as UploadDocument400Response
27
27
  console.log(exampleParsed)
28
28
  ```
29
29
 
@@ -1,16 +1,16 @@
1
- # V3UpstreamApi
1
+ # UpstreamApi
2
2
 
3
3
  All URIs are relative to *https://api.dockflow.com*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
- | [**v3UpstreamGet**](V3UpstreamApi.md#v3upstreamget) | **GET** /v3/upstream | Poll upstream events |
7
+ | [**getUpstream**](UpstreamApi.md#getupstream) | **GET** /v3/upstream | Poll upstream events |
8
8
 
9
9
 
10
10
 
11
- ## v3UpstreamGet
11
+ ## getUpstream
12
12
 
13
- > V3UpstreamGet200Response v3UpstreamGet(since, tradeflow, container, category, code, cursor, active, fields, format, perPage, failsafe)
13
+ > GetUpstream200Response getUpstream(since, tradeflow, container, category, code, cursor, active, fields, format, perPage, failsafe)
14
14
 
15
15
  Poll upstream events
16
16
 
@@ -19,9 +19,9 @@ Poll upstream events
19
19
  ```ts
20
20
  import {
21
21
  Configuration,
22
- V3UpstreamApi,
22
+ UpstreamApi,
23
23
  } from '@dockflow/sdk';
24
- import type { V3UpstreamGetRequest } from '@dockflow/sdk';
24
+ import type { GetUpstreamRequest } from '@dockflow/sdk';
25
25
 
26
26
  async function example() {
27
27
  console.log("🚀 Testing @dockflow/sdk SDK...");
@@ -29,7 +29,7 @@ async function example() {
29
29
  // Configure HTTP bearer authorization: ApiKey
30
30
  accessToken: "YOUR BEARER TOKEN",
31
31
  });
32
- const api = new V3UpstreamApi(config);
32
+ const api = new UpstreamApi(config);
33
33
 
34
34
  const body = {
35
35
  // string | Only tradeflows changed after this ISO 8601 timestamp (exclusive), with an offset. Without since, cursor, tradeflow or container: the last 15 minutes. (optional)
@@ -54,10 +54,10 @@ async function example() {
54
54
  perPage: 56,
55
55
  // '0' | '1' | Set to 1 and Dockflow keeps your position per API key and filter set, so repeated identical polls skip nothing. (optional)
56
56
  failsafe: failsafe_example,
57
- } satisfies V3UpstreamGetRequest;
57
+ } satisfies GetUpstreamRequest;
58
58
 
59
59
  try {
60
- const data = await api.v3UpstreamGet(body);
60
+ const data = await api.getUpstream(body);
61
61
  console.log(data);
62
62
  } catch (error) {
63
63
  console.error(error);
@@ -87,7 +87,7 @@ example().catch(console.error);
87
87
 
88
88
  ### Return type
89
89
 
90
- [**V3UpstreamGet200Response**](V3UpstreamGet200Response.md)
90
+ [**GetUpstream200Response**](GetUpstream200Response.md)
91
91
 
92
92
  ### Authorization
93
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dockflow/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "OpenAPI client for @dockflow/sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -23,47 +23,47 @@ import {
23
23
  DocumentUploadFromJSON,
24
24
  DocumentUploadToJSON,
25
25
  } from '../models/DocumentUpload';
26
+ import {
27
+ type GetDocument200Response,
28
+ GetDocument200ResponseFromJSON,
29
+ GetDocument200ResponseToJSON,
30
+ } from '../models/GetDocument200Response';
31
+ import {
32
+ type GetDocument200ResponseDataInner,
33
+ GetDocument200ResponseDataInnerFromJSON,
34
+ GetDocument200ResponseDataInnerToJSON,
35
+ } from '../models/GetDocument200ResponseDataInner';
26
36
  import {
27
37
  type ListDocumentTypes200ResponseInner,
28
38
  ListDocumentTypes200ResponseInnerFromJSON,
29
39
  ListDocumentTypes200ResponseInnerToJSON,
30
40
  } from '../models/ListDocumentTypes200ResponseInner';
31
41
  import {
32
- type V3DocumentGet200Response,
33
- V3DocumentGet200ResponseFromJSON,
34
- V3DocumentGet200ResponseToJSON,
35
- } from '../models/V3DocumentGet200Response';
36
- import {
37
- type V3DocumentGet200ResponseDataInner,
38
- V3DocumentGet200ResponseDataInnerFromJSON,
39
- V3DocumentGet200ResponseDataInnerToJSON,
40
- } from '../models/V3DocumentGet200ResponseDataInner';
41
- import {
42
- type V3DocumentPost202Response,
43
- V3DocumentPost202ResponseFromJSON,
44
- V3DocumentPost202ResponseToJSON,
45
- } from '../models/V3DocumentPost202Response';
42
+ type UploadDocument202Response,
43
+ UploadDocument202ResponseFromJSON,
44
+ UploadDocument202ResponseToJSON,
45
+ } from '../models/UploadDocument202Response';
46
46
  import {
47
- type V3DocumentPost400Response,
48
- V3DocumentPost400ResponseFromJSON,
49
- V3DocumentPost400ResponseToJSON,
50
- } from '../models/V3DocumentPost400Response';
47
+ type UploadDocument400Response,
48
+ UploadDocument400ResponseFromJSON,
49
+ UploadDocument400ResponseToJSON,
50
+ } from '../models/UploadDocument400Response';
51
51
 
52
- export interface V3DocumentDeleteRequest {
52
+ export interface DeleteDocumentRequest {
53
53
  /**
54
54
  *
55
55
  */
56
56
  reference: string;
57
57
  }
58
58
 
59
- export interface V3DocumentGetRequest {
59
+ export interface GetDocumentRequest {
60
60
  /**
61
61
  *
62
62
  */
63
63
  reference: string;
64
64
  }
65
65
 
66
- export interface V3DocumentPatchRequest {
66
+ export interface UpdateDocumentRequest {
67
67
  /**
68
68
  *
69
69
  */
@@ -74,7 +74,7 @@ export interface V3DocumentPatchRequest {
74
74
  documentUpdate: DocumentUpdate;
75
75
  }
76
76
 
77
- export interface V3DocumentPostRequest {
77
+ export interface UploadDocumentRequest {
78
78
  /**
79
79
  *
80
80
  */
@@ -84,12 +84,19 @@ export interface V3DocumentPostRequest {
84
84
  /**
85
85
  *
86
86
  */
87
- export class V3DocumentApi extends runtime.BaseAPI {
87
+ export class DocumentsApi extends runtime.BaseAPI {
88
88
 
89
89
  /**
90
- * Creates request options for listDocumentTypes without sending the request
90
+ * Creates request options for deleteDocument without sending the request
91
91
  */
92
- async listDocumentTypesRequestOpts(): Promise<runtime.RequestOpts> {
92
+ async deleteDocumentRequestOpts(requestParameters: DeleteDocumentRequest): Promise<runtime.RequestOpts> {
93
+ if (requestParameters['reference'] == null) {
94
+ throw new runtime.RequiredError(
95
+ 'reference',
96
+ 'Required parameter "reference" was null or undefined when calling deleteDocument().'
97
+ );
98
+ }
99
+
93
100
  const queryParameters: any = {};
94
101
 
95
102
  const headerParameters: runtime.HTTPHeaders = {};
@@ -103,42 +110,42 @@ export class V3DocumentApi extends runtime.BaseAPI {
103
110
  }
104
111
  }
105
112
 
106
- let urlPath = `/v3/downstream/documents/types`;
113
+ let urlPath = `/v3/downstream/documents/{reference}`;
114
+ urlPath = urlPath.replace('{reference}', encodeURIComponent(String(requestParameters['reference'])));
107
115
 
108
116
  return {
109
117
  path: urlPath,
110
- method: 'GET',
118
+ method: 'DELETE',
111
119
  headers: headerParameters,
112
120
  query: queryParameters,
113
121
  };
114
122
  }
115
123
 
116
124
  /**
117
- * List document types
125
+ * Delete a document
118
126
  */
119
- async listDocumentTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ListDocumentTypes200ResponseInner>>> {
120
- const requestOptions = await this.listDocumentTypesRequestOpts();
127
+ async deleteDocumentRaw(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
128
+ const requestOptions = await this.deleteDocumentRequestOpts(requestParameters);
121
129
  const response = await this.request(requestOptions, initOverrides);
122
130
 
123
- return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ListDocumentTypes200ResponseInnerFromJSON));
131
+ return new runtime.VoidApiResponse(response);
124
132
  }
125
133
 
126
134
  /**
127
- * List document types
135
+ * Delete a document
128
136
  */
129
- async listDocumentTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ListDocumentTypes200ResponseInner>> {
130
- const response = await this.listDocumentTypesRaw(initOverrides);
131
- return await response.value();
137
+ async deleteDocument(requestParameters: DeleteDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
138
+ await this.deleteDocumentRaw(requestParameters, initOverrides);
132
139
  }
133
140
 
134
141
  /**
135
- * Creates request options for v3DocumentDelete without sending the request
142
+ * Creates request options for getDocument without sending the request
136
143
  */
137
- async v3DocumentDeleteRequestOpts(requestParameters: V3DocumentDeleteRequest): Promise<runtime.RequestOpts> {
144
+ async getDocumentRequestOpts(requestParameters: GetDocumentRequest): Promise<runtime.RequestOpts> {
138
145
  if (requestParameters['reference'] == null) {
139
146
  throw new runtime.RequiredError(
140
147
  'reference',
141
- 'Required parameter "reference" was null or undefined when calling v3DocumentDelete().'
148
+ 'Required parameter "reference" was null or undefined when calling getDocument().'
142
149
  );
143
150
  }
144
151
 
@@ -160,40 +167,34 @@ export class V3DocumentApi extends runtime.BaseAPI {
160
167
 
161
168
  return {
162
169
  path: urlPath,
163
- method: 'DELETE',
170
+ method: 'GET',
164
171
  headers: headerParameters,
165
172
  query: queryParameters,
166
173
  };
167
174
  }
168
175
 
169
176
  /**
170
- * Delete a document
177
+ * List the documents of a tradeflow
171
178
  */
172
- async v3DocumentDeleteRaw(requestParameters: V3DocumentDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
173
- const requestOptions = await this.v3DocumentDeleteRequestOpts(requestParameters);
179
+ async getDocumentRaw(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDocument200Response>> {
180
+ const requestOptions = await this.getDocumentRequestOpts(requestParameters);
174
181
  const response = await this.request(requestOptions, initOverrides);
175
182
 
176
- return new runtime.VoidApiResponse(response);
183
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetDocument200ResponseFromJSON(jsonValue));
177
184
  }
178
185
 
179
186
  /**
180
- * Delete a document
187
+ * List the documents of a tradeflow
181
188
  */
182
- async v3DocumentDelete(requestParameters: V3DocumentDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
183
- await this.v3DocumentDeleteRaw(requestParameters, initOverrides);
189
+ async getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDocument200Response> {
190
+ const response = await this.getDocumentRaw(requestParameters, initOverrides);
191
+ return await response.value();
184
192
  }
185
193
 
186
194
  /**
187
- * Creates request options for v3DocumentGet without sending the request
195
+ * Creates request options for listDocumentTypes without sending the request
188
196
  */
189
- async v3DocumentGetRequestOpts(requestParameters: V3DocumentGetRequest): Promise<runtime.RequestOpts> {
190
- if (requestParameters['reference'] == null) {
191
- throw new runtime.RequiredError(
192
- 'reference',
193
- 'Required parameter "reference" was null or undefined when calling v3DocumentGet().'
194
- );
195
- }
196
-
197
+ async listDocumentTypesRequestOpts(): Promise<runtime.RequestOpts> {
197
198
  const queryParameters: any = {};
198
199
 
199
200
  const headerParameters: runtime.HTTPHeaders = {};
@@ -207,8 +208,7 @@ export class V3DocumentApi extends runtime.BaseAPI {
207
208
  }
208
209
  }
209
210
 
210
- let urlPath = `/v3/downstream/documents/{reference}`;
211
- urlPath = urlPath.replace('{reference}', encodeURIComponent(String(requestParameters['reference'])));
211
+ let urlPath = `/v3/downstream/documents/types`;
212
212
 
213
213
  return {
214
214
  path: urlPath,
@@ -219,38 +219,38 @@ export class V3DocumentApi extends runtime.BaseAPI {
219
219
  }
220
220
 
221
221
  /**
222
- * List the documents of a tradeflow
222
+ * List document types
223
223
  */
224
- async v3DocumentGetRaw(requestParameters: V3DocumentGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V3DocumentGet200Response>> {
225
- const requestOptions = await this.v3DocumentGetRequestOpts(requestParameters);
224
+ async listDocumentTypesRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ListDocumentTypes200ResponseInner>>> {
225
+ const requestOptions = await this.listDocumentTypesRequestOpts();
226
226
  const response = await this.request(requestOptions, initOverrides);
227
227
 
228
- return new runtime.JSONApiResponse(response, (jsonValue) => V3DocumentGet200ResponseFromJSON(jsonValue));
228
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ListDocumentTypes200ResponseInnerFromJSON));
229
229
  }
230
230
 
231
231
  /**
232
- * List the documents of a tradeflow
232
+ * List document types
233
233
  */
234
- async v3DocumentGet(requestParameters: V3DocumentGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V3DocumentGet200Response> {
235
- const response = await this.v3DocumentGetRaw(requestParameters, initOverrides);
234
+ async listDocumentTypes(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ListDocumentTypes200ResponseInner>> {
235
+ const response = await this.listDocumentTypesRaw(initOverrides);
236
236
  return await response.value();
237
237
  }
238
238
 
239
239
  /**
240
- * Creates request options for v3DocumentPatch without sending the request
240
+ * Creates request options for updateDocument without sending the request
241
241
  */
242
- async v3DocumentPatchRequestOpts(requestParameters: V3DocumentPatchRequest): Promise<runtime.RequestOpts> {
242
+ async updateDocumentRequestOpts(requestParameters: UpdateDocumentRequest): Promise<runtime.RequestOpts> {
243
243
  if (requestParameters['reference'] == null) {
244
244
  throw new runtime.RequiredError(
245
245
  'reference',
246
- 'Required parameter "reference" was null or undefined when calling v3DocumentPatch().'
246
+ 'Required parameter "reference" was null or undefined when calling updateDocument().'
247
247
  );
248
248
  }
249
249
 
250
250
  if (requestParameters['documentUpdate'] == null) {
251
251
  throw new runtime.RequiredError(
252
252
  'documentUpdate',
253
- 'Required parameter "documentUpdate" was null or undefined when calling v3DocumentPatch().'
253
+ 'Required parameter "documentUpdate" was null or undefined when calling updateDocument().'
254
254
  );
255
255
  }
256
256
 
@@ -284,29 +284,29 @@ export class V3DocumentApi extends runtime.BaseAPI {
284
284
  /**
285
285
  * Update a document
286
286
  */
287
- async v3DocumentPatchRaw(requestParameters: V3DocumentPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V3DocumentGet200ResponseDataInner>> {
288
- const requestOptions = await this.v3DocumentPatchRequestOpts(requestParameters);
287
+ async updateDocumentRaw(requestParameters: UpdateDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDocument200ResponseDataInner>> {
288
+ const requestOptions = await this.updateDocumentRequestOpts(requestParameters);
289
289
  const response = await this.request(requestOptions, initOverrides);
290
290
 
291
- return new runtime.JSONApiResponse(response, (jsonValue) => V3DocumentGet200ResponseDataInnerFromJSON(jsonValue));
291
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetDocument200ResponseDataInnerFromJSON(jsonValue));
292
292
  }
293
293
 
294
294
  /**
295
295
  * Update a document
296
296
  */
297
- async v3DocumentPatch(requestParameters: V3DocumentPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V3DocumentGet200ResponseDataInner> {
298
- const response = await this.v3DocumentPatchRaw(requestParameters, initOverrides);
297
+ async updateDocument(requestParameters: UpdateDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDocument200ResponseDataInner> {
298
+ const response = await this.updateDocumentRaw(requestParameters, initOverrides);
299
299
  return await response.value();
300
300
  }
301
301
 
302
302
  /**
303
- * Creates request options for v3DocumentPost without sending the request
303
+ * Creates request options for uploadDocument without sending the request
304
304
  */
305
- async v3DocumentPostRequestOpts(requestParameters: V3DocumentPostRequest): Promise<runtime.RequestOpts> {
305
+ async uploadDocumentRequestOpts(requestParameters: UploadDocumentRequest): Promise<runtime.RequestOpts> {
306
306
  if (requestParameters['documentUpload'] == null) {
307
307
  throw new runtime.RequiredError(
308
308
  'documentUpload',
309
- 'Required parameter "documentUpload" was null or undefined when calling v3DocumentPost().'
309
+ 'Required parameter "documentUpload" was null or undefined when calling uploadDocument().'
310
310
  );
311
311
  }
312
312
 
@@ -339,18 +339,18 @@ export class V3DocumentApi extends runtime.BaseAPI {
339
339
  /**
340
340
  * Upload a document to a tradeflow
341
341
  */
342
- async v3DocumentPostRaw(requestParameters: V3DocumentPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<V3DocumentPost202Response>> {
343
- const requestOptions = await this.v3DocumentPostRequestOpts(requestParameters);
342
+ async uploadDocumentRaw(requestParameters: UploadDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadDocument202Response>> {
343
+ const requestOptions = await this.uploadDocumentRequestOpts(requestParameters);
344
344
  const response = await this.request(requestOptions, initOverrides);
345
345
 
346
- return new runtime.JSONApiResponse(response, (jsonValue) => V3DocumentPost202ResponseFromJSON(jsonValue));
346
+ return new runtime.JSONApiResponse(response, (jsonValue) => UploadDocument202ResponseFromJSON(jsonValue));
347
347
  }
348
348
 
349
349
  /**
350
350
  * Upload a document to a tradeflow
351
351
  */
352
- async v3DocumentPost(requestParameters: V3DocumentPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<V3DocumentPost202Response> {
353
- const response = await this.v3DocumentPostRaw(requestParameters, initOverrides);
352
+ async uploadDocument(requestParameters: UploadDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadDocument202Response> {
353
+ const response = await this.uploadDocumentRaw(requestParameters, initOverrides);
354
354
  return await response.value();
355
355
  }
356
356