@makeplane/plane-node-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish-node-sdk.yml +24 -0
- package/.openapi-generator/FILES +119 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +95 -0
- package/dist/apis/AssetsApi.d.ts +100 -0
- package/dist/apis/AssetsApi.js +522 -0
- package/dist/apis/CyclesApi.d.ts +225 -0
- package/dist/apis/CyclesApi.js +1142 -0
- package/dist/apis/IntakeApi.d.ts +96 -0
- package/dist/apis/IntakeApi.js +485 -0
- package/dist/apis/LabelsApi.d.ts +97 -0
- package/dist/apis/LabelsApi.js +488 -0
- package/dist/apis/MembersApi.d.ts +44 -0
- package/dist/apis/MembersApi.js +228 -0
- package/dist/apis/ModulesApi.d.ts +198 -0
- package/dist/apis/ModulesApi.js +991 -0
- package/dist/apis/ProjectsApi.d.ts +120 -0
- package/dist/apis/ProjectsApi.js +621 -0
- package/dist/apis/StatesApi.d.ts +96 -0
- package/dist/apis/StatesApi.js +485 -0
- package/dist/apis/UsersApi.d.ts +27 -0
- package/dist/apis/UsersApi.js +149 -0
- package/dist/apis/WorkItemActivityApi.d.ts +58 -0
- package/dist/apis/WorkItemActivityApi.js +270 -0
- package/dist/apis/WorkItemAttachmentsApi.d.ts +80 -0
- package/dist/apis/WorkItemAttachmentsApi.js +400 -0
- package/dist/apis/WorkItemCommentsApi.d.ts +102 -0
- package/dist/apis/WorkItemCommentsApi.js +500 -0
- package/dist/apis/WorkItemLinksApi.d.ts +106 -0
- package/dist/apis/WorkItemLinksApi.js +515 -0
- package/dist/apis/WorkItemPropertiesApi.d.ts +210 -0
- package/dist/apis/WorkItemPropertiesApi.js +1066 -0
- package/dist/apis/WorkItemTypesApi.d.ts +92 -0
- package/dist/apis/WorkItemTypesApi.js +473 -0
- package/dist/apis/WorkItemWorklogsApi.d.ts +95 -0
- package/dist/apis/WorkItemWorklogsApi.js +479 -0
- package/dist/apis/WorkItemsApi.d.ts +134 -0
- package/dist/apis/WorkItemsApi.js +674 -0
- package/dist/apis/index.d.ts +17 -0
- package/dist/apis/index.js +34 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/models/AccessEnum.d.ts +25 -0
- package/dist/models/AccessEnum.js +51 -0
- package/dist/models/Cycle.d.ts +215 -0
- package/dist/models/Cycle.js +93 -0
- package/dist/models/CycleCreateRequest.d.ts +77 -0
- package/dist/models/CycleCreateRequest.js +67 -0
- package/dist/models/CycleIssue.d.ts +94 -0
- package/dist/models/CycleIssue.js +65 -0
- package/dist/models/CycleIssueRequestRequest.d.ts +34 -0
- package/dist/models/CycleIssueRequestRequest.js +50 -0
- package/dist/models/CycleLite.d.ts +161 -0
- package/dist/models/CycleLite.js +96 -0
- package/dist/models/EntityTypeEnum.d.ts +25 -0
- package/dist/models/EntityTypeEnum.js +51 -0
- package/dist/models/GenericAssetUploadRequest.d.ts +65 -0
- package/dist/models/GenericAssetUploadRequest.js +62 -0
- package/dist/models/GetWorkspaceMembers200ResponseInner.d.ts +73 -0
- package/dist/models/GetWorkspaceMembers200ResponseInner.js +55 -0
- package/dist/models/GroupEnum.d.ts +33 -0
- package/dist/models/GroupEnum.js +59 -0
- package/dist/models/IntakeIssue.d.ts +150 -0
- package/dist/models/IntakeIssue.js +80 -0
- package/dist/models/IntakeIssueCreateRequest.d.ts +72 -0
- package/dist/models/IntakeIssueCreateRequest.js +66 -0
- package/dist/models/IntakeWorkItemStatusEnum.d.ts +31 -0
- package/dist/models/IntakeWorkItemStatusEnum.js +57 -0
- package/dist/models/Issue.d.ts +197 -0
- package/dist/models/Issue.js +98 -0
- package/dist/models/IssueActivity.d.ts +136 -0
- package/dist/models/IssueActivity.js +83 -0
- package/dist/models/IssueAttachment.d.ts +172 -0
- package/dist/models/IssueAttachment.js +89 -0
- package/dist/models/IssueAttachmentUploadRequest.d.ts +58 -0
- package/dist/models/IssueAttachmentUploadRequest.js +60 -0
- package/dist/models/IssueComment.d.ts +137 -0
- package/dist/models/IssueComment.js +74 -0
- package/dist/models/IssueCommentCreateRequest.d.ts +59 -0
- package/dist/models/IssueCommentCreateRequest.js +57 -0
- package/dist/models/IssueExpand.d.ts +226 -0
- package/dist/models/IssueExpand.js +105 -0
- package/dist/models/IssueForIntakeRequest.d.ts +53 -0
- package/dist/models/IssueForIntakeRequest.js +57 -0
- package/dist/models/IssueLink.d.ts +100 -0
- package/dist/models/IssueLink.js +64 -0
- package/dist/models/IssueLinkCreateRequest.d.ts +34 -0
- package/dist/models/IssueLinkCreateRequest.js +50 -0
- package/dist/models/IssuePropertyAPI.d.ts +171 -0
- package/dist/models/IssuePropertyAPI.js +88 -0
- package/dist/models/IssuePropertyAPIRequest.d.ts +99 -0
- package/dist/models/IssuePropertyAPIRequest.js +76 -0
- package/dist/models/IssuePropertyOptionAPI.d.ts +133 -0
- package/dist/models/IssuePropertyOptionAPI.js +73 -0
- package/dist/models/IssuePropertyOptionAPIRequest.d.ts +67 -0
- package/dist/models/IssuePropertyOptionAPIRequest.js +62 -0
- package/dist/models/IssuePropertyValueAPI.d.ts +133 -0
- package/dist/models/IssuePropertyValueAPI.js +78 -0
- package/dist/models/IssuePropertyValueAPIRequest.d.ts +85 -0
- package/dist/models/IssuePropertyValueAPIRequest.js +70 -0
- package/dist/models/IssueRequest.d.ts +167 -0
- package/dist/models/IssueRequest.js +95 -0
- package/dist/models/IssueSearch.d.ts +64 -0
- package/dist/models/IssueSearch.js +70 -0
- package/dist/models/IssueTypeAPI.d.ts +127 -0
- package/dist/models/IssueTypeAPI.js +72 -0
- package/dist/models/IssueTypeAPIRequest.d.ts +67 -0
- package/dist/models/IssueTypeAPIRequest.js +62 -0
- package/dist/models/IssueWorkLogAPI.d.ts +85 -0
- package/dist/models/IssueWorkLogAPI.js +60 -0
- package/dist/models/IssueWorkLogAPIRequest.d.ts +49 -0
- package/dist/models/IssueWorkLogAPIRequest.js +54 -0
- package/dist/models/Label.d.ts +118 -0
- package/dist/models/Label.js +70 -0
- package/dist/models/LabelCreateUpdateRequest.d.ts +70 -0
- package/dist/models/LabelCreateUpdateRequest.js +62 -0
- package/dist/models/LabelLite.d.ts +46 -0
- package/dist/models/LabelLite.js +53 -0
- package/dist/models/Module.d.ts +197 -0
- package/dist/models/Module.js +91 -0
- package/dist/models/ModuleCreateRequest.d.ts +83 -0
- package/dist/models/ModuleCreateRequest.js +67 -0
- package/dist/models/ModuleIssue.d.ts +94 -0
- package/dist/models/ModuleIssue.js +63 -0
- package/dist/models/ModuleIssueRequestRequest.d.ts +34 -0
- package/dist/models/ModuleIssueRequestRequest.js +50 -0
- package/dist/models/ModuleLite.d.ts +167 -0
- package/dist/models/ModuleLite.js +97 -0
- package/dist/models/ModuleStatusEnum.d.ts +33 -0
- package/dist/models/ModuleStatusEnum.js +59 -0
- package/dist/models/NetworkEnum.d.ts +25 -0
- package/dist/models/NetworkEnum.js +51 -0
- package/dist/models/PaginatedArchivedCycleResponse.d.ts +98 -0
- package/dist/models/PaginatedArchivedCycleResponse.js +95 -0
- package/dist/models/PaginatedArchivedModuleResponse.d.ts +98 -0
- package/dist/models/PaginatedArchivedModuleResponse.js +95 -0
- package/dist/models/PaginatedCycleIssueResponse.d.ts +98 -0
- package/dist/models/PaginatedCycleIssueResponse.js +95 -0
- package/dist/models/PaginatedCycleResponse.d.ts +98 -0
- package/dist/models/PaginatedCycleResponse.js +95 -0
- package/dist/models/PaginatedIntakeIssueResponse.d.ts +98 -0
- package/dist/models/PaginatedIntakeIssueResponse.js +95 -0
- package/dist/models/PaginatedIssueActivityDetailResponse.d.ts +98 -0
- package/dist/models/PaginatedIssueActivityDetailResponse.js +95 -0
- package/dist/models/PaginatedIssueActivityResponse.d.ts +98 -0
- package/dist/models/PaginatedIssueActivityResponse.js +95 -0
- package/dist/models/PaginatedIssueCommentResponse.d.ts +98 -0
- package/dist/models/PaginatedIssueCommentResponse.js +95 -0
- package/dist/models/PaginatedIssueLinkDetailResponse.d.ts +98 -0
- package/dist/models/PaginatedIssueLinkDetailResponse.js +95 -0
- package/dist/models/PaginatedIssueLinkResponse.d.ts +98 -0
- package/dist/models/PaginatedIssueLinkResponse.js +95 -0
- package/dist/models/PaginatedLabelResponse.d.ts +98 -0
- package/dist/models/PaginatedLabelResponse.js +95 -0
- package/dist/models/PaginatedModuleIssueResponse.d.ts +98 -0
- package/dist/models/PaginatedModuleIssueResponse.js +95 -0
- package/dist/models/PaginatedModuleResponse.d.ts +98 -0
- package/dist/models/PaginatedModuleResponse.js +95 -0
- package/dist/models/PaginatedProjectResponse.d.ts +98 -0
- package/dist/models/PaginatedProjectResponse.js +95 -0
- package/dist/models/PaginatedStateResponse.d.ts +98 -0
- package/dist/models/PaginatedStateResponse.js +95 -0
- package/dist/models/PaginatedWorkItemResponse.d.ts +98 -0
- package/dist/models/PaginatedWorkItemResponse.js +95 -0
- package/dist/models/PatchedAssetUpdateRequest.d.ts +34 -0
- package/dist/models/PatchedAssetUpdateRequest.js +48 -0
- package/dist/models/PatchedCycleUpdateRequest.d.ts +77 -0
- package/dist/models/PatchedCycleUpdateRequest.js +63 -0
- package/dist/models/PatchedGenericAssetUpdateRequest.d.ts +34 -0
- package/dist/models/PatchedGenericAssetUpdateRequest.js +48 -0
- package/dist/models/PatchedIntakeIssueUpdateRequest.d.ts +66 -0
- package/dist/models/PatchedIntakeIssueUpdateRequest.js +60 -0
- package/dist/models/PatchedIssueCommentCreateRequest.d.ts +59 -0
- package/dist/models/PatchedIssueCommentCreateRequest.js +57 -0
- package/dist/models/PatchedIssueLinkUpdateRequest.d.ts +34 -0
- package/dist/models/PatchedIssueLinkUpdateRequest.js +48 -0
- package/dist/models/PatchedIssuePropertyAPIRequest.d.ts +99 -0
- package/dist/models/PatchedIssuePropertyAPIRequest.js +72 -0
- package/dist/models/PatchedIssuePropertyOptionAPIRequest.d.ts +67 -0
- package/dist/models/PatchedIssuePropertyOptionAPIRequest.js +60 -0
- package/dist/models/PatchedIssueRequest.d.ts +167 -0
- package/dist/models/PatchedIssueRequest.js +93 -0
- package/dist/models/PatchedIssueTypeAPIRequest.d.ts +67 -0
- package/dist/models/PatchedIssueTypeAPIRequest.js +60 -0
- package/dist/models/PatchedIssueWorkLogAPIRequest.d.ts +49 -0
- package/dist/models/PatchedIssueWorkLogAPIRequest.js +54 -0
- package/dist/models/PatchedLabelCreateUpdateRequest.d.ts +70 -0
- package/dist/models/PatchedLabelCreateUpdateRequest.js +60 -0
- package/dist/models/PatchedModuleUpdateRequest.d.ts +83 -0
- package/dist/models/PatchedModuleUpdateRequest.js +65 -0
- package/dist/models/PatchedProjectUpdateRequest.d.ts +143 -0
- package/dist/models/PatchedProjectUpdateRequest.js +85 -0
- package/dist/models/PatchedStateRequest.d.ts +83 -0
- package/dist/models/PatchedStateRequest.js +65 -0
- package/dist/models/PriorityEnum.d.ts +31 -0
- package/dist/models/PriorityEnum.js +57 -0
- package/dist/models/Project.d.ts +294 -0
- package/dist/models/Project.js +124 -0
- package/dist/models/ProjectCreateRequest.d.ts +131 -0
- package/dist/models/ProjectCreateRequest.js +85 -0
- package/dist/models/ProjectWorklogSummary.d.ts +37 -0
- package/dist/models/ProjectWorklogSummary.js +54 -0
- package/dist/models/PropertyTypeEnum.d.ts +39 -0
- package/dist/models/PropertyTypeEnum.js +65 -0
- package/dist/models/RelationTypeEnum.d.ts +25 -0
- package/dist/models/RelationTypeEnum.js +51 -0
- package/dist/models/RetrieveWorkItemAttachment400Response.d.ts +37 -0
- package/dist/models/RetrieveWorkItemAttachment400Response.js +50 -0
- package/dist/models/State.d.ts +137 -0
- package/dist/models/State.js +78 -0
- package/dist/models/StateLite.d.ts +53 -0
- package/dist/models/StateLite.js +50 -0
- package/dist/models/StateRequest.d.ts +83 -0
- package/dist/models/StateRequest.js +69 -0
- package/dist/models/TimezoneEnum.d.ts +887 -0
- package/dist/models/TimezoneEnum.js +913 -0
- package/dist/models/TransferCycleIssueRequestRequest.d.ts +34 -0
- package/dist/models/TransferCycleIssueRequestRequest.js +50 -0
- package/dist/models/TransferCycleWorkItems200Response.d.ts +31 -0
- package/dist/models/TransferCycleWorkItems200Response.js +48 -0
- package/dist/models/TransferCycleWorkItems400Response.d.ts +31 -0
- package/dist/models/TransferCycleWorkItems400Response.js +48 -0
- package/dist/models/TypeEnum.d.ts +31 -0
- package/dist/models/TypeEnum.js +57 -0
- package/dist/models/UserAssetUploadRequest.d.ts +64 -0
- package/dist/models/UserAssetUploadRequest.js +62 -0
- package/dist/models/UserLite.d.ts +70 -0
- package/dist/models/UserLite.js +52 -0
- package/dist/models/index.d.ts +93 -0
- package/dist/models/index.js +110 -0
- package/dist/runtime.d.ts +183 -0
- package/dist/runtime.js +563 -0
- package/eslint.config.mjs +11 -0
- package/package.json +23 -0
- package/src/apis/AssetsApi.ts +388 -0
- package/src/apis/CyclesApi.ts +1031 -0
- package/src/apis/IntakeApi.ts +401 -0
- package/src/apis/LabelsApi.ts +406 -0
- package/src/apis/MembersApi.ts +146 -0
- package/src/apis/ModulesApi.ts +890 -0
- package/src/apis/ProjectsApi.ts +486 -0
- package/src/apis/StatesApi.ts +401 -0
- package/src/apis/UsersApi.ts +71 -0
- package/src/apis/WorkItemActivityApi.ts +228 -0
- package/src/apis/WorkItemAttachmentsApi.ts +335 -0
- package/src/apis/WorkItemCommentsApi.ts +439 -0
- package/src/apis/WorkItemLinksApi.ts +469 -0
- package/src/apis/WorkItemPropertiesApi.ts +981 -0
- package/src/apis/WorkItemTypesApi.ts +378 -0
- package/src/apis/WorkItemWorklogsApi.ts +398 -0
- package/src/apis/WorkItemsApi.ts +591 -0
- package/src/apis/index.ts +19 -0
- package/src/index.ts +5 -0
- package/src/models/AccessEnum.ts +53 -0
- package/src/models/Cycle.ts +300 -0
- package/src/models/CycleCreateRequest.ts +135 -0
- package/src/models/CycleIssue.ts +142 -0
- package/src/models/CycleIssueRequestRequest.ts +68 -0
- package/src/models/CycleLite.ts +246 -0
- package/src/models/EntityTypeEnum.ts +53 -0
- package/src/models/GenericAssetUploadRequest.ts +110 -0
- package/src/models/GetWorkspaceMembers200ResponseInner.ts +113 -0
- package/src/models/GroupEnum.ts +61 -0
- package/src/models/IntakeIssue.ts +227 -0
- package/src/models/IntakeIssueCreateRequest.ts +134 -0
- package/src/models/IntakeWorkItemStatusEnum.ts +59 -0
- package/src/models/Issue.ts +287 -0
- package/src/models/IssueActivity.ts +202 -0
- package/src/models/IssueAttachment.ts +245 -0
- package/src/models/IssueAttachmentUploadRequest.ts +101 -0
- package/src/models/IssueComment.ts +204 -0
- package/src/models/IssueCommentCreateRequest.ts +109 -0
- package/src/models/IssueExpand.ts +348 -0
- package/src/models/IssueForIntakeRequest.ts +102 -0
- package/src/models/IssueLink.ts +148 -0
- package/src/models/IssueLinkCreateRequest.ts +68 -0
- package/src/models/IssuePropertyAPI.ts +255 -0
- package/src/models/IssuePropertyAPIRequest.ts +171 -0
- package/src/models/IssuePropertyOptionAPI.ts +190 -0
- package/src/models/IssuePropertyOptionAPIRequest.ts +113 -0
- package/src/models/IssuePropertyValueAPI.ts +194 -0
- package/src/models/IssuePropertyValueAPIRequest.ts +138 -0
- package/src/models/IssueRequest.ts +254 -0
- package/src/models/IssueSearch.ts +113 -0
- package/src/models/IssueTypeAPI.ts +183 -0
- package/src/models/IssueTypeAPIRequest.ts +113 -0
- package/src/models/IssueWorkLogAPI.ts +130 -0
- package/src/models/IssueWorkLogAPIRequest.ts +88 -0
- package/src/models/Label.ts +172 -0
- package/src/models/LabelCreateUpdateRequest.ts +116 -0
- package/src/models/LabelLite.ts +83 -0
- package/src/models/Module.ts +280 -0
- package/src/models/ModuleCreateRequest.ts +142 -0
- package/src/models/ModuleIssue.ts +140 -0
- package/src/models/ModuleIssueRequestRequest.ts +68 -0
- package/src/models/ModuleLite.ts +253 -0
- package/src/models/ModuleStatusEnum.ts +61 -0
- package/src/models/NetworkEnum.ts +53 -0
- package/src/models/PaginatedArchivedCycleResponse.ts +172 -0
- package/src/models/PaginatedArchivedModuleResponse.ts +172 -0
- package/src/models/PaginatedCycleIssueResponse.ts +172 -0
- package/src/models/PaginatedCycleResponse.ts +172 -0
- package/src/models/PaginatedIntakeIssueResponse.ts +172 -0
- package/src/models/PaginatedIssueActivityDetailResponse.ts +172 -0
- package/src/models/PaginatedIssueActivityResponse.ts +172 -0
- package/src/models/PaginatedIssueCommentResponse.ts +172 -0
- package/src/models/PaginatedIssueLinkDetailResponse.ts +172 -0
- package/src/models/PaginatedIssueLinkResponse.ts +172 -0
- package/src/models/PaginatedLabelResponse.ts +172 -0
- package/src/models/PaginatedModuleIssueResponse.ts +172 -0
- package/src/models/PaginatedModuleResponse.ts +172 -0
- package/src/models/PaginatedProjectResponse.ts +172 -0
- package/src/models/PaginatedStateResponse.ts +172 -0
- package/src/models/PaginatedWorkItemResponse.ts +172 -0
- package/src/models/PatchedAssetUpdateRequest.ts +67 -0
- package/src/models/PatchedCycleUpdateRequest.ts +133 -0
- package/src/models/PatchedGenericAssetUpdateRequest.ts +67 -0
- package/src/models/PatchedIntakeIssueUpdateRequest.ts +124 -0
- package/src/models/PatchedIssueCommentCreateRequest.ts +109 -0
- package/src/models/PatchedIssueLinkUpdateRequest.ts +67 -0
- package/src/models/PatchedIssuePropertyAPIRequest.ts +169 -0
- package/src/models/PatchedIssuePropertyOptionAPIRequest.ts +112 -0
- package/src/models/PatchedIssueRequest.ts +253 -0
- package/src/models/PatchedIssueTypeAPIRequest.ts +112 -0
- package/src/models/PatchedIssueWorkLogAPIRequest.ts +88 -0
- package/src/models/PatchedLabelCreateUpdateRequest.ts +115 -0
- package/src/models/PatchedModuleUpdateRequest.ts +141 -0
- package/src/models/PatchedProjectUpdateRequest.ts +221 -0
- package/src/models/PatchedStateRequest.ts +141 -0
- package/src/models/PriorityEnum.ts +59 -0
- package/src/models/Project.ts +414 -0
- package/src/models/ProjectCreateRequest.ts +207 -0
- package/src/models/ProjectWorklogSummary.ts +74 -0
- package/src/models/PropertyTypeEnum.ts +67 -0
- package/src/models/RelationTypeEnum.ts +53 -0
- package/src/models/RetrieveWorkItemAttachment400Response.ts +72 -0
- package/src/models/State.ts +206 -0
- package/src/models/StateLite.ts +97 -0
- package/src/models/StateRequest.ts +143 -0
- package/src/models/TimezoneEnum.ts +915 -0
- package/src/models/TransferCycleIssueRequestRequest.ts +68 -0
- package/src/models/TransferCycleWorkItems200Response.ts +64 -0
- package/src/models/TransferCycleWorkItems400Response.ts +64 -0
- package/src/models/TypeEnum.ts +59 -0
- package/src/models/UserAssetUploadRequest.ts +121 -0
- package/src/models/UserLite.ts +108 -0
- package/src/models/index.ts +95 -0
- package/src/runtime.ts +431 -0
- package/tsconfig.json +20 -0
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Plane REST API
|
|
6
|
+
* The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction).
|
|
7
|
+
*
|
|
8
|
+
* The version of the API Spec: 0.0.1
|
|
9
|
+
* Contact: support@plane.so
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated.
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
var __extends = (this && this.__extends) || (function () {
|
|
15
|
+
var extendStatics = function (d, b) {
|
|
16
|
+
extendStatics = Object.setPrototypeOf ||
|
|
17
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
18
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
19
|
+
return extendStatics(d, b);
|
|
20
|
+
};
|
|
21
|
+
return function (d, b) {
|
|
22
|
+
if (typeof b !== "function" && b !== null)
|
|
23
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
24
|
+
extendStatics(d, b);
|
|
25
|
+
function __() { this.constructor = d; }
|
|
26
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
29
|
+
var __assign = (this && this.__assign) || function () {
|
|
30
|
+
__assign = Object.assign || function(t) {
|
|
31
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
32
|
+
s = arguments[i];
|
|
33
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
34
|
+
t[p] = s[p];
|
|
35
|
+
}
|
|
36
|
+
return t;
|
|
37
|
+
};
|
|
38
|
+
return __assign.apply(this, arguments);
|
|
39
|
+
};
|
|
40
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
51
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
+
function step(op) {
|
|
54
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
56
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
+
switch (op[0]) {
|
|
59
|
+
case 0: case 1: t = op; break;
|
|
60
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
+
default:
|
|
64
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
+
if (t[2]) _.ops.pop();
|
|
69
|
+
_.trys.pop(); continue;
|
|
70
|
+
}
|
|
71
|
+
op = body.call(thisArg, _);
|
|
72
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
+
exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.COLLECTION_FORMATS = exports.RequiredError = exports.FetchError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
|
|
78
|
+
exports.querystring = querystring;
|
|
79
|
+
exports.exists = exists;
|
|
80
|
+
exports.mapValues = mapValues;
|
|
81
|
+
exports.canConsumeForm = canConsumeForm;
|
|
82
|
+
exports.BASE_PATH = "https://api.plane.so".replace(/\/+$/, "");
|
|
83
|
+
var Configuration = /** @class */ (function () {
|
|
84
|
+
function Configuration(configuration) {
|
|
85
|
+
if (configuration === void 0) { configuration = {}; }
|
|
86
|
+
this.configuration = configuration;
|
|
87
|
+
}
|
|
88
|
+
Object.defineProperty(Configuration.prototype, "config", {
|
|
89
|
+
set: function (configuration) {
|
|
90
|
+
this.configuration = configuration;
|
|
91
|
+
},
|
|
92
|
+
enumerable: false,
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(Configuration.prototype, "basePath", {
|
|
96
|
+
get: function () {
|
|
97
|
+
return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
|
|
98
|
+
},
|
|
99
|
+
enumerable: false,
|
|
100
|
+
configurable: true
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(Configuration.prototype, "fetchApi", {
|
|
103
|
+
get: function () {
|
|
104
|
+
return this.configuration.fetchApi;
|
|
105
|
+
},
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true
|
|
108
|
+
});
|
|
109
|
+
Object.defineProperty(Configuration.prototype, "middleware", {
|
|
110
|
+
get: function () {
|
|
111
|
+
return this.configuration.middleware || [];
|
|
112
|
+
},
|
|
113
|
+
enumerable: false,
|
|
114
|
+
configurable: true
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(Configuration.prototype, "queryParamsStringify", {
|
|
117
|
+
get: function () {
|
|
118
|
+
return this.configuration.queryParamsStringify || querystring;
|
|
119
|
+
},
|
|
120
|
+
enumerable: false,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(Configuration.prototype, "username", {
|
|
124
|
+
get: function () {
|
|
125
|
+
return this.configuration.username;
|
|
126
|
+
},
|
|
127
|
+
enumerable: false,
|
|
128
|
+
configurable: true
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(Configuration.prototype, "password", {
|
|
131
|
+
get: function () {
|
|
132
|
+
return this.configuration.password;
|
|
133
|
+
},
|
|
134
|
+
enumerable: false,
|
|
135
|
+
configurable: true
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(Configuration.prototype, "apiKey", {
|
|
138
|
+
get: function () {
|
|
139
|
+
var apiKey = this.configuration.apiKey;
|
|
140
|
+
if (apiKey) {
|
|
141
|
+
return typeof apiKey === 'function' ? apiKey : function () { return apiKey; };
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
},
|
|
145
|
+
enumerable: false,
|
|
146
|
+
configurable: true
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(Configuration.prototype, "accessToken", {
|
|
149
|
+
get: function () {
|
|
150
|
+
var _this = this;
|
|
151
|
+
var accessToken = this.configuration.accessToken;
|
|
152
|
+
if (accessToken) {
|
|
153
|
+
return typeof accessToken === 'function' ? accessToken : function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
154
|
+
return [2 /*return*/, accessToken];
|
|
155
|
+
}); }); };
|
|
156
|
+
}
|
|
157
|
+
return undefined;
|
|
158
|
+
},
|
|
159
|
+
enumerable: false,
|
|
160
|
+
configurable: true
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(Configuration.prototype, "headers", {
|
|
163
|
+
get: function () {
|
|
164
|
+
return this.configuration.headers;
|
|
165
|
+
},
|
|
166
|
+
enumerable: false,
|
|
167
|
+
configurable: true
|
|
168
|
+
});
|
|
169
|
+
Object.defineProperty(Configuration.prototype, "credentials", {
|
|
170
|
+
get: function () {
|
|
171
|
+
return this.configuration.credentials;
|
|
172
|
+
},
|
|
173
|
+
enumerable: false,
|
|
174
|
+
configurable: true
|
|
175
|
+
});
|
|
176
|
+
return Configuration;
|
|
177
|
+
}());
|
|
178
|
+
exports.Configuration = Configuration;
|
|
179
|
+
exports.DefaultConfig = new Configuration();
|
|
180
|
+
/**
|
|
181
|
+
* This is the base class for all generated API classes.
|
|
182
|
+
*/
|
|
183
|
+
var BaseAPI = /** @class */ (function () {
|
|
184
|
+
function BaseAPI(configuration) {
|
|
185
|
+
if (configuration === void 0) { configuration = exports.DefaultConfig; }
|
|
186
|
+
var _this = this;
|
|
187
|
+
this.configuration = configuration;
|
|
188
|
+
this.fetchApi = function (url, init) { return __awaiter(_this, void 0, void 0, function () {
|
|
189
|
+
var fetchParams, _i, _a, middleware, response, e_1, _b, _c, middleware, _d, _e, middleware;
|
|
190
|
+
return __generator(this, function (_f) {
|
|
191
|
+
switch (_f.label) {
|
|
192
|
+
case 0:
|
|
193
|
+
fetchParams = { url: url, init: init };
|
|
194
|
+
_i = 0, _a = this.middleware;
|
|
195
|
+
_f.label = 1;
|
|
196
|
+
case 1:
|
|
197
|
+
if (!(_i < _a.length)) return [3 /*break*/, 4];
|
|
198
|
+
middleware = _a[_i];
|
|
199
|
+
if (!middleware.pre) return [3 /*break*/, 3];
|
|
200
|
+
return [4 /*yield*/, middleware.pre(__assign({ fetch: this.fetchApi }, fetchParams))];
|
|
201
|
+
case 2:
|
|
202
|
+
fetchParams = (_f.sent()) || fetchParams;
|
|
203
|
+
_f.label = 3;
|
|
204
|
+
case 3:
|
|
205
|
+
_i++;
|
|
206
|
+
return [3 /*break*/, 1];
|
|
207
|
+
case 4:
|
|
208
|
+
response = undefined;
|
|
209
|
+
_f.label = 5;
|
|
210
|
+
case 5:
|
|
211
|
+
_f.trys.push([5, 7, , 12]);
|
|
212
|
+
return [4 /*yield*/, (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init)];
|
|
213
|
+
case 6:
|
|
214
|
+
response = _f.sent();
|
|
215
|
+
return [3 /*break*/, 12];
|
|
216
|
+
case 7:
|
|
217
|
+
e_1 = _f.sent();
|
|
218
|
+
_b = 0, _c = this.middleware;
|
|
219
|
+
_f.label = 8;
|
|
220
|
+
case 8:
|
|
221
|
+
if (!(_b < _c.length)) return [3 /*break*/, 11];
|
|
222
|
+
middleware = _c[_b];
|
|
223
|
+
if (!middleware.onError) return [3 /*break*/, 10];
|
|
224
|
+
return [4 /*yield*/, middleware.onError({
|
|
225
|
+
fetch: this.fetchApi,
|
|
226
|
+
url: fetchParams.url,
|
|
227
|
+
init: fetchParams.init,
|
|
228
|
+
error: e_1,
|
|
229
|
+
response: response ? response.clone() : undefined,
|
|
230
|
+
})];
|
|
231
|
+
case 9:
|
|
232
|
+
response = (_f.sent()) || response;
|
|
233
|
+
_f.label = 10;
|
|
234
|
+
case 10:
|
|
235
|
+
_b++;
|
|
236
|
+
return [3 /*break*/, 8];
|
|
237
|
+
case 11:
|
|
238
|
+
if (response === undefined) {
|
|
239
|
+
if (e_1 instanceof Error) {
|
|
240
|
+
throw new FetchError(e_1, 'The request failed and the interceptors did not return an alternative response');
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
throw e_1;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return [3 /*break*/, 12];
|
|
247
|
+
case 12:
|
|
248
|
+
_d = 0, _e = this.middleware;
|
|
249
|
+
_f.label = 13;
|
|
250
|
+
case 13:
|
|
251
|
+
if (!(_d < _e.length)) return [3 /*break*/, 16];
|
|
252
|
+
middleware = _e[_d];
|
|
253
|
+
if (!middleware.post) return [3 /*break*/, 15];
|
|
254
|
+
return [4 /*yield*/, middleware.post({
|
|
255
|
+
fetch: this.fetchApi,
|
|
256
|
+
url: fetchParams.url,
|
|
257
|
+
init: fetchParams.init,
|
|
258
|
+
response: response.clone(),
|
|
259
|
+
})];
|
|
260
|
+
case 14:
|
|
261
|
+
response = (_f.sent()) || response;
|
|
262
|
+
_f.label = 15;
|
|
263
|
+
case 15:
|
|
264
|
+
_d++;
|
|
265
|
+
return [3 /*break*/, 13];
|
|
266
|
+
case 16: return [2 /*return*/, response];
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
}); };
|
|
270
|
+
this.middleware = configuration.middleware;
|
|
271
|
+
}
|
|
272
|
+
BaseAPI.prototype.withMiddleware = function () {
|
|
273
|
+
var _a;
|
|
274
|
+
var middlewares = [];
|
|
275
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
276
|
+
middlewares[_i] = arguments[_i];
|
|
277
|
+
}
|
|
278
|
+
var next = this.clone();
|
|
279
|
+
next.middleware = (_a = next.middleware).concat.apply(_a, middlewares);
|
|
280
|
+
return next;
|
|
281
|
+
};
|
|
282
|
+
BaseAPI.prototype.withPreMiddleware = function () {
|
|
283
|
+
var preMiddlewares = [];
|
|
284
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
285
|
+
preMiddlewares[_i] = arguments[_i];
|
|
286
|
+
}
|
|
287
|
+
var middlewares = preMiddlewares.map(function (pre) { return ({ pre: pre }); });
|
|
288
|
+
return this.withMiddleware.apply(this, middlewares);
|
|
289
|
+
};
|
|
290
|
+
BaseAPI.prototype.withPostMiddleware = function () {
|
|
291
|
+
var postMiddlewares = [];
|
|
292
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
293
|
+
postMiddlewares[_i] = arguments[_i];
|
|
294
|
+
}
|
|
295
|
+
var middlewares = postMiddlewares.map(function (post) { return ({ post: post }); });
|
|
296
|
+
return this.withMiddleware.apply(this, middlewares);
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Check if the given MIME is a JSON MIME.
|
|
300
|
+
* JSON MIME examples:
|
|
301
|
+
* application/json
|
|
302
|
+
* application/json; charset=UTF8
|
|
303
|
+
* APPLICATION/JSON
|
|
304
|
+
* application/vnd.company+json
|
|
305
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
306
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
307
|
+
*/
|
|
308
|
+
BaseAPI.prototype.isJsonMime = function (mime) {
|
|
309
|
+
if (!mime) {
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
return BaseAPI.jsonRegex.test(mime);
|
|
313
|
+
};
|
|
314
|
+
BaseAPI.prototype.request = function (context, initOverrides) {
|
|
315
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
316
|
+
var _a, url, init, response;
|
|
317
|
+
return __generator(this, function (_b) {
|
|
318
|
+
switch (_b.label) {
|
|
319
|
+
case 0: return [4 /*yield*/, this.createFetchParams(context, initOverrides)];
|
|
320
|
+
case 1:
|
|
321
|
+
_a = _b.sent(), url = _a.url, init = _a.init;
|
|
322
|
+
return [4 /*yield*/, this.fetchApi(url, init)];
|
|
323
|
+
case 2:
|
|
324
|
+
response = _b.sent();
|
|
325
|
+
if (response && (response.status >= 200 && response.status < 300)) {
|
|
326
|
+
return [2 /*return*/, response];
|
|
327
|
+
}
|
|
328
|
+
throw new ResponseError(response, 'Response returned an error code');
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
};
|
|
333
|
+
BaseAPI.prototype.createFetchParams = function (context, initOverrides) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
335
|
+
var url, headers, initOverrideFn, initParams, overriddenInit, _a, body, init;
|
|
336
|
+
var _this = this;
|
|
337
|
+
return __generator(this, function (_b) {
|
|
338
|
+
switch (_b.label) {
|
|
339
|
+
case 0:
|
|
340
|
+
url = this.configuration.basePath + context.path;
|
|
341
|
+
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
342
|
+
// only add the querystring to the URL if there are query parameters.
|
|
343
|
+
// this is done to avoid urls ending with a "?" character which buggy webservers
|
|
344
|
+
// do not handle correctly sometimes.
|
|
345
|
+
url += '?' + this.configuration.queryParamsStringify(context.query);
|
|
346
|
+
}
|
|
347
|
+
headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
348
|
+
Object.keys(headers).forEach(function (key) { return headers[key] === undefined ? delete headers[key] : {}; });
|
|
349
|
+
initOverrideFn = typeof initOverrides === "function"
|
|
350
|
+
? initOverrides
|
|
351
|
+
: function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
352
|
+
return [2 /*return*/, initOverrides];
|
|
353
|
+
}); }); };
|
|
354
|
+
initParams = {
|
|
355
|
+
method: context.method,
|
|
356
|
+
headers: headers,
|
|
357
|
+
body: context.body,
|
|
358
|
+
credentials: this.configuration.credentials,
|
|
359
|
+
};
|
|
360
|
+
_a = [__assign({}, initParams)];
|
|
361
|
+
return [4 /*yield*/, initOverrideFn({
|
|
362
|
+
init: initParams,
|
|
363
|
+
context: context,
|
|
364
|
+
})];
|
|
365
|
+
case 1:
|
|
366
|
+
overriddenInit = __assign.apply(void 0, _a.concat([(_b.sent())]));
|
|
367
|
+
if (isFormData(overriddenInit.body)
|
|
368
|
+
|| (overriddenInit.body instanceof URLSearchParams)
|
|
369
|
+
|| isBlob(overriddenInit.body)) {
|
|
370
|
+
body = overriddenInit.body;
|
|
371
|
+
}
|
|
372
|
+
else if (this.isJsonMime(headers['Content-Type'])) {
|
|
373
|
+
body = JSON.stringify(overriddenInit.body);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
body = overriddenInit.body;
|
|
377
|
+
}
|
|
378
|
+
init = __assign(__assign({}, overriddenInit), { body: body });
|
|
379
|
+
return [2 /*return*/, { url: url, init: init }];
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Create a shallow clone of `this` by constructing a new instance
|
|
386
|
+
* and then shallow cloning data members.
|
|
387
|
+
*/
|
|
388
|
+
BaseAPI.prototype.clone = function () {
|
|
389
|
+
var constructor = this.constructor;
|
|
390
|
+
var next = new constructor(this.configuration);
|
|
391
|
+
next.middleware = this.middleware.slice();
|
|
392
|
+
return next;
|
|
393
|
+
};
|
|
394
|
+
BaseAPI.jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i');
|
|
395
|
+
return BaseAPI;
|
|
396
|
+
}());
|
|
397
|
+
exports.BaseAPI = BaseAPI;
|
|
398
|
+
;
|
|
399
|
+
function isBlob(value) {
|
|
400
|
+
return typeof Blob !== 'undefined' && value instanceof Blob;
|
|
401
|
+
}
|
|
402
|
+
function isFormData(value) {
|
|
403
|
+
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
404
|
+
}
|
|
405
|
+
var ResponseError = /** @class */ (function (_super) {
|
|
406
|
+
__extends(ResponseError, _super);
|
|
407
|
+
function ResponseError(response, msg) {
|
|
408
|
+
var _this = _super.call(this, msg) || this;
|
|
409
|
+
_this.response = response;
|
|
410
|
+
_this.name = "ResponseError";
|
|
411
|
+
return _this;
|
|
412
|
+
}
|
|
413
|
+
return ResponseError;
|
|
414
|
+
}(Error));
|
|
415
|
+
exports.ResponseError = ResponseError;
|
|
416
|
+
var FetchError = /** @class */ (function (_super) {
|
|
417
|
+
__extends(FetchError, _super);
|
|
418
|
+
function FetchError(cause, msg) {
|
|
419
|
+
var _this = _super.call(this, msg) || this;
|
|
420
|
+
_this.cause = cause;
|
|
421
|
+
_this.name = "FetchError";
|
|
422
|
+
return _this;
|
|
423
|
+
}
|
|
424
|
+
return FetchError;
|
|
425
|
+
}(Error));
|
|
426
|
+
exports.FetchError = FetchError;
|
|
427
|
+
var RequiredError = /** @class */ (function (_super) {
|
|
428
|
+
__extends(RequiredError, _super);
|
|
429
|
+
function RequiredError(field, msg) {
|
|
430
|
+
var _this = _super.call(this, msg) || this;
|
|
431
|
+
_this.field = field;
|
|
432
|
+
_this.name = "RequiredError";
|
|
433
|
+
return _this;
|
|
434
|
+
}
|
|
435
|
+
return RequiredError;
|
|
436
|
+
}(Error));
|
|
437
|
+
exports.RequiredError = RequiredError;
|
|
438
|
+
exports.COLLECTION_FORMATS = {
|
|
439
|
+
csv: ",",
|
|
440
|
+
ssv: " ",
|
|
441
|
+
tsv: "\t",
|
|
442
|
+
pipes: "|",
|
|
443
|
+
};
|
|
444
|
+
function querystring(params, prefix) {
|
|
445
|
+
if (prefix === void 0) { prefix = ''; }
|
|
446
|
+
return Object.keys(params)
|
|
447
|
+
.map(function (key) { return querystringSingleKey(key, params[key], prefix); })
|
|
448
|
+
.filter(function (part) { return part.length > 0; })
|
|
449
|
+
.join('&');
|
|
450
|
+
}
|
|
451
|
+
function querystringSingleKey(key, value, keyPrefix) {
|
|
452
|
+
if (keyPrefix === void 0) { keyPrefix = ''; }
|
|
453
|
+
var fullKey = keyPrefix + (keyPrefix.length ? "[".concat(key, "]") : key);
|
|
454
|
+
if (value instanceof Array) {
|
|
455
|
+
var multiValue = value.map(function (singleValue) { return encodeURIComponent(String(singleValue)); })
|
|
456
|
+
.join("&".concat(encodeURIComponent(fullKey), "="));
|
|
457
|
+
return "".concat(encodeURIComponent(fullKey), "=").concat(multiValue);
|
|
458
|
+
}
|
|
459
|
+
if (value instanceof Set) {
|
|
460
|
+
var valueAsArray = Array.from(value);
|
|
461
|
+
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
462
|
+
}
|
|
463
|
+
if (value instanceof Date) {
|
|
464
|
+
return "".concat(encodeURIComponent(fullKey), "=").concat(encodeURIComponent(value.toISOString()));
|
|
465
|
+
}
|
|
466
|
+
if (value instanceof Object) {
|
|
467
|
+
return querystring(value, fullKey);
|
|
468
|
+
}
|
|
469
|
+
return "".concat(encodeURIComponent(fullKey), "=").concat(encodeURIComponent(String(value)));
|
|
470
|
+
}
|
|
471
|
+
function exists(json, key) {
|
|
472
|
+
var value = json[key];
|
|
473
|
+
return value !== null && value !== undefined;
|
|
474
|
+
}
|
|
475
|
+
function mapValues(data, fn) {
|
|
476
|
+
var result = {};
|
|
477
|
+
for (var _i = 0, _a = Object.keys(data); _i < _a.length; _i++) {
|
|
478
|
+
var key = _a[_i];
|
|
479
|
+
result[key] = fn(data[key]);
|
|
480
|
+
}
|
|
481
|
+
return result;
|
|
482
|
+
}
|
|
483
|
+
function canConsumeForm(consumes) {
|
|
484
|
+
for (var _i = 0, consumes_1 = consumes; _i < consumes_1.length; _i++) {
|
|
485
|
+
var consume = consumes_1[_i];
|
|
486
|
+
if ('multipart/form-data' === consume.contentType) {
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
var JSONApiResponse = /** @class */ (function () {
|
|
493
|
+
function JSONApiResponse(raw, transformer) {
|
|
494
|
+
if (transformer === void 0) { transformer = function (jsonValue) { return jsonValue; }; }
|
|
495
|
+
this.raw = raw;
|
|
496
|
+
this.transformer = transformer;
|
|
497
|
+
}
|
|
498
|
+
JSONApiResponse.prototype.value = function () {
|
|
499
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
500
|
+
var _a;
|
|
501
|
+
return __generator(this, function (_b) {
|
|
502
|
+
switch (_b.label) {
|
|
503
|
+
case 0:
|
|
504
|
+
_a = this.transformer;
|
|
505
|
+
return [4 /*yield*/, this.raw.json()];
|
|
506
|
+
case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
});
|
|
510
|
+
};
|
|
511
|
+
return JSONApiResponse;
|
|
512
|
+
}());
|
|
513
|
+
exports.JSONApiResponse = JSONApiResponse;
|
|
514
|
+
var VoidApiResponse = /** @class */ (function () {
|
|
515
|
+
function VoidApiResponse(raw) {
|
|
516
|
+
this.raw = raw;
|
|
517
|
+
}
|
|
518
|
+
VoidApiResponse.prototype.value = function () {
|
|
519
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
520
|
+
return __generator(this, function (_a) {
|
|
521
|
+
return [2 /*return*/, undefined];
|
|
522
|
+
});
|
|
523
|
+
});
|
|
524
|
+
};
|
|
525
|
+
return VoidApiResponse;
|
|
526
|
+
}());
|
|
527
|
+
exports.VoidApiResponse = VoidApiResponse;
|
|
528
|
+
var BlobApiResponse = /** @class */ (function () {
|
|
529
|
+
function BlobApiResponse(raw) {
|
|
530
|
+
this.raw = raw;
|
|
531
|
+
}
|
|
532
|
+
BlobApiResponse.prototype.value = function () {
|
|
533
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
534
|
+
return __generator(this, function (_a) {
|
|
535
|
+
switch (_a.label) {
|
|
536
|
+
case 0: return [4 /*yield*/, this.raw.blob()];
|
|
537
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
});
|
|
541
|
+
};
|
|
542
|
+
;
|
|
543
|
+
return BlobApiResponse;
|
|
544
|
+
}());
|
|
545
|
+
exports.BlobApiResponse = BlobApiResponse;
|
|
546
|
+
var TextApiResponse = /** @class */ (function () {
|
|
547
|
+
function TextApiResponse(raw) {
|
|
548
|
+
this.raw = raw;
|
|
549
|
+
}
|
|
550
|
+
TextApiResponse.prototype.value = function () {
|
|
551
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
552
|
+
return __generator(this, function (_a) {
|
|
553
|
+
switch (_a.label) {
|
|
554
|
+
case 0: return [4 /*yield*/, this.raw.text()];
|
|
555
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
};
|
|
560
|
+
;
|
|
561
|
+
return TextApiResponse;
|
|
562
|
+
}());
|
|
563
|
+
exports.TextApiResponse = TextApiResponse;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import { defineConfig } from "eslint/config";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default defineConfig([
|
|
8
|
+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"] },
|
|
9
|
+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser } },
|
|
10
|
+
tseslint.configs.recommended,
|
|
11
|
+
]);
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@makeplane/plane-node-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Node SDK for Plane",
|
|
5
|
+
"author": "Plane <support@plane.so>",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/makeplane/plane-node-sdk.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"typings": "./dist/index.d.ts",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"prepare": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"typescript": "^4.0 || ^5.0",
|
|
18
|
+
"@eslint/js": "^9.29.0",
|
|
19
|
+
"eslint": "^9.29.0",
|
|
20
|
+
"globals": "^16.2.0",
|
|
21
|
+
"typescript-eslint": "^8.34.1"
|
|
22
|
+
}
|
|
23
|
+
}
|