boldsign 1.0.3 → 2.0.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/.openapi-generator/FILES +157 -156
- package/.openapi-generator/VERSION +1 -1
- package/.openapi-generator-ignore +23 -23
- package/LICENSE +21 -21
- package/README.md +307 -306
- package/api/apis.ts +163 -163
- package/api/brandingApi.ts +1193 -1183
- package/api/contactsApi.ts +772 -772
- package/api/customFieldApi.ts +817 -817
- package/api/documentApi.ts +2953 -2953
- package/api/identityVerificationApi.ts +586 -586
- package/api/index.ts +36 -36
- package/api/planApi.ts +274 -274
- package/api/senderIdentitiesApi.ts +898 -898
- package/api/teamsApi.ts +661 -661
- package/api/templateApi.ts +1915 -1915
- package/api/userApi.ts +968 -968
- package/api.ts +3 -3
- package/boldsign-2.0.0.tgz +0 -0
- package/dist/api/apis.d.ts +1 -1
- package/dist/api/apis.js +1 -1
- package/dist/api/brandingApi.d.ts +2 -2
- package/dist/api/brandingApi.js +10 -4
- package/dist/api/brandingApi.js.map +1 -1
- package/dist/model/auditTrail.d.ts +3 -1
- package/dist/model/auditTrail.js +2 -0
- package/dist/model/auditTrail.js.map +1 -1
- package/dist/model/collaborationSettings.d.ts +17 -0
- package/dist/model/collaborationSettings.js +33 -0
- package/dist/model/collaborationSettings.js.map +1 -0
- package/dist/model/createTemplateRequest.d.ts +1 -1
- package/dist/model/createTemplateRequest.js +5 -5
- package/dist/model/createTemplateRequest.js.map +1 -1
- package/dist/model/documentFiles.d.ts +1 -0
- package/dist/model/documentFiles.js +5 -0
- package/dist/model/documentFiles.js.map +1 -1
- package/dist/model/documentFormFields.d.ts +4 -0
- package/dist/model/documentFormFields.js +15 -0
- package/dist/model/documentFormFields.js.map +1 -1
- package/dist/model/documentSigner.d.ts +1 -0
- package/dist/model/documentSigner.js +5 -0
- package/dist/model/documentSigner.js.map +1 -1
- package/dist/model/documentSignerDetails.d.ts +1 -0
- package/dist/model/documentSignerDetails.js +5 -0
- package/dist/model/documentSignerDetails.js.map +1 -1
- package/dist/model/embeddedCreateTemplateRequest.d.ts +1 -1
- package/dist/model/embeddedCreateTemplateRequest.js +5 -5
- package/dist/model/embeddedCreateTemplateRequest.js.map +1 -1
- package/dist/model/embeddedDocumentRequest.d.ts +1 -1
- package/dist/model/embeddedDocumentRequest.js +5 -5
- package/dist/model/embeddedDocumentRequest.js.map +1 -1
- package/dist/model/embeddedMergeTemplateFormRequest.d.ts +1 -1
- package/dist/model/embeddedMergeTemplateFormRequest.js +5 -5
- package/dist/model/embeddedMergeTemplateFormRequest.js.map +1 -1
- package/dist/model/embeddedSendTemplateFormRequest.d.ts +1 -1
- package/dist/model/embeddedSendTemplateFormRequest.js +5 -5
- package/dist/model/embeddedSendTemplateFormRequest.js.map +1 -1
- package/dist/model/formField.d.ts +2 -0
- package/dist/model/formField.js +5 -0
- package/dist/model/formField.js.map +1 -1
- package/dist/model/index.d.ts +2 -1
- package/dist/model/index.js +6 -3
- package/dist/model/index.js.map +1 -1
- package/dist/model/mergeAndSendForSignForm.d.ts +1 -1
- package/dist/model/mergeAndSendForSignForm.js +5 -5
- package/dist/model/mergeAndSendForSignForm.js.map +1 -1
- package/dist/model/sendForSign.d.ts +1 -1
- package/dist/model/sendForSign.js +5 -5
- package/dist/model/sendForSign.js.map +1 -1
- package/dist/model/sendForSignFromTemplateForm.d.ts +1 -1
- package/dist/model/sendForSignFromTemplateForm.js +5 -5
- package/dist/model/sendForSignFromTemplateForm.js.map +1 -1
- package/dist/model/templateFormFields.d.ts +2 -0
- package/dist/model/templateFormFields.js +5 -0
- package/dist/model/templateFormFields.js.map +1 -1
- package/dist/model/textTagDefinition.d.ts +2 -0
- package/dist/model/textTagDefinition.js +5 -0
- package/dist/model/textTagDefinition.js.map +1 -1
- package/dist/model/viewBrandDetails.d.ts +1 -0
- package/dist/model/viewBrandDetails.js +5 -0
- package/dist/model/viewBrandDetails.js.map +1 -1
- package/dist/tests/config.d.ts +5 -0
- package/dist/tests/config.js +43 -0
- package/dist/tests/config.js.map +1 -0
- package/dist/tests/integration/BrandingApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/BrandingApiTest.spec.js +310 -0
- package/dist/tests/integration/BrandingApiTest.spec.js.map +1 -0
- package/dist/tests/integration/ContactsApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/ContactsApiTest.spec.js +249 -0
- package/dist/tests/integration/ContactsApiTest.spec.js.map +1 -0
- package/dist/tests/integration/CustomFieldApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/CustomFieldApiTest.spec.js +289 -0
- package/dist/tests/integration/CustomFieldApiTest.spec.js.map +1 -0
- package/dist/tests/integration/DocumentApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/DocumentApiTest.spec.js +1710 -0
- package/dist/tests/integration/DocumentApiTest.spec.js.map +1 -0
- package/dist/tests/integration/IdentityVerificationApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/IdentityVerificationApiTest.spec.js +160 -0
- package/dist/tests/integration/IdentityVerificationApiTest.spec.js.map +1 -0
- package/dist/tests/integration/TemplateApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/TemplateApiTest.spec.js +1518 -0
- package/dist/tests/integration/TemplateApiTest.spec.js.map +1 -0
- package/dist/tests/integration/planApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/planApiTest.spec.js +41 -0
- package/dist/tests/integration/planApiTest.spec.js.map +1 -0
- package/dist/tests/integration/senderIdentity.spec.d.ts +1 -0
- package/dist/tests/integration/senderIdentity.spec.js +481 -0
- package/dist/tests/integration/senderIdentity.spec.js.map +1 -0
- package/dist/tests/integration/teamsApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/teamsApiTest.spec.js +230 -0
- package/dist/tests/integration/teamsApiTest.spec.js.map +1 -0
- package/dist/tests/integration/usersApiTest.spec.d.ts +1 -0
- package/dist/tests/integration/usersApiTest.spec.js +290 -0
- package/dist/tests/integration/usersApiTest.spec.js.map +1 -0
- package/dist/tests/performance/performanceApiTest.spec.d.ts +1 -0
- package/dist/tests/performance/performanceApiTest.spec.js +368 -0
- package/dist/tests/performance/performanceApiTest.spec.js.map +1 -0
- package/dist/tests/unit/brandingApi.spec.d.ts +1 -0
- package/dist/tests/unit/brandingApi.spec.js +174 -0
- package/dist/tests/unit/brandingApi.spec.js.map +1 -0
- package/dist/tests/unit/contactsApi.spec.d.ts +1 -0
- package/dist/tests/unit/contactsApi.spec.js +154 -0
- package/dist/tests/unit/contactsApi.spec.js.map +1 -0
- package/dist/tests/unit/customFieldApi.spec.d.ts +1 -0
- package/dist/tests/unit/customFieldApi.spec.js +140 -0
- package/dist/tests/unit/customFieldApi.spec.js.map +1 -0
- package/dist/tests/unit/documentApi.spec.d.ts +1 -0
- package/dist/tests/unit/documentApi.spec.js +476 -0
- package/dist/tests/unit/documentApi.spec.js.map +1 -0
- package/dist/tests/unit/planApi.spec.d.ts +1 -0
- package/dist/tests/unit/planApi.spec.js +69 -0
- package/dist/tests/unit/planApi.spec.js.map +1 -0
- package/dist/tests/unit/senderIdentitiesApi.spec.d.ts +1 -0
- package/dist/tests/unit/senderIdentitiesApi.spec.js +148 -0
- package/dist/tests/unit/senderIdentitiesApi.spec.js.map +1 -0
- package/dist/tests/unit/teamApi.spec.d.ts +1 -0
- package/dist/tests/unit/teamApi.spec.js +116 -0
- package/dist/tests/unit/teamApi.spec.js.map +1 -0
- package/dist/tests/unit/templateApi.spec.d.ts +1 -0
- package/dist/tests/unit/templateApi.spec.js +285 -0
- package/dist/tests/unit/templateApi.spec.js.map +1 -0
- package/dist/tests/unit/userApi.spec.d.ts +1 -0
- package/dist/tests/unit/userApi.spec.js +163 -0
- package/dist/tests/unit/userApi.spec.js.map +1 -0
- package/docs/AccessCodeDetail.md +19 -19
- package/docs/AccessCodeDetails.md +13 -13
- package/docs/Added.md +13 -13
- package/docs/Address.md +16 -16
- package/docs/AttachmentInfo.md +14 -14
- package/docs/AuditTrail.md +21 -21
- package/docs/AuthenticationSettings.md +11 -11
- package/docs/Base64File.md +12 -12
- package/docs/BehalfDocument.md +27 -27
- package/docs/BehalfDocumentRecords.md +12 -12
- package/docs/BehalfOf.md +12 -12
- package/docs/BillingViewModel.md +11 -11
- package/docs/BrandCreated.md +11 -11
- package/docs/BrandCustomFieldDetails.md +16 -16
- package/docs/BrandingApi.md +260 -258
- package/docs/BrandingMessage.md +11 -11
- package/docs/BrandingRecords.md +11 -11
- package/docs/ChangeRecipient.md +18 -18
- package/docs/CollaborationSettings.md +14 -0
- package/docs/ConditionalRule.md +13 -13
- package/docs/ContactCreated.md +12 -12
- package/docs/ContactDetails.md +15 -15
- package/docs/ContactPageDetails.md +13 -13
- package/docs/ContactsApi.md +176 -176
- package/docs/ContactsDetails.md +16 -16
- package/docs/ContactsList.md +12 -12
- package/docs/CreateContactResponse.md +11 -11
- package/docs/CreateSenderIdentityRequest.md +16 -16
- package/docs/CreateTeamRequest.md +11 -11
- package/docs/CreateTemplateRequest.md +35 -35
- package/docs/CreateUser.md +14 -14
- package/docs/CustomDomainSettings.md +12 -12
- package/docs/CustomFieldApi.md +174 -174
- package/docs/CustomFieldCollection.md +11 -11
- package/docs/CustomFieldMessage.md +12 -12
- package/docs/CustomFormField.md +43 -43
- package/docs/Date.md +13 -13
- package/docs/DeleteCustomFieldReply.md +11 -11
- package/docs/Document.md +26 -26
- package/docs/DocumentApi.md +756 -756
- package/docs/DocumentCC.md +11 -11
- package/docs/DocumentCcDetails.md +12 -12
- package/docs/DocumentCreated.md +11 -11
- package/docs/DocumentExpirySettings.md +16 -16
- package/docs/DocumentFiles.md +14 -13
- package/docs/DocumentFormFields.md +52 -49
- package/docs/DocumentInfo.md +14 -14
- package/docs/DocumentProperties.md +50 -50
- package/docs/DocumentReassign.md +13 -13
- package/docs/DocumentRecords.md +12 -12
- package/docs/DocumentSenderDetail.md +14 -14
- package/docs/DocumentSigner.md +32 -31
- package/docs/DocumentSignerDetails.md +38 -37
- package/docs/DocumentTags.md +12 -12
- package/docs/DownloadImageRequest.md +16 -16
- package/docs/EditSenderIdentityRequest.md +14 -14
- package/docs/EditTemplateRequest.md +29 -29
- package/docs/EditableDateFieldSettings.md +13 -13
- package/docs/EmbeddedCreateTemplateRequest.md +46 -46
- package/docs/EmbeddedCustomFieldCreated.md +11 -11
- package/docs/EmbeddedDocumentRequest.md +55 -55
- package/docs/EmbeddedFileDetails.md +16 -16
- package/docs/EmbeddedFileLink.md +11 -11
- package/docs/EmbeddedMergeTemplateFormRequest.md +56 -56
- package/docs/EmbeddedSendCreated.md +12 -12
- package/docs/EmbeddedSendTemplateFormRequest.md +53 -53
- package/docs/EmbeddedSigningLink.md +11 -11
- package/docs/EmbeddedTemplateCreated.md +12 -12
- package/docs/EmbeddedTemplateEditRequest.md +21 -21
- package/docs/EmbeddedTemplateEdited.md +11 -11
- package/docs/Error.md +12 -12
- package/docs/ErrorResult.md +11 -11
- package/docs/ExistingFormField.md +15 -15
- package/docs/ExtendExpiry.md +14 -14
- package/docs/FileInfo.md +14 -14
- package/docs/Font.md +18 -18
- package/docs/FormField.md +51 -50
- package/docs/FormGroup.md +15 -15
- package/docs/FormulaFieldSettings.md +12 -12
- package/docs/IdDocument.md +21 -21
- package/docs/IdReport.md +14 -14
- package/docs/IdVerification.md +18 -18
- package/docs/IdentityVerificationApi.md +109 -109
- package/docs/IdentityVerificationSettings.md +16 -16
- package/docs/ImageInfo.md +13 -13
- package/docs/MergeAndSendForSignForm.md +46 -46
- package/docs/ModificationDetails.md +12 -12
- package/docs/NotificationSettings.md +22 -22
- package/docs/PageDetails.md +16 -16
- package/docs/PhoneNumber.md +12 -12
- package/docs/PlanApi.md +38 -38
- package/docs/PrefillField.md +12 -12
- package/docs/PrefillFieldRequest.md +12 -12
- package/docs/ProblemDetails.md +15 -15
- package/docs/RecipientChangeLog.md +12 -12
- package/docs/RecipientNotificationSettings.md +22 -22
- package/docs/Rectangle.md +14 -14
- package/docs/ReminderMessage.md +13 -13
- package/docs/ReminderSettings.md +13 -13
- package/docs/RemoveAuthentication.md +14 -14
- package/docs/Removed.md +13 -13
- package/docs/RevokeDocument.md +12 -12
- package/docs/Role.md +33 -33
- package/docs/Roles.md +33 -33
- package/docs/SendForSign.md +45 -45
- package/docs/SendForSignFromTemplateForm.md +43 -43
- package/docs/SenderIdentitiesApi.md +209 -209
- package/docs/SenderIdentityCreated.md +11 -11
- package/docs/SenderIdentityList.md +12 -12
- package/docs/SenderIdentityViewModel.md +19 -19
- package/docs/SignerAuthenticationSettings.md +12 -12
- package/docs/Size.md +12 -12
- package/docs/TeamCreated.md +11 -11
- package/docs/TeamDocumentRecords.md +12 -12
- package/docs/TeamListResponse.md +12 -12
- package/docs/TeamPageDetails.md +12 -12
- package/docs/TeamResponse.md +15 -15
- package/docs/TeamUpdateRequest.md +12 -12
- package/docs/TeamUsers.md +16 -16
- package/docs/Teams.md +14 -14
- package/docs/TeamsApi.md +141 -141
- package/docs/Template.md +29 -29
- package/docs/TemplateApi.md +484 -484
- package/docs/TemplateCC.md +12 -12
- package/docs/TemplateCreated.md +11 -11
- package/docs/TemplateFormFields.md +51 -50
- package/docs/TemplateProperties.md +37 -37
- package/docs/TemplateRecords.md +12 -12
- package/docs/TemplateRole.md +28 -28
- package/docs/TemplateSenderDetail.md +12 -12
- package/docs/TemplateSenderDetails.md +13 -13
- package/docs/TemplateSharedTemplateDetail.md +12 -12
- package/docs/TemplateSignerDetails.md +27 -27
- package/docs/TemplateTag.md +14 -14
- package/docs/TextTagDefinition.md +41 -40
- package/docs/TextTagOffset.md +12 -12
- package/docs/UpdateUser.md +14 -14
- package/docs/UpdateUserMetaData.md +12 -12
- package/docs/UserApi.md +240 -240
- package/docs/UserPageDetails.md +12 -12
- package/docs/UserProperties.md +21 -21
- package/docs/UserRecords.md +12 -12
- package/docs/UsersDetails.md +21 -21
- package/docs/Validation.md +13 -13
- package/docs/VerificationDataRequest.md +15 -15
- package/docs/ViewBrandDetails.md +35 -34
- package/docs/ViewCustomFieldDetails.md +17 -17
- package/examples/DocumentProperties.ts +14 -14
- package/examples/brandCreate.ts +28 -28
- package/examples/brandDelete.ts +14 -14
- package/examples/brandGet.ts +14 -14
- package/examples/brandList.ts +13 -13
- package/examples/brandResetDefault.ts +14 -14
- package/examples/brandUpdate.ts +20 -20
- package/examples/contactCreate.ts +25 -25
- package/examples/contactDelete.ts +14 -14
- package/examples/contactGet.ts +14 -14
- package/examples/contactList.ts +15 -15
- package/examples/contactUpdate.ts +25 -25
- package/examples/customFieldCreate.ts +27 -27
- package/examples/customFieldDelete.ts +14 -14
- package/examples/customFieldEdit.ts +29 -29
- package/examples/customFieldEmbeddedCreateUrl.ts +18 -18
- package/examples/customFieldList.ts +14 -14
- package/examples/documentAddAuthentication.ts +19 -19
- package/examples/documentAddTags.ts +18 -18
- package/examples/documentChangeAccessCode.ts +19 -19
- package/examples/documentChangeRecipients.ts +21 -21
- package/examples/documentDelete.ts +15 -15
- package/examples/documentDeleteTags.ts +18 -18
- package/examples/documentDownload.ts +15 -15
- package/examples/documentDownloadAttachment.ts +16 -16
- package/examples/documentDownloadAuditTrial.ts +15 -15
- package/examples/documentEmbeddedRequestLink.ts +48 -48
- package/examples/documentEmbeddedSignLink.ts +22 -22
- package/examples/documentExtendExpiry.ts +19 -19
- package/examples/documentList.ts +18 -18
- package/examples/documentListBehalf.ts +14 -14
- package/examples/documentListTeam.ts +14 -14
- package/examples/documentPrefillFieldCheckBox.ts +22 -22
- package/examples/documentPrefillFieldDropDown.ts +22 -22
- package/examples/documentPrefillFieldEditableDate.ts +22 -22
- package/examples/documentPrefillFieldImage.ts +22 -22
- package/examples/documentPrefillFieldRadioButton.ts +22 -22
- package/examples/documentPrefillFieldTextBox.ts +22 -22
- package/examples/documentRemoveAuthentication.ts +18 -18
- package/examples/documentRevoke.ts +18 -18
- package/examples/documentSend.ts +46 -46
- package/examples/documentSendOnBehalf.ts +52 -52
- package/examples/documentSendReminder.ts +19 -19
- package/examples/embeddedManualVerification.ts +22 -22
- package/examples/identityVerificationImage.ts +23 -23
- package/examples/identityVerificationReport.ts +21 -21
- package/examples/listTemplate.ts +15 -15
- package/examples/plan.ts +13 -13
- package/examples/senderIdentityCreate.ts +20 -20
- package/examples/senderIdentityDelete.ts +14 -14
- package/examples/senderIdentityList.ts +15 -15
- package/examples/senderIdentityRerequest.ts +14 -14
- package/examples/senderIdentityResendInvitation.ts +14 -14
- package/examples/senderIdentityUpdate.ts +19 -19
- package/examples/teamCreate.ts +17 -17
- package/examples/teamGet.ts +14 -14
- package/examples/teamList.ts +15 -15
- package/examples/teamUpdate.ts +18 -18
- package/examples/templateAddTag.ts +19 -19
- package/examples/templateCreate.ts +28 -28
- package/examples/templateDelete.ts +14 -14
- package/examples/templateDeleteTag.ts +19 -19
- package/examples/templateDetails.ts +14 -14
- package/examples/templateDownload.ts +14 -14
- package/examples/templateEdit.ts +21 -21
- package/examples/templateEmbeddedCreate.ts +28 -28
- package/examples/templateEmbeddedEdit.ts +23 -23
- package/examples/templateEmbeddedRequestLink.ts +33 -33
- package/examples/templateMergerEmbeddedRequestUrl.ts +36 -36
- package/examples/templateSendDocument.ts +59 -59
- package/examples/templateSendDocumentUsingMultipleTemplate.ts +39 -39
- package/examples/userCreate.ts +19 -19
- package/examples/userGet.ts +14 -14
- package/examples/userInvitationCancel.ts +14 -14
- package/examples/userList.ts +15 -15
- package/examples/userResendInvitation.ts +14 -14
- package/examples/userUpdateRole.ts +18 -18
- package/git_push.sh +57 -57
- package/model/accessCodeDetail.ts +91 -91
- package/model/accessCodeDetails.ts +44 -44
- package/model/added.ts +43 -43
- package/model/address.ts +61 -61
- package/model/attachmentInfo.ts +49 -49
- package/model/auditTrail.ts +177 -175
- package/model/authenticationSettings.ts +40 -40
- package/model/base64File.ts +37 -37
- package/model/behalfDocument.ts +142 -142
- package/model/behalfDocumentRecords.ts +39 -39
- package/model/behalfOf.ts +37 -37
- package/model/billingViewModel.ts +31 -31
- package/model/brandCreated.ts +31 -31
- package/model/brandCustomFieldDetails.ts +62 -62
- package/model/brandingMessage.ts +31 -31
- package/model/brandingRecords.ts +32 -32
- package/model/changeRecipient.ts +74 -74
- package/model/collaborationSettings.ts +49 -0
- package/model/conditionalRule.ts +43 -43
- package/model/contactCreated.ts +37 -37
- package/model/contactDetails.ts +56 -56
- package/model/contactPageDetails.ts +43 -43
- package/model/contactsDetails.ts +62 -62
- package/model/contactsList.ts +39 -39
- package/model/createContactResponse.ts +32 -32
- package/model/createSenderIdentityRequest.ts +62 -62
- package/model/createTeamRequest.ts +31 -31
- package/model/createTemplateRequest.ts +181 -181
- package/model/createUser.ts +56 -56
- package/model/customDomainSettings.ts +37 -37
- package/model/customFieldCollection.ts +32 -32
- package/model/customFieldMessage.ts +37 -37
- package/model/customFormField.ts +275 -275
- package/model/deleteCustomFieldReply.ts +31 -31
- package/model/document.ts +135 -135
- package/model/documentCC.ts +31 -31
- package/model/documentCcDetails.ts +37 -37
- package/model/documentCreated.ts +31 -31
- package/model/documentExpirySettings.ts +69 -69
- package/model/documentFiles.ts +49 -43
- package/model/documentFormFields.ts +311 -292
- package/model/documentInfo.ts +90 -90
- package/model/documentProperties.ts +316 -316
- package/model/documentReassign.ts +43 -43
- package/model/documentRecords.ts +39 -39
- package/model/documentSenderDetail.ts +49 -49
- package/model/documentSigner.ts +221 -215
- package/model/documentSignerDetails.ts +265 -259
- package/model/documentTags.ts +37 -37
- package/model/downloadImageRequest.ts +61 -61
- package/model/editSenderIdentityRequest.ts +50 -50
- package/model/editTemplateRequest.ts +144 -144
- package/model/editableDateFieldSettings.ts +43 -43
- package/model/embeddedCreateTemplateRequest.ts +271 -271
- package/model/embeddedCustomFieldCreated.ts +31 -31
- package/model/embeddedDocumentRequest.ts +337 -337
- package/model/embeddedFileDetails.ts +61 -61
- package/model/embeddedFileLink.ts +31 -31
- package/model/embeddedMergeTemplateFormRequest.ts +343 -343
- package/model/embeddedSendCreated.ts +37 -37
- package/model/embeddedSendTemplateFormRequest.ts +324 -324
- package/model/embeddedSigningLink.ts +31 -31
- package/model/embeddedTemplateCreated.ts +37 -37
- package/model/embeddedTemplateEditRequest.ts +115 -115
- package/model/embeddedTemplateEdited.ts +31 -31
- package/model/errorResult.ts +31 -31
- package/model/existingFormField.ts +55 -55
- package/model/extendExpiry.ts +49 -49
- package/model/fileInfo.ts +49 -49
- package/model/font.ts +89 -89
- package/model/formField.ts +327 -320
- package/model/formGroup.ts +63 -63
- package/model/formulaFieldSettings.ts +37 -37
- package/model/idDocument.ts +93 -93
- package/model/idReport.ts +50 -50
- package/model/idVerification.ts +73 -73
- package/model/identityVerificationSettings.ts +75 -75
- package/model/imageInfo.ts +43 -43
- package/model/index.ts +546 -543
- package/model/mergeAndSendForSignForm.ts +261 -261
- package/model/modelDate.ts +43 -43
- package/model/modelError.ts +37 -37
- package/model/models.ts +244 -244
- package/model/modificationDetails.ts +37 -37
- package/model/notificationSettings.ts +97 -97
- package/model/pageDetails.ts +61 -61
- package/model/phoneNumber.ts +37 -37
- package/model/prefillField.ts +37 -37
- package/model/prefillFieldRequest.ts +38 -38
- package/model/problemDetails.ts +55 -55
- package/model/recipientChangeLog.ts +39 -39
- package/model/recipientNotificationSettings.ts +97 -97
- package/model/rectangle.ts +49 -49
- package/model/reminderMessage.ts +44 -44
- package/model/reminderSettings.ts +43 -43
- package/model/removeAuthentication.ts +50 -50
- package/model/removed.ts +43 -43
- package/model/revokeDocument.ts +37 -37
- package/model/role.ts +229 -229
- package/model/roles.ts +225 -225
- package/model/sendForSign.ts +255 -255
- package/model/sendForSignFromTemplateForm.ts +242 -242
- package/model/senderIdentityCreated.ts +31 -31
- package/model/senderIdentityList.ts +39 -39
- package/model/senderIdentityViewModel.ts +80 -80
- package/model/signerAuthenticationSettings.ts +37 -37
- package/model/size.ts +37 -37
- package/model/teamCreated.ts +31 -31
- package/model/teamDocumentRecords.ts +39 -39
- package/model/teamListResponse.ts +39 -39
- package/model/teamPageDetails.ts +37 -37
- package/model/teamResponse.ts +56 -56
- package/model/teamUpdateRequest.ts +37 -37
- package/model/teamUsers.ts +73 -73
- package/model/teams.ts +49 -49
- package/model/template.ts +159 -159
- package/model/templateCC.ts +37 -37
- package/model/templateCreated.ts +31 -31
- package/model/templateFormFields.ts +304 -297
- package/model/templateProperties.ts +202 -202
- package/model/templateRecords.ts +39 -39
- package/model/templateRole.ts +195 -195
- package/model/templateSenderDetail.ts +37 -37
- package/model/templateSenderDetails.ts +43 -43
- package/model/templateSharedTemplateDetail.ts +43 -43
- package/model/templateSignerDetails.ts +160 -160
- package/model/templateTag.ts +49 -49
- package/model/textTagDefinition.ts +255 -248
- package/model/textTagOffset.ts +37 -37
- package/model/updateUser.ts +60 -60
- package/model/updateUserMetaData.ts +37 -37
- package/model/userPageDetails.ts +37 -37
- package/model/userProperties.ts +91 -91
- package/model/userRecords.ts +39 -39
- package/model/usersDetails.ts +91 -91
- package/model/validation.ts +52 -52
- package/model/verificationDataRequest.ts +55 -55
- package/model/viewBrandDetails.ts +183 -177
- package/model/viewCustomFieldDetails.ts +68 -68
- package/package.json +52 -52
- package/tests/config.ts +20 -0
- package/tests/documents/agreement.pdf +0 -0
- package/tests/documents/logo.jpg +0 -0
- package/tests/integration/BrandingApiTest.spec.ts +254 -0
- package/tests/integration/ContactsApiTest.spec.ts +222 -0
- package/tests/integration/CustomFieldApiTest.spec.ts +231 -0
- package/tests/integration/DocumentApiTest.spec.ts +1624 -0
- package/tests/integration/IdentityVerificationApiTest.spec.ts +114 -0
- package/tests/integration/TemplateApiTest.spec.ts +1420 -0
- package/tests/integration/planApiTest.spec.ts +26 -0
- package/tests/integration/senderIdentity.spec.ts +397 -0
- package/tests/integration/teamsApiTest.spec.ts +226 -0
- package/tests/integration/usersApiTest.spec.ts +251 -0
- package/tests/performance/performanceApiTest.spec.ts +362 -0
- package/tests/unit/brandingApi.spec.ts +163 -0
- package/tests/unit/contactsApi.spec.ts +143 -0
- package/tests/unit/customFieldApi.spec.ts +123 -0
- package/tests/unit/documentApi.spec.ts +545 -0
- package/tests/unit/planApi.spec.ts +34 -0
- package/tests/unit/senderIdentitiesApi.spec.ts +148 -0
- package/tests/unit/teamApi.spec.ts +94 -0
- package/tests/unit/templateApi.spec.ts +307 -0
- package/tests/unit/userApi.spec.ts +162 -0
- package/tsconfig.json +24 -24
package/api/userApi.ts
CHANGED
|
@@ -1,968 +1,968 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BoldSign API
|
|
3
|
-
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
-
*
|
|
5
|
-
* The version of the OpenAPI document: 1
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
-
* https://openapi-generator.tech
|
|
10
|
-
* Do not edit the class manually.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
ObjectSerializer, Authentication, VoidAuth, Interceptor,
|
|
17
|
-
HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, RequestFile,
|
|
18
|
-
CreateUser,ErrorResult,UpdateUser,UpdateUserMetaData,UserProperties,UserRecords,
|
|
19
|
-
} from '../model';
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
HttpError,
|
|
23
|
-
optionsI,
|
|
24
|
-
returnTypeT,
|
|
25
|
-
returnTypeI,
|
|
26
|
-
generateFormData,
|
|
27
|
-
toFormData,
|
|
28
|
-
queryParamsSerializer,
|
|
29
|
-
USER_AGENT,
|
|
30
|
-
} from './';
|
|
31
|
-
|
|
32
|
-
let defaultBasePath = 'https://api.boldsign.com';
|
|
33
|
-
|
|
34
|
-
// ===============================================
|
|
35
|
-
// This file is autogenerated - Please do not edit
|
|
36
|
-
// ===============================================
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export class UserApi {
|
|
40
|
-
protected _basePath = defaultBasePath;
|
|
41
|
-
protected _defaultHeaders : any = { 'User-Agent': USER_AGENT };
|
|
42
|
-
protected _useQuerystring : boolean = true;
|
|
43
|
-
|
|
44
|
-
protected authentications = {
|
|
45
|
-
'default': <Authentication>new VoidAuth(),
|
|
46
|
-
'Bearer': new ApiKeyAuth('header', 'Authorization'),
|
|
47
|
-
'X-API-KEY': new ApiKeyAuth('header', 'X-API-KEY'),
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
protected interceptors: Interceptor[] = [];
|
|
51
|
-
|
|
52
|
-
constructor(basePath?: string) {
|
|
53
|
-
if (basePath) {
|
|
54
|
-
this.basePath = basePath;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
set useQuerystring(value: boolean) {
|
|
59
|
-
this._useQuerystring = value;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
set basePath(basePath: string) {
|
|
63
|
-
this._basePath = basePath;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
set defaultHeaders(defaultHeaders: any) {
|
|
67
|
-
this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT };
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
get defaultHeaders() {
|
|
71
|
-
return this._defaultHeaders;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
get basePath() {
|
|
75
|
-
return this._basePath;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public setDefaultAuthentication(auth: Authentication) {
|
|
79
|
-
this.authentications.default = auth;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public setApiKey(apikey: string) {
|
|
83
|
-
this.authentications["X-API-KEY"].apiKey = apikey;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
public setAccessToken(accessToken: string) {
|
|
87
|
-
this.authentications["Bearer"].apiKey = 'bearer ' + accessToken;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public addInterceptor(interceptor: Interceptor) {
|
|
91
|
-
this.interceptors.push(interceptor);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
*
|
|
96
|
-
* @summary Cancel the users invitation.
|
|
97
|
-
* @param userId
|
|
98
|
-
* @param options
|
|
99
|
-
*/
|
|
100
|
-
public async cancelInvitation (userId: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
101
|
-
const localVarPath = this.basePath + '/v1/users/cancelInvitation';
|
|
102
|
-
let localVarQueryParameters: any = {};
|
|
103
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
104
|
-
const produces = ['application/json'];
|
|
105
|
-
// give precedence to 'application/json'
|
|
106
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
107
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
108
|
-
} else {
|
|
109
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
110
|
-
}
|
|
111
|
-
let localVarFormParams: any = {};
|
|
112
|
-
let localVarBodyParams: any = undefined;
|
|
113
|
-
|
|
114
|
-
// verify required parameter 'userId' is not null or undefined
|
|
115
|
-
if (userId === null || userId === undefined) {
|
|
116
|
-
throw new Error('Required parameter userId was null or undefined when calling cancelInvitation.');
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (userId !== undefined) {
|
|
120
|
-
localVarQueryParameters['UserId'] = ObjectSerializer.serialize(userId, "string");
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
124
|
-
|
|
125
|
-
let localVarUseFormData = false;
|
|
126
|
-
|
|
127
|
-
let data = {};
|
|
128
|
-
if (localVarUseFormData) {
|
|
129
|
-
const formData = toFormData(localVarFormParams);
|
|
130
|
-
data = formData;
|
|
131
|
-
localVarHeaderParams = {
|
|
132
|
-
...localVarHeaderParams,
|
|
133
|
-
...formData.getHeaders(),
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
138
|
-
method: 'POST',
|
|
139
|
-
params: localVarQueryParameters,
|
|
140
|
-
headers: localVarHeaderParams,
|
|
141
|
-
url: localVarPath,
|
|
142
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
143
|
-
maxContentLength: Infinity,
|
|
144
|
-
maxBodyLength: Infinity,
|
|
145
|
-
responseType: "json",
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
149
|
-
localVarRequestOptions.data = data;
|
|
150
|
-
}
|
|
151
|
-
let authenticationPromise = Promise.resolve();
|
|
152
|
-
|
|
153
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
154
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
155
|
-
}
|
|
156
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
157
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
158
|
-
}
|
|
159
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
160
|
-
|
|
161
|
-
let interceptorPromise = authenticationPromise;
|
|
162
|
-
for (const interceptor of this.interceptors) {
|
|
163
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return interceptorPromise.then(() => {
|
|
167
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
168
|
-
axios.request(localVarRequestOptions)
|
|
169
|
-
.then((response) => {
|
|
170
|
-
handleSuccessfulResponse(
|
|
171
|
-
resolve,
|
|
172
|
-
reject,
|
|
173
|
-
response,
|
|
174
|
-
|
|
175
|
-
);
|
|
176
|
-
}, (error: AxiosError) => {
|
|
177
|
-
if (error.response == null) {
|
|
178
|
-
reject(error);
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
if (handleErrorCodeResponse(
|
|
183
|
-
reject,
|
|
184
|
-
error.response,
|
|
185
|
-
401,
|
|
186
|
-
"ErrorResult",
|
|
187
|
-
)) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
if (handleErrorCodeResponse(
|
|
191
|
-
reject,
|
|
192
|
-
error.response,
|
|
193
|
-
403,
|
|
194
|
-
"ErrorResult",
|
|
195
|
-
)) {
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
reject(error);
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
*
|
|
207
|
-
* @summary Create the user.
|
|
208
|
-
* @param createUser The create user.
|
|
209
|
-
* @param options
|
|
210
|
-
*/
|
|
211
|
-
public async createUser (createUser?: Array<CreateUser>, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
212
|
-
createUser = deserializeIfNeeded(createUser, "Array<CreateUser>");
|
|
213
|
-
const localVarPath = this.basePath + '/v1/users/create';
|
|
214
|
-
let localVarQueryParameters: any = {};
|
|
215
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
216
|
-
const produces = ['application/json'];
|
|
217
|
-
// give precedence to 'application/json'
|
|
218
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
219
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
220
|
-
} else {
|
|
221
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
222
|
-
}
|
|
223
|
-
let localVarFormParams: any = {};
|
|
224
|
-
let localVarBodyParams: any = undefined;
|
|
225
|
-
|
|
226
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
227
|
-
|
|
228
|
-
let localVarUseFormData = false;
|
|
229
|
-
|
|
230
|
-
const result = generateFormData(createUser, Array<CreateUser>);
|
|
231
|
-
localVarUseFormData = result.localVarUseFormData;
|
|
232
|
-
|
|
233
|
-
let data = {};
|
|
234
|
-
if (localVarUseFormData) {
|
|
235
|
-
const formData = toFormData(result.data);
|
|
236
|
-
data = formData;
|
|
237
|
-
localVarHeaderParams = {
|
|
238
|
-
...localVarHeaderParams,
|
|
239
|
-
...formData.getHeaders(),
|
|
240
|
-
};
|
|
241
|
-
} else {
|
|
242
|
-
data = ObjectSerializer.serialize(
|
|
243
|
-
createUser,
|
|
244
|
-
"Array<CreateUser>"
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
249
|
-
method: 'POST',
|
|
250
|
-
params: localVarQueryParameters,
|
|
251
|
-
headers: localVarHeaderParams,
|
|
252
|
-
url: localVarPath,
|
|
253
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
254
|
-
maxContentLength: Infinity,
|
|
255
|
-
maxBodyLength: Infinity,
|
|
256
|
-
responseType: "json",
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
260
|
-
localVarRequestOptions.data = data;
|
|
261
|
-
}
|
|
262
|
-
let authenticationPromise = Promise.resolve();
|
|
263
|
-
|
|
264
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
265
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
266
|
-
}
|
|
267
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
268
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
269
|
-
}
|
|
270
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
271
|
-
|
|
272
|
-
let interceptorPromise = authenticationPromise;
|
|
273
|
-
for (const interceptor of this.interceptors) {
|
|
274
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return interceptorPromise.then(() => {
|
|
278
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
279
|
-
axios.request(localVarRequestOptions)
|
|
280
|
-
.then((response) => {
|
|
281
|
-
handleSuccessfulResponse(
|
|
282
|
-
resolve,
|
|
283
|
-
reject,
|
|
284
|
-
response,
|
|
285
|
-
|
|
286
|
-
);
|
|
287
|
-
}, (error: AxiosError) => {
|
|
288
|
-
if (error.response == null) {
|
|
289
|
-
reject(error);
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
if (handleErrorCodeResponse(
|
|
294
|
-
reject,
|
|
295
|
-
error.response,
|
|
296
|
-
401,
|
|
297
|
-
"ErrorResult",
|
|
298
|
-
)) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
if (handleErrorCodeResponse(
|
|
302
|
-
reject,
|
|
303
|
-
error.response,
|
|
304
|
-
403,
|
|
305
|
-
"ErrorResult",
|
|
306
|
-
)) {
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
reject(error);
|
|
312
|
-
});
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
*
|
|
318
|
-
* @summary Get summary of the user.
|
|
319
|
-
* @param userId User Id.
|
|
320
|
-
* @param options
|
|
321
|
-
*/
|
|
322
|
-
public async getUser (userId: string, options: optionsI = {headers: {}}) : Promise<UserProperties> {
|
|
323
|
-
const localVarPath = this.basePath + '/v1/users/get';
|
|
324
|
-
let localVarQueryParameters: any = {};
|
|
325
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
326
|
-
const produces = ['application/json'];
|
|
327
|
-
// give precedence to 'application/json'
|
|
328
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
329
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
330
|
-
} else {
|
|
331
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
332
|
-
}
|
|
333
|
-
let localVarFormParams: any = {};
|
|
334
|
-
let localVarBodyParams: any = undefined;
|
|
335
|
-
|
|
336
|
-
// verify required parameter 'userId' is not null or undefined
|
|
337
|
-
if (userId === null || userId === undefined) {
|
|
338
|
-
throw new Error('Required parameter userId was null or undefined when calling getUser.');
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
if (userId !== undefined) {
|
|
342
|
-
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
346
|
-
|
|
347
|
-
let localVarUseFormData = false;
|
|
348
|
-
|
|
349
|
-
let data = {};
|
|
350
|
-
if (localVarUseFormData) {
|
|
351
|
-
const formData = toFormData(localVarFormParams);
|
|
352
|
-
data = formData;
|
|
353
|
-
localVarHeaderParams = {
|
|
354
|
-
...localVarHeaderParams,
|
|
355
|
-
...formData.getHeaders(),
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
360
|
-
method: 'GET',
|
|
361
|
-
params: localVarQueryParameters,
|
|
362
|
-
headers: localVarHeaderParams,
|
|
363
|
-
url: localVarPath,
|
|
364
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
365
|
-
maxContentLength: Infinity,
|
|
366
|
-
maxBodyLength: Infinity,
|
|
367
|
-
responseType: "json",
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
371
|
-
localVarRequestOptions.data = data;
|
|
372
|
-
}
|
|
373
|
-
let authenticationPromise = Promise.resolve();
|
|
374
|
-
|
|
375
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
376
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
377
|
-
}
|
|
378
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
379
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
380
|
-
}
|
|
381
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
382
|
-
|
|
383
|
-
let interceptorPromise = authenticationPromise;
|
|
384
|
-
for (const interceptor of this.interceptors) {
|
|
385
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
return interceptorPromise.then(() => {
|
|
389
|
-
return new Promise<UserProperties>((resolve, reject) => {
|
|
390
|
-
axios.request(localVarRequestOptions)
|
|
391
|
-
.then((response) => {
|
|
392
|
-
handleSuccessfulResponse<UserProperties>(
|
|
393
|
-
resolve,
|
|
394
|
-
reject,
|
|
395
|
-
response,
|
|
396
|
-
"UserProperties",
|
|
397
|
-
);
|
|
398
|
-
}, (error: AxiosError) => {
|
|
399
|
-
if (error.response == null) {
|
|
400
|
-
reject(error);
|
|
401
|
-
return;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
if (handleErrorCodeResponse(
|
|
405
|
-
reject,
|
|
406
|
-
error.response,
|
|
407
|
-
200,
|
|
408
|
-
"UserProperties",
|
|
409
|
-
)) {
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
if (handleErrorCodeResponse(
|
|
413
|
-
reject,
|
|
414
|
-
error.response,
|
|
415
|
-
401,
|
|
416
|
-
"ErrorResult",
|
|
417
|
-
)) {
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
if (handleErrorCodeResponse(
|
|
421
|
-
reject,
|
|
422
|
-
error.response,
|
|
423
|
-
403,
|
|
424
|
-
"ErrorResult",
|
|
425
|
-
)) {
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
reject(error);
|
|
431
|
-
});
|
|
432
|
-
});
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
*
|
|
437
|
-
* @summary List user documents.
|
|
438
|
-
* @param page Page index specified in get user list request.
|
|
439
|
-
* @param pageSize Page size specified in get user list request.
|
|
440
|
-
* @param search Users can be listed by the search based on the user ID
|
|
441
|
-
* @param options
|
|
442
|
-
*/
|
|
443
|
-
public async listUsers (page: number, pageSize?: number, search?: string, options: optionsI = {headers: {}}) : Promise<UserRecords> {
|
|
444
|
-
const localVarPath = this.basePath + '/v1/users/list';
|
|
445
|
-
let localVarQueryParameters: any = {};
|
|
446
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
447
|
-
const produces = ['application/json'];
|
|
448
|
-
// give precedence to 'application/json'
|
|
449
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
450
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
451
|
-
} else {
|
|
452
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
453
|
-
}
|
|
454
|
-
let localVarFormParams: any = {};
|
|
455
|
-
let localVarBodyParams: any = undefined;
|
|
456
|
-
|
|
457
|
-
// verify required parameter 'page' is not null or undefined
|
|
458
|
-
if (page === null || page === undefined) {
|
|
459
|
-
throw new Error('Required parameter page was null or undefined when calling listUsers.');
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
if (pageSize !== undefined) {
|
|
463
|
-
localVarQueryParameters['PageSize'] = ObjectSerializer.serialize(pageSize, "number");
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
if (page !== undefined) {
|
|
467
|
-
localVarQueryParameters['Page'] = ObjectSerializer.serialize(page, "number");
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
if (search !== undefined) {
|
|
471
|
-
localVarQueryParameters['Search'] = ObjectSerializer.serialize(search, "string");
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
475
|
-
|
|
476
|
-
let localVarUseFormData = false;
|
|
477
|
-
|
|
478
|
-
let data = {};
|
|
479
|
-
if (localVarUseFormData) {
|
|
480
|
-
const formData = toFormData(localVarFormParams);
|
|
481
|
-
data = formData;
|
|
482
|
-
localVarHeaderParams = {
|
|
483
|
-
...localVarHeaderParams,
|
|
484
|
-
...formData.getHeaders(),
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
489
|
-
method: 'GET',
|
|
490
|
-
params: localVarQueryParameters,
|
|
491
|
-
headers: localVarHeaderParams,
|
|
492
|
-
url: localVarPath,
|
|
493
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
494
|
-
maxContentLength: Infinity,
|
|
495
|
-
maxBodyLength: Infinity,
|
|
496
|
-
responseType: "json",
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
500
|
-
localVarRequestOptions.data = data;
|
|
501
|
-
}
|
|
502
|
-
let authenticationPromise = Promise.resolve();
|
|
503
|
-
|
|
504
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
505
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
506
|
-
}
|
|
507
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
508
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
509
|
-
}
|
|
510
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
511
|
-
|
|
512
|
-
let interceptorPromise = authenticationPromise;
|
|
513
|
-
for (const interceptor of this.interceptors) {
|
|
514
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
return interceptorPromise.then(() => {
|
|
518
|
-
return new Promise<UserRecords>((resolve, reject) => {
|
|
519
|
-
axios.request(localVarRequestOptions)
|
|
520
|
-
.then((response) => {
|
|
521
|
-
handleSuccessfulResponse<UserRecords>(
|
|
522
|
-
resolve,
|
|
523
|
-
reject,
|
|
524
|
-
response,
|
|
525
|
-
"UserRecords",
|
|
526
|
-
);
|
|
527
|
-
}, (error: AxiosError) => {
|
|
528
|
-
if (error.response == null) {
|
|
529
|
-
reject(error);
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
if (handleErrorCodeResponse(
|
|
534
|
-
reject,
|
|
535
|
-
error.response,
|
|
536
|
-
200,
|
|
537
|
-
"UserRecords",
|
|
538
|
-
)) {
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
if (handleErrorCodeResponse(
|
|
542
|
-
reject,
|
|
543
|
-
error.response,
|
|
544
|
-
401,
|
|
545
|
-
"ErrorResult",
|
|
546
|
-
)) {
|
|
547
|
-
return;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
reject(error);
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
/**
|
|
557
|
-
*
|
|
558
|
-
* @summary Resend the users invitation.
|
|
559
|
-
* @param userId
|
|
560
|
-
* @param options
|
|
561
|
-
*/
|
|
562
|
-
public async resendInvitation (userId: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
563
|
-
const localVarPath = this.basePath + '/v1/users/resendInvitation';
|
|
564
|
-
let localVarQueryParameters: any = {};
|
|
565
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
566
|
-
const produces = ['application/json'];
|
|
567
|
-
// give precedence to 'application/json'
|
|
568
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
569
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
570
|
-
} else {
|
|
571
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
572
|
-
}
|
|
573
|
-
let localVarFormParams: any = {};
|
|
574
|
-
let localVarBodyParams: any = undefined;
|
|
575
|
-
|
|
576
|
-
// verify required parameter 'userId' is not null or undefined
|
|
577
|
-
if (userId === null || userId === undefined) {
|
|
578
|
-
throw new Error('Required parameter userId was null or undefined when calling resendInvitation.');
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
if (userId !== undefined) {
|
|
582
|
-
localVarQueryParameters['UserId'] = ObjectSerializer.serialize(userId, "string");
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
586
|
-
|
|
587
|
-
let localVarUseFormData = false;
|
|
588
|
-
|
|
589
|
-
let data = {};
|
|
590
|
-
if (localVarUseFormData) {
|
|
591
|
-
const formData = toFormData(localVarFormParams);
|
|
592
|
-
data = formData;
|
|
593
|
-
localVarHeaderParams = {
|
|
594
|
-
...localVarHeaderParams,
|
|
595
|
-
...formData.getHeaders(),
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
600
|
-
method: 'POST',
|
|
601
|
-
params: localVarQueryParameters,
|
|
602
|
-
headers: localVarHeaderParams,
|
|
603
|
-
url: localVarPath,
|
|
604
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
605
|
-
maxContentLength: Infinity,
|
|
606
|
-
maxBodyLength: Infinity,
|
|
607
|
-
responseType: "json",
|
|
608
|
-
};
|
|
609
|
-
|
|
610
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
611
|
-
localVarRequestOptions.data = data;
|
|
612
|
-
}
|
|
613
|
-
let authenticationPromise = Promise.resolve();
|
|
614
|
-
|
|
615
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
616
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
617
|
-
}
|
|
618
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
619
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
620
|
-
}
|
|
621
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
622
|
-
|
|
623
|
-
let interceptorPromise = authenticationPromise;
|
|
624
|
-
for (const interceptor of this.interceptors) {
|
|
625
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
return interceptorPromise.then(() => {
|
|
629
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
630
|
-
axios.request(localVarRequestOptions)
|
|
631
|
-
.then((response) => {
|
|
632
|
-
handleSuccessfulResponse(
|
|
633
|
-
resolve,
|
|
634
|
-
reject,
|
|
635
|
-
response,
|
|
636
|
-
|
|
637
|
-
);
|
|
638
|
-
}, (error: AxiosError) => {
|
|
639
|
-
if (error.response == null) {
|
|
640
|
-
reject(error);
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
if (handleErrorCodeResponse(
|
|
645
|
-
reject,
|
|
646
|
-
error.response,
|
|
647
|
-
401,
|
|
648
|
-
"ErrorResult",
|
|
649
|
-
)) {
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
if (handleErrorCodeResponse(
|
|
653
|
-
reject,
|
|
654
|
-
error.response,
|
|
655
|
-
403,
|
|
656
|
-
"ErrorResult",
|
|
657
|
-
)) {
|
|
658
|
-
return;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
reject(error);
|
|
663
|
-
});
|
|
664
|
-
});
|
|
665
|
-
});
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
*
|
|
669
|
-
* @summary Update new User meta data details.
|
|
670
|
-
* @param updateUserMetaData update query.
|
|
671
|
-
* @param options
|
|
672
|
-
*/
|
|
673
|
-
public async updateMetaData (updateUserMetaData?: UpdateUserMetaData, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
674
|
-
updateUserMetaData = deserializeIfNeeded(updateUserMetaData, "UpdateUserMetaData");
|
|
675
|
-
const localVarPath = this.basePath + '/v1/users/updateMetaData';
|
|
676
|
-
let localVarQueryParameters: any = {};
|
|
677
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
678
|
-
const produces = ['application/json'];
|
|
679
|
-
// give precedence to 'application/json'
|
|
680
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
681
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
682
|
-
} else {
|
|
683
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
684
|
-
}
|
|
685
|
-
let localVarFormParams: any = {};
|
|
686
|
-
let localVarBodyParams: any = undefined;
|
|
687
|
-
|
|
688
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
689
|
-
|
|
690
|
-
let localVarUseFormData = false;
|
|
691
|
-
|
|
692
|
-
const result = generateFormData(updateUserMetaData, UpdateUserMetaData);
|
|
693
|
-
localVarUseFormData = result.localVarUseFormData;
|
|
694
|
-
|
|
695
|
-
let data = {};
|
|
696
|
-
if (localVarUseFormData) {
|
|
697
|
-
const formData = toFormData(result.data);
|
|
698
|
-
data = formData;
|
|
699
|
-
localVarHeaderParams = {
|
|
700
|
-
...localVarHeaderParams,
|
|
701
|
-
...formData.getHeaders(),
|
|
702
|
-
};
|
|
703
|
-
} else {
|
|
704
|
-
data = ObjectSerializer.serialize(
|
|
705
|
-
updateUserMetaData,
|
|
706
|
-
"UpdateUserMetaData"
|
|
707
|
-
);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
711
|
-
method: 'PUT',
|
|
712
|
-
params: localVarQueryParameters,
|
|
713
|
-
headers: localVarHeaderParams,
|
|
714
|
-
url: localVarPath,
|
|
715
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
716
|
-
maxContentLength: Infinity,
|
|
717
|
-
maxBodyLength: Infinity,
|
|
718
|
-
responseType: "json",
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
722
|
-
localVarRequestOptions.data = data;
|
|
723
|
-
}
|
|
724
|
-
let authenticationPromise = Promise.resolve();
|
|
725
|
-
|
|
726
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
727
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
728
|
-
}
|
|
729
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
730
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
731
|
-
}
|
|
732
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
733
|
-
|
|
734
|
-
let interceptorPromise = authenticationPromise;
|
|
735
|
-
for (const interceptor of this.interceptors) {
|
|
736
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
return interceptorPromise.then(() => {
|
|
740
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
741
|
-
axios.request(localVarRequestOptions)
|
|
742
|
-
.then((response) => {
|
|
743
|
-
handleSuccessfulResponse(
|
|
744
|
-
resolve,
|
|
745
|
-
reject,
|
|
746
|
-
response,
|
|
747
|
-
|
|
748
|
-
);
|
|
749
|
-
}, (error: AxiosError) => {
|
|
750
|
-
if (error.response == null) {
|
|
751
|
-
reject(error);
|
|
752
|
-
return;
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
if (handleErrorCodeResponse(
|
|
756
|
-
reject,
|
|
757
|
-
error.response,
|
|
758
|
-
401,
|
|
759
|
-
"ErrorResult",
|
|
760
|
-
)) {
|
|
761
|
-
return;
|
|
762
|
-
}
|
|
763
|
-
if (handleErrorCodeResponse(
|
|
764
|
-
reject,
|
|
765
|
-
error.response,
|
|
766
|
-
403,
|
|
767
|
-
"ErrorResult",
|
|
768
|
-
)) {
|
|
769
|
-
return;
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
reject(error);
|
|
774
|
-
});
|
|
775
|
-
});
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
*
|
|
780
|
-
* @summary Update new User role.
|
|
781
|
-
* @param updateUser update query.
|
|
782
|
-
* @param options
|
|
783
|
-
*/
|
|
784
|
-
public async updateUser (updateUser?: UpdateUser, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
785
|
-
updateUser = deserializeIfNeeded(updateUser, "UpdateUser");
|
|
786
|
-
const localVarPath = this.basePath + '/v1/users/update';
|
|
787
|
-
let localVarQueryParameters: any = {};
|
|
788
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
789
|
-
const produces = ['application/json'];
|
|
790
|
-
// give precedence to 'application/json'
|
|
791
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
792
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
793
|
-
} else {
|
|
794
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
795
|
-
}
|
|
796
|
-
let localVarFormParams: any = {};
|
|
797
|
-
let localVarBodyParams: any = undefined;
|
|
798
|
-
|
|
799
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
800
|
-
|
|
801
|
-
let localVarUseFormData = false;
|
|
802
|
-
|
|
803
|
-
const result = generateFormData(updateUser, UpdateUser);
|
|
804
|
-
localVarUseFormData = result.localVarUseFormData;
|
|
805
|
-
|
|
806
|
-
let data = {};
|
|
807
|
-
if (localVarUseFormData) {
|
|
808
|
-
const formData = toFormData(result.data);
|
|
809
|
-
data = formData;
|
|
810
|
-
localVarHeaderParams = {
|
|
811
|
-
...localVarHeaderParams,
|
|
812
|
-
...formData.getHeaders(),
|
|
813
|
-
};
|
|
814
|
-
} else {
|
|
815
|
-
data = ObjectSerializer.serialize(
|
|
816
|
-
updateUser,
|
|
817
|
-
"UpdateUser"
|
|
818
|
-
);
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
822
|
-
method: 'PUT',
|
|
823
|
-
params: localVarQueryParameters,
|
|
824
|
-
headers: localVarHeaderParams,
|
|
825
|
-
url: localVarPath,
|
|
826
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
827
|
-
maxContentLength: Infinity,
|
|
828
|
-
maxBodyLength: Infinity,
|
|
829
|
-
responseType: "json",
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
833
|
-
localVarRequestOptions.data = data;
|
|
834
|
-
}
|
|
835
|
-
let authenticationPromise = Promise.resolve();
|
|
836
|
-
|
|
837
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
838
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
839
|
-
}
|
|
840
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
841
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
842
|
-
}
|
|
843
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
844
|
-
|
|
845
|
-
let interceptorPromise = authenticationPromise;
|
|
846
|
-
for (const interceptor of this.interceptors) {
|
|
847
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
848
|
-
}
|
|
849
|
-
|
|
850
|
-
return interceptorPromise.then(() => {
|
|
851
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
852
|
-
axios.request(localVarRequestOptions)
|
|
853
|
-
.then((response) => {
|
|
854
|
-
handleSuccessfulResponse(
|
|
855
|
-
resolve,
|
|
856
|
-
reject,
|
|
857
|
-
response,
|
|
858
|
-
|
|
859
|
-
);
|
|
860
|
-
}, (error: AxiosError) => {
|
|
861
|
-
if (error.response == null) {
|
|
862
|
-
reject(error);
|
|
863
|
-
return;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
if (handleErrorCodeResponse(
|
|
867
|
-
reject,
|
|
868
|
-
error.response,
|
|
869
|
-
401,
|
|
870
|
-
"ErrorResult",
|
|
871
|
-
)) {
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
if (handleErrorCodeResponse(
|
|
875
|
-
reject,
|
|
876
|
-
error.response,
|
|
877
|
-
403,
|
|
878
|
-
"ErrorResult",
|
|
879
|
-
)) {
|
|
880
|
-
return;
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
reject(error);
|
|
885
|
-
});
|
|
886
|
-
});
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
function deserializeIfNeeded<T> (obj: T, classname: string): T {
|
|
892
|
-
if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
|
|
893
|
-
return ObjectSerializer.deserialize(obj, classname);
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
return obj;
|
|
897
|
-
}
|
|
898
|
-
|
|
899
|
-
type AxiosResolve<T> = (
|
|
900
|
-
value: (T | PromiseLike<T>),
|
|
901
|
-
) => void
|
|
902
|
-
|
|
903
|
-
type AxiosReject = (reason?: any) => void;
|
|
904
|
-
|
|
905
|
-
function handleSuccessfulResponse<T>(
|
|
906
|
-
resolve: AxiosResolve<T>,
|
|
907
|
-
reject: AxiosReject,
|
|
908
|
-
response: AxiosResponse,
|
|
909
|
-
returnType?: string,
|
|
910
|
-
) {
|
|
911
|
-
let body = response.data;
|
|
912
|
-
|
|
913
|
-
if (
|
|
914
|
-
response.status &&
|
|
915
|
-
response.status >= 200 &&
|
|
916
|
-
response.status <= 299
|
|
917
|
-
) {
|
|
918
|
-
if (returnType) {
|
|
919
|
-
body = ObjectSerializer.deserialize(body, returnType);
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
resolve(body);
|
|
923
|
-
} else {
|
|
924
|
-
reject(new HttpError(response, body, response.status));
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
function handleErrorCodeResponse(
|
|
929
|
-
reject: AxiosReject,
|
|
930
|
-
response: AxiosResponse,
|
|
931
|
-
code: number,
|
|
932
|
-
returnType: string
|
|
933
|
-
): boolean {
|
|
934
|
-
if (response.status !== code) {
|
|
935
|
-
return false;
|
|
936
|
-
}
|
|
937
|
-
|
|
938
|
-
let body = response.data;
|
|
939
|
-
if(code === 401) {
|
|
940
|
-
body = "Unauthorized request (401): Invalid authentication.";
|
|
941
|
-
}
|
|
942
|
-
reject(new HttpError(response, body, response.status));
|
|
943
|
-
|
|
944
|
-
return true;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
function handleErrorRangeResponse(
|
|
948
|
-
reject: AxiosReject,
|
|
949
|
-
response: AxiosResponse,
|
|
950
|
-
code: string,
|
|
951
|
-
returnType: string
|
|
952
|
-
): boolean {
|
|
953
|
-
let rangeCodeLeft = Number(code[0] + "00");
|
|
954
|
-
let rangeCodeRight = Number(code[0] + "99");
|
|
955
|
-
|
|
956
|
-
if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
|
|
957
|
-
const body = ObjectSerializer.deserialize(
|
|
958
|
-
response.data,
|
|
959
|
-
returnType,
|
|
960
|
-
);
|
|
961
|
-
|
|
962
|
-
reject(new HttpError(response, body, response.status));
|
|
963
|
-
|
|
964
|
-
return true;
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
return false;
|
|
968
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* BoldSign API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
ObjectSerializer, Authentication, VoidAuth, Interceptor,
|
|
17
|
+
HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth, RequestFile,
|
|
18
|
+
CreateUser,ErrorResult,UpdateUser,UpdateUserMetaData,UserProperties,UserRecords,
|
|
19
|
+
} from '../model';
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
HttpError,
|
|
23
|
+
optionsI,
|
|
24
|
+
returnTypeT,
|
|
25
|
+
returnTypeI,
|
|
26
|
+
generateFormData,
|
|
27
|
+
toFormData,
|
|
28
|
+
queryParamsSerializer,
|
|
29
|
+
USER_AGENT,
|
|
30
|
+
} from './';
|
|
31
|
+
|
|
32
|
+
let defaultBasePath = 'https://api.boldsign.com';
|
|
33
|
+
|
|
34
|
+
// ===============================================
|
|
35
|
+
// This file is autogenerated - Please do not edit
|
|
36
|
+
// ===============================================
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
export class UserApi {
|
|
40
|
+
protected _basePath = defaultBasePath;
|
|
41
|
+
protected _defaultHeaders : any = { 'User-Agent': USER_AGENT };
|
|
42
|
+
protected _useQuerystring : boolean = true;
|
|
43
|
+
|
|
44
|
+
protected authentications = {
|
|
45
|
+
'default': <Authentication>new VoidAuth(),
|
|
46
|
+
'Bearer': new ApiKeyAuth('header', 'Authorization'),
|
|
47
|
+
'X-API-KEY': new ApiKeyAuth('header', 'X-API-KEY'),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected interceptors: Interceptor[] = [];
|
|
51
|
+
|
|
52
|
+
constructor(basePath?: string) {
|
|
53
|
+
if (basePath) {
|
|
54
|
+
this.basePath = basePath;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
set useQuerystring(value: boolean) {
|
|
59
|
+
this._useQuerystring = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
set basePath(basePath: string) {
|
|
63
|
+
this._basePath = basePath;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
67
|
+
this._defaultHeaders = { ...defaultHeaders, "User-Agent": USER_AGENT };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get defaultHeaders() {
|
|
71
|
+
return this._defaultHeaders;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get basePath() {
|
|
75
|
+
return this._basePath;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
79
|
+
this.authentications.default = auth;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public setApiKey(apikey: string) {
|
|
83
|
+
this.authentications["X-API-KEY"].apiKey = apikey;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public setAccessToken(accessToken: string) {
|
|
87
|
+
this.authentications["Bearer"].apiKey = 'bearer ' + accessToken;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
91
|
+
this.interceptors.push(interceptor);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
*
|
|
96
|
+
* @summary Cancel the users invitation.
|
|
97
|
+
* @param userId
|
|
98
|
+
* @param options
|
|
99
|
+
*/
|
|
100
|
+
public async cancelInvitation (userId: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
101
|
+
const localVarPath = this.basePath + '/v1/users/cancelInvitation';
|
|
102
|
+
let localVarQueryParameters: any = {};
|
|
103
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
104
|
+
const produces = ['application/json'];
|
|
105
|
+
// give precedence to 'application/json'
|
|
106
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
107
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
108
|
+
} else {
|
|
109
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
110
|
+
}
|
|
111
|
+
let localVarFormParams: any = {};
|
|
112
|
+
let localVarBodyParams: any = undefined;
|
|
113
|
+
|
|
114
|
+
// verify required parameter 'userId' is not null or undefined
|
|
115
|
+
if (userId === null || userId === undefined) {
|
|
116
|
+
throw new Error('Required parameter userId was null or undefined when calling cancelInvitation.');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (userId !== undefined) {
|
|
120
|
+
localVarQueryParameters['UserId'] = ObjectSerializer.serialize(userId, "string");
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
124
|
+
|
|
125
|
+
let localVarUseFormData = false;
|
|
126
|
+
|
|
127
|
+
let data = {};
|
|
128
|
+
if (localVarUseFormData) {
|
|
129
|
+
const formData = toFormData(localVarFormParams);
|
|
130
|
+
data = formData;
|
|
131
|
+
localVarHeaderParams = {
|
|
132
|
+
...localVarHeaderParams,
|
|
133
|
+
...formData.getHeaders(),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
138
|
+
method: 'POST',
|
|
139
|
+
params: localVarQueryParameters,
|
|
140
|
+
headers: localVarHeaderParams,
|
|
141
|
+
url: localVarPath,
|
|
142
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
143
|
+
maxContentLength: Infinity,
|
|
144
|
+
maxBodyLength: Infinity,
|
|
145
|
+
responseType: "json",
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
149
|
+
localVarRequestOptions.data = data;
|
|
150
|
+
}
|
|
151
|
+
let authenticationPromise = Promise.resolve();
|
|
152
|
+
|
|
153
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
154
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
155
|
+
}
|
|
156
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
157
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
158
|
+
}
|
|
159
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
160
|
+
|
|
161
|
+
let interceptorPromise = authenticationPromise;
|
|
162
|
+
for (const interceptor of this.interceptors) {
|
|
163
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return interceptorPromise.then(() => {
|
|
167
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
168
|
+
axios.request(localVarRequestOptions)
|
|
169
|
+
.then((response) => {
|
|
170
|
+
handleSuccessfulResponse(
|
|
171
|
+
resolve,
|
|
172
|
+
reject,
|
|
173
|
+
response,
|
|
174
|
+
|
|
175
|
+
);
|
|
176
|
+
}, (error: AxiosError) => {
|
|
177
|
+
if (error.response == null) {
|
|
178
|
+
reject(error);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if (handleErrorCodeResponse(
|
|
183
|
+
reject,
|
|
184
|
+
error.response,
|
|
185
|
+
401,
|
|
186
|
+
"ErrorResult",
|
|
187
|
+
)) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (handleErrorCodeResponse(
|
|
191
|
+
reject,
|
|
192
|
+
error.response,
|
|
193
|
+
403,
|
|
194
|
+
"ErrorResult",
|
|
195
|
+
)) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
reject(error);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
*
|
|
207
|
+
* @summary Create the user.
|
|
208
|
+
* @param createUser The create user.
|
|
209
|
+
* @param options
|
|
210
|
+
*/
|
|
211
|
+
public async createUser (createUser?: Array<CreateUser>, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
212
|
+
createUser = deserializeIfNeeded(createUser, "Array<CreateUser>");
|
|
213
|
+
const localVarPath = this.basePath + '/v1/users/create';
|
|
214
|
+
let localVarQueryParameters: any = {};
|
|
215
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
216
|
+
const produces = ['application/json'];
|
|
217
|
+
// give precedence to 'application/json'
|
|
218
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
219
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
220
|
+
} else {
|
|
221
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
222
|
+
}
|
|
223
|
+
let localVarFormParams: any = {};
|
|
224
|
+
let localVarBodyParams: any = undefined;
|
|
225
|
+
|
|
226
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
227
|
+
|
|
228
|
+
let localVarUseFormData = false;
|
|
229
|
+
|
|
230
|
+
const result = generateFormData(createUser, Array<CreateUser>);
|
|
231
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
232
|
+
|
|
233
|
+
let data = {};
|
|
234
|
+
if (localVarUseFormData) {
|
|
235
|
+
const formData = toFormData(result.data);
|
|
236
|
+
data = formData;
|
|
237
|
+
localVarHeaderParams = {
|
|
238
|
+
...localVarHeaderParams,
|
|
239
|
+
...formData.getHeaders(),
|
|
240
|
+
};
|
|
241
|
+
} else {
|
|
242
|
+
data = ObjectSerializer.serialize(
|
|
243
|
+
createUser,
|
|
244
|
+
"Array<CreateUser>"
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
249
|
+
method: 'POST',
|
|
250
|
+
params: localVarQueryParameters,
|
|
251
|
+
headers: localVarHeaderParams,
|
|
252
|
+
url: localVarPath,
|
|
253
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
254
|
+
maxContentLength: Infinity,
|
|
255
|
+
maxBodyLength: Infinity,
|
|
256
|
+
responseType: "json",
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
260
|
+
localVarRequestOptions.data = data;
|
|
261
|
+
}
|
|
262
|
+
let authenticationPromise = Promise.resolve();
|
|
263
|
+
|
|
264
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
265
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
266
|
+
}
|
|
267
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
268
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
269
|
+
}
|
|
270
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
271
|
+
|
|
272
|
+
let interceptorPromise = authenticationPromise;
|
|
273
|
+
for (const interceptor of this.interceptors) {
|
|
274
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return interceptorPromise.then(() => {
|
|
278
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
279
|
+
axios.request(localVarRequestOptions)
|
|
280
|
+
.then((response) => {
|
|
281
|
+
handleSuccessfulResponse(
|
|
282
|
+
resolve,
|
|
283
|
+
reject,
|
|
284
|
+
response,
|
|
285
|
+
|
|
286
|
+
);
|
|
287
|
+
}, (error: AxiosError) => {
|
|
288
|
+
if (error.response == null) {
|
|
289
|
+
reject(error);
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (handleErrorCodeResponse(
|
|
294
|
+
reject,
|
|
295
|
+
error.response,
|
|
296
|
+
401,
|
|
297
|
+
"ErrorResult",
|
|
298
|
+
)) {
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
if (handleErrorCodeResponse(
|
|
302
|
+
reject,
|
|
303
|
+
error.response,
|
|
304
|
+
403,
|
|
305
|
+
"ErrorResult",
|
|
306
|
+
)) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
reject(error);
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
*
|
|
318
|
+
* @summary Get summary of the user.
|
|
319
|
+
* @param userId User Id.
|
|
320
|
+
* @param options
|
|
321
|
+
*/
|
|
322
|
+
public async getUser (userId: string, options: optionsI = {headers: {}}) : Promise<UserProperties> {
|
|
323
|
+
const localVarPath = this.basePath + '/v1/users/get';
|
|
324
|
+
let localVarQueryParameters: any = {};
|
|
325
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
326
|
+
const produces = ['application/json'];
|
|
327
|
+
// give precedence to 'application/json'
|
|
328
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
329
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
330
|
+
} else {
|
|
331
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
332
|
+
}
|
|
333
|
+
let localVarFormParams: any = {};
|
|
334
|
+
let localVarBodyParams: any = undefined;
|
|
335
|
+
|
|
336
|
+
// verify required parameter 'userId' is not null or undefined
|
|
337
|
+
if (userId === null || userId === undefined) {
|
|
338
|
+
throw new Error('Required parameter userId was null or undefined when calling getUser.');
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (userId !== undefined) {
|
|
342
|
+
localVarQueryParameters['userId'] = ObjectSerializer.serialize(userId, "string");
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
346
|
+
|
|
347
|
+
let localVarUseFormData = false;
|
|
348
|
+
|
|
349
|
+
let data = {};
|
|
350
|
+
if (localVarUseFormData) {
|
|
351
|
+
const formData = toFormData(localVarFormParams);
|
|
352
|
+
data = formData;
|
|
353
|
+
localVarHeaderParams = {
|
|
354
|
+
...localVarHeaderParams,
|
|
355
|
+
...formData.getHeaders(),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
360
|
+
method: 'GET',
|
|
361
|
+
params: localVarQueryParameters,
|
|
362
|
+
headers: localVarHeaderParams,
|
|
363
|
+
url: localVarPath,
|
|
364
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
365
|
+
maxContentLength: Infinity,
|
|
366
|
+
maxBodyLength: Infinity,
|
|
367
|
+
responseType: "json",
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
371
|
+
localVarRequestOptions.data = data;
|
|
372
|
+
}
|
|
373
|
+
let authenticationPromise = Promise.resolve();
|
|
374
|
+
|
|
375
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
376
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
377
|
+
}
|
|
378
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
379
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
380
|
+
}
|
|
381
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
382
|
+
|
|
383
|
+
let interceptorPromise = authenticationPromise;
|
|
384
|
+
for (const interceptor of this.interceptors) {
|
|
385
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return interceptorPromise.then(() => {
|
|
389
|
+
return new Promise<UserProperties>((resolve, reject) => {
|
|
390
|
+
axios.request(localVarRequestOptions)
|
|
391
|
+
.then((response) => {
|
|
392
|
+
handleSuccessfulResponse<UserProperties>(
|
|
393
|
+
resolve,
|
|
394
|
+
reject,
|
|
395
|
+
response,
|
|
396
|
+
"UserProperties",
|
|
397
|
+
);
|
|
398
|
+
}, (error: AxiosError) => {
|
|
399
|
+
if (error.response == null) {
|
|
400
|
+
reject(error);
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (handleErrorCodeResponse(
|
|
405
|
+
reject,
|
|
406
|
+
error.response,
|
|
407
|
+
200,
|
|
408
|
+
"UserProperties",
|
|
409
|
+
)) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
if (handleErrorCodeResponse(
|
|
413
|
+
reject,
|
|
414
|
+
error.response,
|
|
415
|
+
401,
|
|
416
|
+
"ErrorResult",
|
|
417
|
+
)) {
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
if (handleErrorCodeResponse(
|
|
421
|
+
reject,
|
|
422
|
+
error.response,
|
|
423
|
+
403,
|
|
424
|
+
"ErrorResult",
|
|
425
|
+
)) {
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
reject(error);
|
|
431
|
+
});
|
|
432
|
+
});
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
*
|
|
437
|
+
* @summary List user documents.
|
|
438
|
+
* @param page Page index specified in get user list request.
|
|
439
|
+
* @param pageSize Page size specified in get user list request.
|
|
440
|
+
* @param search Users can be listed by the search based on the user ID
|
|
441
|
+
* @param options
|
|
442
|
+
*/
|
|
443
|
+
public async listUsers (page: number, pageSize?: number, search?: string, options: optionsI = {headers: {}}) : Promise<UserRecords> {
|
|
444
|
+
const localVarPath = this.basePath + '/v1/users/list';
|
|
445
|
+
let localVarQueryParameters: any = {};
|
|
446
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
447
|
+
const produces = ['application/json'];
|
|
448
|
+
// give precedence to 'application/json'
|
|
449
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
450
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
451
|
+
} else {
|
|
452
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
453
|
+
}
|
|
454
|
+
let localVarFormParams: any = {};
|
|
455
|
+
let localVarBodyParams: any = undefined;
|
|
456
|
+
|
|
457
|
+
// verify required parameter 'page' is not null or undefined
|
|
458
|
+
if (page === null || page === undefined) {
|
|
459
|
+
throw new Error('Required parameter page was null or undefined when calling listUsers.');
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (pageSize !== undefined) {
|
|
463
|
+
localVarQueryParameters['PageSize'] = ObjectSerializer.serialize(pageSize, "number");
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
if (page !== undefined) {
|
|
467
|
+
localVarQueryParameters['Page'] = ObjectSerializer.serialize(page, "number");
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (search !== undefined) {
|
|
471
|
+
localVarQueryParameters['Search'] = ObjectSerializer.serialize(search, "string");
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
475
|
+
|
|
476
|
+
let localVarUseFormData = false;
|
|
477
|
+
|
|
478
|
+
let data = {};
|
|
479
|
+
if (localVarUseFormData) {
|
|
480
|
+
const formData = toFormData(localVarFormParams);
|
|
481
|
+
data = formData;
|
|
482
|
+
localVarHeaderParams = {
|
|
483
|
+
...localVarHeaderParams,
|
|
484
|
+
...formData.getHeaders(),
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
489
|
+
method: 'GET',
|
|
490
|
+
params: localVarQueryParameters,
|
|
491
|
+
headers: localVarHeaderParams,
|
|
492
|
+
url: localVarPath,
|
|
493
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
494
|
+
maxContentLength: Infinity,
|
|
495
|
+
maxBodyLength: Infinity,
|
|
496
|
+
responseType: "json",
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
500
|
+
localVarRequestOptions.data = data;
|
|
501
|
+
}
|
|
502
|
+
let authenticationPromise = Promise.resolve();
|
|
503
|
+
|
|
504
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
505
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
506
|
+
}
|
|
507
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
508
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
509
|
+
}
|
|
510
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
511
|
+
|
|
512
|
+
let interceptorPromise = authenticationPromise;
|
|
513
|
+
for (const interceptor of this.interceptors) {
|
|
514
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
return interceptorPromise.then(() => {
|
|
518
|
+
return new Promise<UserRecords>((resolve, reject) => {
|
|
519
|
+
axios.request(localVarRequestOptions)
|
|
520
|
+
.then((response) => {
|
|
521
|
+
handleSuccessfulResponse<UserRecords>(
|
|
522
|
+
resolve,
|
|
523
|
+
reject,
|
|
524
|
+
response,
|
|
525
|
+
"UserRecords",
|
|
526
|
+
);
|
|
527
|
+
}, (error: AxiosError) => {
|
|
528
|
+
if (error.response == null) {
|
|
529
|
+
reject(error);
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (handleErrorCodeResponse(
|
|
534
|
+
reject,
|
|
535
|
+
error.response,
|
|
536
|
+
200,
|
|
537
|
+
"UserRecords",
|
|
538
|
+
)) {
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
if (handleErrorCodeResponse(
|
|
542
|
+
reject,
|
|
543
|
+
error.response,
|
|
544
|
+
401,
|
|
545
|
+
"ErrorResult",
|
|
546
|
+
)) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
reject(error);
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
*
|
|
558
|
+
* @summary Resend the users invitation.
|
|
559
|
+
* @param userId
|
|
560
|
+
* @param options
|
|
561
|
+
*/
|
|
562
|
+
public async resendInvitation (userId: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
563
|
+
const localVarPath = this.basePath + '/v1/users/resendInvitation';
|
|
564
|
+
let localVarQueryParameters: any = {};
|
|
565
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
566
|
+
const produces = ['application/json'];
|
|
567
|
+
// give precedence to 'application/json'
|
|
568
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
569
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
570
|
+
} else {
|
|
571
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
572
|
+
}
|
|
573
|
+
let localVarFormParams: any = {};
|
|
574
|
+
let localVarBodyParams: any = undefined;
|
|
575
|
+
|
|
576
|
+
// verify required parameter 'userId' is not null or undefined
|
|
577
|
+
if (userId === null || userId === undefined) {
|
|
578
|
+
throw new Error('Required parameter userId was null or undefined when calling resendInvitation.');
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
if (userId !== undefined) {
|
|
582
|
+
localVarQueryParameters['UserId'] = ObjectSerializer.serialize(userId, "string");
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
586
|
+
|
|
587
|
+
let localVarUseFormData = false;
|
|
588
|
+
|
|
589
|
+
let data = {};
|
|
590
|
+
if (localVarUseFormData) {
|
|
591
|
+
const formData = toFormData(localVarFormParams);
|
|
592
|
+
data = formData;
|
|
593
|
+
localVarHeaderParams = {
|
|
594
|
+
...localVarHeaderParams,
|
|
595
|
+
...formData.getHeaders(),
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
600
|
+
method: 'POST',
|
|
601
|
+
params: localVarQueryParameters,
|
|
602
|
+
headers: localVarHeaderParams,
|
|
603
|
+
url: localVarPath,
|
|
604
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
605
|
+
maxContentLength: Infinity,
|
|
606
|
+
maxBodyLength: Infinity,
|
|
607
|
+
responseType: "json",
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
611
|
+
localVarRequestOptions.data = data;
|
|
612
|
+
}
|
|
613
|
+
let authenticationPromise = Promise.resolve();
|
|
614
|
+
|
|
615
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
616
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
617
|
+
}
|
|
618
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
619
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
620
|
+
}
|
|
621
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
622
|
+
|
|
623
|
+
let interceptorPromise = authenticationPromise;
|
|
624
|
+
for (const interceptor of this.interceptors) {
|
|
625
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
return interceptorPromise.then(() => {
|
|
629
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
630
|
+
axios.request(localVarRequestOptions)
|
|
631
|
+
.then((response) => {
|
|
632
|
+
handleSuccessfulResponse(
|
|
633
|
+
resolve,
|
|
634
|
+
reject,
|
|
635
|
+
response,
|
|
636
|
+
|
|
637
|
+
);
|
|
638
|
+
}, (error: AxiosError) => {
|
|
639
|
+
if (error.response == null) {
|
|
640
|
+
reject(error);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
if (handleErrorCodeResponse(
|
|
645
|
+
reject,
|
|
646
|
+
error.response,
|
|
647
|
+
401,
|
|
648
|
+
"ErrorResult",
|
|
649
|
+
)) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
if (handleErrorCodeResponse(
|
|
653
|
+
reject,
|
|
654
|
+
error.response,
|
|
655
|
+
403,
|
|
656
|
+
"ErrorResult",
|
|
657
|
+
)) {
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
reject(error);
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
*
|
|
669
|
+
* @summary Update new User meta data details.
|
|
670
|
+
* @param updateUserMetaData update query.
|
|
671
|
+
* @param options
|
|
672
|
+
*/
|
|
673
|
+
public async updateMetaData (updateUserMetaData?: UpdateUserMetaData, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
674
|
+
updateUserMetaData = deserializeIfNeeded(updateUserMetaData, "UpdateUserMetaData");
|
|
675
|
+
const localVarPath = this.basePath + '/v1/users/updateMetaData';
|
|
676
|
+
let localVarQueryParameters: any = {};
|
|
677
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
678
|
+
const produces = ['application/json'];
|
|
679
|
+
// give precedence to 'application/json'
|
|
680
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
681
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
682
|
+
} else {
|
|
683
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
684
|
+
}
|
|
685
|
+
let localVarFormParams: any = {};
|
|
686
|
+
let localVarBodyParams: any = undefined;
|
|
687
|
+
|
|
688
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
689
|
+
|
|
690
|
+
let localVarUseFormData = false;
|
|
691
|
+
|
|
692
|
+
const result = generateFormData(updateUserMetaData, UpdateUserMetaData);
|
|
693
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
694
|
+
|
|
695
|
+
let data = {};
|
|
696
|
+
if (localVarUseFormData) {
|
|
697
|
+
const formData = toFormData(result.data);
|
|
698
|
+
data = formData;
|
|
699
|
+
localVarHeaderParams = {
|
|
700
|
+
...localVarHeaderParams,
|
|
701
|
+
...formData.getHeaders(),
|
|
702
|
+
};
|
|
703
|
+
} else {
|
|
704
|
+
data = ObjectSerializer.serialize(
|
|
705
|
+
updateUserMetaData,
|
|
706
|
+
"UpdateUserMetaData"
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
711
|
+
method: 'PUT',
|
|
712
|
+
params: localVarQueryParameters,
|
|
713
|
+
headers: localVarHeaderParams,
|
|
714
|
+
url: localVarPath,
|
|
715
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
716
|
+
maxContentLength: Infinity,
|
|
717
|
+
maxBodyLength: Infinity,
|
|
718
|
+
responseType: "json",
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
722
|
+
localVarRequestOptions.data = data;
|
|
723
|
+
}
|
|
724
|
+
let authenticationPromise = Promise.resolve();
|
|
725
|
+
|
|
726
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
727
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
728
|
+
}
|
|
729
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
730
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
731
|
+
}
|
|
732
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
733
|
+
|
|
734
|
+
let interceptorPromise = authenticationPromise;
|
|
735
|
+
for (const interceptor of this.interceptors) {
|
|
736
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
return interceptorPromise.then(() => {
|
|
740
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
741
|
+
axios.request(localVarRequestOptions)
|
|
742
|
+
.then((response) => {
|
|
743
|
+
handleSuccessfulResponse(
|
|
744
|
+
resolve,
|
|
745
|
+
reject,
|
|
746
|
+
response,
|
|
747
|
+
|
|
748
|
+
);
|
|
749
|
+
}, (error: AxiosError) => {
|
|
750
|
+
if (error.response == null) {
|
|
751
|
+
reject(error);
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
if (handleErrorCodeResponse(
|
|
756
|
+
reject,
|
|
757
|
+
error.response,
|
|
758
|
+
401,
|
|
759
|
+
"ErrorResult",
|
|
760
|
+
)) {
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
if (handleErrorCodeResponse(
|
|
764
|
+
reject,
|
|
765
|
+
error.response,
|
|
766
|
+
403,
|
|
767
|
+
"ErrorResult",
|
|
768
|
+
)) {
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
reject(error);
|
|
774
|
+
});
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
*
|
|
780
|
+
* @summary Update new User role.
|
|
781
|
+
* @param updateUser update query.
|
|
782
|
+
* @param options
|
|
783
|
+
*/
|
|
784
|
+
public async updateUser (updateUser?: UpdateUser, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
785
|
+
updateUser = deserializeIfNeeded(updateUser, "UpdateUser");
|
|
786
|
+
const localVarPath = this.basePath + '/v1/users/update';
|
|
787
|
+
let localVarQueryParameters: any = {};
|
|
788
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
789
|
+
const produces = ['application/json'];
|
|
790
|
+
// give precedence to 'application/json'
|
|
791
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
792
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
793
|
+
} else {
|
|
794
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
795
|
+
}
|
|
796
|
+
let localVarFormParams: any = {};
|
|
797
|
+
let localVarBodyParams: any = undefined;
|
|
798
|
+
|
|
799
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
800
|
+
|
|
801
|
+
let localVarUseFormData = false;
|
|
802
|
+
|
|
803
|
+
const result = generateFormData(updateUser, UpdateUser);
|
|
804
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
805
|
+
|
|
806
|
+
let data = {};
|
|
807
|
+
if (localVarUseFormData) {
|
|
808
|
+
const formData = toFormData(result.data);
|
|
809
|
+
data = formData;
|
|
810
|
+
localVarHeaderParams = {
|
|
811
|
+
...localVarHeaderParams,
|
|
812
|
+
...formData.getHeaders(),
|
|
813
|
+
};
|
|
814
|
+
} else {
|
|
815
|
+
data = ObjectSerializer.serialize(
|
|
816
|
+
updateUser,
|
|
817
|
+
"UpdateUser"
|
|
818
|
+
);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
822
|
+
method: 'PUT',
|
|
823
|
+
params: localVarQueryParameters,
|
|
824
|
+
headers: localVarHeaderParams,
|
|
825
|
+
url: localVarPath,
|
|
826
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
827
|
+
maxContentLength: Infinity,
|
|
828
|
+
maxBodyLength: Infinity,
|
|
829
|
+
responseType: "json",
|
|
830
|
+
};
|
|
831
|
+
|
|
832
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
833
|
+
localVarRequestOptions.data = data;
|
|
834
|
+
}
|
|
835
|
+
let authenticationPromise = Promise.resolve();
|
|
836
|
+
|
|
837
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
838
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
839
|
+
}
|
|
840
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
841
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
842
|
+
}
|
|
843
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
844
|
+
|
|
845
|
+
let interceptorPromise = authenticationPromise;
|
|
846
|
+
for (const interceptor of this.interceptors) {
|
|
847
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
return interceptorPromise.then(() => {
|
|
851
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
852
|
+
axios.request(localVarRequestOptions)
|
|
853
|
+
.then((response) => {
|
|
854
|
+
handleSuccessfulResponse(
|
|
855
|
+
resolve,
|
|
856
|
+
reject,
|
|
857
|
+
response,
|
|
858
|
+
|
|
859
|
+
);
|
|
860
|
+
}, (error: AxiosError) => {
|
|
861
|
+
if (error.response == null) {
|
|
862
|
+
reject(error);
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
if (handleErrorCodeResponse(
|
|
867
|
+
reject,
|
|
868
|
+
error.response,
|
|
869
|
+
401,
|
|
870
|
+
"ErrorResult",
|
|
871
|
+
)) {
|
|
872
|
+
return;
|
|
873
|
+
}
|
|
874
|
+
if (handleErrorCodeResponse(
|
|
875
|
+
reject,
|
|
876
|
+
error.response,
|
|
877
|
+
403,
|
|
878
|
+
"ErrorResult",
|
|
879
|
+
)) {
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
|
|
884
|
+
reject(error);
|
|
885
|
+
});
|
|
886
|
+
});
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
function deserializeIfNeeded<T> (obj: T, classname: string): T {
|
|
892
|
+
if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
|
|
893
|
+
return ObjectSerializer.deserialize(obj, classname);
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
return obj;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
type AxiosResolve<T> = (
|
|
900
|
+
value: (T | PromiseLike<T>),
|
|
901
|
+
) => void
|
|
902
|
+
|
|
903
|
+
type AxiosReject = (reason?: any) => void;
|
|
904
|
+
|
|
905
|
+
function handleSuccessfulResponse<T>(
|
|
906
|
+
resolve: AxiosResolve<T>,
|
|
907
|
+
reject: AxiosReject,
|
|
908
|
+
response: AxiosResponse,
|
|
909
|
+
returnType?: string,
|
|
910
|
+
) {
|
|
911
|
+
let body = response.data;
|
|
912
|
+
|
|
913
|
+
if (
|
|
914
|
+
response.status &&
|
|
915
|
+
response.status >= 200 &&
|
|
916
|
+
response.status <= 299
|
|
917
|
+
) {
|
|
918
|
+
if (returnType) {
|
|
919
|
+
body = ObjectSerializer.deserialize(body, returnType);
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
resolve(body);
|
|
923
|
+
} else {
|
|
924
|
+
reject(new HttpError(response, body, response.status));
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
function handleErrorCodeResponse(
|
|
929
|
+
reject: AxiosReject,
|
|
930
|
+
response: AxiosResponse,
|
|
931
|
+
code: number,
|
|
932
|
+
returnType: string
|
|
933
|
+
): boolean {
|
|
934
|
+
if (response.status !== code) {
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
let body = response.data;
|
|
939
|
+
if(code === 401) {
|
|
940
|
+
body = "Unauthorized request (401): Invalid authentication.";
|
|
941
|
+
}
|
|
942
|
+
reject(new HttpError(response, body, response.status));
|
|
943
|
+
|
|
944
|
+
return true;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
function handleErrorRangeResponse(
|
|
948
|
+
reject: AxiosReject,
|
|
949
|
+
response: AxiosResponse,
|
|
950
|
+
code: string,
|
|
951
|
+
returnType: string
|
|
952
|
+
): boolean {
|
|
953
|
+
let rangeCodeLeft = Number(code[0] + "00");
|
|
954
|
+
let rangeCodeRight = Number(code[0] + "99");
|
|
955
|
+
|
|
956
|
+
if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
|
|
957
|
+
const body = ObjectSerializer.deserialize(
|
|
958
|
+
response.data,
|
|
959
|
+
returnType,
|
|
960
|
+
);
|
|
961
|
+
|
|
962
|
+
reject(new HttpError(response, body, response.status));
|
|
963
|
+
|
|
964
|
+
return true;
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
return false;
|
|
968
|
+
}
|