@makeplane/plane-node-sdk 0.1.4 → 0.2.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 (566) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +117 -76
  3. package/dist/Configuration.d.ts +21 -0
  4. package/dist/Configuration.d.ts.map +1 -0
  5. package/dist/Configuration.js +28 -0
  6. package/dist/Configuration.js.map +1 -0
  7. package/dist/api/BaseResource.d.ts +55 -0
  8. package/dist/api/BaseResource.d.ts.map +1 -0
  9. package/dist/api/BaseResource.js +179 -0
  10. package/dist/api/BaseResource.js.map +1 -0
  11. package/dist/api/Customers/Properties.d.ts +44 -0
  12. package/dist/api/Customers/Properties.d.ts.map +1 -0
  13. package/dist/api/Customers/Properties.js +65 -0
  14. package/dist/api/Customers/Properties.js.map +1 -0
  15. package/dist/api/Customers/Requests.d.ts +32 -0
  16. package/dist/api/Customers/Requests.d.ts.map +1 -0
  17. package/dist/api/Customers/Requests.js +45 -0
  18. package/dist/api/Customers/Requests.js.map +1 -0
  19. package/dist/api/Customers/index.d.ts +49 -0
  20. package/dist/api/Customers/index.d.ts.map +1 -0
  21. package/dist/api/Customers/index.js +71 -0
  22. package/dist/api/Customers/index.js.map +1 -0
  23. package/dist/api/Cycles.d.ts +61 -0
  24. package/dist/api/Cycles.d.ts.map +1 -0
  25. package/dist/api/Cycles.js +89 -0
  26. package/dist/api/Cycles.js.map +1 -0
  27. package/dist/api/Epics.d.ts +20 -0
  28. package/dist/api/Epics.d.ts.map +1 -0
  29. package/dist/api/Epics.js +27 -0
  30. package/dist/api/Epics.js.map +1 -0
  31. package/dist/api/Intake.d.ts +32 -0
  32. package/dist/api/Intake.d.ts.map +1 -0
  33. package/dist/api/Intake.js +45 -0
  34. package/dist/api/Intake.js.map +1 -0
  35. package/dist/api/Labels.d.ts +58 -0
  36. package/dist/api/Labels.d.ts.map +1 -0
  37. package/dist/api/Labels.js +45 -0
  38. package/dist/api/Labels.js.map +1 -0
  39. package/dist/api/Links.d.ts +32 -0
  40. package/dist/api/Links.d.ts.map +1 -0
  41. package/dist/api/Links.js +45 -0
  42. package/dist/api/Links.js.map +1 -0
  43. package/dist/api/Members.d.ts +56 -0
  44. package/dist/api/Members.d.ts.map +1 -0
  45. package/dist/api/Members.js +45 -0
  46. package/dist/api/Members.js.map +1 -0
  47. package/dist/api/Modules.d.ts +57 -0
  48. package/dist/api/Modules.d.ts.map +1 -0
  49. package/dist/api/Modules.js +83 -0
  50. package/dist/api/Modules.js.map +1 -0
  51. package/dist/api/Pages.d.ts +35 -0
  52. package/dist/api/Pages.d.ts.map +1 -0
  53. package/dist/api/Pages.js +53 -0
  54. package/dist/api/Pages.js.map +1 -0
  55. package/dist/api/Projects.d.ts +41 -0
  56. package/dist/api/Projects.d.ts.map +1 -0
  57. package/dist/api/Projects.js +60 -0
  58. package/dist/api/Projects.js.map +1 -0
  59. package/dist/api/States.d.ts +32 -0
  60. package/dist/api/States.d.ts.map +1 -0
  61. package/dist/api/States.js +45 -0
  62. package/dist/api/States.js.map +1 -0
  63. package/dist/api/Users.d.ts +15 -0
  64. package/dist/api/Users.d.ts.map +1 -0
  65. package/dist/api/Users.js +21 -0
  66. package/dist/api/Users.js.map +1 -0
  67. package/dist/api/WorkItemProperties/Options.d.ts +31 -0
  68. package/dist/api/WorkItemProperties/Options.d.ts.map +1 -0
  69. package/dist/api/WorkItemProperties/Options.js +45 -0
  70. package/dist/api/WorkItemProperties/Options.js.map +1 -0
  71. package/dist/api/WorkItemProperties/Values.d.ts +23 -0
  72. package/dist/api/WorkItemProperties/Values.d.ts.map +1 -0
  73. package/dist/api/WorkItemProperties/Values.js +34 -0
  74. package/dist/api/WorkItemProperties/Values.js.map +1 -0
  75. package/dist/api/WorkItemProperties/index.d.ts +35 -0
  76. package/dist/api/WorkItemProperties/index.d.ts.map +1 -0
  77. package/dist/api/WorkItemProperties/index.js +49 -0
  78. package/dist/api/WorkItemProperties/index.js.map +1 -0
  79. package/dist/api/WorkItemTypes.d.ts +36 -0
  80. package/dist/api/WorkItemTypes.d.ts.map +1 -0
  81. package/dist/api/WorkItemTypes.js +45 -0
  82. package/dist/api/WorkItemTypes.js.map +1 -0
  83. package/dist/api/WorkItems/Activities.d.ts +20 -0
  84. package/dist/api/WorkItems/Activities.d.ts.map +1 -0
  85. package/dist/api/WorkItems/Activities.js +27 -0
  86. package/dist/api/WorkItems/Activities.js.map +1 -0
  87. package/dist/api/WorkItems/Attachments.d.ts +31 -0
  88. package/dist/api/WorkItems/Attachments.d.ts.map +1 -0
  89. package/dist/api/WorkItems/Attachments.js +45 -0
  90. package/dist/api/WorkItems/Attachments.js.map +1 -0
  91. package/dist/api/WorkItems/Comments.d.ts +32 -0
  92. package/dist/api/WorkItems/Comments.d.ts.map +1 -0
  93. package/dist/api/WorkItems/Comments.js +45 -0
  94. package/dist/api/WorkItems/Comments.js.map +1 -0
  95. package/dist/api/WorkItems/Relations.d.ts +23 -0
  96. package/dist/api/WorkItems/Relations.d.ts.map +1 -0
  97. package/dist/api/WorkItems/Relations.js +33 -0
  98. package/dist/api/WorkItems/Relations.js.map +1 -0
  99. package/dist/api/WorkItems/WorkLogs.d.ts +27 -0
  100. package/dist/api/WorkItems/WorkLogs.d.ts.map +1 -0
  101. package/dist/api/WorkItems/WorkLogs.js +39 -0
  102. package/dist/api/WorkItems/WorkLogs.js.map +1 -0
  103. package/dist/api/WorkItems/index.d.ts +48 -0
  104. package/dist/api/WorkItems/index.d.ts.map +1 -0
  105. package/dist/api/WorkItems/index.js +75 -0
  106. package/dist/api/WorkItems/index.js.map +1 -0
  107. package/dist/api/Workspace.d.ts +15 -0
  108. package/dist/api/Workspace.d.ts.map +1 -0
  109. package/dist/api/Workspace.js +21 -0
  110. package/dist/api/Workspace.js.map +1 -0
  111. package/dist/client/index.d.ts +4 -0
  112. package/dist/client/index.d.ts.map +1 -0
  113. package/dist/client/index.js +8 -0
  114. package/dist/client/index.js.map +1 -0
  115. package/dist/{oauth/api.d.ts → client/oauth-client.d.ts} +7 -5
  116. package/dist/client/oauth-client.d.ts.map +1 -0
  117. package/dist/client/oauth-client.js +129 -0
  118. package/dist/client/oauth-client.js.map +1 -0
  119. package/dist/client/plane-client.d.ts +47 -0
  120. package/dist/client/plane-client.d.ts.map +1 -0
  121. package/dist/client/plane-client.js +55 -0
  122. package/dist/client/plane-client.js.map +1 -0
  123. package/dist/errors/HttpError.d.ts +8 -0
  124. package/dist/errors/HttpError.d.ts.map +1 -0
  125. package/dist/errors/HttpError.js +15 -0
  126. package/dist/errors/HttpError.js.map +1 -0
  127. package/dist/errors/PlaneError.d.ts +9 -0
  128. package/dist/errors/PlaneError.d.ts.map +1 -0
  129. package/dist/errors/PlaneError.js +16 -0
  130. package/dist/errors/PlaneError.js.map +1 -0
  131. package/dist/errors/index.d.ts +3 -0
  132. package/dist/errors/index.d.ts.map +1 -0
  133. package/dist/errors/index.js +8 -0
  134. package/dist/errors/index.js.map +1 -0
  135. package/dist/index.d.ts +31 -4
  136. package/dist/index.d.ts.map +1 -0
  137. package/dist/index.js +67 -5
  138. package/dist/index.js.map +1 -0
  139. package/dist/models/Attachment.d.ts +46 -0
  140. package/dist/models/Attachment.d.ts.map +1 -0
  141. package/dist/models/Attachment.js +7 -0
  142. package/dist/models/Attachment.js.map +1 -0
  143. package/dist/models/Comment.d.ts +43 -0
  144. package/dist/models/Comment.d.ts.map +1 -0
  145. package/dist/models/Comment.js +3 -0
  146. package/dist/models/Comment.js.map +1 -0
  147. package/dist/models/Customer.d.ts +136 -0
  148. package/dist/models/Customer.d.ts.map +1 -0
  149. package/dist/models/Customer.js +3 -0
  150. package/dist/models/Customer.js.map +1 -0
  151. package/dist/models/Cycle.d.ts +59 -210
  152. package/dist/models/Cycle.d.ts.map +1 -0
  153. package/dist/models/Cycle.js +1 -91
  154. package/dist/models/Cycle.js.map +1 -0
  155. package/dist/models/Epic.d.ts +34 -0
  156. package/dist/models/Epic.d.ts.map +1 -0
  157. package/dist/{oauth/models.js → models/Epic.js} +1 -0
  158. package/dist/models/Epic.js.map +1 -0
  159. package/dist/models/Intake.d.ts +48 -0
  160. package/dist/models/Intake.d.ts.map +1 -0
  161. package/dist/models/Intake.js +3 -0
  162. package/dist/models/Intake.js.map +1 -0
  163. package/dist/models/Label.d.ts +13 -113
  164. package/dist/models/Label.d.ts.map +1 -0
  165. package/dist/models/Label.js +1 -68
  166. package/dist/models/Label.js.map +1 -0
  167. package/dist/models/Link.d.ts +25 -0
  168. package/dist/models/Link.d.ts.map +1 -0
  169. package/dist/models/Link.js +3 -0
  170. package/dist/models/Link.js.map +1 -0
  171. package/dist/models/Module.d.ts +55 -193
  172. package/dist/models/Module.d.ts.map +1 -0
  173. package/dist/models/Module.js +1 -89
  174. package/dist/models/Module.js.map +1 -0
  175. package/dist/{oauth/models.d.ts → models/OAuth.d.ts} +1 -0
  176. package/dist/models/OAuth.d.ts.map +1 -0
  177. package/dist/models/OAuth.js +3 -0
  178. package/dist/models/OAuth.js.map +1 -0
  179. package/dist/models/Page.d.ts +14 -0
  180. package/dist/models/Page.d.ts.map +1 -0
  181. package/dist/models/Page.js +3 -0
  182. package/dist/models/Page.js.map +1 -0
  183. package/dist/models/Project.d.ts +42 -290
  184. package/dist/models/Project.d.ts.map +1 -0
  185. package/dist/models/Project.js +1 -122
  186. package/dist/models/Project.js.map +1 -0
  187. package/dist/models/State.d.ts +34 -124
  188. package/dist/models/State.d.ts.map +1 -0
  189. package/dist/models/State.js +2 -73
  190. package/dist/models/State.js.map +1 -0
  191. package/dist/models/User.d.ts +10 -0
  192. package/dist/models/User.d.ts.map +1 -0
  193. package/dist/models/User.js +3 -0
  194. package/dist/models/User.js.map +1 -0
  195. package/dist/models/WorkItem.d.ts +111 -0
  196. package/dist/models/WorkItem.d.ts.map +1 -0
  197. package/dist/models/WorkItem.js +3 -0
  198. package/dist/models/WorkItem.js.map +1 -0
  199. package/dist/models/WorkItemProperty.d.ts +123 -0
  200. package/dist/models/WorkItemProperty.d.ts.map +1 -0
  201. package/dist/models/WorkItemProperty.js +3 -0
  202. package/dist/models/WorkItemProperty.js.map +1 -0
  203. package/dist/models/WorkItemRelation.d.ts +34 -0
  204. package/dist/models/WorkItemRelation.d.ts.map +1 -0
  205. package/dist/models/WorkItemRelation.js +3 -0
  206. package/dist/models/WorkItemRelation.js.map +1 -0
  207. package/dist/models/WorkItemType.d.ts +18 -0
  208. package/dist/models/WorkItemType.d.ts.map +1 -0
  209. package/dist/models/WorkItemType.js +3 -0
  210. package/dist/models/WorkItemType.js.map +1 -0
  211. package/dist/models/WorkLog.d.ts +23 -0
  212. package/dist/models/WorkLog.d.ts.map +1 -0
  213. package/dist/models/WorkLog.js +3 -0
  214. package/dist/models/WorkLog.js.map +1 -0
  215. package/dist/models/common.d.ts +63 -0
  216. package/dist/models/common.d.ts.map +1 -0
  217. package/dist/models/common.js +6 -0
  218. package/dist/models/common.js.map +1 -0
  219. package/dist/models/index.d.ts +11 -95
  220. package/dist/models/index.d.ts.map +1 -0
  221. package/dist/models/index.js +9 -94
  222. package/dist/models/index.js.map +1 -0
  223. package/package.json +49 -14
  224. package/.github/workflows/publish-node-sdk.yml +0 -43
  225. package/.openapi-generator/FILES +0 -124
  226. package/.openapi-generator/VERSION +0 -1
  227. package/.openapi-generator-ignore +0 -23
  228. package/dist/apis/AssetsApi.d.ts +0 -100
  229. package/dist/apis/AssetsApi.js +0 -522
  230. package/dist/apis/CyclesApi.d.ts +0 -225
  231. package/dist/apis/CyclesApi.js +0 -1142
  232. package/dist/apis/IntakeApi.d.ts +0 -96
  233. package/dist/apis/IntakeApi.js +0 -485
  234. package/dist/apis/LabelsApi.d.ts +0 -97
  235. package/dist/apis/LabelsApi.js +0 -488
  236. package/dist/apis/MembersApi.d.ts +0 -44
  237. package/dist/apis/MembersApi.js +0 -228
  238. package/dist/apis/ModulesApi.d.ts +0 -198
  239. package/dist/apis/ModulesApi.js +0 -991
  240. package/dist/apis/ProjectsApi.d.ts +0 -120
  241. package/dist/apis/ProjectsApi.js +0 -621
  242. package/dist/apis/StatesApi.d.ts +0 -96
  243. package/dist/apis/StatesApi.js +0 -485
  244. package/dist/apis/UsersApi.d.ts +0 -27
  245. package/dist/apis/UsersApi.js +0 -149
  246. package/dist/apis/WorkItemActivityApi.d.ts +0 -58
  247. package/dist/apis/WorkItemActivityApi.js +0 -270
  248. package/dist/apis/WorkItemAttachmentsApi.d.ts +0 -80
  249. package/dist/apis/WorkItemAttachmentsApi.js +0 -400
  250. package/dist/apis/WorkItemCommentsApi.d.ts +0 -102
  251. package/dist/apis/WorkItemCommentsApi.js +0 -500
  252. package/dist/apis/WorkItemLinksApi.d.ts +0 -106
  253. package/dist/apis/WorkItemLinksApi.js +0 -515
  254. package/dist/apis/WorkItemPropertiesApi.d.ts +0 -210
  255. package/dist/apis/WorkItemPropertiesApi.js +0 -1066
  256. package/dist/apis/WorkItemTypesApi.d.ts +0 -92
  257. package/dist/apis/WorkItemTypesApi.js +0 -473
  258. package/dist/apis/WorkItemWorklogsApi.d.ts +0 -95
  259. package/dist/apis/WorkItemWorklogsApi.js +0 -479
  260. package/dist/apis/WorkItemsApi.d.ts +0 -134
  261. package/dist/apis/WorkItemsApi.js +0 -674
  262. package/dist/apis/index.d.ts +0 -17
  263. package/dist/apis/index.js +0 -34
  264. package/dist/models/AccessEnum.d.ts +0 -25
  265. package/dist/models/AccessEnum.js +0 -51
  266. package/dist/models/CycleCreateRequest.d.ts +0 -77
  267. package/dist/models/CycleCreateRequest.js +0 -67
  268. package/dist/models/CycleIssue.d.ts +0 -94
  269. package/dist/models/CycleIssue.js +0 -65
  270. package/dist/models/CycleIssueRequestRequest.d.ts +0 -34
  271. package/dist/models/CycleIssueRequestRequest.js +0 -50
  272. package/dist/models/CycleLite.d.ts +0 -161
  273. package/dist/models/CycleLite.js +0 -96
  274. package/dist/models/EntityTypeEnum.d.ts +0 -25
  275. package/dist/models/EntityTypeEnum.js +0 -51
  276. package/dist/models/GenericAssetUploadRequest.d.ts +0 -65
  277. package/dist/models/GenericAssetUploadRequest.js +0 -62
  278. package/dist/models/GetWorkspaceMembers200ResponseInner.d.ts +0 -73
  279. package/dist/models/GetWorkspaceMembers200ResponseInner.js +0 -55
  280. package/dist/models/GroupEnum.d.ts +0 -33
  281. package/dist/models/GroupEnum.js +0 -59
  282. package/dist/models/IntakeIssue.d.ts +0 -150
  283. package/dist/models/IntakeIssue.js +0 -80
  284. package/dist/models/IntakeIssueCreateRequest.d.ts +0 -72
  285. package/dist/models/IntakeIssueCreateRequest.js +0 -66
  286. package/dist/models/IntakeWorkItemStatusEnum.d.ts +0 -31
  287. package/dist/models/IntakeWorkItemStatusEnum.js +0 -57
  288. package/dist/models/Issue.d.ts +0 -197
  289. package/dist/models/Issue.js +0 -98
  290. package/dist/models/IssueActivity.d.ts +0 -136
  291. package/dist/models/IssueActivity.js +0 -83
  292. package/dist/models/IssueAttachment.d.ts +0 -172
  293. package/dist/models/IssueAttachment.js +0 -89
  294. package/dist/models/IssueAttachmentUploadRequest.d.ts +0 -58
  295. package/dist/models/IssueAttachmentUploadRequest.js +0 -60
  296. package/dist/models/IssueComment.d.ts +0 -137
  297. package/dist/models/IssueComment.js +0 -74
  298. package/dist/models/IssueCommentCreateRequest.d.ts +0 -59
  299. package/dist/models/IssueCommentCreateRequest.js +0 -57
  300. package/dist/models/IssueDetail.d.ts +0 -211
  301. package/dist/models/IssueDetail.js +0 -108
  302. package/dist/models/IssueExpand.d.ts +0 -224
  303. package/dist/models/IssueExpand.js +0 -103
  304. package/dist/models/IssueForIntakeRequest.d.ts +0 -53
  305. package/dist/models/IssueForIntakeRequest.js +0 -57
  306. package/dist/models/IssueLink.d.ts +0 -100
  307. package/dist/models/IssueLink.js +0 -64
  308. package/dist/models/IssueLinkCreateRequest.d.ts +0 -34
  309. package/dist/models/IssueLinkCreateRequest.js +0 -50
  310. package/dist/models/IssuePropertyAPI.d.ts +0 -171
  311. package/dist/models/IssuePropertyAPI.js +0 -88
  312. package/dist/models/IssuePropertyAPIRequest.d.ts +0 -99
  313. package/dist/models/IssuePropertyAPIRequest.js +0 -76
  314. package/dist/models/IssuePropertyOptionAPI.d.ts +0 -133
  315. package/dist/models/IssuePropertyOptionAPI.js +0 -73
  316. package/dist/models/IssuePropertyOptionAPIRequest.d.ts +0 -67
  317. package/dist/models/IssuePropertyOptionAPIRequest.js +0 -62
  318. package/dist/models/IssuePropertyValueAPI.d.ts +0 -133
  319. package/dist/models/IssuePropertyValueAPI.js +0 -78
  320. package/dist/models/IssuePropertyValueAPIDetail.d.ts +0 -39
  321. package/dist/models/IssuePropertyValueAPIDetail.js +0 -54
  322. package/dist/models/IssuePropertyValueAPIRequest.d.ts +0 -85
  323. package/dist/models/IssuePropertyValueAPIRequest.js +0 -70
  324. package/dist/models/IssueRequest.d.ts +0 -167
  325. package/dist/models/IssueRequest.js +0 -95
  326. package/dist/models/IssueSearch.d.ts +0 -34
  327. package/dist/models/IssueSearch.js +0 -51
  328. package/dist/models/IssueSearchItem.d.ts +0 -64
  329. package/dist/models/IssueSearchItem.js +0 -70
  330. package/dist/models/IssueTypeAPI.d.ts +0 -127
  331. package/dist/models/IssueTypeAPI.js +0 -72
  332. package/dist/models/IssueTypeAPIRequest.d.ts +0 -67
  333. package/dist/models/IssueTypeAPIRequest.js +0 -62
  334. package/dist/models/IssueWorkLogAPI.d.ts +0 -85
  335. package/dist/models/IssueWorkLogAPI.js +0 -60
  336. package/dist/models/IssueWorkLogAPIRequest.d.ts +0 -49
  337. package/dist/models/IssueWorkLogAPIRequest.js +0 -54
  338. package/dist/models/LabelCreateUpdateRequest.d.ts +0 -70
  339. package/dist/models/LabelCreateUpdateRequest.js +0 -62
  340. package/dist/models/ModuleCreateRequest.d.ts +0 -83
  341. package/dist/models/ModuleCreateRequest.js +0 -67
  342. package/dist/models/ModuleIssue.d.ts +0 -94
  343. package/dist/models/ModuleIssue.js +0 -63
  344. package/dist/models/ModuleIssueRequestRequest.d.ts +0 -34
  345. package/dist/models/ModuleIssueRequestRequest.js +0 -50
  346. package/dist/models/ModuleLite.d.ts +0 -167
  347. package/dist/models/ModuleLite.js +0 -97
  348. package/dist/models/ModuleStatusEnum.d.ts +0 -33
  349. package/dist/models/ModuleStatusEnum.js +0 -59
  350. package/dist/models/NetworkEnum.d.ts +0 -25
  351. package/dist/models/NetworkEnum.js +0 -51
  352. package/dist/models/PaginatedArchivedCycleResponse.d.ts +0 -98
  353. package/dist/models/PaginatedArchivedCycleResponse.js +0 -95
  354. package/dist/models/PaginatedArchivedModuleResponse.d.ts +0 -98
  355. package/dist/models/PaginatedArchivedModuleResponse.js +0 -95
  356. package/dist/models/PaginatedCycleIssueResponse.d.ts +0 -98
  357. package/dist/models/PaginatedCycleIssueResponse.js +0 -95
  358. package/dist/models/PaginatedCycleResponse.d.ts +0 -98
  359. package/dist/models/PaginatedCycleResponse.js +0 -95
  360. package/dist/models/PaginatedIntakeIssueResponse.d.ts +0 -98
  361. package/dist/models/PaginatedIntakeIssueResponse.js +0 -95
  362. package/dist/models/PaginatedIssueActivityDetailResponse.d.ts +0 -98
  363. package/dist/models/PaginatedIssueActivityDetailResponse.js +0 -95
  364. package/dist/models/PaginatedIssueActivityResponse.d.ts +0 -98
  365. package/dist/models/PaginatedIssueActivityResponse.js +0 -95
  366. package/dist/models/PaginatedIssueCommentResponse.d.ts +0 -98
  367. package/dist/models/PaginatedIssueCommentResponse.js +0 -95
  368. package/dist/models/PaginatedIssueLinkDetailResponse.d.ts +0 -98
  369. package/dist/models/PaginatedIssueLinkDetailResponse.js +0 -95
  370. package/dist/models/PaginatedIssueLinkResponse.d.ts +0 -98
  371. package/dist/models/PaginatedIssueLinkResponse.js +0 -95
  372. package/dist/models/PaginatedLabelResponse.d.ts +0 -98
  373. package/dist/models/PaginatedLabelResponse.js +0 -95
  374. package/dist/models/PaginatedModuleIssueResponse.d.ts +0 -98
  375. package/dist/models/PaginatedModuleIssueResponse.js +0 -95
  376. package/dist/models/PaginatedModuleResponse.d.ts +0 -98
  377. package/dist/models/PaginatedModuleResponse.js +0 -95
  378. package/dist/models/PaginatedProjectResponse.d.ts +0 -98
  379. package/dist/models/PaginatedProjectResponse.js +0 -95
  380. package/dist/models/PaginatedStateResponse.d.ts +0 -98
  381. package/dist/models/PaginatedStateResponse.js +0 -95
  382. package/dist/models/PaginatedWorkItemResponse.d.ts +0 -98
  383. package/dist/models/PaginatedWorkItemResponse.js +0 -95
  384. package/dist/models/PatchedAssetUpdateRequest.d.ts +0 -34
  385. package/dist/models/PatchedAssetUpdateRequest.js +0 -48
  386. package/dist/models/PatchedCycleUpdateRequest.d.ts +0 -77
  387. package/dist/models/PatchedCycleUpdateRequest.js +0 -63
  388. package/dist/models/PatchedGenericAssetUpdateRequest.d.ts +0 -34
  389. package/dist/models/PatchedGenericAssetUpdateRequest.js +0 -48
  390. package/dist/models/PatchedIntakeIssueUpdateRequest.d.ts +0 -66
  391. package/dist/models/PatchedIntakeIssueUpdateRequest.js +0 -60
  392. package/dist/models/PatchedIssueCommentCreateRequest.d.ts +0 -59
  393. package/dist/models/PatchedIssueCommentCreateRequest.js +0 -57
  394. package/dist/models/PatchedIssueLinkUpdateRequest.d.ts +0 -34
  395. package/dist/models/PatchedIssueLinkUpdateRequest.js +0 -48
  396. package/dist/models/PatchedIssuePropertyAPIRequest.d.ts +0 -99
  397. package/dist/models/PatchedIssuePropertyAPIRequest.js +0 -72
  398. package/dist/models/PatchedIssuePropertyOptionAPIRequest.d.ts +0 -67
  399. package/dist/models/PatchedIssuePropertyOptionAPIRequest.js +0 -60
  400. package/dist/models/PatchedIssueRequest.d.ts +0 -167
  401. package/dist/models/PatchedIssueRequest.js +0 -93
  402. package/dist/models/PatchedIssueTypeAPIRequest.d.ts +0 -67
  403. package/dist/models/PatchedIssueTypeAPIRequest.js +0 -60
  404. package/dist/models/PatchedIssueWorkLogAPIRequest.d.ts +0 -49
  405. package/dist/models/PatchedIssueWorkLogAPIRequest.js +0 -54
  406. package/dist/models/PatchedLabelCreateUpdateRequest.d.ts +0 -70
  407. package/dist/models/PatchedLabelCreateUpdateRequest.js +0 -60
  408. package/dist/models/PatchedModuleUpdateRequest.d.ts +0 -83
  409. package/dist/models/PatchedModuleUpdateRequest.js +0 -65
  410. package/dist/models/PatchedProjectUpdateRequest.d.ts +0 -143
  411. package/dist/models/PatchedProjectUpdateRequest.js +0 -85
  412. package/dist/models/PatchedStateRequest.d.ts +0 -83
  413. package/dist/models/PatchedStateRequest.js +0 -65
  414. package/dist/models/PriorityEnum.d.ts +0 -31
  415. package/dist/models/PriorityEnum.js +0 -57
  416. package/dist/models/ProjectCreateRequest.d.ts +0 -131
  417. package/dist/models/ProjectCreateRequest.js +0 -85
  418. package/dist/models/ProjectWorklogSummary.d.ts +0 -37
  419. package/dist/models/ProjectWorklogSummary.js +0 -54
  420. package/dist/models/PropertyTypeEnum.d.ts +0 -39
  421. package/dist/models/PropertyTypeEnum.js +0 -65
  422. package/dist/models/RelationTypeEnum.d.ts +0 -25
  423. package/dist/models/RelationTypeEnum.js +0 -51
  424. package/dist/models/RetrieveWorkItemAttachment400Response.d.ts +0 -37
  425. package/dist/models/RetrieveWorkItemAttachment400Response.js +0 -50
  426. package/dist/models/StateLite.d.ts +0 -53
  427. package/dist/models/StateLite.js +0 -50
  428. package/dist/models/StateRequest.d.ts +0 -83
  429. package/dist/models/StateRequest.js +0 -69
  430. package/dist/models/TimezoneEnum.d.ts +0 -887
  431. package/dist/models/TimezoneEnum.js +0 -913
  432. package/dist/models/TransferCycleIssueRequestRequest.d.ts +0 -34
  433. package/dist/models/TransferCycleIssueRequestRequest.js +0 -50
  434. package/dist/models/TransferCycleWorkItems200Response.d.ts +0 -31
  435. package/dist/models/TransferCycleWorkItems200Response.js +0 -48
  436. package/dist/models/TransferCycleWorkItems400Response.d.ts +0 -31
  437. package/dist/models/TransferCycleWorkItems400Response.js +0 -48
  438. package/dist/models/TypeEnum.d.ts +0 -31
  439. package/dist/models/TypeEnum.js +0 -57
  440. package/dist/models/UserAssetUploadRequest.d.ts +0 -64
  441. package/dist/models/UserAssetUploadRequest.js +0 -62
  442. package/dist/models/UserLite.d.ts +0 -70
  443. package/dist/models/UserLite.js +0 -52
  444. package/dist/oauth/api.js +0 -243
  445. package/dist/runtime.d.ts +0 -183
  446. package/dist/runtime.js +0 -563
  447. package/eslint.config.mjs +0 -11
  448. package/src/apis/AssetsApi.ts +0 -388
  449. package/src/apis/CyclesApi.ts +0 -1031
  450. package/src/apis/IntakeApi.ts +0 -401
  451. package/src/apis/LabelsApi.ts +0 -406
  452. package/src/apis/MembersApi.ts +0 -146
  453. package/src/apis/ModulesApi.ts +0 -890
  454. package/src/apis/ProjectsApi.ts +0 -486
  455. package/src/apis/StatesApi.ts +0 -401
  456. package/src/apis/UsersApi.ts +0 -71
  457. package/src/apis/WorkItemActivityApi.ts +0 -228
  458. package/src/apis/WorkItemAttachmentsApi.ts +0 -335
  459. package/src/apis/WorkItemCommentsApi.ts +0 -439
  460. package/src/apis/WorkItemLinksApi.ts +0 -469
  461. package/src/apis/WorkItemPropertiesApi.ts +0 -984
  462. package/src/apis/WorkItemTypesApi.ts +0 -378
  463. package/src/apis/WorkItemWorklogsApi.ts +0 -398
  464. package/src/apis/WorkItemsApi.ts +0 -594
  465. package/src/apis/index.ts +0 -19
  466. package/src/index.ts +0 -6
  467. package/src/models/AccessEnum.ts +0 -53
  468. package/src/models/Cycle.ts +0 -300
  469. package/src/models/CycleCreateRequest.ts +0 -135
  470. package/src/models/CycleIssue.ts +0 -142
  471. package/src/models/CycleIssueRequestRequest.ts +0 -68
  472. package/src/models/CycleLite.ts +0 -246
  473. package/src/models/EntityTypeEnum.ts +0 -53
  474. package/src/models/GenericAssetUploadRequest.ts +0 -110
  475. package/src/models/GetWorkspaceMembers200ResponseInner.ts +0 -113
  476. package/src/models/GroupEnum.ts +0 -61
  477. package/src/models/IntakeIssue.ts +0 -227
  478. package/src/models/IntakeIssueCreateRequest.ts +0 -134
  479. package/src/models/IntakeWorkItemStatusEnum.ts +0 -59
  480. package/src/models/Issue.ts +0 -287
  481. package/src/models/IssueActivity.ts +0 -202
  482. package/src/models/IssueAttachment.ts +0 -245
  483. package/src/models/IssueAttachmentUploadRequest.ts +0 -101
  484. package/src/models/IssueComment.ts +0 -204
  485. package/src/models/IssueCommentCreateRequest.ts +0 -109
  486. package/src/models/IssueDetail.ts +0 -319
  487. package/src/models/IssueExpand.ts +0 -334
  488. package/src/models/IssueForIntakeRequest.ts +0 -102
  489. package/src/models/IssueLink.ts +0 -148
  490. package/src/models/IssueLinkCreateRequest.ts +0 -68
  491. package/src/models/IssuePropertyAPI.ts +0 -255
  492. package/src/models/IssuePropertyAPIRequest.ts +0 -171
  493. package/src/models/IssuePropertyOptionAPI.ts +0 -190
  494. package/src/models/IssuePropertyOptionAPIRequest.ts +0 -113
  495. package/src/models/IssuePropertyValueAPI.ts +0 -194
  496. package/src/models/IssuePropertyValueAPIDetail.ts +0 -76
  497. package/src/models/IssuePropertyValueAPIRequest.ts +0 -138
  498. package/src/models/IssueRequest.ts +0 -254
  499. package/src/models/IssueSearch.ts +0 -75
  500. package/src/models/IssueSearchItem.ts +0 -113
  501. package/src/models/IssueTypeAPI.ts +0 -183
  502. package/src/models/IssueTypeAPIRequest.ts +0 -113
  503. package/src/models/IssueWorkLogAPI.ts +0 -130
  504. package/src/models/IssueWorkLogAPIRequest.ts +0 -88
  505. package/src/models/Label.ts +0 -172
  506. package/src/models/LabelCreateUpdateRequest.ts +0 -116
  507. package/src/models/Module.ts +0 -280
  508. package/src/models/ModuleCreateRequest.ts +0 -142
  509. package/src/models/ModuleIssue.ts +0 -140
  510. package/src/models/ModuleIssueRequestRequest.ts +0 -68
  511. package/src/models/ModuleLite.ts +0 -253
  512. package/src/models/ModuleStatusEnum.ts +0 -61
  513. package/src/models/NetworkEnum.ts +0 -53
  514. package/src/models/PaginatedArchivedCycleResponse.ts +0 -172
  515. package/src/models/PaginatedArchivedModuleResponse.ts +0 -172
  516. package/src/models/PaginatedCycleIssueResponse.ts +0 -172
  517. package/src/models/PaginatedCycleResponse.ts +0 -172
  518. package/src/models/PaginatedIntakeIssueResponse.ts +0 -172
  519. package/src/models/PaginatedIssueActivityDetailResponse.ts +0 -172
  520. package/src/models/PaginatedIssueActivityResponse.ts +0 -172
  521. package/src/models/PaginatedIssueCommentResponse.ts +0 -172
  522. package/src/models/PaginatedIssueLinkDetailResponse.ts +0 -172
  523. package/src/models/PaginatedIssueLinkResponse.ts +0 -172
  524. package/src/models/PaginatedLabelResponse.ts +0 -172
  525. package/src/models/PaginatedModuleIssueResponse.ts +0 -172
  526. package/src/models/PaginatedModuleResponse.ts +0 -172
  527. package/src/models/PaginatedProjectResponse.ts +0 -172
  528. package/src/models/PaginatedStateResponse.ts +0 -172
  529. package/src/models/PaginatedWorkItemResponse.ts +0 -172
  530. package/src/models/PatchedAssetUpdateRequest.ts +0 -67
  531. package/src/models/PatchedCycleUpdateRequest.ts +0 -133
  532. package/src/models/PatchedGenericAssetUpdateRequest.ts +0 -67
  533. package/src/models/PatchedIntakeIssueUpdateRequest.ts +0 -124
  534. package/src/models/PatchedIssueCommentCreateRequest.ts +0 -109
  535. package/src/models/PatchedIssueLinkUpdateRequest.ts +0 -67
  536. package/src/models/PatchedIssuePropertyAPIRequest.ts +0 -169
  537. package/src/models/PatchedIssuePropertyOptionAPIRequest.ts +0 -112
  538. package/src/models/PatchedIssueRequest.ts +0 -253
  539. package/src/models/PatchedIssueTypeAPIRequest.ts +0 -112
  540. package/src/models/PatchedIssueWorkLogAPIRequest.ts +0 -88
  541. package/src/models/PatchedLabelCreateUpdateRequest.ts +0 -115
  542. package/src/models/PatchedModuleUpdateRequest.ts +0 -141
  543. package/src/models/PatchedProjectUpdateRequest.ts +0 -221
  544. package/src/models/PatchedStateRequest.ts +0 -141
  545. package/src/models/PriorityEnum.ts +0 -59
  546. package/src/models/Project.ts +0 -414
  547. package/src/models/ProjectCreateRequest.ts +0 -207
  548. package/src/models/ProjectWorklogSummary.ts +0 -74
  549. package/src/models/PropertyTypeEnum.ts +0 -67
  550. package/src/models/RelationTypeEnum.ts +0 -53
  551. package/src/models/RetrieveWorkItemAttachment400Response.ts +0 -72
  552. package/src/models/State.ts +0 -199
  553. package/src/models/StateLite.ts +0 -97
  554. package/src/models/StateRequest.ts +0 -143
  555. package/src/models/TimezoneEnum.ts +0 -915
  556. package/src/models/TransferCycleIssueRequestRequest.ts +0 -68
  557. package/src/models/TransferCycleWorkItems200Response.ts +0 -64
  558. package/src/models/TransferCycleWorkItems400Response.ts +0 -64
  559. package/src/models/TypeEnum.ts +0 -59
  560. package/src/models/UserAssetUploadRequest.ts +0 -121
  561. package/src/models/UserLite.ts +0 -108
  562. package/src/models/index.ts +0 -97
  563. package/src/oauth/api.ts +0 -183
  564. package/src/oauth/models.ts +0 -30
  565. package/src/runtime.ts +0 -431
  566. package/tsconfig.json +0 -20
package/src/oauth/api.ts DELETED
@@ -1,183 +0,0 @@
1
- import * as runtime from "../runtime";
2
- import { PlaneOAuthTokenResponse, PlaneOAuthAppInstallation } from "./models";
3
-
4
- /**
5
- * OAuth API helper class
6
- */
7
- export class OAuthApi extends runtime.BaseAPI {
8
- private clientId: string;
9
- private clientSecret: string;
10
- private redirectUri: string;
11
- private baseUrl: string;
12
-
13
- constructor(
14
- configuration: runtime.Configuration,
15
- oauthConfig?: {
16
- clientId: string;
17
- clientSecret: string;
18
- redirectUri: string;
19
- }
20
- ) {
21
- super(configuration);
22
- if (oauthConfig) {
23
- this.clientId = oauthConfig.clientId;
24
- this.clientSecret = oauthConfig.clientSecret;
25
- this.redirectUri = oauthConfig.redirectUri;
26
- this.baseUrl = configuration.basePath || "https://api.plane.so";
27
- }
28
- }
29
-
30
- /**
31
- * Get the authorization URL for the OAuth flow
32
- * @param responseType - The response type (default: "code")
33
- * @param state - Optional state parameter for security
34
- * @returns The authorization URL
35
- */
36
- getAuthorizationUrl(responseType: string = "code", state?: string): string {
37
- const params = new URLSearchParams({
38
- client_id: this.clientId,
39
- response_type: responseType,
40
- redirect_uri: this.redirectUri,
41
- });
42
-
43
- if (state) {
44
- params.append("state", state);
45
- }
46
-
47
- return `${this.baseUrl}/auth/o/authorize-app/?${params.toString()}`;
48
- }
49
-
50
- /**
51
- * Exchange authorization code for access token
52
- * @param code - The authorization code
53
- * @param grantType - The grant type (default: "authorization_code")
54
- * @returns Promise resolving to token response
55
- */
56
- async exchangeCodeForToken(
57
- code: string,
58
- grantType: string = "authorization_code"
59
- ): Promise<PlaneOAuthTokenResponse> {
60
- const data = new URLSearchParams({
61
- grant_type: grantType,
62
- code: code,
63
- client_id: this.clientId,
64
- client_secret: this.clientSecret,
65
- redirect_uri: this.redirectUri,
66
- });
67
-
68
- const headers: runtime.HTTPHeaders = {
69
- "Cache-Control": "no-cache",
70
- "Content-Type": "application/x-www-form-urlencoded",
71
- };
72
-
73
- const response = await this.request({
74
- path: `/auth/o/token/`,
75
- method: "POST",
76
- headers: headers,
77
- body: data,
78
- });
79
-
80
- return await response.json();
81
- }
82
-
83
- /**
84
- * Get a new access token using a refresh token
85
- * @param refreshToken - The refresh token
86
- * @returns Promise resolving to token response
87
- */
88
- async getRefreshToken(
89
- refreshToken: string
90
- ): Promise<PlaneOAuthTokenResponse> {
91
- const data = new URLSearchParams({
92
- grant_type: "refresh_token",
93
- refresh_token: refreshToken,
94
- client_id: this.clientId,
95
- client_secret: this.clientSecret,
96
- });
97
-
98
- const headers: runtime.HTTPHeaders = {
99
- "Cache-Control": "no-cache",
100
- "Content-Type": "application/x-www-form-urlencoded",
101
- };
102
-
103
- const response = await this.request({
104
- path: `/auth/o/token/`,
105
- method: "POST",
106
- headers: headers,
107
- body: data,
108
- });
109
-
110
- return await response.json();
111
- }
112
-
113
- /**
114
- * Get a new access token using client credentials for bot/app installations
115
- * @param appInstallationId - The app installation ID
116
- * @returns Promise resolving to token response
117
- */
118
- async getBotToken(
119
- appInstallationId: string
120
- ): Promise<PlaneOAuthTokenResponse> {
121
- const data = new URLSearchParams({
122
- grant_type: "client_credentials",
123
- app_installation_id: appInstallationId,
124
- });
125
-
126
- const headers: runtime.HTTPHeaders = {
127
- "Cache-Control": "no-cache",
128
- "Content-Type": "application/x-www-form-urlencoded",
129
- Authorization: `Basic ${this.getBasicAuthToken()}`,
130
- };
131
-
132
- const response = await this.request({
133
- path: `/auth/o/token/`,
134
- method: "POST",
135
- headers: headers,
136
- body: data,
137
- });
138
-
139
- return await response.json();
140
- }
141
-
142
- /**
143
- * Get an app installation by ID using the bot token
144
- * @param token - The bot token from getBotToken method
145
- * @param appInstallationId - The app installation ID
146
- * @returns Promise resolving to app installation
147
- */
148
- async getAppInstallations(
149
- token: string,
150
- appInstallationId?: string
151
- ): Promise<PlaneOAuthAppInstallation[]> {
152
- const headers: runtime.HTTPHeaders = {
153
- Authorization: `Bearer ${token}`,
154
- };
155
-
156
- let path = `/auth/o/app-installation/`;
157
- if (appInstallationId) {
158
- path += `?id=${appInstallationId}`;
159
- }
160
-
161
- const response = await this.request({
162
- path: path,
163
- method: "GET",
164
- headers: headers,
165
- });
166
-
167
- const data = await response.json();
168
- if (!data || data.length === 0) {
169
- throw new runtime.ResponseError(response, "App installation not found");
170
- }
171
-
172
- return data;
173
- }
174
-
175
- /**
176
- * Generate basic auth token from client_id and client_secret
177
- * @returns Base64 encoded basic auth token
178
- */
179
- private getBasicAuthToken(): string {
180
- const credentials = `${this.clientId}:${this.clientSecret}`;
181
- return btoa(credentials);
182
- }
183
- }
@@ -1,30 +0,0 @@
1
- export interface PlaneOAuthTokenResponse {
2
- access_token: string;
3
- expires_in?: number;
4
- token_type: string;
5
- scope?: string;
6
- refresh_token?: string;
7
- }
8
-
9
- export interface WorkspaceDetail {
10
- name: string;
11
- slug: string;
12
- id: string;
13
- logo_url?: string;
14
- }
15
-
16
- export interface PlaneOAuthAppInstallation {
17
- id: string;
18
- workspace_detail: WorkspaceDetail;
19
- created_at: string;
20
- updated_at: string;
21
- deleted_at?: string;
22
- status: string;
23
- created_by?: string;
24
- updated_by?: string;
25
- workspace: string;
26
- application: string;
27
- installed_by: string;
28
- app_bot: string;
29
- webhook?: string;
30
- }
package/src/runtime.ts DELETED
@@ -1,431 +0,0 @@
1
- /* tslint:disable */
2
- /* eslint-disable */
3
- /**
4
- * The Plane REST API
5
- * The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction).
6
- *
7
- * The version of the API Spec: 0.0.1
8
- * Contact: support@plane.so
9
- *
10
- * NOTE: This class is auto generated.
11
- * Do not edit the class manually.
12
- */
13
-
14
-
15
- export const BASE_PATH = "https://api.plane.so".replace(/\/+$/, "");
16
-
17
- export interface ConfigurationParameters {
18
- basePath?: string; // override base path
19
- fetchApi?: FetchAPI; // override for fetch implementation
20
- middleware?: Middleware[]; // middleware to apply before/after fetch requests
21
- queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
22
- username?: string; // parameter for basic security
23
- password?: string; // parameter for basic security
24
- apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
25
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
26
- headers?: HTTPHeaders; //header params we want to use on every request
27
- credentials?: RequestCredentials; //value for the credentials param we want to use on each request
28
- }
29
-
30
- export class Configuration {
31
- constructor(private configuration: ConfigurationParameters = {}) {}
32
-
33
- set config(configuration: Configuration) {
34
- this.configuration = configuration;
35
- }
36
-
37
- get basePath(): string {
38
- return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
39
- }
40
-
41
- get fetchApi(): FetchAPI | undefined {
42
- return this.configuration.fetchApi;
43
- }
44
-
45
- get middleware(): Middleware[] {
46
- return this.configuration.middleware || [];
47
- }
48
-
49
- get queryParamsStringify(): (params: HTTPQuery) => string {
50
- return this.configuration.queryParamsStringify || querystring;
51
- }
52
-
53
- get username(): string | undefined {
54
- return this.configuration.username;
55
- }
56
-
57
- get password(): string | undefined {
58
- return this.configuration.password;
59
- }
60
-
61
- get apiKey(): ((name: string) => string | Promise<string>) | undefined {
62
- const apiKey = this.configuration.apiKey;
63
- if (apiKey) {
64
- return typeof apiKey === 'function' ? apiKey : () => apiKey;
65
- }
66
- return undefined;
67
- }
68
-
69
- get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined {
70
- const accessToken = `Bearer ${this.configuration.accessToken}`;
71
- if (accessToken) {
72
- return typeof accessToken === 'function' ? accessToken : async () => accessToken;
73
- }
74
- return undefined;
75
- }
76
-
77
- get headers(): HTTPHeaders | undefined {
78
- return this.configuration.headers;
79
- }
80
-
81
- get credentials(): RequestCredentials | undefined {
82
- return this.configuration.credentials;
83
- }
84
- }
85
-
86
- export const DefaultConfig = new Configuration();
87
-
88
- /**
89
- * This is the base class for all generated API classes.
90
- */
91
- export class BaseAPI {
92
-
93
- private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
94
- private middleware: Middleware[];
95
-
96
- constructor(protected configuration = DefaultConfig) {
97
- this.middleware = configuration.middleware;
98
- }
99
-
100
- withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
101
- const next = this.clone<T>();
102
- next.middleware = next.middleware.concat(...middlewares);
103
- return next;
104
- }
105
-
106
- withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>) {
107
- const middlewares = preMiddlewares.map((pre) => ({ pre }));
108
- return this.withMiddleware<T>(...middlewares);
109
- }
110
-
111
- withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>) {
112
- const middlewares = postMiddlewares.map((post) => ({ post }));
113
- return this.withMiddleware<T>(...middlewares);
114
- }
115
-
116
- /**
117
- * Check if the given MIME is a JSON MIME.
118
- * JSON MIME examples:
119
- * application/json
120
- * application/json; charset=UTF8
121
- * APPLICATION/JSON
122
- * application/vnd.company+json
123
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
124
- * @return True if the given MIME is JSON, false otherwise.
125
- */
126
- protected isJsonMime(mime: string | null | undefined): boolean {
127
- if (!mime) {
128
- return false;
129
- }
130
- return BaseAPI.jsonRegex.test(mime);
131
- }
132
-
133
- protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
134
- const { url, init } = await this.createFetchParams(context, initOverrides);
135
- const response = await this.fetchApi(url, init);
136
- if (response && (response.status >= 200 && response.status < 300)) {
137
- return response;
138
- }
139
- throw new ResponseError(response, 'Response returned an error code');
140
- }
141
-
142
- private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
143
- let url = this.configuration.basePath + context.path;
144
- if (context.query !== undefined && Object.keys(context.query).length !== 0) {
145
- // only add the querystring to the URL if there are query parameters.
146
- // this is done to avoid urls ending with a "?" character which buggy webservers
147
- // do not handle correctly sometimes.
148
- url += '?' + this.configuration.queryParamsStringify(context.query);
149
- }
150
-
151
- const headers = Object.assign({}, this.configuration.headers, context.headers);
152
- Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
153
-
154
- const initOverrideFn =
155
- typeof initOverrides === "function"
156
- ? initOverrides
157
- : async () => initOverrides;
158
-
159
- const initParams = {
160
- method: context.method,
161
- headers,
162
- body: context.body,
163
- credentials: this.configuration.credentials,
164
- };
165
-
166
- const overriddenInit: RequestInit = {
167
- ...initParams,
168
- ...(await initOverrideFn({
169
- init: initParams,
170
- context,
171
- }))
172
- };
173
-
174
- let body: any;
175
- if (isFormData(overriddenInit.body)
176
- || (overriddenInit.body instanceof URLSearchParams)
177
- || isBlob(overriddenInit.body)) {
178
- body = overriddenInit.body;
179
- } else if (this.isJsonMime(headers['Content-Type'])) {
180
- body = JSON.stringify(overriddenInit.body);
181
- } else {
182
- body = overriddenInit.body;
183
- }
184
-
185
- const init: RequestInit = {
186
- ...overriddenInit,
187
- body
188
- };
189
-
190
- return { url, init };
191
- }
192
-
193
- private fetchApi = async (url: string, init: RequestInit) => {
194
- let fetchParams = { url, init };
195
- for (const middleware of this.middleware) {
196
- if (middleware.pre) {
197
- fetchParams = await middleware.pre({
198
- fetch: this.fetchApi,
199
- ...fetchParams,
200
- }) || fetchParams;
201
- }
202
- }
203
- let response: Response | undefined = undefined;
204
- try {
205
- response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
206
- } catch (e) {
207
- for (const middleware of this.middleware) {
208
- if (middleware.onError) {
209
- response = await middleware.onError({
210
- fetch: this.fetchApi,
211
- url: fetchParams.url,
212
- init: fetchParams.init,
213
- error: e,
214
- response: response ? response.clone() : undefined,
215
- }) || response;
216
- }
217
- }
218
- if (response === undefined) {
219
- if (e instanceof Error) {
220
- throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
221
- } else {
222
- throw e;
223
- }
224
- }
225
- }
226
- for (const middleware of this.middleware) {
227
- if (middleware.post) {
228
- response = await middleware.post({
229
- fetch: this.fetchApi,
230
- url: fetchParams.url,
231
- init: fetchParams.init,
232
- response: response.clone(),
233
- }) || response;
234
- }
235
- }
236
- return response;
237
- }
238
-
239
- /**
240
- * Create a shallow clone of `this` by constructing a new instance
241
- * and then shallow cloning data members.
242
- */
243
- private clone<T extends BaseAPI>(this: T): T {
244
- const constructor = this.constructor as any;
245
- const next = new constructor(this.configuration);
246
- next.middleware = this.middleware.slice();
247
- return next;
248
- }
249
- };
250
-
251
- function isBlob(value: any): value is Blob {
252
- return typeof Blob !== 'undefined' && value instanceof Blob;
253
- }
254
-
255
- function isFormData(value: any): value is FormData {
256
- return typeof FormData !== "undefined" && value instanceof FormData;
257
- }
258
-
259
- export class ResponseError extends Error {
260
- override name: "ResponseError" = "ResponseError";
261
- constructor(public response: Response, msg?: string) {
262
- super(msg);
263
- }
264
- }
265
-
266
- export class FetchError extends Error {
267
- override name: "FetchError" = "FetchError";
268
- constructor(public cause: Error, msg?: string) {
269
- super(msg);
270
- }
271
- }
272
-
273
- export class RequiredError extends Error {
274
- override name: "RequiredError" = "RequiredError";
275
- constructor(public field: string, msg?: string) {
276
- super(msg);
277
- }
278
- }
279
-
280
- export const COLLECTION_FORMATS = {
281
- csv: ",",
282
- ssv: " ",
283
- tsv: "\t",
284
- pipes: "|",
285
- };
286
-
287
- export type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
288
-
289
- export type Json = any;
290
- export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
291
- export type HTTPHeaders = { [key: string]: string };
292
- export type HTTPQuery = { [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery };
293
- export type HTTPBody = Json | FormData | URLSearchParams;
294
- export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody };
295
- export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
296
-
297
- export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
298
-
299
- export interface FetchParams {
300
- url: string;
301
- init: RequestInit;
302
- }
303
-
304
- export interface RequestOpts {
305
- path: string;
306
- method: HTTPMethod;
307
- headers: HTTPHeaders;
308
- query?: HTTPQuery;
309
- body?: HTTPBody;
310
- }
311
-
312
- export function querystring(params: HTTPQuery, prefix: string = ''): string {
313
- return Object.keys(params)
314
- .map(key => querystringSingleKey(key, params[key], prefix))
315
- .filter(part => part.length > 0)
316
- .join('&');
317
- }
318
-
319
- function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
320
- const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
321
- if (value instanceof Array) {
322
- const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
323
- .join(`&${encodeURIComponent(fullKey)}=`);
324
- return `${encodeURIComponent(fullKey)}=${multiValue}`;
325
- }
326
- if (value instanceof Set) {
327
- const valueAsArray = Array.from(value);
328
- return querystringSingleKey(key, valueAsArray, keyPrefix);
329
- }
330
- if (value instanceof Date) {
331
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
332
- }
333
- if (value instanceof Object) {
334
- return querystring(value as HTTPQuery, fullKey);
335
- }
336
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
337
- }
338
-
339
- export function exists(json: any, key: string) {
340
- const value = json[key];
341
- return value !== null && value !== undefined;
342
- }
343
-
344
- export function mapValues(data: any, fn: (item: any) => any) {
345
- const result: { [key: string]: any } = {};
346
- for (const key of Object.keys(data)) {
347
- result[key] = fn(data[key]);
348
- }
349
- return result;
350
- }
351
-
352
- export function canConsumeForm(consumes: Consume[]): boolean {
353
- for (const consume of consumes) {
354
- if ('multipart/form-data' === consume.contentType) {
355
- return true;
356
- }
357
- }
358
- return false;
359
- }
360
-
361
- export interface Consume {
362
- contentType: string;
363
- }
364
-
365
- export interface RequestContext {
366
- fetch: FetchAPI;
367
- url: string;
368
- init: RequestInit;
369
- }
370
-
371
- export interface ResponseContext {
372
- fetch: FetchAPI;
373
- url: string;
374
- init: RequestInit;
375
- response: Response;
376
- }
377
-
378
- export interface ErrorContext {
379
- fetch: FetchAPI;
380
- url: string;
381
- init: RequestInit;
382
- error: unknown;
383
- response?: Response;
384
- }
385
-
386
- export interface Middleware {
387
- pre?(context: RequestContext): Promise<FetchParams | void>;
388
- post?(context: ResponseContext): Promise<Response | void>;
389
- onError?(context: ErrorContext): Promise<Response | void>;
390
- }
391
-
392
- export interface ApiResponse<T> {
393
- raw: Response;
394
- value(): Promise<T>;
395
- }
396
-
397
- export interface ResponseTransformer<T> {
398
- (json: any): T;
399
- }
400
-
401
- export class JSONApiResponse<T> {
402
- constructor(public raw: Response, private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue) {}
403
-
404
- async value(): Promise<T> {
405
- return this.transformer(await this.raw.json());
406
- }
407
- }
408
-
409
- export class VoidApiResponse {
410
- constructor(public raw: Response) {}
411
-
412
- async value(): Promise<void> {
413
- return undefined;
414
- }
415
- }
416
-
417
- export class BlobApiResponse {
418
- constructor(public raw: Response) {}
419
-
420
- async value(): Promise<Blob> {
421
- return await this.raw.blob();
422
- };
423
- }
424
-
425
- export class TextApiResponse {
426
- constructor(public raw: Response) {}
427
-
428
- async value(): Promise<string> {
429
- return await this.raw.text();
430
- };
431
- }
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "declaration": true,
4
- "target": "es5",
5
- "module": "commonjs",
6
- "moduleResolution": "node",
7
- "outDir": "dist",
8
- "lib": [
9
- "es6",
10
- "dom"
11
- ],
12
- "typeRoots": [
13
- "node_modules/@types"
14
- ]
15
- },
16
- "exclude": [
17
- "dist",
18
- "node_modules"
19
- ]
20
- }