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/contactsApi.ts
CHANGED
|
@@ -1,772 +1,772 @@
|
|
|
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
|
-
ContactDetails,ContactsDetails,ContactsList,CreateContactResponse,ErrorResult,
|
|
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 ContactsApi {
|
|
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 List Contact document.
|
|
97
|
-
* @param page Page index specified in get user contact list request. Default value is 1.
|
|
98
|
-
* @param pageSize Page size specified in get user contact list request. Default value is 10.
|
|
99
|
-
* @param searchKey Contacts can be listed by the search based on the Name or Email
|
|
100
|
-
* @param contactType Contact type whether the contact is My Contacts or All Contacts. Default value is AllContacts.
|
|
101
|
-
* @param options
|
|
102
|
-
*/
|
|
103
|
-
public async contactUserList (page: number, pageSize?: number, searchKey?: string, contactType?: 'MyContacts' | 'AllContacts', options: optionsI = {headers: {}}) : Promise<ContactsList> {
|
|
104
|
-
const localVarPath = this.basePath + '/v1/contacts/list';
|
|
105
|
-
let localVarQueryParameters: any = {};
|
|
106
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
107
|
-
const produces = ['application/json'];
|
|
108
|
-
// give precedence to 'application/json'
|
|
109
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
110
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
111
|
-
} else {
|
|
112
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
113
|
-
}
|
|
114
|
-
let localVarFormParams: any = {};
|
|
115
|
-
let localVarBodyParams: any = undefined;
|
|
116
|
-
|
|
117
|
-
// verify required parameter 'page' is not null or undefined
|
|
118
|
-
if (page === null || page === undefined) {
|
|
119
|
-
throw new Error('Required parameter page was null or undefined when calling contactUserList.');
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (pageSize !== undefined) {
|
|
123
|
-
localVarQueryParameters['PageSize'] = ObjectSerializer.serialize(pageSize, "number");
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (page !== undefined) {
|
|
127
|
-
localVarQueryParameters['Page'] = ObjectSerializer.serialize(page, "number");
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (searchKey !== undefined) {
|
|
131
|
-
localVarQueryParameters['SearchKey'] = ObjectSerializer.serialize(searchKey, "string");
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if (contactType !== undefined) {
|
|
135
|
-
localVarQueryParameters['ContactType'] = ObjectSerializer.serialize(contactType, "'MyContacts' | 'AllContacts'");
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
139
|
-
|
|
140
|
-
let localVarUseFormData = false;
|
|
141
|
-
|
|
142
|
-
let data = {};
|
|
143
|
-
if (localVarUseFormData) {
|
|
144
|
-
const formData = toFormData(localVarFormParams);
|
|
145
|
-
data = formData;
|
|
146
|
-
localVarHeaderParams = {
|
|
147
|
-
...localVarHeaderParams,
|
|
148
|
-
...formData.getHeaders(),
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
153
|
-
method: 'GET',
|
|
154
|
-
params: localVarQueryParameters,
|
|
155
|
-
headers: localVarHeaderParams,
|
|
156
|
-
url: localVarPath,
|
|
157
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
158
|
-
maxContentLength: Infinity,
|
|
159
|
-
maxBodyLength: Infinity,
|
|
160
|
-
responseType: "json",
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
164
|
-
localVarRequestOptions.data = data;
|
|
165
|
-
}
|
|
166
|
-
let authenticationPromise = Promise.resolve();
|
|
167
|
-
|
|
168
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
169
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
170
|
-
}
|
|
171
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
172
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
173
|
-
}
|
|
174
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
175
|
-
|
|
176
|
-
let interceptorPromise = authenticationPromise;
|
|
177
|
-
for (const interceptor of this.interceptors) {
|
|
178
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return interceptorPromise.then(() => {
|
|
182
|
-
return new Promise<ContactsList>((resolve, reject) => {
|
|
183
|
-
axios.request(localVarRequestOptions)
|
|
184
|
-
.then((response) => {
|
|
185
|
-
handleSuccessfulResponse<ContactsList>(
|
|
186
|
-
resolve,
|
|
187
|
-
reject,
|
|
188
|
-
response,
|
|
189
|
-
"ContactsList",
|
|
190
|
-
);
|
|
191
|
-
}, (error: AxiosError) => {
|
|
192
|
-
if (error.response == null) {
|
|
193
|
-
reject(error);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
if (handleErrorCodeResponse(
|
|
198
|
-
reject,
|
|
199
|
-
error.response,
|
|
200
|
-
200,
|
|
201
|
-
"ContactsList",
|
|
202
|
-
)) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
if (handleErrorCodeResponse(
|
|
206
|
-
reject,
|
|
207
|
-
error.response,
|
|
208
|
-
401,
|
|
209
|
-
"ErrorResult",
|
|
210
|
-
)) {
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
if (handleErrorCodeResponse(
|
|
214
|
-
reject,
|
|
215
|
-
error.response,
|
|
216
|
-
400,
|
|
217
|
-
"ErrorResult",
|
|
218
|
-
)) {
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
reject(error);
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
*
|
|
230
|
-
* @summary Create the new Contact.
|
|
231
|
-
* @param contactDetails The contact details.
|
|
232
|
-
* @param options
|
|
233
|
-
*/
|
|
234
|
-
public async createContact (contactDetails?: Array<ContactDetails>, options: optionsI = {headers: {}}) : Promise<CreateContactResponse> {
|
|
235
|
-
contactDetails = deserializeIfNeeded(contactDetails, "Array<ContactDetails>");
|
|
236
|
-
const localVarPath = this.basePath + '/v1/contacts/create';
|
|
237
|
-
let localVarQueryParameters: any = {};
|
|
238
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
239
|
-
const produces = ['application/json'];
|
|
240
|
-
// give precedence to 'application/json'
|
|
241
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
242
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
243
|
-
} else {
|
|
244
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
245
|
-
}
|
|
246
|
-
let localVarFormParams: any = {};
|
|
247
|
-
let localVarBodyParams: any = undefined;
|
|
248
|
-
|
|
249
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
250
|
-
|
|
251
|
-
let localVarUseFormData = false;
|
|
252
|
-
|
|
253
|
-
const result = generateFormData(contactDetails, Array<ContactDetails>);
|
|
254
|
-
localVarUseFormData = result.localVarUseFormData;
|
|
255
|
-
|
|
256
|
-
let data = {};
|
|
257
|
-
if (localVarUseFormData) {
|
|
258
|
-
const formData = toFormData(result.data);
|
|
259
|
-
data = formData;
|
|
260
|
-
localVarHeaderParams = {
|
|
261
|
-
...localVarHeaderParams,
|
|
262
|
-
...formData.getHeaders(),
|
|
263
|
-
};
|
|
264
|
-
} else {
|
|
265
|
-
data = ObjectSerializer.serialize(
|
|
266
|
-
contactDetails,
|
|
267
|
-
"Array<ContactDetails>"
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
272
|
-
method: 'POST',
|
|
273
|
-
params: localVarQueryParameters,
|
|
274
|
-
headers: localVarHeaderParams,
|
|
275
|
-
url: localVarPath,
|
|
276
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
277
|
-
maxContentLength: Infinity,
|
|
278
|
-
maxBodyLength: Infinity,
|
|
279
|
-
responseType: "json",
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
283
|
-
localVarRequestOptions.data = data;
|
|
284
|
-
}
|
|
285
|
-
let authenticationPromise = Promise.resolve();
|
|
286
|
-
|
|
287
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
288
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
289
|
-
}
|
|
290
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
291
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
292
|
-
}
|
|
293
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
294
|
-
|
|
295
|
-
let interceptorPromise = authenticationPromise;
|
|
296
|
-
for (const interceptor of this.interceptors) {
|
|
297
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
return interceptorPromise.then(() => {
|
|
301
|
-
return new Promise<CreateContactResponse>((resolve, reject) => {
|
|
302
|
-
axios.request(localVarRequestOptions)
|
|
303
|
-
.then((response) => {
|
|
304
|
-
handleSuccessfulResponse<CreateContactResponse>(
|
|
305
|
-
resolve,
|
|
306
|
-
reject,
|
|
307
|
-
response,
|
|
308
|
-
"CreateContactResponse",
|
|
309
|
-
);
|
|
310
|
-
}, (error: AxiosError) => {
|
|
311
|
-
if (error.response == null) {
|
|
312
|
-
reject(error);
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
if (handleErrorCodeResponse(
|
|
317
|
-
reject,
|
|
318
|
-
error.response,
|
|
319
|
-
201,
|
|
320
|
-
"CreateContactResponse",
|
|
321
|
-
)) {
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
if (handleErrorCodeResponse(
|
|
325
|
-
reject,
|
|
326
|
-
error.response,
|
|
327
|
-
401,
|
|
328
|
-
"ErrorResult",
|
|
329
|
-
)) {
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
if (handleErrorCodeResponse(
|
|
333
|
-
reject,
|
|
334
|
-
error.response,
|
|
335
|
-
400,
|
|
336
|
-
"ErrorResult",
|
|
337
|
-
)) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
reject(error);
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
*
|
|
349
|
-
* @summary Deletes a contact.
|
|
350
|
-
* @param id The contact id.
|
|
351
|
-
* @param options
|
|
352
|
-
*/
|
|
353
|
-
public async deleteContacts (id: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
354
|
-
const localVarPath = this.basePath + '/v1/contacts/delete';
|
|
355
|
-
let localVarQueryParameters: any = {};
|
|
356
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
357
|
-
const produces = ['application/json'];
|
|
358
|
-
// give precedence to 'application/json'
|
|
359
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
360
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
361
|
-
} else {
|
|
362
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
363
|
-
}
|
|
364
|
-
let localVarFormParams: any = {};
|
|
365
|
-
let localVarBodyParams: any = undefined;
|
|
366
|
-
|
|
367
|
-
// verify required parameter 'id' is not null or undefined
|
|
368
|
-
if (id === null || id === undefined) {
|
|
369
|
-
throw new Error('Required parameter id was null or undefined when calling deleteContacts.');
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
if (id !== undefined) {
|
|
373
|
-
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
377
|
-
|
|
378
|
-
let localVarUseFormData = false;
|
|
379
|
-
|
|
380
|
-
let data = {};
|
|
381
|
-
if (localVarUseFormData) {
|
|
382
|
-
const formData = toFormData(localVarFormParams);
|
|
383
|
-
data = formData;
|
|
384
|
-
localVarHeaderParams = {
|
|
385
|
-
...localVarHeaderParams,
|
|
386
|
-
...formData.getHeaders(),
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
391
|
-
method: 'DELETE',
|
|
392
|
-
params: localVarQueryParameters,
|
|
393
|
-
headers: localVarHeaderParams,
|
|
394
|
-
url: localVarPath,
|
|
395
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
396
|
-
maxContentLength: Infinity,
|
|
397
|
-
maxBodyLength: Infinity,
|
|
398
|
-
responseType: "json",
|
|
399
|
-
};
|
|
400
|
-
|
|
401
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
402
|
-
localVarRequestOptions.data = data;
|
|
403
|
-
}
|
|
404
|
-
let authenticationPromise = Promise.resolve();
|
|
405
|
-
|
|
406
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
407
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
408
|
-
}
|
|
409
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
410
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
411
|
-
}
|
|
412
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
413
|
-
|
|
414
|
-
let interceptorPromise = authenticationPromise;
|
|
415
|
-
for (const interceptor of this.interceptors) {
|
|
416
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
return interceptorPromise.then(() => {
|
|
420
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
421
|
-
axios.request(localVarRequestOptions)
|
|
422
|
-
.then((response) => {
|
|
423
|
-
handleSuccessfulResponse(
|
|
424
|
-
resolve,
|
|
425
|
-
reject,
|
|
426
|
-
response,
|
|
427
|
-
|
|
428
|
-
);
|
|
429
|
-
}, (error: AxiosError) => {
|
|
430
|
-
if (error.response == null) {
|
|
431
|
-
reject(error);
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
if (handleErrorCodeResponse(
|
|
436
|
-
reject,
|
|
437
|
-
error.response,
|
|
438
|
-
401,
|
|
439
|
-
"ErrorResult",
|
|
440
|
-
)) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
if (handleErrorCodeResponse(
|
|
444
|
-
reject,
|
|
445
|
-
error.response,
|
|
446
|
-
403,
|
|
447
|
-
"ErrorResult",
|
|
448
|
-
)) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
reject(error);
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
/**
|
|
459
|
-
*
|
|
460
|
-
* @summary Get summary of the contact.
|
|
461
|
-
* @param id Contact Id.
|
|
462
|
-
* @param options
|
|
463
|
-
*/
|
|
464
|
-
public async getContact (id: string, options: optionsI = {headers: {}}) : Promise<ContactsDetails> {
|
|
465
|
-
const localVarPath = this.basePath + '/v1/contacts/get';
|
|
466
|
-
let localVarQueryParameters: any = {};
|
|
467
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
468
|
-
const produces = ['application/json'];
|
|
469
|
-
// give precedence to 'application/json'
|
|
470
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
471
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
472
|
-
} else {
|
|
473
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
474
|
-
}
|
|
475
|
-
let localVarFormParams: any = {};
|
|
476
|
-
let localVarBodyParams: any = undefined;
|
|
477
|
-
|
|
478
|
-
// verify required parameter 'id' is not null or undefined
|
|
479
|
-
if (id === null || id === undefined) {
|
|
480
|
-
throw new Error('Required parameter id was null or undefined when calling getContact.');
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if (id !== undefined) {
|
|
484
|
-
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
488
|
-
|
|
489
|
-
let localVarUseFormData = false;
|
|
490
|
-
|
|
491
|
-
let data = {};
|
|
492
|
-
if (localVarUseFormData) {
|
|
493
|
-
const formData = toFormData(localVarFormParams);
|
|
494
|
-
data = formData;
|
|
495
|
-
localVarHeaderParams = {
|
|
496
|
-
...localVarHeaderParams,
|
|
497
|
-
...formData.getHeaders(),
|
|
498
|
-
};
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
502
|
-
method: 'GET',
|
|
503
|
-
params: localVarQueryParameters,
|
|
504
|
-
headers: localVarHeaderParams,
|
|
505
|
-
url: localVarPath,
|
|
506
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
507
|
-
maxContentLength: Infinity,
|
|
508
|
-
maxBodyLength: Infinity,
|
|
509
|
-
responseType: "json",
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
513
|
-
localVarRequestOptions.data = data;
|
|
514
|
-
}
|
|
515
|
-
let authenticationPromise = Promise.resolve();
|
|
516
|
-
|
|
517
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
518
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
519
|
-
}
|
|
520
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
521
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
522
|
-
}
|
|
523
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
524
|
-
|
|
525
|
-
let interceptorPromise = authenticationPromise;
|
|
526
|
-
for (const interceptor of this.interceptors) {
|
|
527
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
return interceptorPromise.then(() => {
|
|
531
|
-
return new Promise<ContactsDetails>((resolve, reject) => {
|
|
532
|
-
axios.request(localVarRequestOptions)
|
|
533
|
-
.then((response) => {
|
|
534
|
-
handleSuccessfulResponse<ContactsDetails>(
|
|
535
|
-
resolve,
|
|
536
|
-
reject,
|
|
537
|
-
response,
|
|
538
|
-
"ContactsDetails",
|
|
539
|
-
);
|
|
540
|
-
}, (error: AxiosError) => {
|
|
541
|
-
if (error.response == null) {
|
|
542
|
-
reject(error);
|
|
543
|
-
return;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
if (handleErrorCodeResponse(
|
|
547
|
-
reject,
|
|
548
|
-
error.response,
|
|
549
|
-
200,
|
|
550
|
-
"ContactsDetails",
|
|
551
|
-
)) {
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
if (handleErrorCodeResponse(
|
|
555
|
-
reject,
|
|
556
|
-
error.response,
|
|
557
|
-
401,
|
|
558
|
-
"ErrorResult",
|
|
559
|
-
)) {
|
|
560
|
-
return;
|
|
561
|
-
}
|
|
562
|
-
if (handleErrorCodeResponse(
|
|
563
|
-
reject,
|
|
564
|
-
error.response,
|
|
565
|
-
403,
|
|
566
|
-
"ErrorResult",
|
|
567
|
-
)) {
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
reject(error);
|
|
573
|
-
});
|
|
574
|
-
});
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
*
|
|
579
|
-
* @summary Update the contact.
|
|
580
|
-
* @param id The contactId.
|
|
581
|
-
* @param contactDetails The contact details.
|
|
582
|
-
* @param options
|
|
583
|
-
*/
|
|
584
|
-
public async updateContact (id?: string, contactDetails?: ContactDetails, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
585
|
-
contactDetails = deserializeIfNeeded(contactDetails, "ContactDetails");
|
|
586
|
-
const localVarPath = this.basePath + '/v1/contacts/update';
|
|
587
|
-
let localVarQueryParameters: any = {};
|
|
588
|
-
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
589
|
-
const produces = ['application/json'];
|
|
590
|
-
// give precedence to 'application/json'
|
|
591
|
-
if (produces.indexOf('application/json') >= 0) {
|
|
592
|
-
localVarHeaderParams['content-type'] = 'application/json';
|
|
593
|
-
} else {
|
|
594
|
-
localVarHeaderParams['content-type'] = produces.join(',');
|
|
595
|
-
}
|
|
596
|
-
let localVarFormParams: any = {};
|
|
597
|
-
let localVarBodyParams: any = undefined;
|
|
598
|
-
|
|
599
|
-
if (id !== undefined) {
|
|
600
|
-
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
604
|
-
|
|
605
|
-
let localVarUseFormData = false;
|
|
606
|
-
|
|
607
|
-
const result = generateFormData(contactDetails, ContactDetails);
|
|
608
|
-
localVarUseFormData = result.localVarUseFormData;
|
|
609
|
-
|
|
610
|
-
let data = {};
|
|
611
|
-
if (localVarUseFormData) {
|
|
612
|
-
const formData = toFormData(result.data);
|
|
613
|
-
data = formData;
|
|
614
|
-
localVarHeaderParams = {
|
|
615
|
-
...localVarHeaderParams,
|
|
616
|
-
...formData.getHeaders(),
|
|
617
|
-
};
|
|
618
|
-
} else {
|
|
619
|
-
data = ObjectSerializer.serialize(
|
|
620
|
-
contactDetails,
|
|
621
|
-
"ContactDetails"
|
|
622
|
-
);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
let localVarRequestOptions: AxiosRequestConfig = {
|
|
626
|
-
method: 'PUT',
|
|
627
|
-
params: localVarQueryParameters,
|
|
628
|
-
headers: localVarHeaderParams,
|
|
629
|
-
url: localVarPath,
|
|
630
|
-
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
631
|
-
maxContentLength: Infinity,
|
|
632
|
-
maxBodyLength: Infinity,
|
|
633
|
-
responseType: "json",
|
|
634
|
-
};
|
|
635
|
-
|
|
636
|
-
if (localVarRequestOptions.method !== 'GET') {
|
|
637
|
-
localVarRequestOptions.data = data;
|
|
638
|
-
}
|
|
639
|
-
let authenticationPromise = Promise.resolve();
|
|
640
|
-
|
|
641
|
-
if (this.authentications["X-API-KEY"].apiKey) {
|
|
642
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
643
|
-
}
|
|
644
|
-
if (this.authentications["Bearer"].apiKey) {
|
|
645
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
646
|
-
}
|
|
647
|
-
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
648
|
-
|
|
649
|
-
let interceptorPromise = authenticationPromise;
|
|
650
|
-
for (const interceptor of this.interceptors) {
|
|
651
|
-
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
return interceptorPromise.then(() => {
|
|
655
|
-
return new Promise<returnTypeI>((resolve, reject) => {
|
|
656
|
-
axios.request(localVarRequestOptions)
|
|
657
|
-
.then((response) => {
|
|
658
|
-
handleSuccessfulResponse(
|
|
659
|
-
resolve,
|
|
660
|
-
reject,
|
|
661
|
-
response,
|
|
662
|
-
|
|
663
|
-
);
|
|
664
|
-
}, (error: AxiosError) => {
|
|
665
|
-
if (error.response == null) {
|
|
666
|
-
reject(error);
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
if (handleErrorCodeResponse(
|
|
671
|
-
reject,
|
|
672
|
-
error.response,
|
|
673
|
-
401,
|
|
674
|
-
"ErrorResult",
|
|
675
|
-
)) {
|
|
676
|
-
return;
|
|
677
|
-
}
|
|
678
|
-
if (handleErrorCodeResponse(
|
|
679
|
-
reject,
|
|
680
|
-
error.response,
|
|
681
|
-
400,
|
|
682
|
-
"ErrorResult",
|
|
683
|
-
)) {
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
reject(error);
|
|
689
|
-
});
|
|
690
|
-
});
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
function deserializeIfNeeded<T> (obj: T, classname: string): T {
|
|
696
|
-
if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
|
|
697
|
-
return ObjectSerializer.deserialize(obj, classname);
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
return obj;
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
type AxiosResolve<T> = (
|
|
704
|
-
value: (T | PromiseLike<T>),
|
|
705
|
-
) => void
|
|
706
|
-
|
|
707
|
-
type AxiosReject = (reason?: any) => void;
|
|
708
|
-
|
|
709
|
-
function handleSuccessfulResponse<T>(
|
|
710
|
-
resolve: AxiosResolve<T>,
|
|
711
|
-
reject: AxiosReject,
|
|
712
|
-
response: AxiosResponse,
|
|
713
|
-
returnType?: string,
|
|
714
|
-
) {
|
|
715
|
-
let body = response.data;
|
|
716
|
-
|
|
717
|
-
if (
|
|
718
|
-
response.status &&
|
|
719
|
-
response.status >= 200 &&
|
|
720
|
-
response.status <= 299
|
|
721
|
-
) {
|
|
722
|
-
if (returnType) {
|
|
723
|
-
body = ObjectSerializer.deserialize(body, returnType);
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
resolve(body);
|
|
727
|
-
} else {
|
|
728
|
-
reject(new HttpError(response, body, response.status));
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
function handleErrorCodeResponse(
|
|
733
|
-
reject: AxiosReject,
|
|
734
|
-
response: AxiosResponse,
|
|
735
|
-
code: number,
|
|
736
|
-
returnType: string
|
|
737
|
-
): boolean {
|
|
738
|
-
if (response.status !== code) {
|
|
739
|
-
return false;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
let body = response.data;
|
|
743
|
-
if(code === 401) {
|
|
744
|
-
body = "Unauthorized request (401): Invalid authentication.";
|
|
745
|
-
}
|
|
746
|
-
reject(new HttpError(response, body, response.status));
|
|
747
|
-
|
|
748
|
-
return true;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
function handleErrorRangeResponse(
|
|
752
|
-
reject: AxiosReject,
|
|
753
|
-
response: AxiosResponse,
|
|
754
|
-
code: string,
|
|
755
|
-
returnType: string
|
|
756
|
-
): boolean {
|
|
757
|
-
let rangeCodeLeft = Number(code[0] + "00");
|
|
758
|
-
let rangeCodeRight = Number(code[0] + "99");
|
|
759
|
-
|
|
760
|
-
if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
|
|
761
|
-
const body = ObjectSerializer.deserialize(
|
|
762
|
-
response.data,
|
|
763
|
-
returnType,
|
|
764
|
-
);
|
|
765
|
-
|
|
766
|
-
reject(new HttpError(response, body, response.status));
|
|
767
|
-
|
|
768
|
-
return true;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
return false;
|
|
772
|
-
}
|
|
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
|
+
ContactDetails,ContactsDetails,ContactsList,CreateContactResponse,ErrorResult,
|
|
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 ContactsApi {
|
|
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 List Contact document.
|
|
97
|
+
* @param page Page index specified in get user contact list request. Default value is 1.
|
|
98
|
+
* @param pageSize Page size specified in get user contact list request. Default value is 10.
|
|
99
|
+
* @param searchKey Contacts can be listed by the search based on the Name or Email
|
|
100
|
+
* @param contactType Contact type whether the contact is My Contacts or All Contacts. Default value is AllContacts.
|
|
101
|
+
* @param options
|
|
102
|
+
*/
|
|
103
|
+
public async contactUserList (page: number, pageSize?: number, searchKey?: string, contactType?: 'MyContacts' | 'AllContacts', options: optionsI = {headers: {}}) : Promise<ContactsList> {
|
|
104
|
+
const localVarPath = this.basePath + '/v1/contacts/list';
|
|
105
|
+
let localVarQueryParameters: any = {};
|
|
106
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
107
|
+
const produces = ['application/json'];
|
|
108
|
+
// give precedence to 'application/json'
|
|
109
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
110
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
111
|
+
} else {
|
|
112
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
113
|
+
}
|
|
114
|
+
let localVarFormParams: any = {};
|
|
115
|
+
let localVarBodyParams: any = undefined;
|
|
116
|
+
|
|
117
|
+
// verify required parameter 'page' is not null or undefined
|
|
118
|
+
if (page === null || page === undefined) {
|
|
119
|
+
throw new Error('Required parameter page was null or undefined when calling contactUserList.');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (pageSize !== undefined) {
|
|
123
|
+
localVarQueryParameters['PageSize'] = ObjectSerializer.serialize(pageSize, "number");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (page !== undefined) {
|
|
127
|
+
localVarQueryParameters['Page'] = ObjectSerializer.serialize(page, "number");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (searchKey !== undefined) {
|
|
131
|
+
localVarQueryParameters['SearchKey'] = ObjectSerializer.serialize(searchKey, "string");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (contactType !== undefined) {
|
|
135
|
+
localVarQueryParameters['ContactType'] = ObjectSerializer.serialize(contactType, "'MyContacts' | 'AllContacts'");
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
139
|
+
|
|
140
|
+
let localVarUseFormData = false;
|
|
141
|
+
|
|
142
|
+
let data = {};
|
|
143
|
+
if (localVarUseFormData) {
|
|
144
|
+
const formData = toFormData(localVarFormParams);
|
|
145
|
+
data = formData;
|
|
146
|
+
localVarHeaderParams = {
|
|
147
|
+
...localVarHeaderParams,
|
|
148
|
+
...formData.getHeaders(),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
153
|
+
method: 'GET',
|
|
154
|
+
params: localVarQueryParameters,
|
|
155
|
+
headers: localVarHeaderParams,
|
|
156
|
+
url: localVarPath,
|
|
157
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
158
|
+
maxContentLength: Infinity,
|
|
159
|
+
maxBodyLength: Infinity,
|
|
160
|
+
responseType: "json",
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
164
|
+
localVarRequestOptions.data = data;
|
|
165
|
+
}
|
|
166
|
+
let authenticationPromise = Promise.resolve();
|
|
167
|
+
|
|
168
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
169
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
170
|
+
}
|
|
171
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
172
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
173
|
+
}
|
|
174
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
175
|
+
|
|
176
|
+
let interceptorPromise = authenticationPromise;
|
|
177
|
+
for (const interceptor of this.interceptors) {
|
|
178
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return interceptorPromise.then(() => {
|
|
182
|
+
return new Promise<ContactsList>((resolve, reject) => {
|
|
183
|
+
axios.request(localVarRequestOptions)
|
|
184
|
+
.then((response) => {
|
|
185
|
+
handleSuccessfulResponse<ContactsList>(
|
|
186
|
+
resolve,
|
|
187
|
+
reject,
|
|
188
|
+
response,
|
|
189
|
+
"ContactsList",
|
|
190
|
+
);
|
|
191
|
+
}, (error: AxiosError) => {
|
|
192
|
+
if (error.response == null) {
|
|
193
|
+
reject(error);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (handleErrorCodeResponse(
|
|
198
|
+
reject,
|
|
199
|
+
error.response,
|
|
200
|
+
200,
|
|
201
|
+
"ContactsList",
|
|
202
|
+
)) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (handleErrorCodeResponse(
|
|
206
|
+
reject,
|
|
207
|
+
error.response,
|
|
208
|
+
401,
|
|
209
|
+
"ErrorResult",
|
|
210
|
+
)) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (handleErrorCodeResponse(
|
|
214
|
+
reject,
|
|
215
|
+
error.response,
|
|
216
|
+
400,
|
|
217
|
+
"ErrorResult",
|
|
218
|
+
)) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
reject(error);
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
*
|
|
230
|
+
* @summary Create the new Contact.
|
|
231
|
+
* @param contactDetails The contact details.
|
|
232
|
+
* @param options
|
|
233
|
+
*/
|
|
234
|
+
public async createContact (contactDetails?: Array<ContactDetails>, options: optionsI = {headers: {}}) : Promise<CreateContactResponse> {
|
|
235
|
+
contactDetails = deserializeIfNeeded(contactDetails, "Array<ContactDetails>");
|
|
236
|
+
const localVarPath = this.basePath + '/v1/contacts/create';
|
|
237
|
+
let localVarQueryParameters: any = {};
|
|
238
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
239
|
+
const produces = ['application/json'];
|
|
240
|
+
// give precedence to 'application/json'
|
|
241
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
242
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
243
|
+
} else {
|
|
244
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
245
|
+
}
|
|
246
|
+
let localVarFormParams: any = {};
|
|
247
|
+
let localVarBodyParams: any = undefined;
|
|
248
|
+
|
|
249
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
250
|
+
|
|
251
|
+
let localVarUseFormData = false;
|
|
252
|
+
|
|
253
|
+
const result = generateFormData(contactDetails, Array<ContactDetails>);
|
|
254
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
255
|
+
|
|
256
|
+
let data = {};
|
|
257
|
+
if (localVarUseFormData) {
|
|
258
|
+
const formData = toFormData(result.data);
|
|
259
|
+
data = formData;
|
|
260
|
+
localVarHeaderParams = {
|
|
261
|
+
...localVarHeaderParams,
|
|
262
|
+
...formData.getHeaders(),
|
|
263
|
+
};
|
|
264
|
+
} else {
|
|
265
|
+
data = ObjectSerializer.serialize(
|
|
266
|
+
contactDetails,
|
|
267
|
+
"Array<ContactDetails>"
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
272
|
+
method: 'POST',
|
|
273
|
+
params: localVarQueryParameters,
|
|
274
|
+
headers: localVarHeaderParams,
|
|
275
|
+
url: localVarPath,
|
|
276
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
277
|
+
maxContentLength: Infinity,
|
|
278
|
+
maxBodyLength: Infinity,
|
|
279
|
+
responseType: "json",
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
283
|
+
localVarRequestOptions.data = data;
|
|
284
|
+
}
|
|
285
|
+
let authenticationPromise = Promise.resolve();
|
|
286
|
+
|
|
287
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
288
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
289
|
+
}
|
|
290
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
291
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
292
|
+
}
|
|
293
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
294
|
+
|
|
295
|
+
let interceptorPromise = authenticationPromise;
|
|
296
|
+
for (const interceptor of this.interceptors) {
|
|
297
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return interceptorPromise.then(() => {
|
|
301
|
+
return new Promise<CreateContactResponse>((resolve, reject) => {
|
|
302
|
+
axios.request(localVarRequestOptions)
|
|
303
|
+
.then((response) => {
|
|
304
|
+
handleSuccessfulResponse<CreateContactResponse>(
|
|
305
|
+
resolve,
|
|
306
|
+
reject,
|
|
307
|
+
response,
|
|
308
|
+
"CreateContactResponse",
|
|
309
|
+
);
|
|
310
|
+
}, (error: AxiosError) => {
|
|
311
|
+
if (error.response == null) {
|
|
312
|
+
reject(error);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
if (handleErrorCodeResponse(
|
|
317
|
+
reject,
|
|
318
|
+
error.response,
|
|
319
|
+
201,
|
|
320
|
+
"CreateContactResponse",
|
|
321
|
+
)) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
if (handleErrorCodeResponse(
|
|
325
|
+
reject,
|
|
326
|
+
error.response,
|
|
327
|
+
401,
|
|
328
|
+
"ErrorResult",
|
|
329
|
+
)) {
|
|
330
|
+
return;
|
|
331
|
+
}
|
|
332
|
+
if (handleErrorCodeResponse(
|
|
333
|
+
reject,
|
|
334
|
+
error.response,
|
|
335
|
+
400,
|
|
336
|
+
"ErrorResult",
|
|
337
|
+
)) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
reject(error);
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
*
|
|
349
|
+
* @summary Deletes a contact.
|
|
350
|
+
* @param id The contact id.
|
|
351
|
+
* @param options
|
|
352
|
+
*/
|
|
353
|
+
public async deleteContacts (id: string, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
354
|
+
const localVarPath = this.basePath + '/v1/contacts/delete';
|
|
355
|
+
let localVarQueryParameters: any = {};
|
|
356
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
357
|
+
const produces = ['application/json'];
|
|
358
|
+
// give precedence to 'application/json'
|
|
359
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
360
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
361
|
+
} else {
|
|
362
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
363
|
+
}
|
|
364
|
+
let localVarFormParams: any = {};
|
|
365
|
+
let localVarBodyParams: any = undefined;
|
|
366
|
+
|
|
367
|
+
// verify required parameter 'id' is not null or undefined
|
|
368
|
+
if (id === null || id === undefined) {
|
|
369
|
+
throw new Error('Required parameter id was null or undefined when calling deleteContacts.');
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (id !== undefined) {
|
|
373
|
+
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
377
|
+
|
|
378
|
+
let localVarUseFormData = false;
|
|
379
|
+
|
|
380
|
+
let data = {};
|
|
381
|
+
if (localVarUseFormData) {
|
|
382
|
+
const formData = toFormData(localVarFormParams);
|
|
383
|
+
data = formData;
|
|
384
|
+
localVarHeaderParams = {
|
|
385
|
+
...localVarHeaderParams,
|
|
386
|
+
...formData.getHeaders(),
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
391
|
+
method: 'DELETE',
|
|
392
|
+
params: localVarQueryParameters,
|
|
393
|
+
headers: localVarHeaderParams,
|
|
394
|
+
url: localVarPath,
|
|
395
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
396
|
+
maxContentLength: Infinity,
|
|
397
|
+
maxBodyLength: Infinity,
|
|
398
|
+
responseType: "json",
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
402
|
+
localVarRequestOptions.data = data;
|
|
403
|
+
}
|
|
404
|
+
let authenticationPromise = Promise.resolve();
|
|
405
|
+
|
|
406
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
407
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
408
|
+
}
|
|
409
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
410
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
411
|
+
}
|
|
412
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
413
|
+
|
|
414
|
+
let interceptorPromise = authenticationPromise;
|
|
415
|
+
for (const interceptor of this.interceptors) {
|
|
416
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return interceptorPromise.then(() => {
|
|
420
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
421
|
+
axios.request(localVarRequestOptions)
|
|
422
|
+
.then((response) => {
|
|
423
|
+
handleSuccessfulResponse(
|
|
424
|
+
resolve,
|
|
425
|
+
reject,
|
|
426
|
+
response,
|
|
427
|
+
|
|
428
|
+
);
|
|
429
|
+
}, (error: AxiosError) => {
|
|
430
|
+
if (error.response == null) {
|
|
431
|
+
reject(error);
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (handleErrorCodeResponse(
|
|
436
|
+
reject,
|
|
437
|
+
error.response,
|
|
438
|
+
401,
|
|
439
|
+
"ErrorResult",
|
|
440
|
+
)) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
if (handleErrorCodeResponse(
|
|
444
|
+
reject,
|
|
445
|
+
error.response,
|
|
446
|
+
403,
|
|
447
|
+
"ErrorResult",
|
|
448
|
+
)) {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
reject(error);
|
|
454
|
+
});
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
*
|
|
460
|
+
* @summary Get summary of the contact.
|
|
461
|
+
* @param id Contact Id.
|
|
462
|
+
* @param options
|
|
463
|
+
*/
|
|
464
|
+
public async getContact (id: string, options: optionsI = {headers: {}}) : Promise<ContactsDetails> {
|
|
465
|
+
const localVarPath = this.basePath + '/v1/contacts/get';
|
|
466
|
+
let localVarQueryParameters: any = {};
|
|
467
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
468
|
+
const produces = ['application/json'];
|
|
469
|
+
// give precedence to 'application/json'
|
|
470
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
471
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
472
|
+
} else {
|
|
473
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
474
|
+
}
|
|
475
|
+
let localVarFormParams: any = {};
|
|
476
|
+
let localVarBodyParams: any = undefined;
|
|
477
|
+
|
|
478
|
+
// verify required parameter 'id' is not null or undefined
|
|
479
|
+
if (id === null || id === undefined) {
|
|
480
|
+
throw new Error('Required parameter id was null or undefined when calling getContact.');
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (id !== undefined) {
|
|
484
|
+
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
488
|
+
|
|
489
|
+
let localVarUseFormData = false;
|
|
490
|
+
|
|
491
|
+
let data = {};
|
|
492
|
+
if (localVarUseFormData) {
|
|
493
|
+
const formData = toFormData(localVarFormParams);
|
|
494
|
+
data = formData;
|
|
495
|
+
localVarHeaderParams = {
|
|
496
|
+
...localVarHeaderParams,
|
|
497
|
+
...formData.getHeaders(),
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
502
|
+
method: 'GET',
|
|
503
|
+
params: localVarQueryParameters,
|
|
504
|
+
headers: localVarHeaderParams,
|
|
505
|
+
url: localVarPath,
|
|
506
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
507
|
+
maxContentLength: Infinity,
|
|
508
|
+
maxBodyLength: Infinity,
|
|
509
|
+
responseType: "json",
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
513
|
+
localVarRequestOptions.data = data;
|
|
514
|
+
}
|
|
515
|
+
let authenticationPromise = Promise.resolve();
|
|
516
|
+
|
|
517
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
518
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
519
|
+
}
|
|
520
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
521
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
522
|
+
}
|
|
523
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
524
|
+
|
|
525
|
+
let interceptorPromise = authenticationPromise;
|
|
526
|
+
for (const interceptor of this.interceptors) {
|
|
527
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return interceptorPromise.then(() => {
|
|
531
|
+
return new Promise<ContactsDetails>((resolve, reject) => {
|
|
532
|
+
axios.request(localVarRequestOptions)
|
|
533
|
+
.then((response) => {
|
|
534
|
+
handleSuccessfulResponse<ContactsDetails>(
|
|
535
|
+
resolve,
|
|
536
|
+
reject,
|
|
537
|
+
response,
|
|
538
|
+
"ContactsDetails",
|
|
539
|
+
);
|
|
540
|
+
}, (error: AxiosError) => {
|
|
541
|
+
if (error.response == null) {
|
|
542
|
+
reject(error);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if (handleErrorCodeResponse(
|
|
547
|
+
reject,
|
|
548
|
+
error.response,
|
|
549
|
+
200,
|
|
550
|
+
"ContactsDetails",
|
|
551
|
+
)) {
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (handleErrorCodeResponse(
|
|
555
|
+
reject,
|
|
556
|
+
error.response,
|
|
557
|
+
401,
|
|
558
|
+
"ErrorResult",
|
|
559
|
+
)) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (handleErrorCodeResponse(
|
|
563
|
+
reject,
|
|
564
|
+
error.response,
|
|
565
|
+
403,
|
|
566
|
+
"ErrorResult",
|
|
567
|
+
)) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
reject(error);
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
*
|
|
579
|
+
* @summary Update the contact.
|
|
580
|
+
* @param id The contactId.
|
|
581
|
+
* @param contactDetails The contact details.
|
|
582
|
+
* @param options
|
|
583
|
+
*/
|
|
584
|
+
public async updateContact (id?: string, contactDetails?: ContactDetails, options: optionsI = {headers: {}}) : Promise<returnTypeI> {
|
|
585
|
+
contactDetails = deserializeIfNeeded(contactDetails, "ContactDetails");
|
|
586
|
+
const localVarPath = this.basePath + '/v1/contacts/update';
|
|
587
|
+
let localVarQueryParameters: any = {};
|
|
588
|
+
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
|
589
|
+
const produces = ['application/json'];
|
|
590
|
+
// give precedence to 'application/json'
|
|
591
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
592
|
+
localVarHeaderParams['content-type'] = 'application/json';
|
|
593
|
+
} else {
|
|
594
|
+
localVarHeaderParams['content-type'] = produces.join(',');
|
|
595
|
+
}
|
|
596
|
+
let localVarFormParams: any = {};
|
|
597
|
+
let localVarBodyParams: any = undefined;
|
|
598
|
+
|
|
599
|
+
if (id !== undefined) {
|
|
600
|
+
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "string");
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
604
|
+
|
|
605
|
+
let localVarUseFormData = false;
|
|
606
|
+
|
|
607
|
+
const result = generateFormData(contactDetails, ContactDetails);
|
|
608
|
+
localVarUseFormData = result.localVarUseFormData;
|
|
609
|
+
|
|
610
|
+
let data = {};
|
|
611
|
+
if (localVarUseFormData) {
|
|
612
|
+
const formData = toFormData(result.data);
|
|
613
|
+
data = formData;
|
|
614
|
+
localVarHeaderParams = {
|
|
615
|
+
...localVarHeaderParams,
|
|
616
|
+
...formData.getHeaders(),
|
|
617
|
+
};
|
|
618
|
+
} else {
|
|
619
|
+
data = ObjectSerializer.serialize(
|
|
620
|
+
contactDetails,
|
|
621
|
+
"ContactDetails"
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
let localVarRequestOptions: AxiosRequestConfig = {
|
|
626
|
+
method: 'PUT',
|
|
627
|
+
params: localVarQueryParameters,
|
|
628
|
+
headers: localVarHeaderParams,
|
|
629
|
+
url: localVarPath,
|
|
630
|
+
paramsSerializer: this._useQuerystring ? queryParamsSerializer : undefined,
|
|
631
|
+
maxContentLength: Infinity,
|
|
632
|
+
maxBodyLength: Infinity,
|
|
633
|
+
responseType: "json",
|
|
634
|
+
};
|
|
635
|
+
|
|
636
|
+
if (localVarRequestOptions.method !== 'GET') {
|
|
637
|
+
localVarRequestOptions.data = data;
|
|
638
|
+
}
|
|
639
|
+
let authenticationPromise = Promise.resolve();
|
|
640
|
+
|
|
641
|
+
if (this.authentications["X-API-KEY"].apiKey) {
|
|
642
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["X-API-KEY"].applyToRequest(localVarRequestOptions));
|
|
643
|
+
}
|
|
644
|
+
if (this.authentications["Bearer"].apiKey) {
|
|
645
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications["Bearer"].applyToRequest(localVarRequestOptions));
|
|
646
|
+
}
|
|
647
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
648
|
+
|
|
649
|
+
let interceptorPromise = authenticationPromise;
|
|
650
|
+
for (const interceptor of this.interceptors) {
|
|
651
|
+
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
return interceptorPromise.then(() => {
|
|
655
|
+
return new Promise<returnTypeI>((resolve, reject) => {
|
|
656
|
+
axios.request(localVarRequestOptions)
|
|
657
|
+
.then((response) => {
|
|
658
|
+
handleSuccessfulResponse(
|
|
659
|
+
resolve,
|
|
660
|
+
reject,
|
|
661
|
+
response,
|
|
662
|
+
|
|
663
|
+
);
|
|
664
|
+
}, (error: AxiosError) => {
|
|
665
|
+
if (error.response == null) {
|
|
666
|
+
reject(error);
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
if (handleErrorCodeResponse(
|
|
671
|
+
reject,
|
|
672
|
+
error.response,
|
|
673
|
+
401,
|
|
674
|
+
"ErrorResult",
|
|
675
|
+
)) {
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
if (handleErrorCodeResponse(
|
|
679
|
+
reject,
|
|
680
|
+
error.response,
|
|
681
|
+
400,
|
|
682
|
+
"ErrorResult",
|
|
683
|
+
)) {
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
reject(error);
|
|
689
|
+
});
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
function deserializeIfNeeded<T> (obj: T, classname: string): T {
|
|
696
|
+
if (obj !== null && obj !== undefined && obj.constructor.name !== classname) {
|
|
697
|
+
return ObjectSerializer.deserialize(obj, classname);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
return obj;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
type AxiosResolve<T> = (
|
|
704
|
+
value: (T | PromiseLike<T>),
|
|
705
|
+
) => void
|
|
706
|
+
|
|
707
|
+
type AxiosReject = (reason?: any) => void;
|
|
708
|
+
|
|
709
|
+
function handleSuccessfulResponse<T>(
|
|
710
|
+
resolve: AxiosResolve<T>,
|
|
711
|
+
reject: AxiosReject,
|
|
712
|
+
response: AxiosResponse,
|
|
713
|
+
returnType?: string,
|
|
714
|
+
) {
|
|
715
|
+
let body = response.data;
|
|
716
|
+
|
|
717
|
+
if (
|
|
718
|
+
response.status &&
|
|
719
|
+
response.status >= 200 &&
|
|
720
|
+
response.status <= 299
|
|
721
|
+
) {
|
|
722
|
+
if (returnType) {
|
|
723
|
+
body = ObjectSerializer.deserialize(body, returnType);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
resolve(body);
|
|
727
|
+
} else {
|
|
728
|
+
reject(new HttpError(response, body, response.status));
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
function handleErrorCodeResponse(
|
|
733
|
+
reject: AxiosReject,
|
|
734
|
+
response: AxiosResponse,
|
|
735
|
+
code: number,
|
|
736
|
+
returnType: string
|
|
737
|
+
): boolean {
|
|
738
|
+
if (response.status !== code) {
|
|
739
|
+
return false;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
let body = response.data;
|
|
743
|
+
if(code === 401) {
|
|
744
|
+
body = "Unauthorized request (401): Invalid authentication.";
|
|
745
|
+
}
|
|
746
|
+
reject(new HttpError(response, body, response.status));
|
|
747
|
+
|
|
748
|
+
return true;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
function handleErrorRangeResponse(
|
|
752
|
+
reject: AxiosReject,
|
|
753
|
+
response: AxiosResponse,
|
|
754
|
+
code: string,
|
|
755
|
+
returnType: string
|
|
756
|
+
): boolean {
|
|
757
|
+
let rangeCodeLeft = Number(code[0] + "00");
|
|
758
|
+
let rangeCodeRight = Number(code[0] + "99");
|
|
759
|
+
|
|
760
|
+
if (response.status >= rangeCodeLeft && response.status <= rangeCodeRight) {
|
|
761
|
+
const body = ObjectSerializer.deserialize(
|
|
762
|
+
response.data,
|
|
763
|
+
returnType,
|
|
764
|
+
);
|
|
765
|
+
|
|
766
|
+
reject(new HttpError(response, body, response.status));
|
|
767
|
+
|
|
768
|
+
return true;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
return false;
|
|
772
|
+
}
|