@documenso/sdk-typescript 0.3.0 → 0.3.1

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 (217) hide show
  1. package/FUNCTIONS.md +5 -3
  2. package/README.md +110 -108
  3. package/bin/mcp-server.js +600 -1261
  4. package/bin/mcp-server.js.map +35 -43
  5. package/docs/sdks/documents/README.md +63 -140
  6. package/docs/sdks/templates/README.md +1 -78
  7. package/jsr.json +1 -1
  8. package/lib/config.d.ts +3 -3
  9. package/lib/config.js +3 -3
  10. package/lib/files.d.ts +5 -0
  11. package/lib/files.d.ts.map +1 -1
  12. package/lib/files.js +41 -0
  13. package/lib/files.js.map +1 -1
  14. package/lib/security.d.ts +2 -2
  15. package/lib/security.d.ts.map +1 -1
  16. package/mcp-server/mcp-server.js +1 -1
  17. package/mcp-server/server.d.ts.map +1 -1
  18. package/mcp-server/server.js +2 -6
  19. package/mcp-server/server.js.map +1 -1
  20. package/models/errors/index.d.ts +0 -2
  21. package/models/errors/index.d.ts.map +1 -1
  22. package/models/errors/index.js +0 -2
  23. package/models/errors/index.js.map +1 -1
  24. package/models/operations/documentcreatedocumenttemporary.d.ts +8 -8
  25. package/models/operations/documentcreatedocumenttemporary.d.ts.map +1 -1
  26. package/models/operations/documentcreatedocumenttemporary.js +16 -16
  27. package/models/operations/documentcreatedocumenttemporary.js.map +1 -1
  28. package/models/operations/documentfinddocuments.d.ts +2 -2
  29. package/models/operations/documentfinddocuments.d.ts.map +1 -1
  30. package/models/operations/documentfinddocuments.js +2 -2
  31. package/models/operations/documentfinddocuments.js.map +1 -1
  32. package/models/operations/documentgetdocumentwithdetailsbyid.d.ts +8 -8
  33. package/models/operations/documentgetdocumentwithdetailsbyid.d.ts.map +1 -1
  34. package/models/operations/documentgetdocumentwithdetailsbyid.js +16 -16
  35. package/models/operations/documentgetdocumentwithdetailsbyid.js.map +1 -1
  36. package/models/operations/documentsenddocument.d.ts +2 -2
  37. package/models/operations/documentsenddocument.d.ts.map +1 -1
  38. package/models/operations/documentsenddocument.js +2 -2
  39. package/models/operations/documentsenddocument.js.map +1 -1
  40. package/models/operations/documentupdatedocument.d.ts +2 -2
  41. package/models/operations/documentupdatedocument.d.ts.map +1 -1
  42. package/models/operations/documentupdatedocument.js +2 -2
  43. package/models/operations/documentupdatedocument.js.map +1 -1
  44. package/models/operations/fieldcreatedocumentfield.d.ts +4 -4
  45. package/models/operations/fieldcreatedocumentfield.d.ts.map +1 -1
  46. package/models/operations/fieldcreatedocumentfield.js +12 -12
  47. package/models/operations/fieldcreatedocumentfield.js.map +1 -1
  48. package/models/operations/fieldcreatedocumentfields.d.ts +4 -4
  49. package/models/operations/fieldcreatedocumentfields.d.ts.map +1 -1
  50. package/models/operations/fieldcreatedocumentfields.js +12 -12
  51. package/models/operations/fieldcreatedocumentfields.js.map +1 -1
  52. package/models/operations/fieldcreatetemplatefield.d.ts +4 -4
  53. package/models/operations/fieldcreatetemplatefield.d.ts.map +1 -1
  54. package/models/operations/fieldcreatetemplatefield.js +12 -12
  55. package/models/operations/fieldcreatetemplatefield.js.map +1 -1
  56. package/models/operations/fieldcreatetemplatefields.d.ts +4 -4
  57. package/models/operations/fieldcreatetemplatefields.d.ts.map +1 -1
  58. package/models/operations/fieldcreatetemplatefields.js +12 -12
  59. package/models/operations/fieldcreatetemplatefields.js.map +1 -1
  60. package/models/operations/fieldgetdocumentfield.d.ts +4 -4
  61. package/models/operations/fieldgetdocumentfield.d.ts.map +1 -1
  62. package/models/operations/fieldgetdocumentfield.js +12 -12
  63. package/models/operations/fieldgetdocumentfield.js.map +1 -1
  64. package/models/operations/fieldgettemplatefield.d.ts +4 -4
  65. package/models/operations/fieldgettemplatefield.d.ts.map +1 -1
  66. package/models/operations/fieldgettemplatefield.js +12 -12
  67. package/models/operations/fieldgettemplatefield.js.map +1 -1
  68. package/models/operations/fieldupdatedocumentfield.d.ts +4 -4
  69. package/models/operations/fieldupdatedocumentfield.d.ts.map +1 -1
  70. package/models/operations/fieldupdatedocumentfield.js +12 -12
  71. package/models/operations/fieldupdatedocumentfield.js.map +1 -1
  72. package/models/operations/fieldupdatedocumentfields.d.ts +4 -4
  73. package/models/operations/fieldupdatedocumentfields.d.ts.map +1 -1
  74. package/models/operations/fieldupdatedocumentfields.js +12 -12
  75. package/models/operations/fieldupdatedocumentfields.js.map +1 -1
  76. package/models/operations/fieldupdatetemplatefield.d.ts +4 -4
  77. package/models/operations/fieldupdatetemplatefield.d.ts.map +1 -1
  78. package/models/operations/fieldupdatetemplatefield.js +12 -12
  79. package/models/operations/fieldupdatetemplatefield.js.map +1 -1
  80. package/models/operations/fieldupdatetemplatefields.d.ts +4 -4
  81. package/models/operations/fieldupdatetemplatefields.d.ts.map +1 -1
  82. package/models/operations/fieldupdatetemplatefields.js +12 -12
  83. package/models/operations/fieldupdatetemplatefields.js.map +1 -1
  84. package/models/operations/index.d.ts +0 -2
  85. package/models/operations/index.d.ts.map +1 -1
  86. package/models/operations/index.js +0 -2
  87. package/models/operations/index.js.map +1 -1
  88. package/models/operations/recipientgetdocumentrecipient.d.ts +4 -4
  89. package/models/operations/recipientgetdocumentrecipient.d.ts.map +1 -1
  90. package/models/operations/recipientgetdocumentrecipient.js +12 -12
  91. package/models/operations/recipientgetdocumentrecipient.js.map +1 -1
  92. package/models/operations/recipientgettemplaterecipient.d.ts +4 -4
  93. package/models/operations/recipientgettemplaterecipient.d.ts.map +1 -1
  94. package/models/operations/recipientgettemplaterecipient.js +12 -12
  95. package/models/operations/recipientgettemplaterecipient.js.map +1 -1
  96. package/models/operations/recipientupdatedocumentrecipient.d.ts +4 -4
  97. package/models/operations/recipientupdatedocumentrecipient.d.ts.map +1 -1
  98. package/models/operations/recipientupdatedocumentrecipient.js +12 -12
  99. package/models/operations/recipientupdatedocumentrecipient.js.map +1 -1
  100. package/models/operations/recipientupdatedocumentrecipients.d.ts +4 -4
  101. package/models/operations/recipientupdatedocumentrecipients.d.ts.map +1 -1
  102. package/models/operations/recipientupdatedocumentrecipients.js +12 -12
  103. package/models/operations/recipientupdatedocumentrecipients.js.map +1 -1
  104. package/models/operations/recipientupdatetemplaterecipient.d.ts +4 -4
  105. package/models/operations/recipientupdatetemplaterecipient.d.ts.map +1 -1
  106. package/models/operations/recipientupdatetemplaterecipient.js +12 -12
  107. package/models/operations/recipientupdatetemplaterecipient.js.map +1 -1
  108. package/models/operations/recipientupdatetemplaterecipients.d.ts +4 -4
  109. package/models/operations/recipientupdatetemplaterecipients.d.ts.map +1 -1
  110. package/models/operations/recipientupdatetemplaterecipients.js +12 -12
  111. package/models/operations/recipientupdatetemplaterecipients.js.map +1 -1
  112. package/models/operations/templatecreatedocumentfromtemplate.d.ts +12 -12
  113. package/models/operations/templatecreatedocumentfromtemplate.d.ts.map +1 -1
  114. package/models/operations/templatecreatedocumentfromtemplate.js +28 -28
  115. package/models/operations/templatecreatedocumentfromtemplate.js.map +1 -1
  116. package/models/operations/templateduplicatetemplate.d.ts +2 -2
  117. package/models/operations/templateduplicatetemplate.d.ts.map +1 -1
  118. package/models/operations/templateduplicatetemplate.js +2 -2
  119. package/models/operations/templateduplicatetemplate.js.map +1 -1
  120. package/models/operations/templatefindtemplates.d.ts +6 -6
  121. package/models/operations/templatefindtemplates.d.ts.map +1 -1
  122. package/models/operations/templatefindtemplates.js +14 -14
  123. package/models/operations/templatefindtemplates.js.map +1 -1
  124. package/models/operations/templategettemplatebyid.d.ts +8 -8
  125. package/models/operations/templategettemplatebyid.d.ts.map +1 -1
  126. package/models/operations/templategettemplatebyid.js +16 -16
  127. package/models/operations/templategettemplatebyid.js.map +1 -1
  128. package/models/operations/templateupdatetemplate.d.ts +2 -2
  129. package/models/operations/templateupdatetemplate.d.ts.map +1 -1
  130. package/models/operations/templateupdatetemplate.js +2 -2
  131. package/models/operations/templateupdatetemplate.js.map +1 -1
  132. package/package.json +1 -1
  133. package/sdk/documents.d.ts +4 -11
  134. package/sdk/documents.d.ts.map +1 -1
  135. package/sdk/documents.js +6 -16
  136. package/sdk/documents.js.map +1 -1
  137. package/sdk/templates.d.ts +0 -7
  138. package/sdk/templates.d.ts.map +1 -1
  139. package/sdk/templates.js +0 -10
  140. package/sdk/templates.js.map +1 -1
  141. package/src/lib/config.ts +3 -3
  142. package/src/lib/files.ts +42 -0
  143. package/src/lib/security.ts +2 -2
  144. package/src/mcp-server/mcp-server.ts +1 -1
  145. package/src/mcp-server/server.ts +2 -6
  146. package/src/models/errors/index.ts +0 -2
  147. package/src/models/operations/documentcreatedocumenttemporary.ts +34 -34
  148. package/src/models/operations/documentfinddocuments.ts +4 -4
  149. package/src/models/operations/documentgetdocumentwithdetailsbyid.ts +49 -49
  150. package/src/models/operations/documentsenddocument.ts +4 -4
  151. package/src/models/operations/documentupdatedocument.ts +4 -4
  152. package/src/models/operations/fieldcreatedocumentfield.ts +35 -35
  153. package/src/models/operations/fieldcreatedocumentfields.ts +38 -38
  154. package/src/models/operations/fieldcreatetemplatefield.ts +35 -35
  155. package/src/models/operations/fieldcreatetemplatefields.ts +38 -38
  156. package/src/models/operations/fieldgetdocumentfield.ts +26 -26
  157. package/src/models/operations/fieldgettemplatefield.ts +26 -26
  158. package/src/models/operations/fieldupdatedocumentfield.ts +35 -35
  159. package/src/models/operations/fieldupdatedocumentfields.ts +38 -38
  160. package/src/models/operations/fieldupdatetemplatefield.ts +35 -35
  161. package/src/models/operations/fieldupdatetemplatefields.ts +38 -38
  162. package/src/models/operations/index.ts +0 -2
  163. package/src/models/operations/recipientgetdocumentrecipient.ts +31 -33
  164. package/src/models/operations/recipientgettemplaterecipient.ts +31 -33
  165. package/src/models/operations/recipientupdatedocumentrecipient.ts +36 -36
  166. package/src/models/operations/recipientupdatedocumentrecipients.ts +38 -38
  167. package/src/models/operations/recipientupdatetemplaterecipient.ts +36 -36
  168. package/src/models/operations/recipientupdatetemplaterecipients.ts +38 -38
  169. package/src/models/operations/templatecreatedocumentfromtemplate.ts +73 -73
  170. package/src/models/operations/templateduplicatetemplate.ts +4 -4
  171. package/src/models/operations/templatefindtemplates.ts +30 -30
  172. package/src/models/operations/templategettemplatebyid.ts +34 -34
  173. package/src/models/operations/templateupdatetemplate.ts +4 -4
  174. package/src/sdk/documents.ts +14 -32
  175. package/src/sdk/templates.ts +0 -18
  176. package/src/types/constdatetime.ts +1 -1
  177. package/types/constdatetime.js +1 -1
  178. package/funcs/documentsMoveToTeam.d.ts +0 -18
  179. package/funcs/documentsMoveToTeam.d.ts.map +0 -1
  180. package/funcs/documentsMoveToTeam.js +0 -118
  181. package/funcs/documentsMoveToTeam.js.map +0 -1
  182. package/funcs/templatesMoveToTeam.d.ts +0 -18
  183. package/funcs/templatesMoveToTeam.d.ts.map +0 -1
  184. package/funcs/templatesMoveToTeam.js +0 -118
  185. package/funcs/templatesMoveToTeam.js.map +0 -1
  186. package/mcp-server/tools/documentsMoveToTeam.d.ts +0 -8
  187. package/mcp-server/tools/documentsMoveToTeam.d.ts.map +0 -1
  188. package/mcp-server/tools/documentsMoveToTeam.js +0 -64
  189. package/mcp-server/tools/documentsMoveToTeam.js.map +0 -1
  190. package/mcp-server/tools/templatesMoveToTeam.d.ts +0 -8
  191. package/mcp-server/tools/templatesMoveToTeam.d.ts.map +0 -1
  192. package/mcp-server/tools/templatesMoveToTeam.js +0 -64
  193. package/mcp-server/tools/templatesMoveToTeam.js.map +0 -1
  194. package/models/errors/documentmovedocumenttoteam.d.ts +0 -143
  195. package/models/errors/documentmovedocumenttoteam.d.ts.map +0 -1
  196. package/models/errors/documentmovedocumenttoteam.js +0 -201
  197. package/models/errors/documentmovedocumenttoteam.js.map +0 -1
  198. package/models/errors/templatemovetemplatetoteam.d.ts +0 -143
  199. package/models/errors/templatemovetemplatetoteam.d.ts.map +0 -1
  200. package/models/errors/templatemovetemplatetoteam.js +0 -201
  201. package/models/errors/templatemovetemplatetoteam.js.map +0 -1
  202. package/models/operations/documentmovedocumenttoteam.d.ts +0 -310
  203. package/models/operations/documentmovedocumenttoteam.d.ts.map +0 -1
  204. package/models/operations/documentmovedocumenttoteam.js +0 -292
  205. package/models/operations/documentmovedocumenttoteam.js.map +0 -1
  206. package/models/operations/templatemovetemplatetoteam.d.ts +0 -239
  207. package/models/operations/templatemovetemplatetoteam.d.ts.map +0 -1
  208. package/models/operations/templatemovetemplatetoteam.js +0 -241
  209. package/models/operations/templatemovetemplatetoteam.js.map +0 -1
  210. package/src/funcs/documentsMoveToTeam.ts +0 -180
  211. package/src/funcs/templatesMoveToTeam.ts +0 -180
  212. package/src/mcp-server/tools/documentsMoveToTeam.ts +0 -37
  213. package/src/mcp-server/tools/templatesMoveToTeam.ts +0 -37
  214. package/src/models/errors/documentmovedocumenttoteam.ts +0 -358
  215. package/src/models/errors/templatemovetemplatetoteam.ts +0 -358
  216. package/src/models/operations/documentmovedocumenttoteam.ts +0 -529
  217. package/src/models/operations/templatemovetemplatetoteam.ts +0 -417
@@ -5,19 +5,18 @@
5
5
 
6
6
  ### Available Operations
7
7
 
8
+ * [update](#update) - Update document
8
9
  * [find](#find) - Find documents
9
10
  * [get](#get) - Get document
10
11
  * [createV0](#createv0) - Create document
11
- * [update](#update) - Update document
12
12
  * [delete](#delete) - Delete document
13
- * [moveToTeam](#movetoteam) - Move document
14
13
  * [distribute](#distribute) - Distribute document
15
14
  * [redistribute](#redistribute) - Redistribute document
16
15
  * [duplicate](#duplicate) - Duplicate document
17
16
 
18
- ## find
17
+ ## update
19
18
 
20
- Find documents based on a search criteria
19
+ Update document
21
20
 
22
21
  ### Example Usage
23
22
 
@@ -29,7 +28,9 @@ const documenso = new Documenso({
29
28
  });
30
29
 
31
30
  async function run() {
32
- const result = await documenso.documents.find({});
31
+ const result = await documenso.documents.update({
32
+ documentId: 9701.92,
33
+ });
33
34
 
34
35
  console.log(result);
35
36
  }
@@ -43,7 +44,7 @@ The standalone function version of this method:
43
44
 
44
45
  ```typescript
45
46
  import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
46
- import { documentsFind } from "@documenso/sdk-typescript/funcs/documentsFind.js";
47
+ import { documentsUpdate } from "@documenso/sdk-typescript/funcs/documentsUpdate.js";
47
48
 
48
49
  // Use `DocumensoCore` for best tree-shaking performance.
49
50
  // You can create one instance of it to use across an application.
@@ -52,12 +53,14 @@ const documenso = new DocumensoCore({
52
53
  });
53
54
 
54
55
  async function run() {
55
- const res = await documentsFind(documenso, {});
56
+ const res = await documentsUpdate(documenso, {
57
+ documentId: 9701.92,
58
+ });
56
59
  if (res.ok) {
57
60
  const { value: result } = res;
58
61
  console.log(result);
59
62
  } else {
60
- console.log("documentsFind failed:", res.error);
63
+ console.log("documentsUpdate failed:", res.error);
61
64
  }
62
65
  }
63
66
 
@@ -68,27 +71,26 @@ run();
68
71
 
69
72
  | Parameter | Type | Required | Description |
70
73
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
71
- | `request` | [operations.DocumentFindDocumentsRequest](../../models/operations/documentfinddocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
74
+ | `request` | [operations.DocumentUpdateDocumentRequest](../../models/operations/documentupdatedocumentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
72
75
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
73
76
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
74
77
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
75
78
 
76
79
  ### Response
77
80
 
78
- **Promise\<[operations.DocumentFindDocumentsResponse](../../models/operations/documentfinddocumentsresponse.md)\>**
81
+ **Promise\<[operations.DocumentUpdateDocumentResponse](../../models/operations/documentupdatedocumentresponse.md)\>**
79
82
 
80
83
  ### Errors
81
84
 
82
- | Error Type | Status Code | Content Type |
83
- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
84
- | errors.DocumentFindDocumentsBadRequestError | 400 | application/json |
85
- | errors.DocumentFindDocumentsNotFoundError | 404 | application/json |
86
- | errors.DocumentFindDocumentsInternalServerError | 500 | application/json |
87
- | errors.APIError | 4XX, 5XX | \*/\* |
85
+ | Error Type | Status Code | Content Type |
86
+ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
87
+ | errors.DocumentUpdateDocumentBadRequestError | 400 | application/json |
88
+ | errors.DocumentUpdateDocumentInternalServerError | 500 | application/json |
89
+ | errors.APIError | 4XX, 5XX | \*/\* |
88
90
 
89
- ## get
91
+ ## find
90
92
 
91
- Returns a document given an ID
93
+ Find documents based on a search criteria
92
94
 
93
95
  ### Example Usage
94
96
 
@@ -100,9 +102,7 @@ const documenso = new Documenso({
100
102
  });
101
103
 
102
104
  async function run() {
103
- const result = await documenso.documents.get({
104
- documentId: 7491.86,
105
- });
105
+ const result = await documenso.documents.find({});
106
106
 
107
107
  console.log(result);
108
108
  }
@@ -116,7 +116,7 @@ The standalone function version of this method:
116
116
 
117
117
  ```typescript
118
118
  import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
119
- import { documentsGet } from "@documenso/sdk-typescript/funcs/documentsGet.js";
119
+ import { documentsFind } from "@documenso/sdk-typescript/funcs/documentsFind.js";
120
120
 
121
121
  // Use `DocumensoCore` for best tree-shaking performance.
122
122
  // You can create one instance of it to use across an application.
@@ -125,14 +125,12 @@ const documenso = new DocumensoCore({
125
125
  });
126
126
 
127
127
  async function run() {
128
- const res = await documentsGet(documenso, {
129
- documentId: 7491.86,
130
- });
128
+ const res = await documentsFind(documenso, {});
131
129
  if (res.ok) {
132
130
  const { value: result } = res;
133
131
  console.log(result);
134
132
  } else {
135
- console.log("documentsGet failed:", res.error);
133
+ console.log("documentsFind failed:", res.error);
136
134
  }
137
135
  }
138
136
 
@@ -143,27 +141,27 @@ run();
143
141
 
144
142
  | Parameter | Type | Required | Description |
145
143
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
146
- | `request` | [operations.DocumentGetDocumentWithDetailsByIdRequest](../../models/operations/documentgetdocumentwithdetailsbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
144
+ | `request` | [operations.DocumentFindDocumentsRequest](../../models/operations/documentfinddocumentsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
147
145
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
148
146
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
149
147
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
150
148
 
151
149
  ### Response
152
150
 
153
- **Promise\<[operations.DocumentGetDocumentWithDetailsByIdResponse](../../models/operations/documentgetdocumentwithdetailsbyidresponse.md)\>**
151
+ **Promise\<[operations.DocumentFindDocumentsResponse](../../models/operations/documentfinddocumentsresponse.md)\>**
154
152
 
155
153
  ### Errors
156
154
 
157
- | Error Type | Status Code | Content Type |
158
- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
159
- | errors.DocumentGetDocumentWithDetailsByIdBadRequestError | 400 | application/json |
160
- | errors.DocumentGetDocumentWithDetailsByIdNotFoundError | 404 | application/json |
161
- | errors.DocumentGetDocumentWithDetailsByIdInternalServerError | 500 | application/json |
162
- | errors.APIError | 4XX, 5XX | \*/\* |
155
+ | Error Type | Status Code | Content Type |
156
+ | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- |
157
+ | errors.DocumentFindDocumentsBadRequestError | 400 | application/json |
158
+ | errors.DocumentFindDocumentsNotFoundError | 404 | application/json |
159
+ | errors.DocumentFindDocumentsInternalServerError | 500 | application/json |
160
+ | errors.APIError | 4XX, 5XX | \*/\* |
163
161
 
164
- ## createV0
162
+ ## get
165
163
 
166
- You will need to upload the PDF to the provided URL returned. Note: Once V2 API is released, this will be removed since we will allow direct uploads, instead of using an upload URL.
164
+ Returns a document given an ID
167
165
 
168
166
  ### Example Usage
169
167
 
@@ -175,8 +173,8 @@ const documenso = new Documenso({
175
173
  });
176
174
 
177
175
  async function run() {
178
- const result = await documenso.documents.createV0({
179
- title: "<value>",
176
+ const result = await documenso.documents.get({
177
+ documentId: 7491.86,
180
178
  });
181
179
 
182
180
  console.log(result);
@@ -191,7 +189,7 @@ The standalone function version of this method:
191
189
 
192
190
  ```typescript
193
191
  import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
194
- import { documentsCreateV0 } from "@documenso/sdk-typescript/funcs/documentsCreateV0.js";
192
+ import { documentsGet } from "@documenso/sdk-typescript/funcs/documentsGet.js";
195
193
 
196
194
  // Use `DocumensoCore` for best tree-shaking performance.
197
195
  // You can create one instance of it to use across an application.
@@ -200,14 +198,14 @@ const documenso = new DocumensoCore({
200
198
  });
201
199
 
202
200
  async function run() {
203
- const res = await documentsCreateV0(documenso, {
204
- title: "<value>",
201
+ const res = await documentsGet(documenso, {
202
+ documentId: 7491.86,
205
203
  });
206
204
  if (res.ok) {
207
205
  const { value: result } = res;
208
206
  console.log(result);
209
207
  } else {
210
- console.log("documentsCreateV0 failed:", res.error);
208
+ console.log("documentsGet failed:", res.error);
211
209
  }
212
210
  }
213
211
 
@@ -218,26 +216,27 @@ run();
218
216
 
219
217
  | Parameter | Type | Required | Description |
220
218
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
221
- | `request` | [operations.DocumentCreateDocumentTemporaryRequest](../../models/operations/documentcreatedocumenttemporaryrequest.md) | :heavy_check_mark: | The request object to use for the request. |
219
+ | `request` | [operations.DocumentGetDocumentWithDetailsByIdRequest](../../models/operations/documentgetdocumentwithdetailsbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
222
220
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
223
221
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
224
222
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
225
223
 
226
224
  ### Response
227
225
 
228
- **Promise\<[operations.DocumentCreateDocumentTemporaryResponse](../../models/operations/documentcreatedocumenttemporaryresponse.md)\>**
226
+ **Promise\<[operations.DocumentGetDocumentWithDetailsByIdResponse](../../models/operations/documentgetdocumentwithdetailsbyidresponse.md)\>**
229
227
 
230
228
  ### Errors
231
229
 
232
- | Error Type | Status Code | Content Type |
233
- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
234
- | errors.DocumentCreateDocumentTemporaryBadRequestError | 400 | application/json |
235
- | errors.DocumentCreateDocumentTemporaryInternalServerError | 500 | application/json |
236
- | errors.APIError | 4XX, 5XX | \*/\* |
230
+ | Error Type | Status Code | Content Type |
231
+ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
232
+ | errors.DocumentGetDocumentWithDetailsByIdBadRequestError | 400 | application/json |
233
+ | errors.DocumentGetDocumentWithDetailsByIdNotFoundError | 404 | application/json |
234
+ | errors.DocumentGetDocumentWithDetailsByIdInternalServerError | 500 | application/json |
235
+ | errors.APIError | 4XX, 5XX | \*/\* |
237
236
 
238
- ## update
237
+ ## createV0
239
238
 
240
- Update document
239
+ You will need to upload the PDF to the provided URL returned. Note: Once V2 API is released, this will be removed since we will allow direct uploads, instead of using an upload URL.
241
240
 
242
241
  ### Example Usage
243
242
 
@@ -249,8 +248,8 @@ const documenso = new Documenso({
249
248
  });
250
249
 
251
250
  async function run() {
252
- const result = await documenso.documents.update({
253
- documentId: 9701.92,
251
+ const result = await documenso.documents.createV0({
252
+ title: "<value>",
254
253
  });
255
254
 
256
255
  console.log(result);
@@ -265,7 +264,7 @@ The standalone function version of this method:
265
264
 
266
265
  ```typescript
267
266
  import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
268
- import { documentsUpdate } from "@documenso/sdk-typescript/funcs/documentsUpdate.js";
267
+ import { documentsCreateV0 } from "@documenso/sdk-typescript/funcs/documentsCreateV0.js";
269
268
 
270
269
  // Use `DocumensoCore` for best tree-shaking performance.
271
270
  // You can create one instance of it to use across an application.
@@ -274,14 +273,14 @@ const documenso = new DocumensoCore({
274
273
  });
275
274
 
276
275
  async function run() {
277
- const res = await documentsUpdate(documenso, {
278
- documentId: 9701.92,
276
+ const res = await documentsCreateV0(documenso, {
277
+ title: "<value>",
279
278
  });
280
279
  if (res.ok) {
281
280
  const { value: result } = res;
282
281
  console.log(result);
283
282
  } else {
284
- console.log("documentsUpdate failed:", res.error);
283
+ console.log("documentsCreateV0 failed:", res.error);
285
284
  }
286
285
  }
287
286
 
@@ -292,22 +291,22 @@ run();
292
291
 
293
292
  | Parameter | Type | Required | Description |
294
293
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
295
- | `request` | [operations.DocumentUpdateDocumentRequest](../../models/operations/documentupdatedocumentrequest.md) | :heavy_check_mark: | The request object to use for the request. |
294
+ | `request` | [operations.DocumentCreateDocumentTemporaryRequest](../../models/operations/documentcreatedocumenttemporaryrequest.md) | :heavy_check_mark: | The request object to use for the request. |
296
295
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
297
296
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
298
297
  | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
299
298
 
300
299
  ### Response
301
300
 
302
- **Promise\<[operations.DocumentUpdateDocumentResponse](../../models/operations/documentupdatedocumentresponse.md)\>**
301
+ **Promise\<[operations.DocumentCreateDocumentTemporaryResponse](../../models/operations/documentcreatedocumenttemporaryresponse.md)\>**
303
302
 
304
303
  ### Errors
305
304
 
306
- | Error Type | Status Code | Content Type |
307
- | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ |
308
- | errors.DocumentUpdateDocumentBadRequestError | 400 | application/json |
309
- | errors.DocumentUpdateDocumentInternalServerError | 500 | application/json |
310
- | errors.APIError | 4XX, 5XX | \*/\* |
305
+ | Error Type | Status Code | Content Type |
306
+ | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- |
307
+ | errors.DocumentCreateDocumentTemporaryBadRequestError | 400 | application/json |
308
+ | errors.DocumentCreateDocumentTemporaryInternalServerError | 500 | application/json |
309
+ | errors.APIError | 4XX, 5XX | \*/\* |
311
310
 
312
311
  ## delete
313
312
 
@@ -383,82 +382,6 @@ run();
383
382
  | errors.DocumentDeleteDocumentInternalServerError | 500 | application/json |
384
383
  | errors.APIError | 4XX, 5XX | \*/\* |
385
384
 
386
- ## moveToTeam
387
-
388
- Move a document from your personal account to a team
389
-
390
- ### Example Usage
391
-
392
- ```typescript
393
- import { Documenso } from "@documenso/sdk-typescript";
394
-
395
- const documenso = new Documenso({
396
- apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
397
- });
398
-
399
- async function run() {
400
- const result = await documenso.documents.moveToTeam({
401
- documentId: 7184.15,
402
- teamId: 4855.19,
403
- });
404
-
405
- console.log(result);
406
- }
407
-
408
- run();
409
- ```
410
-
411
- ### Standalone function
412
-
413
- The standalone function version of this method:
414
-
415
- ```typescript
416
- import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
417
- import { documentsMoveToTeam } from "@documenso/sdk-typescript/funcs/documentsMoveToTeam.js";
418
-
419
- // Use `DocumensoCore` for best tree-shaking performance.
420
- // You can create one instance of it to use across an application.
421
- const documenso = new DocumensoCore({
422
- apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
423
- });
424
-
425
- async function run() {
426
- const res = await documentsMoveToTeam(documenso, {
427
- documentId: 7184.15,
428
- teamId: 4855.19,
429
- });
430
- if (res.ok) {
431
- const { value: result } = res;
432
- console.log(result);
433
- } else {
434
- console.log("documentsMoveToTeam failed:", res.error);
435
- }
436
- }
437
-
438
- run();
439
- ```
440
-
441
- ### Parameters
442
-
443
- | Parameter | Type | Required | Description |
444
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
445
- | `request` | [operations.DocumentMoveDocumentToTeamRequest](../../models/operations/documentmovedocumenttoteamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
446
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
447
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
448
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
449
-
450
- ### Response
451
-
452
- **Promise\<[operations.DocumentMoveDocumentToTeamResponse](../../models/operations/documentmovedocumenttoteamresponse.md)\>**
453
-
454
- ### Errors
455
-
456
- | Error Type | Status Code | Content Type |
457
- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
458
- | errors.DocumentMoveDocumentToTeamBadRequestError | 400 | application/json |
459
- | errors.DocumentMoveDocumentToTeamInternalServerError | 500 | application/json |
460
- | errors.APIError | 4XX, 5XX | \*/\* |
461
-
462
385
  ## distribute
463
386
 
464
387
  Send the document out to recipients based on your distribution method
@@ -11,7 +11,6 @@
11
11
  * [duplicate](#duplicate) - Duplicate template
12
12
  * [delete](#delete) - Delete template
13
13
  * [use](#use) - Use template
14
- * [moveToTeam](#movetoteam) - Move template
15
14
 
16
15
  ## find
17
16
 
@@ -455,80 +454,4 @@ run();
455
454
  | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
456
455
  | errors.TemplateCreateDocumentFromTemplateBadRequestError | 400 | application/json |
457
456
  | errors.TemplateCreateDocumentFromTemplateInternalServerError | 500 | application/json |
458
- | errors.APIError | 4XX, 5XX | \*/\* |
459
-
460
- ## moveToTeam
461
-
462
- Move a template to a team
463
-
464
- ### Example Usage
465
-
466
- ```typescript
467
- import { Documenso } from "@documenso/sdk-typescript";
468
-
469
- const documenso = new Documenso({
470
- apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
471
- });
472
-
473
- async function run() {
474
- const result = await documenso.templates.moveToTeam({
475
- templateId: 9124,
476
- teamId: 6200.73,
477
- });
478
-
479
- console.log(result);
480
- }
481
-
482
- run();
483
- ```
484
-
485
- ### Standalone function
486
-
487
- The standalone function version of this method:
488
-
489
- ```typescript
490
- import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
491
- import { templatesMoveToTeam } from "@documenso/sdk-typescript/funcs/templatesMoveToTeam.js";
492
-
493
- // Use `DocumensoCore` for best tree-shaking performance.
494
- // You can create one instance of it to use across an application.
495
- const documenso = new DocumensoCore({
496
- apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
497
- });
498
-
499
- async function run() {
500
- const res = await templatesMoveToTeam(documenso, {
501
- templateId: 9124,
502
- teamId: 6200.73,
503
- });
504
- if (res.ok) {
505
- const { value: result } = res;
506
- console.log(result);
507
- } else {
508
- console.log("templatesMoveToTeam failed:", res.error);
509
- }
510
- }
511
-
512
- run();
513
- ```
514
-
515
- ### Parameters
516
-
517
- | Parameter | Type | Required | Description |
518
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
519
- | `request` | [operations.TemplateMoveTemplateToTeamRequest](../../models/operations/templatemovetemplatetoteamrequest.md) | :heavy_check_mark: | The request object to use for the request. |
520
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
521
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
522
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
523
-
524
- ### Response
525
-
526
- **Promise\<[operations.TemplateMoveTemplateToTeamResponse](../../models/operations/templatemovetemplatetoteamresponse.md)\>**
527
-
528
- ### Errors
529
-
530
- | Error Type | Status Code | Content Type |
531
- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- |
532
- | errors.TemplateMoveTemplateToTeamBadRequestError | 400 | application/json |
533
- | errors.TemplateMoveTemplateToTeamInternalServerError | 500 | application/json |
534
- | errors.APIError | 4XX, 5XX | \*/\* |
457
+ | errors.APIError | 4XX, 5XX | \*/\* |
package/jsr.json CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  {
4
4
  "name": "@documenso/sdk-typescript",
5
- "version": "0.3.0",
5
+ "version": "0.3.1",
6
6
  "exports": {
7
7
  ".": "./src/index.ts",
8
8
  "./models/errors": "./src/models/errors/index.ts",
package/lib/config.d.ts CHANGED
@@ -31,8 +31,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
31
31
  export declare const SDK_METADATA: {
32
32
  readonly language: "typescript";
33
33
  readonly openapiDocVersion: "0.0.0";
34
- readonly sdkVersion: "0.3.0";
35
- readonly genVersion: "2.623.0";
36
- readonly userAgent: "speakeasy-sdk/typescript 0.3.0 2.623.0 0.0.0 @documenso/sdk-typescript";
34
+ readonly sdkVersion: "0.3.1";
35
+ readonly genVersion: "2.644.1";
36
+ readonly userAgent: "speakeasy-sdk/typescript 0.3.1 2.644.1 0.0.0 @documenso/sdk-typescript";
37
37
  };
38
38
  //# sourceMappingURL=config.d.ts.map
package/lib/config.js CHANGED
@@ -28,8 +28,8 @@ function serverURLFromOptions(options) {
28
28
  exports.SDK_METADATA = {
29
29
  language: "typescript",
30
30
  openapiDocVersion: "0.0.0",
31
- sdkVersion: "0.3.0",
32
- genVersion: "2.623.0",
33
- userAgent: "speakeasy-sdk/typescript 0.3.0 2.623.0 0.0.0 @documenso/sdk-typescript",
31
+ sdkVersion: "0.3.1",
32
+ genVersion: "2.644.1",
33
+ userAgent: "speakeasy-sdk/typescript 0.3.1 2.644.1 0.0.0 @documenso/sdk-typescript",
34
34
  };
35
35
  //# sourceMappingURL=config.js.map
package/lib/files.d.ts CHANGED
@@ -5,4 +5,9 @@
5
5
  * request structure.
6
6
  */
7
7
  export declare function readableStreamToArrayBuffer(readable: ReadableStream<Uint8Array>): Promise<ArrayBuffer>;
8
+ /**
9
+ * Determines the MIME content type based on a file's extension.
10
+ * Returns null if the extension is not recognized.
11
+ */
12
+ export declare function getContentTypeFromFileName(fileName: string): string | null;
8
13
  //# sourceMappingURL=files.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/lib/files.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,WAAW,CAAC,CA2BtB"}
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../src/lib/files.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,GACnC,OAAO,CAAC,WAAW,CAAC,CA2BtB;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoC1E"}
package/lib/files.js CHANGED
@@ -4,6 +4,7 @@
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.readableStreamToArrayBuffer = readableStreamToArrayBuffer;
7
+ exports.getContentTypeFromFileName = getContentTypeFromFileName;
7
8
  /**
8
9
  * Consumes a stream and returns a concatenated array buffer. Useful in
9
10
  * situations where we need to read the whole file because it forms part of a
@@ -33,4 +34,44 @@ async function readableStreamToArrayBuffer(readable) {
33
34
  }
34
35
  return concatenatedChunks.buffer;
35
36
  }
37
+ /**
38
+ * Determines the MIME content type based on a file's extension.
39
+ * Returns null if the extension is not recognized.
40
+ */
41
+ function getContentTypeFromFileName(fileName) {
42
+ if (!fileName)
43
+ return null;
44
+ const ext = fileName.toLowerCase().split(".").pop();
45
+ if (!ext)
46
+ return null;
47
+ const mimeTypes = {
48
+ json: "application/json",
49
+ xml: "application/xml",
50
+ html: "text/html",
51
+ htm: "text/html",
52
+ txt: "text/plain",
53
+ csv: "text/csv",
54
+ pdf: "application/pdf",
55
+ png: "image/png",
56
+ jpg: "image/jpeg",
57
+ jpeg: "image/jpeg",
58
+ gif: "image/gif",
59
+ svg: "image/svg+xml",
60
+ js: "application/javascript",
61
+ css: "text/css",
62
+ zip: "application/zip",
63
+ tar: "application/x-tar",
64
+ gz: "application/gzip",
65
+ mp4: "video/mp4",
66
+ mp3: "audio/mpeg",
67
+ wav: "audio/wav",
68
+ webp: "image/webp",
69
+ ico: "image/x-icon",
70
+ woff: "font/woff",
71
+ woff2: "font/woff2",
72
+ ttf: "font/ttf",
73
+ otf: "font/otf",
74
+ };
75
+ return mimeTypes[ext] || null;
76
+ }
36
77
  //# sourceMappingURL=files.js.map