├── .github ├── FUNDING.yml └── workflows │ ├── phpstan.yml │ ├── phpunit.yml │ └── vendor-check.yml ├── .gitignore ├── CHANGELOG.md ├── CONTRIBUTING.md ├── MIT-LICENSE.txt ├── Makefile ├── README.md ├── SECURITY.md ├── bin └── console ├── composer.json ├── docs └── EN │ ├── Core │ └── Auth │ │ └── auth.md │ ├── Development │ └── dev.md │ ├── Services │ └── bitrix24-php-sdk-methods.md │ └── documentation.md ├── examples ├── local-application │ ├── composer.json │ ├── index.php │ └── install.php └── webhook │ ├── composer.json │ └── example.php ├── phpstan.neon.dist ├── phpunit.xml.dist ├── rector.php ├── src ├── Application │ ├── ApplicationStatus.php │ ├── Contracts │ │ ├── ApplicationInstallations │ │ │ ├── Docs │ │ │ │ └── ApplicationInstallations.md │ │ │ ├── Entity │ │ │ │ ├── ApplicationInstallationInterface.php │ │ │ │ └── ApplicationInstallationStatus.php │ │ │ ├── Events │ │ │ │ ├── ApplicationInstallationApplicationStatusChangedEvent.php │ │ │ │ ├── ApplicationInstallationBitrix24PartnerChangedEvent.php │ │ │ │ ├── ApplicationInstallationBitrix24PartnerContactPersonChangedEvent.php │ │ │ │ ├── ApplicationInstallationBlockedEvent.php │ │ │ │ ├── ApplicationInstallationContactPersonChangedEvent.php │ │ │ │ ├── ApplicationInstallationCreatedEvent.php │ │ │ │ ├── ApplicationInstallationExternalIdChangedEvent.php │ │ │ │ ├── ApplicationInstallationFinishedEvent.php │ │ │ │ ├── ApplicationInstallationPortalLicenseFamilyChangedEvent.php │ │ │ │ ├── ApplicationInstallationPortalUsersCountChangedEvent.php │ │ │ │ ├── ApplicationInstallationUnblockedEvent.php │ │ │ │ └── ApplicationInstallationUninstalledEvent.php │ │ │ ├── Exceptions │ │ │ │ └── ApplicationInstallationNotFoundException.php │ │ │ └── Repository │ │ │ │ └── ApplicationInstallationRepositoryInterface.php │ │ ├── Bitrix24Accounts │ │ │ ├── Docs │ │ │ │ └── Bitrix24Accounts.md │ │ │ ├── Entity │ │ │ │ ├── Bitrix24AccountInterface.php │ │ │ │ └── Bitrix24AccountStatus.php │ │ │ ├── Events │ │ │ │ ├── Bitrix24AccountApplicationInstalledEvent.php │ │ │ │ ├── Bitrix24AccountApplicationUninstalledEvent.php │ │ │ │ ├── Bitrix24AccountApplicationVersionUpdatedEvent.php │ │ │ │ ├── Bitrix24AccountBlockedEvent.php │ │ │ │ ├── Bitrix24AccountCreatedEvent.php │ │ │ │ ├── Bitrix24AccountDeletedEvent.php │ │ │ │ ├── Bitrix24AccountDomainUrlChangedEvent.php │ │ │ │ └── Bitrix24AccountUnblockedEvent.php │ │ │ ├── Exceptions │ │ │ │ └── Bitrix24AccountNotFoundException.php │ │ │ └── Repository │ │ │ │ └── Bitrix24AccountRepositoryInterface.php │ │ ├── Bitrix24Partners │ │ │ ├── Docs │ │ │ │ └── Bitrix24Partners.md │ │ │ ├── Entity │ │ │ │ ├── Bitrix24PartnerInterface.php │ │ │ │ └── Bitrix24PartnerStatus.php │ │ │ ├── Events │ │ │ │ ├── Bitrix24PartnerBlockedEvent.php │ │ │ │ ├── Bitrix24PartnerCreatedEvent.php │ │ │ │ ├── Bitrix24PartnerDeletedEvent.php │ │ │ │ ├── Bitrix24PartnerEmailChangedEvent.php │ │ │ │ ├── Bitrix24PartnerExternalIdChangedEvent.php │ │ │ │ ├── Bitrix24PartnerOpenLineIdChangedEvent.php │ │ │ │ ├── Bitrix24PartnerPartnerIdChangedEvent.php │ │ │ │ ├── Bitrix24PartnerPhoneChangedEvent.php │ │ │ │ ├── Bitrix24PartnerSiteChangedEvent.php │ │ │ │ ├── Bitrix24PartnerTitleChangedEvent.php │ │ │ │ └── Bitrix24PartnerUnblockedEvent.php │ │ │ ├── Exceptions │ │ │ │ └── Bitrix24PartnerNotFoundException.php │ │ │ └── Repository │ │ │ │ └── Bitrix24PartnerRepositoryInterface.php │ │ ├── ContactPersons │ │ │ ├── Docs │ │ │ │ └── ContactPersons.md │ │ │ ├── Entity │ │ │ │ ├── ContactPersonInterface.php │ │ │ │ ├── ContactPersonStatus.php │ │ │ │ └── FullName.php │ │ │ ├── Events │ │ │ │ ├── ContactPersonBlockedEvent.php │ │ │ │ ├── ContactPersonCreatedEvent.php │ │ │ │ ├── ContactPersonDeletedEvent.php │ │ │ │ ├── ContactPersonEmailChangedEvent.php │ │ │ │ ├── ContactPersonEmailVerifiedEvent.php │ │ │ │ ├── ContactPersonFullNameChangedEvent.php │ │ │ │ ├── ContactPersonLinkedToExternalEntityEvent.php │ │ │ │ ├── ContactPersonMobilePhoneChangedEvent.php │ │ │ │ ├── ContactPersonMobilePhoneVerifiedEvent.php │ │ │ │ └── ContactPersonUnblockedEvent.php │ │ │ ├── Exceptions │ │ │ │ └── ContactPersonNotFoundException.php │ │ │ └── Repository │ │ │ │ └── ContactPersonRepositoryInterface.php │ │ └── Events │ │ │ └── AggregateRootEventsEmitterInterface.php │ ├── PortalLicenseFamily.php │ └── Requests │ │ ├── AbstractRequest.php │ │ ├── Events │ │ ├── AbstractEventRequest.php │ │ ├── EventAuthItem.php │ │ ├── EventInterface.php │ │ ├── OnApplicationInstall │ │ │ ├── ApplicationData.php │ │ │ └── OnApplicationInstall.php │ │ └── OnApplicationUninstall │ │ │ ├── ApplicationData.php │ │ │ └── OnApplicationUninstall.php │ │ └── Placement │ │ └── PlacementRequest.php ├── Attributes │ ├── ApiBatchMethodMetadata.php │ ├── ApiBatchServiceMetadata.php │ ├── ApiEndpointMetadata.php │ ├── ApiServiceMetadata.php │ └── Services │ │ └── AttributesParser.php ├── Core │ ├── ApiClient.php │ ├── ApiLevelErrorHandler.php │ ├── Batch.php │ ├── BulkItemsReader │ │ ├── BulkItemsReader.php │ │ ├── BulkItemsReaderBuilder.php │ │ └── ReadStrategies │ │ │ ├── FilterWithBatchWithoutCountOrder.php │ │ │ └── FilterWithoutBatchWithoutCountOrder.php │ ├── Commands │ │ ├── Command.php │ │ └── CommandCollection.php │ ├── Contracts │ │ ├── AddedItemIdResultInterface.php │ │ ├── ApiClientInterface.php │ │ ├── BatchOperationsInterface.php │ │ ├── BulkItemsReaderInterface.php │ │ ├── CoreInterface.php │ │ ├── DeletedItemResultInterface.php │ │ └── UpdatedItemResultInterface.php │ ├── Core.php │ ├── CoreBuilder.php │ ├── Credentials │ │ ├── ApplicationProfile.php │ │ ├── AuthToken.php │ │ ├── Credentials.php │ │ ├── Endpoints.php │ │ ├── Scope.php │ │ └── WebhookUrl.php │ ├── Exceptions │ │ ├── AuthForbiddenException.php │ │ ├── BaseException.php │ │ ├── FileNotFoundException.php │ │ ├── ImmutableResultViolationException.php │ │ ├── InvalidArgumentException.php │ │ ├── MethodConfirmWaitingException.php │ │ ├── MethodNotFoundException.php │ │ ├── OperationTimeLimitExceededException.php │ │ ├── QueryLimitExceededException.php │ │ ├── TransportException.php │ │ ├── UnknownScopeCodeException.php │ │ ├── UserNotFoundOrIsNotActiveException.php │ │ └── WrongAuthTypeException.php │ ├── Fields │ │ └── FieldsFilter.php │ ├── Response │ │ ├── DTO │ │ │ ├── Pagination.php │ │ │ ├── RenewedAuthToken.php │ │ │ ├── ResponseData.php │ │ │ └── Time.php │ │ └── Response.php │ └── Result │ │ ├── AbstractItem.php │ │ ├── AbstractResult.php │ │ ├── AddedItemBatchResult.php │ │ ├── AddedItemResult.php │ │ ├── DeletedItemBatchResult.php │ │ ├── DeletedItemResult.php │ │ ├── EmptyResult.php │ │ ├── FieldsResult.php │ │ ├── UpdatedItemBatchResult.php │ │ ├── UpdatedItemResult.php │ │ └── UserInterfaceDialogCallResult.php ├── Events │ ├── AuthTokenRenewedEvent.php │ └── PortalDomainUrlChangedEvent.php ├── Infrastructure │ ├── Console │ │ └── Commands │ │ │ └── GenerateCoverageDocumentationCommand.php │ ├── Filesystem │ │ └── Base64Encoder.php │ └── HttpClient │ │ ├── RequestId │ │ ├── DefaultRequestIdGenerator.php │ │ └── RequestIdGeneratorInterface.php │ │ └── TransportLayer │ │ ├── NetworkTimingsParser.php │ │ └── ResponseInfoParser.php └── Services │ ├── AbstractBatchService.php │ ├── AbstractService.php │ ├── AbstractServiceBuilder.php │ ├── CRM │ ├── Activity │ │ ├── ActivityContentType.php │ │ ├── ActivityDirectionType.php │ │ ├── ActivityFetcherBuilder.php │ │ ├── ActivityNotifyType.php │ │ ├── ActivityPriority.php │ │ ├── ActivityStatus.php │ │ ├── ActivityType.php │ │ ├── ReadModel │ │ │ ├── EmailFetcher.php │ │ │ ├── OpenLineFetcher.php │ │ │ ├── VoximplantFetcher.php │ │ │ └── WebFormFetcher.php │ │ ├── Result │ │ │ ├── ActivitiesResult.php │ │ │ ├── ActivityItemResult.php │ │ │ ├── ActivityResult.php │ │ │ ├── Email │ │ │ │ ├── EmailActivityItemResult.php │ │ │ │ ├── EmailMeta.php │ │ │ │ └── EmailSettings.php │ │ │ ├── OpenLine │ │ │ │ ├── OpenLineActivityItemResult.php │ │ │ │ └── OpenLineProviderParams.php │ │ │ └── WebForm │ │ │ │ ├── VisitedPageItem.php │ │ │ │ ├── WebFormActivityItemResult.php │ │ │ │ ├── WebFormFieldItem.php │ │ │ │ ├── WebFormMetadata.php │ │ │ │ └── WebFormProviderParams.php │ │ └── Service │ │ │ ├── Activity.php │ │ │ └── Batch.php │ ├── CRMServiceBuilder.php │ ├── Common │ │ └── Result │ │ │ ├── AbstractCrmItem.php │ │ │ ├── DiscountType.php │ │ │ └── SystemFields │ │ │ └── Types │ │ │ ├── Email.php │ │ │ ├── EmailValueType.php │ │ │ ├── InstantMessenger.php │ │ │ ├── InstantMessengerValueType.php │ │ │ ├── Phone.php │ │ │ ├── PhoneValueType.php │ │ │ ├── Website.php │ │ │ └── WebsiteValueType.php │ ├── Contact │ │ ├── Result │ │ │ ├── ContactItemResult.php │ │ │ ├── ContactResult.php │ │ │ ├── ContactUserfieldItemResult.php │ │ │ ├── ContactUserfieldResult.php │ │ │ ├── ContactUserfieldsResult.php │ │ │ └── ContactsResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ ├── Contact.php │ │ │ └── ContactUserfield.php │ ├── Deal │ │ ├── DealStageSemanticId.php │ │ ├── Result │ │ │ ├── DealCategoriesResult.php │ │ │ ├── DealCategoryItemResult.php │ │ │ ├── DealCategoryResult.php │ │ │ ├── DealCategoryStageItemResult.php │ │ │ ├── DealCategoryStagesResult.php │ │ │ ├── DealCategoryStatusResult.php │ │ │ ├── DealContactItemResult.php │ │ │ ├── DealContactItemsResult.php │ │ │ ├── DealItemResult.php │ │ │ ├── DealProductRowItemResult.php │ │ │ ├── DealProductRowItemsResult.php │ │ │ ├── DealResult.php │ │ │ ├── DealSemanticStage.php │ │ │ ├── DealUserfieldItemResult.php │ │ │ ├── DealUserfieldResult.php │ │ │ ├── DealUserfieldsResult.php │ │ │ └── DealsResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ ├── Deal.php │ │ │ ├── DealCategory.php │ │ │ ├── DealCategoryStage.php │ │ │ ├── DealContact.php │ │ │ ├── DealProductRows.php │ │ │ └── DealUserfield.php │ ├── Duplicates │ │ ├── Result │ │ │ └── DuplicateResult.php │ │ └── Service │ │ │ ├── Duplicate.php │ │ │ └── EntityType.php │ ├── Item │ │ ├── Result │ │ │ ├── ItemItemResult.php │ │ │ ├── ItemResult.php │ │ │ └── ItemsResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Item.php │ ├── Lead │ │ ├── Result │ │ │ ├── LeadItemResult.php │ │ │ ├── LeadResult.php │ │ │ └── LeadsResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Lead.php │ ├── Product │ │ ├── Result │ │ │ ├── ProductItemResult.php │ │ │ ├── ProductResult.php │ │ │ └── ProductsResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Product.php │ ├── Settings │ │ ├── Result │ │ │ └── SettingsModeResult.php │ │ └── Service │ │ │ └── Settings.php │ └── Userfield │ │ ├── Exceptions │ │ ├── UserfieldNameIsTooLongException.php │ │ └── UserfieldNotFoundException.php │ │ ├── Result │ │ ├── AbstractUserfieldItemResult.php │ │ ├── UserfieldTypeItemResult.php │ │ └── UserfieldTypesResult.php │ │ └── Service │ │ └── Userfield.php │ ├── Catalog │ ├── Catalog │ │ ├── Result │ │ │ ├── CatalogItemResult.php │ │ │ ├── CatalogResult.php │ │ │ └── CatalogsResult.php │ │ └── Service │ │ │ └── Catalog.php │ ├── CatalogServiceBuilder.php │ ├── Common │ │ ├── ProductType.php │ │ └── Result │ │ │ └── AbstractCatalogItem.php │ └── Product │ │ ├── Result │ │ ├── ProductItemResult.php │ │ ├── ProductResult.php │ │ └── ProductsResult.php │ │ └── Service │ │ ├── Batch.php │ │ └── Product.php │ ├── IM │ ├── IMServiceBuilder.php │ └── Notify │ │ └── Service │ │ └── Notify.php │ ├── IMOpenLines │ ├── IMOpenLinesServiceBuilder.php │ ├── Result │ │ ├── AddedMessageItemResult.php │ │ └── JoinOpenLineResult.php │ └── Service │ │ └── Network.php │ ├── Main │ ├── Common │ │ └── EventHandlerMetadata.php │ ├── MainServiceBuilder.php │ ├── Result │ │ ├── ApplicationInfoItemResult.php │ │ ├── ApplicationInfoResult.php │ │ ├── EventHandlerBindResult.php │ │ ├── EventHandlerItemResult.php │ │ ├── EventHandlerUnbindResult.php │ │ ├── EventHandlersResult.php │ │ ├── EventListResult.php │ │ ├── IsUserAdminResult.php │ │ ├── MethodAffordabilityResult.php │ │ ├── ServerTimeResult.php │ │ ├── UserProfileItemResult.php │ │ └── UserProfileResult.php │ └── Service │ │ ├── Event.php │ │ ├── EventManager.php │ │ └── Main.php │ ├── Placement │ ├── PlacementServiceBuilder.php │ ├── Result │ │ ├── DeleteUserTypeResult.php │ │ ├── PlacementBindResult.php │ │ ├── PlacementLocationCodesResult.php │ │ ├── PlacementLocationItemResult.php │ │ ├── PlacementUnbindResult.php │ │ ├── PlacementsLocationInformationResult.php │ │ ├── RegisterUserTypeResult.php │ │ ├── UserFieldTypeItemResult.php │ │ └── UserFieldTypesResult.php │ └── Service │ │ ├── Placement.php │ │ ├── PlacementLocationCode.php │ │ └── UserFieldType.php │ ├── ServiceBuilder.php │ ├── ServiceBuilderFactory.php │ ├── Telephony │ ├── Call │ │ ├── Result │ │ │ ├── TranscriptAttachItemResult.php │ │ │ └── TranscriptAttachedResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Call.php │ ├── Common │ │ ├── CallFailedCode.php │ │ ├── CallType.php │ │ ├── CrmEntity.php │ │ ├── CrmEntityType.php │ │ ├── PbxType.php │ │ ├── SipRegistrationStatus.php │ │ ├── TelephonyCallStatusCode.php │ │ ├── TranscriptMessage.php │ │ └── TranscriptMessageSide.php │ ├── Events │ │ ├── OnExternalCallBackStart │ │ │ ├── OnExternalCallBackStart.php │ │ │ └── OnExternalCallBackStartEventPayload.php │ │ ├── OnExternalCallStart │ │ │ ├── OnExternalCallStart.php │ │ │ └── OnExternalCallStartEventPayload.php │ │ ├── OnVoximplantCallEnd │ │ │ ├── OnVoximplantCallEnd.php │ │ │ └── OnVoximplantCallEndEventPayload.php │ │ ├── OnVoximplantCallInit │ │ │ ├── OnVoximplantCallInit.php │ │ │ └── OnVoximplantCallInitEventPayload.php │ │ ├── OnVoximplantCallStart │ │ │ ├── OnVoximplantCallStart.php │ │ │ └── OnVoximplantCallStartEventPayload.php │ │ └── TelephonyEventsFabric.php │ ├── ExternalCall │ │ ├── Result │ │ │ ├── CallRecordFileUploadedItemResult.php │ │ │ ├── CallRecordFileUploadedResult.php │ │ │ ├── CallRecordUploadUrlItemResult.php │ │ │ ├── CallRecordUploadUrlResult.php │ │ │ ├── ExternalCallFinishedItemResult.php │ │ │ ├── ExternalCallFinishedResult.php │ │ │ ├── ExternalCallRegisteredItemResult.php │ │ │ ├── ExternalCallRegisteredResult.php │ │ │ ├── SearchCrmEntitiesItemResult.php │ │ │ ├── SearchCrmEntitiesResult.php │ │ │ └── UserDigestItemResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── ExternalCall.php │ ├── ExternalLine │ │ ├── Result │ │ │ ├── ExternalLineAddItemResult.php │ │ │ ├── ExternalLineAddedResult.php │ │ │ ├── ExternalLineItemResult.php │ │ │ └── ExternalLinesResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── ExternalLine.php │ ├── TelephonyServiceBuilder.php │ └── Voximplant │ │ ├── InfoCall │ │ ├── Result │ │ │ ├── VoximplantInfoCallItemResult.php │ │ │ └── VoximplantInfoCallResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── InfoCall.php │ │ ├── Line │ │ ├── Result │ │ │ ├── VoximplantLineIdItemResult.php │ │ │ ├── VoximplantLineIdResult.php │ │ │ ├── VoximplantLineItemResult.php │ │ │ └── VoximplantLinesResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Line.php │ │ ├── Sip │ │ ├── Result │ │ │ ├── SipConnectorStatusItemResult.php │ │ │ ├── SipConnectorStatusResult.php │ │ │ ├── SipLineAddedResult.php │ │ │ ├── SipLineItemResult.php │ │ │ ├── SipLineStatusItemResult.php │ │ │ ├── SipLineStatusResult.php │ │ │ └── SipLinesResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Sip.php │ │ ├── TTS │ │ └── Voices │ │ │ ├── Result │ │ │ ├── VoximplantVoiceItemResult.php │ │ │ └── VoximplantVoicesResult.php │ │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Voices.php │ │ ├── Url │ │ ├── Result │ │ │ ├── VoximplantPagesItemResult.php │ │ │ └── VoximplantPagesResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── Url.php │ │ ├── User │ │ ├── Result │ │ │ ├── VoximplantUserSettingsItemResult.php │ │ │ └── VoximplantUserSettingsResult.php │ │ └── Service │ │ │ ├── Batch.php │ │ │ └── User.php │ │ └── VoximplantServiceBuilder.php │ ├── User │ ├── Result │ │ ├── UserItemResult.php │ │ ├── UserResult.php │ │ └── UsersResult.php │ ├── Service │ │ └── User.php │ └── UserServiceBuilder.php │ ├── UserConsent │ ├── Result │ │ ├── UserConsentAgreementItemResult.php │ │ ├── UserConsentAgreementResult.php │ │ ├── UserConsentAgreementTextItemResult.php │ │ ├── UserConsentAgreementTextResult.php │ │ └── UserConsentAgreementsResult.php │ ├── Service │ │ ├── UserConsent.php │ │ └── UserConsentAgreement.php │ └── UserConsentServiceBuilder.php │ └── Workflows │ ├── Activity │ ├── Result │ │ ├── AddedActivityResult.php │ │ ├── AddedMessageToLogResult.php │ │ ├── UpdateActivityResult.php │ │ └── WorkflowActivitiesResult.php │ └── Service │ │ ├── Activity.php │ │ └── Batch.php │ ├── Common │ ├── Auth.php │ ├── DocumentType.php │ ├── WorkflowAutoExecutionType.php │ ├── WorkflowDocumentId.php │ ├── WorkflowDocumentType.php │ ├── WorkflowPropertyType.php │ ├── WorkflowTaskActivityType.php │ ├── WorkflowTaskCompleteStatusType.php │ ├── WorkflowTaskStatusType.php │ └── WorkflowTaskUserStatusType.php │ ├── Event │ ├── Result │ │ └── EventSendResult.php │ └── Service │ │ ├── Batch.php │ │ └── Event.php │ ├── Exceptions │ ├── ActivityOrRobotAlreadyInstalledException.php │ ├── ActivityOrRobotValidationFailureException.php │ └── WorkflowTaskAlreadyCompletedException.php │ ├── Robot │ ├── Request │ │ └── IncomingRobotRequest.php │ ├── Result │ │ ├── AddedRobotResult.php │ │ ├── UpdateRobotResult.php │ │ └── WorkflowRobotsResult.php │ └── Service │ │ └── Robot.php │ ├── Task │ ├── Result │ │ ├── WorkflowTaskCompleteResult.php │ │ ├── WorkflowTaskItemResult.php │ │ └── WorkflowTasksResult.php │ └── Service │ │ ├── Batch.php │ │ └── Task.php │ ├── Template │ ├── Result │ │ ├── WorkflowTemplateItemResult.php │ │ └── WorkflowTemplatesResult.php │ └── Service │ │ ├── Batch.php │ │ └── Template.php │ ├── Workflow │ ├── Request │ │ └── IncomingWorkflowRequest.php │ ├── Result │ │ ├── WorkflowInstanceItemResult.php │ │ ├── WorkflowInstanceStartResult.php │ │ ├── WorkflowInstancesResult.php │ │ ├── WorkflowKillResult.php │ │ └── WorkflowTerminationResult.php │ └── Service │ │ ├── Batch.php │ │ └── Workflow.php │ └── WorkflowsServiceBuilder.php ├── tests ├── .env ├── Application │ └── Contracts │ │ ├── ApplicationInstallations │ │ ├── Entity │ │ │ └── ApplicationInstallationInterfaceTest.php │ │ └── Repository │ │ │ └── ApplicationInstallationRepositoryInterfaceTest.php │ │ ├── Bitrix24Accounts │ │ ├── Entity │ │ │ └── Bitrix24AccountInterfaceTest.php │ │ └── Repository │ │ │ └── Bitrix24AccountRepositoryInterfaceTest.php │ │ ├── Bitrix24Partners │ │ ├── Entity │ │ │ └── Bitrix24PartnerInterfaceTest.php │ │ └── Repository │ │ │ └── Bitrix24PartnerRepositoryInterfaceTest.php │ │ └── ContactPersons │ │ ├── Entity │ │ └── ContactPersonInterfaceTest.php │ │ └── Repository │ │ └── ContactPersonRepositoryInterfaceTest.php ├── ApplicationBridge │ ├── .env │ ├── ApplicationCredentialsProvider.php │ ├── AuthTokenFileStorage.php │ ├── AuthTokenRepositoryInterface.php │ ├── index.php │ └── install.php ├── Builders │ ├── DemoDataGenerator.php │ └── Services │ │ └── CRM │ │ ├── PhoneCollectionBuilder.php │ │ └── PhoneNumberBuilder.php ├── CustomAssertions │ └── CustomBitrix24Assertions.php ├── Integration │ ├── Core │ │ ├── BatchGetTraversableTest.php │ │ ├── BatchTest.php │ │ ├── BulkItemsReader │ │ │ └── ReadStrategies │ │ │ │ ├── FilterWithBatchWithoutCountOrderTest.php │ │ │ │ └── FilterWithoutBatchWithoutCountOrderTest.php │ │ └── CoreTest.php │ ├── Fabric.php │ └── Services │ │ ├── CRM │ │ ├── Activity │ │ │ ├── ReadModel │ │ │ │ ├── EmailFetcherTest.php │ │ │ │ ├── OpenLineFetcherTest.php │ │ │ │ ├── VoximplantFetcherTest.php │ │ │ │ └── WebFormFetcherTest.php │ │ │ └── Service │ │ │ │ ├── ActivityTest.php │ │ │ │ └── BatchTest.php │ │ ├── Contact │ │ │ └── Service │ │ │ │ ├── ContactBatchTest.php │ │ │ │ ├── ContactTest.php │ │ │ │ ├── ContactUserfieldTest.php │ │ │ │ └── ContactUserfieldUseCaseTest.php │ │ ├── Deal │ │ │ └── Service │ │ │ │ ├── BatchTest.php │ │ │ │ ├── DealCategoryStageTest.php │ │ │ │ ├── DealCategoryTest.php │ │ │ │ ├── DealContactTest.php │ │ │ │ ├── DealProductRowsTest.php │ │ │ │ ├── DealTest.php │ │ │ │ ├── DealUserfieldTest.php │ │ │ │ └── DealUserfieldUseCaseTest.php │ │ ├── Duplicates │ │ │ └── Service │ │ │ │ └── DuplicateTest.php │ │ ├── Lead │ │ │ └── Service │ │ │ │ ├── BatchTest.php │ │ │ │ └── LeadTest.php │ │ ├── Products │ │ │ └── Service │ │ │ │ └── ProductsTest.php │ │ └── Userfield │ │ │ └── Service │ │ │ └── UserfieldTest.php │ │ ├── Catalog │ │ ├── Catalog │ │ │ └── Service │ │ │ │ └── CatalogTest.php │ │ └── Product │ │ │ └── Service │ │ │ └── ProductTest.php │ │ ├── IM │ │ └── Service │ │ │ └── NotifyTest.php │ │ ├── IMOpenLines │ │ └── Service │ │ │ └── NetworkTest.php │ │ ├── Main │ │ └── Service │ │ │ └── MainTest.php │ │ ├── Placement │ │ └── Service │ │ │ └── PlacementTest.php │ │ ├── Telephony │ │ ├── Call │ │ │ └── Service │ │ │ │ └── CallTest.php │ │ ├── ExternalCall │ │ │ └── Service │ │ │ │ └── ExternalCallTest.php │ │ ├── ExternalLine │ │ │ └── Service │ │ │ │ └── ExternalLineTest.php │ │ ├── Voximplant │ │ │ ├── InfoCall │ │ │ │ └── Service │ │ │ │ │ └── InfoCallTest.php │ │ │ ├── Line │ │ │ │ └── Service │ │ │ │ │ └── LineTest.php │ │ │ ├── Sip │ │ │ │ └── SipTest.php │ │ │ ├── TTS │ │ │ │ └── Voices │ │ │ │ │ └── Service │ │ │ │ │ └── VoicesTest.php │ │ │ ├── Url │ │ │ │ └── Service │ │ │ │ │ └── UrlTest.php │ │ │ └── User │ │ │ │ └── UserTest.php │ │ └── call-record-test.mp3 │ │ ├── User │ │ └── Service │ │ │ └── UserTest.php │ │ └── UserConsent │ │ └── Service │ │ ├── UserConsentAgreementTest.php │ │ └── UserConsentTest.php ├── Temp │ └── OperatingTimingTest.php ├── Unit │ ├── Application │ │ ├── ApplicationStatusTest.php │ │ └── Contracts │ │ │ ├── ApplicationInstallations │ │ │ ├── Entity │ │ │ │ ├── ApplicationInstallationInterfaceReferenceImplementationTest.php │ │ │ │ └── ApplicationInstallationReferenceEntityImplementation.php │ │ │ └── Repository │ │ │ │ ├── InMemoryApplicationInstallationRepositoryImplementation.php │ │ │ │ └── InMemoryApplicationInstallationRepositoryImplementationTest.php │ │ │ ├── Bitrix24Accounts │ │ │ ├── Entity │ │ │ │ ├── Bitrix24AccountInterfaceReferenceImplementationTest.php │ │ │ │ └── Bitrix24AccountReferenceEntityImplementation.php │ │ │ └── Repository │ │ │ │ ├── InMemoryBitrix24AccountRepositoryImplementation.php │ │ │ │ └── InMemoryBitrix24AccountRepositoryImplementationTest.php │ │ │ ├── Bitrix24Partners │ │ │ ├── Entity │ │ │ │ ├── Bitrix24PartnerInterfaceReferenceImplementationTest.php │ │ │ │ └── Bitrix24PartnerReferenceEntityImplementation.php │ │ │ └── Repository │ │ │ │ ├── InMemoryBitrix24PartnerRepositoryImplementation.php │ │ │ │ └── InMemoryBitrix24PartnerRepositoryImplementationTest.php │ │ │ └── ContactPersons │ │ │ ├── Entity │ │ │ ├── ContactPersonInterfaceReferenceImplementationTest.php │ │ │ └── ContactPersonReferenceEntityImplementation.php │ │ │ └── Repository │ │ │ ├── InMemoryContactPersonRepositoryImplementation.php │ │ │ └── InMemoryContactPersonRepositoryImplementationTest.php │ ├── Core │ │ ├── ApiLevelErrorHandlerTest.php │ │ ├── CoreBuilderTest.php │ │ ├── Credentials │ │ │ ├── ApplicationProfileTest.php │ │ │ ├── CredentialsTest.php │ │ │ ├── ScopeTest.php │ │ │ └── WebhookUrlTest.php │ │ ├── Response │ │ │ └── DTO │ │ │ │ └── TimeTest.php │ │ └── Result │ │ │ └── AbstractItemTest.php │ ├── Infrastructure │ │ └── HttpClient │ │ │ └── RequestId │ │ │ └── DefaultRequestIdGeneratorTest.php │ ├── Services │ │ ├── CRM │ │ │ └── CRMServiceBuilderTest.php │ │ ├── IM │ │ │ └── IMServiceBuilderTest.php │ │ ├── Main │ │ │ └── MainServiceBuilderTest.php │ │ └── ServiceBuilderTest.php │ └── Stubs │ │ ├── NullBatch.php │ │ ├── NullBulkItemsReader.php │ │ └── NullCore.php └── bootstrap.php └── tools ├── .env └── Commands ├── CopyPropertyValues.php ├── GenerateContactsCommand.php ├── PerformanceBenchmarks └── ListCommand.php └── ShowFieldsDescriptionCommand.php /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://boosty.to/bitrix24-php-sdk"] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea* 2 | /app 3 | vendor 4 | composer.phar 5 | composer.lock 6 | .phpunit.result.cache 7 | tools/.env.local 8 | tools/logs 9 | tests/ApplicationBridge/auth.json 10 | examples/logs 11 | *.log 12 | .env.local -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | | Version | Supported | 6 | | ------- | ------------------ | 7 | | 2.x | :white_check_mark: | 8 | | 1.x | :x: | 9 | | 0.x | :x: | 10 | 11 | ## Reporting a Vulnerability 12 | Create issue with vulnerability details -------------------------------------------------------------------------------- /docs/EN/Development/dev.md: -------------------------------------------------------------------------------- 1 | # How to build bitrix24-php-sdk 2 | 3 | ## How to rebuild documentation 4 | 5 | Use cli-command 6 | 7 | ```shell 8 | make build-documentation 9 | ``` 10 | 11 | ## How to add new scope 12 | 13 | 1. Add new scope in scope enum `src/Core/Credentials/Scope.php`. 14 | 2. Add new scope folder in `src/Services/` folder and add services. 15 | 3. Add new integration tests in mirror scope folder in `tests/Integration/Services`. 16 | 4. Add new scope support in phpunit `phpunit.xml.dist` testsuite list 17 | 5. Add new scope support in `Makefile` -------------------------------------------------------------------------------- /examples/local-application/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mesilov/bitrix24-php-sdk-webhook-example", 3 | "description": "Example for work with bitrix24-php-sdk via webhook", 4 | "minimum-stability": "stable", 5 | "license": "proprietary", 6 | "authors": [ 7 | { 8 | "name": "Maksim Mesilov", 9 | "email": "mesilov.maxim@gmail.com" 10 | } 11 | ], 12 | "require": { 13 | "mesilov/bitrix24-php-sdk": "dev-feature/390-prepare-publish-2-0", 14 | "monolog/monolog": "^3", 15 | "symfony/dotenv": "^7" 16 | }, 17 | "require-dev": { 18 | "roave/security-advisories": "dev-latest" 19 | } 20 | } -------------------------------------------------------------------------------- /examples/local-application/install.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | ?> 14 |
15 | Application installation started, tokens from Bitrix24: 16 | = print_r($_REQUEST, true) ?> 17 |18 | 19 | -------------------------------------------------------------------------------- /examples/webhook/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mesilov/bitrix24-php-sdk-webhook-example", 3 | "description": "Example for work with bitrix24-php-sdk via webhook", 4 | "minimum-stability": "stable", 5 | "license": "proprietary", 6 | "authors": [ 7 | { 8 | "name": "Maksim Mesilov", 9 | "email": "mesilov.maxim@gmail.com" 10 | } 11 | ], 12 | "require": { 13 | "mesilov/bitrix24-php-sdk": "dev-feature/390-prepare-publish-2-0", 14 | "monolog/monolog": "^3", 15 | "symfony/dotenv": "^7" 16 | }, 17 | "require-dev": { 18 | "roave/security-advisories": "dev-latest" 19 | } 20 | } -------------------------------------------------------------------------------- /phpstan.neon.dist: -------------------------------------------------------------------------------- 1 | parameters: 2 | level: 5 3 | paths: 4 | - src/ 5 | - tests/Unit/ 6 | - tests/Integration/Services/Telephony 7 | - tests/Integration/Services/User 8 | - tests/Integration/Services/UserConsent 9 | - tests/Integration/Services/IM 10 | - tests/Integration/Services/Catalog 11 | - tests/Integration/Services/IMOpenLines 12 | - tests/Integration/Services/Main 13 | - tests/Integration/Services/Placement 14 | bootstrapFiles: 15 | - tests/bootstrap.php 16 | parallel: 17 | jobSize: 20 18 | maximumNumberOfProcesses: 8 19 | minimumNumberOfJobsPerProcess: 2 20 | editorUrlTitle: '%%relFile%%:%%line%%' 21 | editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%' 22 | treatPhpDocTypesAsCertain: false 23 | -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Entity/ApplicationInstallationStatus.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Entity; 16 | 17 | enum ApplicationInstallationStatus: string 18 | { 19 | case new = 'new'; // started the installation procedure, but have not yet finalized, there is no “installation completed” 20 | case active = 'active'; // active portal, there is a connection to B24 21 | case deleted = 'deleted'; // the app has been removed from the portal 22 | case blocked = 'blocked'; // lost connection with the portal or the developer forcibly deactivated the account 23 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Events/ApplicationInstallationApplicationStatusChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Events; 15 | 16 | use Bitrix24\SDK\Application\ApplicationStatus; 17 | use Carbon\CarbonImmutable; 18 | use Symfony\Component\Uid\Uuid; 19 | use Symfony\Contracts\EventDispatcher\Event; 20 | 21 | class ApplicationInstallationApplicationStatusChangedEvent extends Event 22 | { 23 | public function __construct( 24 | public readonly Uuid $applicationInstallationId, 25 | public readonly CarbonImmutable $timestamp, 26 | public readonly ApplicationStatus $applicationStatus) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Events/ApplicationInstallationBlockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ApplicationInstallationBlockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $applicationInstallationId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $comment) 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Events/ApplicationInstallationCreatedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ApplicationInstallationCreatedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $applicationInstallationId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly Uuid $bitrix24AccountId) 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Events/ApplicationInstallationExternalIdChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ApplicationInstallationExternalIdChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $applicationInstallationId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $previousExternalId, 26 | public readonly ?string $currentExternalId) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Events/ApplicationInstallationUnblockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ApplicationInstallationUnblockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $applicationInstallationId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $comment) 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ApplicationInstallations/Exceptions/ApplicationInstallationNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ApplicationInstallations\Exceptions; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | class ApplicationInstallationNotFoundException extends BaseException 19 | { 20 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Entity/Bitrix24AccountStatus.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity; 15 | 16 | enum Bitrix24AccountStatus: string 17 | { 18 | case new = 'new'; // started the installation procedure, but have not yet finalized, there is no “installation completed” 19 | case active = 'active'; // active portal, there is a connection to B24 20 | case deleted = 'deleted'; // the app has been removed from the portal 21 | case blocked = 'blocked'; // lost connection with the portal or the developer forcibly deactivated the account 22 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountApplicationInstalledEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountApplicationInstalledEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountApplicationUninstalledEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountApplicationUninstalledEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp 25 | ) 26 | { 27 | } 28 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountApplicationVersionUpdatedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountApplicationVersionUpdatedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountBlockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountBlockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountCreatedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountCreatedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountDeletedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountDeletedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountDomainUrlChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountDomainUrlChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Events/Bitrix24AccountUnblockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24AccountUnblockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24AccountId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Accounts/Exceptions/Bitrix24AccountNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Exceptions; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | class Bitrix24AccountNotFoundException extends BaseException 19 | { 20 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Entity/Bitrix24PartnerStatus.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Entity; 15 | 16 | enum Bitrix24PartnerStatus: string 17 | { 18 | case active = 'active'; // active bitrix24 partner 19 | case deleted = 'deleted'; // partner was deleted 20 | case blocked = 'blocked'; // partner was blocked 21 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerBlockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerBlockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerCreatedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerCreatedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerDeletedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerDeletedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerEmailChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerEmailChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $previousEmail, 26 | public readonly ?string $currentEmail) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerExternalIdChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerExternalIdChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $previousExternalId, 26 | public readonly ?string $currentExternalId) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerOpenLineIdChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerOpenLineIdChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $previousOpenLineId, 26 | public readonly ?string $currentOpenLineId) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerPartnerIdChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerPartnerIdChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?int $previousPartnerId, 26 | public readonly ?int $currentPartnerId) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerPhoneChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use libphonenumber\PhoneNumber; 18 | use Symfony\Component\Uid\Uuid; 19 | use Symfony\Contracts\EventDispatcher\Event; 20 | 21 | class Bitrix24PartnerPhoneChangedEvent extends Event 22 | { 23 | public function __construct( 24 | public readonly Uuid $bitrix24PartnerId, 25 | public readonly CarbonImmutable $timestamp, 26 | public readonly ?PhoneNumber $previousPhone, 27 | public readonly ?PhoneNumber $currentPhone) 28 | { 29 | } 30 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerSiteChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerSiteChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly ?string $previousSite, 26 | public readonly ?string $currentSite) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerTitleChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerTitleChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp, 25 | public readonly string $previousTitle, 26 | public readonly string $currentTitle) 27 | { 28 | } 29 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Events/Bitrix24PartnerUnblockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class Bitrix24PartnerUnblockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $bitrix24PartnerId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Bitrix24Partners/Exceptions/Bitrix24PartnerNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Bitrix24Partners\Exceptions; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | class Bitrix24PartnerNotFoundException extends BaseException 19 | { 20 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Entity/ContactPersonStatus.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Entity; 15 | 16 | enum ContactPersonStatus: string 17 | { 18 | case active = 'active'; // active contact person 19 | case deleted = 'deleted'; // the app has been removed from the portal 20 | case blocked = 'blocked'; // developer forcibly deactivated the account 21 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonBlockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonBlockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonCreatedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonCreatedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonDeletedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonDeletedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonEmailChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonEmailChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonEmailVerifiedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonEmailVerifiedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonFullNameChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonFullNameChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonLinkedToExternalEntityEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonLinkedToExternalEntityEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonMobilePhoneChangedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonMobilePhoneChangedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonMobilePhoneVerifiedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonMobilePhoneVerifiedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Events/ContactPersonUnblockedEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Events; 15 | 16 | use Carbon\CarbonImmutable; 17 | use Symfony\Component\Uid\Uuid; 18 | use Symfony\Contracts\EventDispatcher\Event; 19 | 20 | class ContactPersonUnblockedEvent extends Event 21 | { 22 | public function __construct( 23 | public readonly Uuid $contactPersonId, 24 | public readonly CarbonImmutable $timestamp) 25 | { 26 | } 27 | } -------------------------------------------------------------------------------- /src/Application/Contracts/ContactPersons/Exceptions/ContactPersonNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\ContactPersons\Exceptions; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | class ContactPersonNotFoundException extends BaseException 19 | { 20 | } -------------------------------------------------------------------------------- /src/Application/Contracts/Events/AggregateRootEventsEmitterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Contracts\Events; 15 | 16 | use Symfony\Contracts\EventDispatcher\Event; 17 | 18 | interface AggregateRootEventsEmitterInterface 19 | { 20 | /** 21 | * @return Event[] 22 | */ 23 | public function emitEvents(): array; 24 | } -------------------------------------------------------------------------------- /src/Application/PortalLicenseFamily.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application; 15 | 16 | /** 17 | * Portal license family enum 18 | * @link https://training.bitrix24.com/rest_help/general/app_info.php 19 | */ 20 | enum PortalLicenseFamily: string 21 | { 22 | case free = 'free'; 23 | case basic = 'basic'; 24 | case std = 'std'; 25 | case pro = 'pro'; 26 | case en = 'en'; 27 | case nfr = 'nfr'; 28 | } -------------------------------------------------------------------------------- /src/Application/Requests/AbstractRequest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Requests; 15 | 16 | use Symfony\Component\HttpFoundation\Request; 17 | 18 | abstract class AbstractRequest 19 | { 20 | public function __construct(protected Request $request) 21 | { 22 | } 23 | 24 | public function getRequest(): Request 25 | { 26 | return $this->request; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Application/Requests/Events/EventInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Requests\Events; 15 | 16 | 17 | use Bitrix24\SDK\Application\ApplicationStatus; 18 | use Bitrix24\SDK\Core\Credentials\Scope; 19 | use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException; 20 | use Bitrix24\SDK\Core\Exceptions\UnknownScopeCodeException; 21 | use Bitrix24\SDK\Core\Result\AbstractItem; 22 | 23 | interface EventInterface 24 | { 25 | public function getEventCode(): string; 26 | 27 | public function getAuth(): EventAuthItem; 28 | 29 | public function getEventPayload(): array; 30 | } -------------------------------------------------------------------------------- /src/Application/Requests/Events/OnApplicationInstall/ApplicationData.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Requests\Events\OnApplicationInstall; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $VERSION 20 | * @property-read string $ACTIVE 21 | * @property-read string $INSTALLED 22 | * @property-read string $LANGUAGE_ID 23 | */ 24 | class ApplicationData extends AbstractItem 25 | { 26 | } -------------------------------------------------------------------------------- /src/Application/Requests/Events/OnApplicationInstall/OnApplicationInstall.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Requests\Events\OnApplicationInstall; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class OnApplicationInstall extends AbstractEventRequest 19 | { 20 | public function getApplicationData(): ApplicationData 21 | { 22 | return new ApplicationData($this->eventPayload['data']); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Application/Requests/Events/OnApplicationUninstall/ApplicationData.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Requests\Events\OnApplicationUninstall; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $CLEAN 20 | * @property-read string $LANGUAGE_ID 21 | */ 22 | class ApplicationData extends AbstractItem 23 | { 24 | } -------------------------------------------------------------------------------- /src/Application/Requests/Events/OnApplicationUninstall/OnApplicationUninstall.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Application\Requests\Events\OnApplicationUninstall; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class OnApplicationUninstall extends AbstractEventRequest 19 | { 20 | public function getApplicationData(): ApplicationData 21 | { 22 | return new ApplicationData($this->eventPayload['data']); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Attributes/ApiBatchMethodMetadata.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Attributes; 15 | 16 | use Attribute; 17 | 18 | #[Attribute(Attribute::TARGET_METHOD)] 19 | class ApiBatchMethodMetadata 20 | { 21 | public function __construct( 22 | public string $name, 23 | public string $documentationUrl, 24 | public ?string $description = null, 25 | public bool $isDeprecated = false, 26 | public ?string $deprecationMessage = null 27 | ) 28 | { 29 | } 30 | } -------------------------------------------------------------------------------- /src/Attributes/ApiBatchServiceMetadata.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Attributes; 15 | 16 | use Attribute; 17 | use Bitrix24\SDK\Core\Credentials\Scope; 18 | 19 | #[Attribute(Attribute::TARGET_CLASS)] 20 | class ApiBatchServiceMetadata 21 | { 22 | public function __construct( 23 | public Scope $scope, 24 | public ?string $documentationUrl = null, 25 | public ?string $description = null, 26 | public bool $isDeprecated = false, 27 | public ?string $deprecationMessage = null 28 | ) 29 | { 30 | } 31 | } -------------------------------------------------------------------------------- /src/Attributes/ApiEndpointMetadata.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Attributes; 15 | 16 | use Attribute; 17 | 18 | #[Attribute(Attribute::TARGET_METHOD)] 19 | class ApiEndpointMetadata 20 | { 21 | public function __construct( 22 | public string $name, 23 | public string $documentationUrl, 24 | public ?string $description = null, 25 | public bool $isDeprecated = false, 26 | public ?string $deprecationMessage = null 27 | ) 28 | { 29 | } 30 | } -------------------------------------------------------------------------------- /src/Attributes/ApiServiceMetadata.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Attributes; 15 | 16 | use Attribute; 17 | use Bitrix24\SDK\Core\Credentials\Scope; 18 | 19 | #[Attribute(Attribute::TARGET_CLASS)] 20 | class ApiServiceMetadata 21 | { 22 | public function __construct( 23 | public Scope $scope, 24 | public ?string $documentationUrl = null, 25 | public ?string $description = null, 26 | public bool $isDeprecated = false, 27 | public ?string $deprecationMessage = null 28 | ) 29 | { 30 | } 31 | } -------------------------------------------------------------------------------- /src/Core/Commands/CommandCollection.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Commands; 15 | 16 | use SplObjectStorage; 17 | 18 | /** 19 | * Class CommandCollection 20 | * 21 | * @package Bitrix24\SDK\Core\Commands 22 | * 23 | * @method attach(Command $command) 24 | * @method Command current() 25 | */ 26 | class CommandCollection extends SplObjectStorage 27 | { 28 | } -------------------------------------------------------------------------------- /src/Core/Contracts/AddedItemIdResultInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Contracts; 15 | 16 | interface AddedItemIdResultInterface 17 | { 18 | /** 19 | * added entity id 20 | */ 21 | public function getId(): int; 22 | } -------------------------------------------------------------------------------- /src/Core/Contracts/CoreInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Contracts; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Exceptions\TransportException; 18 | use Bitrix24\SDK\Core\Response\Response; 19 | 20 | /** 21 | * Interface CoreInterface 22 | * 23 | * @package Bitrix24\SDK\Core\Contracts 24 | */ 25 | interface CoreInterface 26 | { 27 | /** 28 | * @throws BaseException 29 | * @throws TransportException 30 | */ 31 | public function call(string $apiMethod, array $parameters = []): Response; 32 | 33 | public function getApiClient(): ApiClientInterface; 34 | } -------------------------------------------------------------------------------- /src/Core/Contracts/DeletedItemResultInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Contracts; 15 | 16 | interface DeletedItemResultInterface 17 | { 18 | /** 19 | * Success deletion flag 20 | */ 21 | public function isSuccess(): bool; 22 | } -------------------------------------------------------------------------------- /src/Core/Contracts/UpdatedItemResultInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Contracts; 15 | 16 | interface UpdatedItemResultInterface 17 | { 18 | /** 19 | * Success update flag 20 | */ 21 | public function isSuccess(): bool; 22 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/AuthForbiddenException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | class AuthForbiddenException extends BaseException 17 | { 18 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/BaseException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class BaseException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class BaseException extends \Exception 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/FileNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | class FileNotFoundException extends BaseException 17 | { 18 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/ImmutableResultViolationException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class ImmutableResultViolationException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class ImmutableResultViolationException extends BaseException 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/InvalidArgumentException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class InvalidArgumentException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class InvalidArgumentException extends BaseException 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/MethodConfirmWaitingException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | use Throwable; 17 | 18 | class MethodConfirmWaitingException extends BaseException 19 | { 20 | public function __construct(public readonly string $methodName, string $message, int $code = 0, ?Throwable $throwable = null) 21 | { 22 | parent::__construct($message, $code, $throwable); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/MethodNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class MethodNotFoundException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class MethodNotFoundException extends BaseException 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/OperationTimeLimitExceededException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class OperationTimeLimitExceededException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class OperationTimeLimitExceededException extends BaseException 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/QueryLimitExceededException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class QueryLimitExceededException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class QueryLimitExceededException extends BaseException 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/TransportException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * When any error happens at the transport level. 18 | * 19 | * Class TransportException 20 | * 21 | * @package Bitrix24\SDK\Core\Exceptions 22 | */ 23 | class TransportException extends BaseException 24 | { 25 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/UnknownScopeCodeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | /** 17 | * Class UnknownScopeCodeException 18 | * 19 | * @package Bitrix24\SDK\Core\Exceptions 20 | */ 21 | class UnknownScopeCodeException extends InvalidArgumentException 22 | { 23 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/UserNotFoundOrIsNotActiveException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | 16 | class UserNotFoundOrIsNotActiveException extends BaseException 17 | { 18 | } -------------------------------------------------------------------------------- /src/Core/Exceptions/WrongAuthTypeException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Exceptions; 15 | class WrongAuthTypeException extends BaseException 16 | { 17 | } -------------------------------------------------------------------------------- /src/Core/Fields/FieldsFilter.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Fields; 15 | 16 | class FieldsFilter 17 | { 18 | public function filterSystemFields(array $fieldCodes): array 19 | { 20 | $res = []; 21 | foreach ($fieldCodes as $fieldCode) { 22 | if (!str_starts_with((string) $fieldCode, 'UF_CRM_')) { 23 | $res[] = $fieldCode; 24 | } 25 | } 26 | 27 | return $res; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/Core/Response/DTO/Pagination.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Response\DTO; 15 | 16 | readonly class Pagination 17 | { 18 | public function __construct( 19 | private ?int $nextItem = null, 20 | private ?int $total = null) 21 | { 22 | } 23 | 24 | public function getNextItem(): ?int 25 | { 26 | return $this->nextItem; 27 | } 28 | 29 | public function getTotal(): ?int 30 | { 31 | return $this->total; 32 | } 33 | } -------------------------------------------------------------------------------- /src/Core/Result/AbstractResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Response\Response; 17 | 18 | /** 19 | * Class AbstractResult 20 | * 21 | * @package Bitrix24\SDK\Core\Result 22 | */ 23 | abstract class AbstractResult 24 | { 25 | /** 26 | * AbstractResult constructor. 27 | */ 28 | public function __construct(protected Response $coreResponse) 29 | { 30 | } 31 | 32 | public function getCoreResponse(): Response 33 | { 34 | return $this->coreResponse; 35 | } 36 | } -------------------------------------------------------------------------------- /src/Core/Result/AddedItemBatchResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\AddedItemIdResultInterface; 17 | use Bitrix24\SDK\Core\Response\DTO\ResponseData; 18 | 19 | class AddedItemBatchResult implements AddedItemIdResultInterface 20 | { 21 | public function __construct(private readonly ResponseData $responseData) 22 | { 23 | } 24 | 25 | public function getResponseData(): ResponseData 26 | { 27 | return $this->responseData; 28 | } 29 | 30 | public function getId(): int 31 | { 32 | return (int)$this->getResponseData()->getResult()[0]; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Core/Result/AddedItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\AddedItemIdResultInterface; 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | 19 | /** 20 | * Class AddedItemResult 21 | * 22 | * @package Bitrix24\SDK\Core\Result 23 | */ 24 | class AddedItemResult extends AbstractResult implements AddedItemIdResultInterface 25 | { 26 | /** 27 | * @throws BaseException 28 | */ 29 | public function getId(): int 30 | { 31 | return (int)$this->getCoreResponse()->getResponseData()->getResult()[0]; 32 | } 33 | } -------------------------------------------------------------------------------- /src/Core/Result/DeletedItemBatchResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\DeletedItemResultInterface; 17 | use Bitrix24\SDK\Core\Response\DTO\ResponseData; 18 | 19 | class DeletedItemBatchResult implements DeletedItemResultInterface 20 | { 21 | public function __construct(private readonly ResponseData $responseData) 22 | { 23 | } 24 | 25 | public function getResponseData(): ResponseData 26 | { 27 | return $this->responseData; 28 | } 29 | 30 | public function isSuccess(): bool 31 | { 32 | return (bool)$this->getResponseData()->getResult()[0]; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Core/Result/DeletedItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\DeletedItemResultInterface; 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | 19 | /** 20 | * Class DeletedItemResult 21 | * 22 | * @package Bitrix24\SDK\Core\Result 23 | */ 24 | class DeletedItemResult extends AbstractResult implements DeletedItemResultInterface 25 | { 26 | /** 27 | * @throws BaseException 28 | */ 29 | public function isSuccess(): bool 30 | { 31 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 32 | } 33 | } -------------------------------------------------------------------------------- /src/Core/Result/EmptyResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\DeletedItemResultInterface; 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | 19 | class EmptyResult extends AbstractResult 20 | { 21 | } -------------------------------------------------------------------------------- /src/Core/Result/FieldsResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | /** 19 | * Class FieldsResult 20 | * 21 | * @package Bitrix24\SDK\Core\Result 22 | */ 23 | class FieldsResult extends AbstractResult 24 | { 25 | /** 26 | * @throws BaseException 27 | */ 28 | public function getFieldsDescription(): array 29 | { 30 | return $this->getCoreResponse()->getResponseData()->getResult(); 31 | } 32 | } -------------------------------------------------------------------------------- /src/Core/Result/UpdatedItemBatchResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\UpdatedItemResultInterface; 17 | use Bitrix24\SDK\Core\Response\DTO\ResponseData; 18 | 19 | class UpdatedItemBatchResult implements UpdatedItemResultInterface 20 | { 21 | public function __construct(private readonly ResponseData $responseData) 22 | { 23 | } 24 | 25 | public function getResponseData(): ResponseData 26 | { 27 | return $this->responseData; 28 | } 29 | 30 | public function isSuccess(): bool 31 | { 32 | return (bool)$this->getResponseData()->getResult()[0]; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Core/Result/UpdatedItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | /** 19 | * Class UpdatedItemResult 20 | * 21 | * @package Bitrix24\SDK\Core\Result 22 | */ 23 | class UpdatedItemResult extends AbstractResult 24 | { 25 | /** 26 | * @throws BaseException 27 | */ 28 | public function isSuccess(): bool 29 | { 30 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 31 | } 32 | } -------------------------------------------------------------------------------- /src/Core/Result/UserInterfaceDialogCallResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Core\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | 18 | class UserInterfaceDialogCallResult extends AbstractResult 19 | { 20 | /** 21 | * @throws BaseException 22 | */ 23 | public function isSuccess(): bool 24 | { 25 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 26 | } 27 | } -------------------------------------------------------------------------------- /src/Infrastructure/HttpClient/RequestId/RequestIdGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Infrastructure\HttpClient\RequestId; 15 | 16 | interface RequestIdGeneratorInterface 17 | { 18 | public function getRequestId(): string; 19 | 20 | public function getHeaderFieldName(): string; 21 | 22 | public function getQueryStringParameterName():string; 23 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/ActivityContentType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity; 15 | 16 | /** 17 | * @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_contenttype.php 18 | */ 19 | enum ActivityContentType: int 20 | { 21 | case default = 0; 22 | case plainText = 1; 23 | case bbCode = 2; 24 | case html = 3; 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/ActivityDirectionType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity; 15 | 16 | /** 17 | * @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum-activitydirection.php 18 | */ 19 | enum ActivityDirectionType: int 20 | { 21 | case default = 0; 22 | case incoming = 1; 23 | case outgoing = 2; 24 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/ActivityNotifyType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity; 15 | 16 | /** 17 | * @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enumactivitynotifytype.php 18 | */ 19 | enum ActivityNotifyType: int 20 | { 21 | case default = 0; 22 | case minutes = 1; 23 | case hours = 2; 24 | case days = 3; 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/ActivityPriority.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity; 15 | 16 | /** 17 | * @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_activitypriority.php 18 | */ 19 | enum ActivityPriority: int 20 | { 21 | case default = 0; 22 | case low = 1; 23 | case medium = 2; 24 | case high = 3; 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/ActivityStatus.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity; 15 | 16 | /** 17 | * @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_activitystatus.php 18 | */ 19 | enum ActivityStatus: int 20 | { 21 | case default = 0; 22 | case waiting = 1; 23 | case finished = 2; 24 | case finishedAutomatically = 3; 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/ActivityType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity; 15 | 16 | /** 17 | * @see https://training.bitrix24.com/rest_help/crm/auxiliary/enum/crm_enum_activitytype.php 18 | */ 19 | enum ActivityType: int 20 | { 21 | case default = 0; 22 | case meeting = 1; 23 | case call = 2; 24 | case task = 3; 25 | case letter = 4; 26 | case action = 5; 27 | case userAction = 6; 28 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/ActivitiesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Activity\Result; 16 | 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AbstractResult; 19 | 20 | class ActivitiesResult extends AbstractResult 21 | { 22 | /** 23 | * @return \Bitrix24\SDK\Services\CRM\Activity\Result\ActivityItemResult[] 24 | * @throws BaseException 25 | */ 26 | public function getActivities(): array 27 | { 28 | $res = []; 29 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 30 | $res[] = new ActivityItemResult($item); 31 | } 32 | 33 | return $res; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/ActivityResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Activity\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ActivityResult extends AbstractResult 20 | { 21 | public function activity(): ActivityItemResult 22 | { 23 | return new ActivityItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/Email/EmailActivityItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity\Result\Email; 15 | 16 | use Bitrix24\SDK\Services\CRM\Activity\Result\ActivityItemResult; 17 | 18 | /** 19 | * @property-read \Bitrix24\SDK\Services\CRM\Activity\Result\Email\EmailSettings $SETTINGS 20 | */ 21 | class EmailActivityItemResult extends ActivityItemResult 22 | { 23 | public function __get($offset) 24 | { 25 | if ($offset === 'SETTINGS') { 26 | return new EmailSettings($this->data[$offset]); 27 | } 28 | 29 | return parent::__get($offset); 30 | } 31 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/Email/EmailMeta.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity\Result\Email; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $__email 20 | * @property-read string $from 21 | * @property-read string $replyTo 22 | * @property-read string $to 23 | * @property-read string $cc 24 | * @property-read string $bcc 25 | */ 26 | class EmailMeta extends AbstractItem 27 | { 28 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/OpenLine/OpenLineActivityItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity\Result\OpenLine; 15 | 16 | use Bitrix24\SDK\Services\CRM\Activity\Result\ActivityItemResult; 17 | 18 | class OpenLineActivityItemResult extends ActivityItemResult 19 | { 20 | /** 21 | * @return \Bitrix24\SDK\Services\CRM\Activity\Result\OpenLine\OpenLineProviderParams 22 | */ 23 | public function getProviderParams(): OpenLineProviderParams 24 | { 25 | return new OpenLineProviderParams($this->PROVIDER_PARAMS['USER_CODE']); 26 | } 27 | } -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/WebForm/VisitedPageItem.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Activity\Result\WebForm; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $HREF 20 | * @property-read int $DATE 21 | * @property-read string $TITLE 22 | */ 23 | class VisitedPageItem extends AbstractItem 24 | { 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/Services/CRM/Activity/Result/WebForm/WebFormFieldItem.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Activity\Result\WebForm; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractItem; 18 | 19 | /** 20 | * @property-read string $type 21 | * @property-read string $code 22 | * @property-read bool $required 23 | * @property-read string $caption 24 | * @property-read array $value 25 | */ 26 | class WebFormFieldItem extends AbstractItem 27 | { 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/DiscountType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result; 15 | 16 | enum DiscountType: int 17 | { 18 | case monetary = 1; 19 | case percentage = 2; 20 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/Email.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $VALUE 20 | * @property-read int $ID 21 | * @property-read PhoneValueType $VALUE_TYPE 22 | */ 23 | class Email extends AbstractItem 24 | { 25 | public function __get($offset) 26 | { 27 | return match ($offset) { 28 | 'VALUE' => $this->data[$offset], 29 | 'ID' => (int)$this->data['ID'], 30 | 'VALUE_TYPE' => EmailValueType::from($this->data['VALUE_TYPE']), 31 | default => parent::__get($offset), 32 | }; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/EmailValueType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | enum EmailValueType: string 17 | { 18 | case work = 'WORK'; 19 | case home = 'HOME'; 20 | case other = 'OTHER'; 21 | case mailing = 'MAILING'; 22 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/InstantMessengerValueType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | enum InstantMessengerValueType: string 17 | { 18 | case facebook = 'FACEBOOK'; 19 | case telegram = 'TELEGRAM'; 20 | case vk = 'VK'; 21 | case skype = 'SKYPE'; 22 | case viber = 'VIBER'; 23 | case instagram = 'INSTAGRAM'; 24 | case bitrix24 = 'BITRIX24'; 25 | case openline = 'OPENLINE'; 26 | case imol = 'IMOL'; 27 | case icq = 'ICQ'; 28 | case msn = 'MSN'; 29 | case jabber = 'JABBER'; 30 | case other = 'OTHER'; 31 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/Phone.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $VALUE 20 | * @property-read int $ID 21 | * @property-read PhoneValueType $VALUE_TYPE 22 | */ 23 | class Phone extends AbstractItem 24 | { 25 | public function __get($offset) 26 | { 27 | return match ($offset) { 28 | 'VALUE' => $this->data[$offset], 29 | 'ID' => (int)$this->data['ID'], 30 | 'VALUE_TYPE' => PhoneValueType::from($this->data['VALUE_TYPE']), 31 | default => parent::__get($offset), 32 | }; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/PhoneValueType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | enum PhoneValueType:string 17 | { 18 | case work='WORK'; 19 | case mobile='MOBILE'; 20 | case fax='FAX'; 21 | case home='HOME'; 22 | case pager='PAGER'; 23 | case mailing='MAILING'; 24 | case other='OTHER'; 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/Website.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $VALUE 20 | * @property-read int $ID 21 | * @property-read PhoneValueType $VALUE_TYPE 22 | */ 23 | class Website extends AbstractItem 24 | { 25 | public function __get($offset) 26 | { 27 | return match ($offset) { 28 | 'VALUE' => $this->data[$offset], 29 | 'ID' => (int)$this->data['ID'], 30 | 'VALUE_TYPE' => EmailValueType::from($this->data['VALUE_TYPE']), 31 | default => parent::__get($offset), 32 | }; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/CRM/Common/Result/SystemFields/Types/WebsiteValueType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Common\Result\SystemFields\Types; 15 | 16 | enum WebsiteValueType: string 17 | { 18 | case work = 'WORK'; 19 | case home = 'HOME'; 20 | case facebook = 'FACEBOOK'; 21 | case vk = 'VK'; 22 | case livejournal = 'LIVEJOURNAL'; 23 | case twitter = 'TWITTER'; 24 | case other = 'OTHER'; 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Contact/Result/ContactResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Contact\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | /** 20 | * Class ContactResult 21 | * 22 | * @package Bitrix24\SDK\Services\CRM\Contact\Result 23 | */ 24 | class ContactResult extends AbstractResult 25 | { 26 | public function contact(): ContactItemResult 27 | { 28 | return new ContactItemResult($this->getCoreResponse()->getResponseData()->getResult()); 29 | } 30 | } -------------------------------------------------------------------------------- /src/Services/CRM/Contact/Result/ContactUserfieldItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Contact\Result; 15 | 16 | use Bitrix24\SDK\Services\CRM\Userfield\Result\AbstractUserfieldItemResult; 17 | 18 | class ContactUserfieldItemResult extends AbstractUserfieldItemResult 19 | { 20 | } -------------------------------------------------------------------------------- /src/Services/CRM/Contact/Result/ContactUserfieldResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Contact\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class ContactUserfieldResult extends AbstractResult 19 | { 20 | /** 21 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 22 | */ 23 | public function userfieldItem(): ContactUserfieldItemResult 24 | { 25 | return new ContactUserfieldItemResult($this->getCoreResponse()->getResponseData()->getResult()); 26 | } 27 | } -------------------------------------------------------------------------------- /src/Services/CRM/Contact/Result/ContactUserfieldsResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Contact\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ContactUserfieldsResult extends AbstractResult 20 | { 21 | /** 22 | * @return ContactUserfieldItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getUserfields(): array 26 | { 27 | $res = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 29 | $res[] = new ContactUserfieldItemResult($item); 30 | } 31 | 32 | return $res; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/DealStageSemanticId.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Deal; 15 | 16 | /** 17 | * Status type identifier (STAGE_SEMANTIC_ID), line: 18 | * "F": "(failed) - processed unsuccessfully", 19 | * "S": "(success) - processed successfully", 20 | * "P": "(processing) - deal in process" 21 | */ 22 | enum DealStageSemanticId: string 23 | { 24 | case process = 'P'; 25 | case success = 'S'; 26 | case failure = 'F'; 27 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealCategoryItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 15 | 16 | use Bitrix24\SDK\Services\CRM\Common\Result\AbstractCrmItem; 17 | use Carbon\CarbonImmutable; 18 | 19 | /** 20 | * Class DealItemResult 21 | * 22 | * @property int $ID 23 | * @property CarbonImmutable $CREATED_DATE 24 | * @property string $NAME 25 | * @property bool $IS_LOCKED 26 | * @property int $SORT 27 | */ 28 | class DealCategoryItemResult extends AbstractCrmItem 29 | { 30 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealCategoryResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | /** 19 | * Class DealCategoryResult 20 | * 21 | * @package Bitrix24\SDK\Services\CRM\Deal\Result 22 | */ 23 | class DealCategoryResult extends AbstractResult 24 | { 25 | public function getDealCategoryFields(): DealCategoryItemResult 26 | { 27 | return new DealCategoryItemResult($this->getCoreResponse()->getResponseData()->getResult()); 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealCategoryStageItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * Class DealCategoryStageItemResult 20 | * 21 | * @property string $NAME 22 | * @property int $SORT 23 | * @property string $STATUS_ID 24 | */ 25 | class DealCategoryStageItemResult extends AbstractItem 26 | { 27 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealCategoryStatusResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 16 | 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AbstractResult; 19 | 20 | /** 21 | * Class DealCategoryStatusResult 22 | * 23 | * @package Bitrix24\SDK\Services\CRM\Deal\Result 24 | */ 25 | class DealCategoryStatusResult extends AbstractResult 26 | { 27 | /** 28 | * @return string 29 | * @throws BaseException 30 | */ 31 | public function getDealCategoryTypeId(): string 32 | { 33 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealContactItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * Class DealItemResult 20 | * 21 | * @property-read int $CONTACT_ID 22 | * @property-read int $SORT 23 | * @property-read int $ROLE_ID 24 | * @property-read string $IS_PRIMARY 25 | */ 26 | class DealContactItemResult extends AbstractItem 27 | { 28 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | /** 20 | * Class DealResult 21 | * 22 | * @package Bitrix24\SDK\Services\CRM\Deal\Result 23 | */ 24 | class DealResult extends AbstractResult 25 | { 26 | public function deal(): DealItemResult 27 | { 28 | return new DealItemResult($this->getCoreResponse()->getResponseData()->getResult()); 29 | } 30 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealSemanticStage.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 16 | 17 | enum DealSemanticStage: string 18 | { 19 | case underway = 'P'; 20 | case successful = 'S'; 21 | case failed = 'F'; 22 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealUserfieldItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 16 | 17 | use Bitrix24\SDK\Services\CRM\Userfield\Result\AbstractUserfieldItemResult; 18 | 19 | class DealUserfieldItemResult extends AbstractUserfieldItemResult 20 | { 21 | } -------------------------------------------------------------------------------- /src/Services/CRM/Deal/Result/DealUserfieldResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Deal\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class DealUserfieldResult extends AbstractResult 20 | { 21 | /** 22 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 23 | */ 24 | public function userfieldItem(): DealUserfieldItemResult 25 | { 26 | return new DealUserfieldItemResult($this->getCoreResponse()->getResponseData()->getResult()); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/CRM/Duplicates/Service/EntityType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Duplicates\Service; 15 | 16 | enum EntityType: string 17 | { 18 | case Lead = 'LEAD'; 19 | case Contact = 'CONTACT'; 20 | case Company = 'COMPANY'; 21 | } -------------------------------------------------------------------------------- /src/Services/CRM/Item/Result/ItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Item\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ItemResult extends AbstractResult 20 | { 21 | public function item(): ItemItemResult 22 | { 23 | return new ItemItemResult($this->getCoreResponse()->getResponseData()->getResult()['item']); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Item/Result/ItemsResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Item\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ItemsResult extends AbstractResult 20 | { 21 | /** 22 | * @return ItemItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getItems(): array 26 | { 27 | $items = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 29 | $items[] = new ItemItemResult($item); 30 | } 31 | 32 | return $items; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/CRM/Lead/Result/LeadResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Lead\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | /** 20 | * Class LeadResult 21 | * 22 | * @package Bitrix24\SDK\Services\CRM\Lead\Result 23 | */ 24 | class LeadResult extends AbstractResult 25 | { 26 | /** 27 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 28 | */ 29 | public function lead(): LeadItemResult 30 | { 31 | return new LeadItemResult($this->getCoreResponse()->getResponseData()->getResult()); 32 | } 33 | } -------------------------------------------------------------------------------- /src/Services/CRM/Product/Result/ProductResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\CRM\Product\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ProductResult extends AbstractResult 20 | { 21 | public function product(): ProductItemResult 22 | { 23 | return new ProductItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/CRM/Settings/Result/SettingsModeResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Settings\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | /** 19 | * Class SettingsModeResult 20 | * 21 | * @package Bitrix24\SDK\Services\CRM\Settings\Result 22 | */ 23 | class SettingsModeResult extends AbstractResult 24 | { 25 | public function getModeId(): int 26 | { 27 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/CRM/Userfield/Exceptions/UserfieldNameIsTooLongException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Userfield\Exceptions; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException; 17 | 18 | class UserfieldNameIsTooLongException extends InvalidArgumentException 19 | { 20 | } 21 | -------------------------------------------------------------------------------- /src/Services/CRM/Userfield/Exceptions/UserfieldNotFoundException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Userfield\Exceptions; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException; 17 | 18 | class UserfieldNotFoundException extends InvalidArgumentException 19 | { 20 | } -------------------------------------------------------------------------------- /src/Services/CRM/Userfield/Result/UserfieldTypeItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\CRM\Userfield\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $ID 20 | * @property-read string $title 21 | */ 22 | class UserfieldTypeItemResult extends AbstractItem 23 | { 24 | } -------------------------------------------------------------------------------- /src/Services/Catalog/Catalog/Result/CatalogItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Catalog\Catalog\Result; 15 | 16 | use Bitrix24\SDK\Services\Catalog\Common\Result\AbstractCatalogItem; 17 | 18 | /** 19 | * @property-read int $iblockId 20 | * @property-read int $iblockTypeId 21 | * @property-read int $id 22 | * @property-read string $lid 23 | * @property-read string $name 24 | * @property-read int $productIblockId 25 | * @property-read int $skuPropertyId 26 | * @property-read bool $subscription 27 | * @property-read int $vatId 28 | * @property-read bool $yandexExport 29 | */ 30 | class CatalogItemResult extends AbstractCatalogItem 31 | { 32 | } -------------------------------------------------------------------------------- /src/Services/Catalog/Catalog/Result/CatalogResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Catalog\Catalog\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class CatalogResult extends AbstractResult 19 | { 20 | public function catalog(): CatalogItemResult 21 | { 22 | return new CatalogItemResult($this->getCoreResponse()->getResponseData()->getResult()['catalog']); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Catalog/Common/ProductType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Catalog\Common; 15 | 16 | enum ProductType: int 17 | { 18 | case simple = 1; 19 | case bundle = 2; 20 | case SKU = 3; 21 | case productOffer = 4; 22 | case genericOffer = 5; 23 | } -------------------------------------------------------------------------------- /src/Services/Catalog/Product/Result/ProductResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Catalog\Product\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class ProductResult extends AbstractResult 19 | { 20 | public function product(): ProductItemResult 21 | { 22 | if (array_key_exists('element', $this->getCoreResponse()->getResponseData()->getResult())) { 23 | // fix for catalog.product.add 24 | return new ProductItemResult($this->getCoreResponse()->getResponseData()->getResult()['element']); 25 | } 26 | 27 | return new ProductItemResult($this->getCoreResponse()->getResponseData()->getResult()['product']); 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/Catalog/Product/Result/ProductsResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Catalog\Product\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ProductsResult extends AbstractResult 20 | { 21 | /** 22 | * @return ProductItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getProducts(): array 26 | { 27 | $res = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult()['products'] as $product) { 29 | $res[] = new ProductItemResult($product); 30 | } 31 | 32 | return $res; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/Catalog/Product/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Catalog\Product\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AddedItemBatchResult; 19 | use Bitrix24\SDK\Core\Result\DeletedItemBatchResult; 20 | use Bitrix24\SDK\Core\Result\UpdatedItemBatchResult; 21 | use Generator; 22 | use Psr\Log\LoggerInterface; 23 | 24 | readonly class Batch 25 | { 26 | public function __construct( 27 | protected BatchOperationsInterface $batch, 28 | protected LoggerInterface $log) 29 | { 30 | } 31 | } -------------------------------------------------------------------------------- /src/Services/IM/IMServiceBuilder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\IM; 15 | 16 | use Bitrix24\SDK\Services\AbstractServiceBuilder; 17 | use Bitrix24\SDK\Services\IM\Notify\Service\Notify; 18 | 19 | class IMServiceBuilder extends AbstractServiceBuilder 20 | { 21 | public function notify(): Notify 22 | { 23 | if (!isset($this->serviceCache[__METHOD__])) { 24 | $this->serviceCache[__METHOD__] = new Notify($this->core, $this->log); 25 | } 26 | 27 | return $this->serviceCache[__METHOD__]; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/IMOpenLines/IMOpenLinesServiceBuilder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\IMOpenLines; 15 | 16 | use Bitrix24\SDK\Services\AbstractServiceBuilder; 17 | use Bitrix24\SDK\Services\IMOpenLines\Service\Network; 18 | 19 | class IMOpenLinesServiceBuilder extends AbstractServiceBuilder 20 | { 21 | public function Network(): Network 22 | { 23 | if (!isset($this->serviceCache[__METHOD__])) { 24 | $this->serviceCache[__METHOD__] = new Network($this->core, $this->log); 25 | } 26 | 27 | return $this->serviceCache[__METHOD__]; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/IMOpenLines/Result/AddedMessageItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\IMOpenLines\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | 20 | class AddedMessageItemResult extends AbstractResult 21 | { 22 | /** 23 | * @throws BaseException 24 | */ 25 | public function isSuccess(): bool 26 | { 27 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/IMOpenLines/Result/JoinOpenLineResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\IMOpenLines\Result; 15 | 16 | use Bitrix24\SDK\Core\Contracts\AddedItemIdResultInterface; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class JoinOpenLineResult extends AbstractResult implements AddedItemIdResultInterface 20 | { 21 | /** 22 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 23 | */ 24 | public function getId(): int 25 | { 26 | return (int)$this->getCoreResponse()->getResponseData()->getResult()[0]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Main/Common/EventHandlerMetadata.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Bitrix24\SDK\Services\Main\Common; 13 | 14 | use Bitrix24\SDK\Services\Main\Result\EventHandlerItemResult; 15 | 16 | readonly class EventHandlerMetadata 17 | { 18 | public function __construct( 19 | public string $code, 20 | public string $handlerUrl, 21 | public int $userId, 22 | public ?array $options = null 23 | ) 24 | { 25 | } 26 | 27 | public function isInstalled(EventHandlerItemResult $eventHandlerItemResult): bool 28 | { 29 | return strtoupper($eventHandlerItemResult->event) === strtoupper($this->code) && 30 | $eventHandlerItemResult->handler === $this->handlerUrl; 31 | } 32 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/ApplicationInfoResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\Main\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ApplicationInfoResult extends AbstractResult 20 | { 21 | public function applicationInfo(): ApplicationInfoItemResult 22 | { 23 | return new ApplicationInfoItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/EventHandlerBindResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class EventHandlerBindResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function isBinded(): bool 25 | { 26 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/EventHandlerItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $event 20 | * @property-read string $handler 21 | * @property-read string $auth_type 22 | * @property-read int $offline 23 | */ 24 | class EventHandlerItemResult extends AbstractItem 25 | { 26 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/EventHandlerUnbindResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class EventHandlerUnbindResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function getUnbindedHandlersCount(): int 25 | { 26 | return (int)$this->getCoreResponse()->getResponseData()->getResult()['count']; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/EventHandlersResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class EventHandlersResult extends AbstractResult 20 | { 21 | /** 22 | * @return EventHandlerItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getEventHandlers(): array 26 | { 27 | $res = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $event) { 29 | $res[] = new EventHandlerItemResult($event); 30 | } 31 | 32 | return $res; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/EventListResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class EventListResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function getEvents(): array 25 | { 26 | return $this->getCoreResponse()->getResponseData()->getResult(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/IsUserAdminResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class IsUserAdminResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function isAdmin(): bool 25 | { 26 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/ServerTimeResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Main\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | use Carbon\CarbonImmutable; 19 | use Exception; 20 | 21 | class ServerTimeResult extends AbstractResult 22 | { 23 | /** 24 | * @throws BaseException 25 | * @throws Exception 26 | */ 27 | public function time(): CarbonImmutable 28 | { 29 | return new CarbonImmutable($this->getCoreResponse()->getResponseData()->getResult()[0]); 30 | } 31 | } -------------------------------------------------------------------------------- /src/Services/Main/Result/UserProfileResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\Main\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class UserProfileResult extends AbstractResult 20 | { 21 | public function getUserProfile(): UserProfileItemResult 22 | { 23 | return new UserProfileItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/DeleteUserTypeResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class DeleteUserTypeResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function isSuccess(): bool 25 | { 26 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/PlacementBindResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class PlacementBindResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function isSuccess(): bool 25 | { 26 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/PlacementLocationCodesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class PlacementLocationCodesResult extends AbstractResult 19 | { 20 | /** 21 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 22 | */ 23 | public function getLocationCodes(): array 24 | { 25 | return $this->getCoreResponse()->getResponseData()->getResult(); 26 | } 27 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/PlacementLocationItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $placement 20 | * @property-read string $handler 21 | * @property-read string $title 22 | * @property-read string $description 23 | * @property-read array $options 24 | * @property-read array $langAll 25 | */ 26 | class PlacementLocationItemResult extends AbstractItem 27 | { 28 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/PlacementUnbindResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class PlacementUnbindResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function getDeletedPlacementHandlersCount(): int 25 | { 26 | return (int)$this->getCoreResponse()->getResponseData()->getResult()['count']; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/RegisterUserTypeResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class RegisterUserTypeResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function isSuccess(): bool 25 | { 26 | return (bool)$this->getCoreResponse()->getResponseData()->getResult()[0]; 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/UserFieldTypeItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read string $DESCRIPTION 20 | * @property-read string $HANDLER 21 | * @property-read string $TITLE 22 | * @property-read string $USER_TYPE_ID 23 | */ 24 | class UserFieldTypeItemResult extends AbstractItem 25 | { 26 | } -------------------------------------------------------------------------------- /src/Services/Placement/Result/UserFieldTypesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Placement\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class UserFieldTypesResult extends AbstractResult 19 | { 20 | /** 21 | * @return UserFieldTypeItemResult[] 22 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 23 | */ 24 | public function getUserFieldTypes(): array 25 | { 26 | $res = []; 27 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 28 | $res[] = new UserFieldTypeItemResult($item); 29 | } 30 | 31 | return $res; 32 | } 33 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Call/Result/TranscriptAttachItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Call\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-negative-int $TRANSCRIPT_ID 20 | */ 21 | class TranscriptAttachItemResult extends AbstractItem 22 | { 23 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Call/Result/TranscriptAttachedResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Call\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class TranscriptAttachedResult extends AbstractResult 19 | { 20 | public function getTranscriptAttachItem(): TranscriptAttachItemResult 21 | { 22 | return new TranscriptAttachItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Call/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Call\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Common/CallFailedCode.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum CallFailedCode: int 17 | { 18 | case successful = 200; 19 | case missed = 304; 20 | case declined = 603; 21 | case prohibited = 403; 22 | case wrongNumber = 404; 23 | case unavailable = 486; 24 | case directionUnavailable = 484; 25 | case directionUnavailableToo = 503; 26 | case temporarilyUnavailable = 480; 27 | case insufficientFundsOnTheAccount = 402; 28 | case blocked = 423; 29 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Common/CallType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum CallType: int 17 | { 18 | case outbound = 1; 19 | case inbound = 2; 20 | case inboundWithRedirect = 3; 21 | case callback = 4; 22 | } 23 | -------------------------------------------------------------------------------- /src/Services/Telephony/Common/CrmEntity.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | readonly class CrmEntity 17 | { 18 | public function __construct( 19 | public int $id, 20 | public CrmEntityType $type 21 | ) 22 | { 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Common/CrmEntityType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum CrmEntityType: string 17 | { 18 | case contact = 'CONTACT'; 19 | case company = 'COMPANY'; 20 | case lead = 'LEAD'; 21 | } 22 | -------------------------------------------------------------------------------- /src/Services/Telephony/Common/PbxType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum PbxType: string 17 | { 18 | case cloud = 'cloud'; 19 | case office = 'office'; 20 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Common/SipRegistrationStatus.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum SipRegistrationStatus: string 17 | { 18 | case success = 'success'; 19 | case error = 'error'; 20 | case inProgress = 'in_progress'; 21 | case wait = 'wait'; 22 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Common/TelephonyCallStatusCode.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum TelephonyCallStatusCode: int 17 | { 18 | case successful = 200; 19 | case missed = 304; 20 | case prohibited = 403; 21 | case declined = 603; 22 | case wrong_number = 404; 23 | case unavailable = 486; 24 | case direction_unavailable = 484; 25 | case direction_unavailable_too = 503; 26 | case temporarily_unavailable = 480; 27 | case insufficient_balance = 402; 28 | case blocked = 423; 29 | } 30 | -------------------------------------------------------------------------------- /src/Services/Telephony/Common/TranscriptMessage.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | readonly class TranscriptMessage 17 | { 18 | public function __construct( 19 | public TranscriptMessageSide $side, 20 | public int $startTime, 21 | public int $stopTime, 22 | public string $message 23 | ) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Common/TranscriptMessageSide.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Common; 15 | 16 | enum TranscriptMessageSide: string 17 | { 18 | case user = 'User'; 19 | case client = 'Client'; 20 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Events/OnExternalCallBackStart/OnExternalCallBackStart.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Events\OnExternalCallBackStart; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class OnExternalCallBackStart extends AbstractEventRequest 19 | { 20 | public const CODE = 'ONEXTERNALCALLBACKSTART'; 21 | 22 | public function getPayload(): OnExternalCallBackStartEventPayload 23 | { 24 | return new OnExternalCallBackStartEventPayload($this->eventPayload['data']); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Events/OnExternalCallStart/OnExternalCallStart.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Events\OnExternalCallStart; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class OnExternalCallStart extends AbstractEventRequest 19 | { 20 | public const CODE = 'ONEXTERNALCALLSTART'; 21 | 22 | public function getPayload(): OnExternalCallStartEventPayload 23 | { 24 | return new OnExternalCallStartEventPayload($this->eventPayload['data']); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Events/OnVoximplantCallEnd/OnVoximplantCallEnd.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Events\OnVoximplantCallEnd; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class 19 | OnVoximplantCallEnd extends AbstractEventRequest 20 | { 21 | public const CODE = 'ONVOXIMPLANTCALLEND'; 22 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Events/OnVoximplantCallInit/OnVoximplantCallInit.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Events\OnVoximplantCallInit; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class OnVoximplantCallInit extends AbstractEventRequest 19 | { 20 | public const CODE = 'ONVOXIMPLANTCALLINIT'; 21 | 22 | public function getPayload(): OnVoximplantCallInitEventPayload 23 | { 24 | return new OnVoximplantCallInitEventPayload($this->eventPayload['data']); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Events/OnVoximplantCallStart/OnVoximplantCallStart.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Events\OnVoximplantCallStart; 15 | 16 | use Bitrix24\SDK\Application\Requests\Events\AbstractEventRequest; 17 | 18 | class OnVoximplantCallStart extends AbstractEventRequest 19 | { 20 | public const CODE = 'ONVOXIMPLANTCALLSTART'; 21 | 22 | public function getPayload(): OnVoximplantCallStartEventPayload 23 | { 24 | return new OnVoximplantCallStartEventPayload($this->eventPayload['data']); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/CallRecordFileUploadedItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read int $FILE_ID 20 | */ 21 | class CallRecordFileUploadedItemResult extends AbstractItem 22 | { 23 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/CallRecordFileUploadedResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class CallRecordFileUploadedResult extends AbstractResult 19 | { 20 | public function getRecordUploadedResult(): CallRecordFileUploadedItemResult 21 | { 22 | return new CallRecordFileUploadedItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/CallRecordUploadUrlItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $uploadUrl 20 | * @property-read non-empty-string $fieldName 21 | */ 22 | class CallRecordUploadUrlItemResult extends AbstractItem 23 | { 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/CallRecordUploadUrlResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class CallRecordUploadUrlResult extends AbstractResult 19 | { 20 | public function getUploadUrlResult(): CallRecordUploadUrlItemResult 21 | { 22 | return new CallRecordUploadUrlItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/ExternalCallFinishedResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class ExternalCallFinishedResult extends AbstractResult 20 | { 21 | public function getExternalCallFinished(): ExternalCallFinishedItemResult 22 | { 23 | return new ExternalCallFinishedItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/ExternalCallRegisteredResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class ExternalCallRegisteredResult extends AbstractResult 19 | { 20 | public function getExternalCallRegistered(): ExternalCallRegisteredItemResult 21 | { 22 | return new ExternalCallRegisteredItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Result/SearchCrmEntitiesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class SearchCrmEntitiesResult extends AbstractResult 20 | { 21 | /** 22 | * @return SearchCrmEntitiesItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getCrmEntities(): array 26 | { 27 | $res = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 29 | $res[] = new SearchCrmEntitiesItemResult($item); 30 | } 31 | 32 | return $res; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalCall/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalCall\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalLine/Result/ExternalLineAddItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalLine\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-negative-int $ID 20 | */ 21 | class ExternalLineAddItemResult extends AbstractItem 22 | { 23 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalLine/Result/ExternalLineAddedResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalLine\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class ExternalLineAddedResult extends AbstractResult 19 | { 20 | public function getExternalLineAddResultItem(): ExternalLineAddItemResult 21 | { 22 | return new ExternalLineAddItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalLine/Result/ExternalLineItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalLine\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $NUMBER 20 | * @property-read non-empty-string|null $NAME 21 | * @property-read bool $CRM_AUTO_CREATE 22 | */ 23 | class ExternalLineItemResult extends AbstractItem 24 | { 25 | public function __get($offset) 26 | { 27 | return match ($offset) { 28 | 'CRM_AUTO_CREATE' => $this->data[$offset] === 'Y', 29 | default => $this->data[$offset] ?? null, 30 | }; 31 | } 32 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalLine/Result/ExternalLinesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalLine\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class ExternalLinesResult extends AbstractResult 19 | { 20 | public function getExternalLines(): array 21 | { 22 | $lines = []; 23 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $line) { 24 | $lines[] = new ExternalLineItemResult($line); 25 | } 26 | 27 | return $lines; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/Telephony/ExternalLine/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\ExternalLine\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/InfoCall/Result/VoximplantInfoCallItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\InfoCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $CALL_ID 20 | * @property-read bool $RESULT 21 | */ 22 | class VoximplantInfoCallItemResult extends AbstractItem 23 | { 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/InfoCall/Result/VoximplantInfoCallResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\InfoCall\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class VoximplantInfoCallResult extends AbstractResult 19 | { 20 | public function getCallResult(): VoximplantInfoCallItemResult 21 | { 22 | return new VoximplantInfoCallItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/InfoCall/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\InfoCall\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Line/Result/VoximplantLineIdItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Line\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $LINE_ID 20 | */ 21 | class VoximplantLineIdItemResult extends AbstractItem 22 | { 23 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Line/Result/VoximplantLineIdResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Line\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | use Bitrix24\SDK\Services\Telephony\ExternalCall\Result\ExternalCallFinishedItemResult; 18 | use Bitrix24\SDK\Services\Telephony\Voximplant\Sip\Result\SipLineStatusItemResult; 19 | 20 | class VoximplantLineIdResult extends AbstractResult 21 | { 22 | public function getLineId(): VoximplantLineIdItemResult 23 | { 24 | return new VoximplantLineIdItemResult(['LINE_ID' => $this->getCoreResponse()->getResponseData()->getResult()[0]]); 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Line/Result/VoximplantLineItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Line\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $LINE_ID 20 | * @property-read non-empty-string $NUMBER 21 | */ 22 | class VoximplantLineItemResult extends AbstractItem 23 | { 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Line/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Line\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Sip/Result/SipConnectorStatusResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Sip\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class SipConnectorStatusResult extends AbstractResult 19 | { 20 | public function getStatus(): SipConnectorStatusItemResult 21 | { 22 | return new SipConnectorStatusItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Sip/Result/SipLineAddedResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Sip\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | use Bitrix24\SDK\Services\Telephony\ExternalCall\Result\ExternalCallFinishedItemResult; 18 | 19 | class SipLineAddedResult extends AbstractResult 20 | { 21 | public function getLine(): SipLineItemResult 22 | { 23 | return new SipLineItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Sip/Result/SipLineStatusResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Sip\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | use Bitrix24\SDK\Services\Telephony\ExternalCall\Result\ExternalCallFinishedItemResult; 18 | 19 | class SipLineStatusResult extends AbstractResult 20 | { 21 | public function getStatus(): SipLineStatusItemResult 22 | { 23 | return new SipLineStatusItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Sip/Result/SipLinesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Sip\Result; 16 | 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AbstractResult; 19 | 20 | class SipLinesResult extends AbstractResult 21 | { 22 | /** 23 | * @return SipLineItemResult[] 24 | * @throws BaseException 25 | */ 26 | public function getLines(): array 27 | { 28 | $res = []; 29 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $line) { 30 | $res[] = new SipLineItemResult($line); 31 | } 32 | 33 | return $res; 34 | } 35 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Sip/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Sip\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/TTS/Voices/Result/VoximplantVoiceItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\TTS\Voices\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $CODE 20 | * @property-read non-empty-string $NAME 21 | */ 22 | class VoximplantVoiceItemResult extends AbstractItem 23 | { 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/TTS/Voices/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\TTS\Voices\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Url/Result/VoximplantPagesItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Url\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * @property-read non-empty-string $detail_statistics 20 | * @property-read non-empty-string $buy_connector 21 | * @property-read non-empty-string $edit_config 22 | * @property-read non-empty-string $lines 23 | */ 24 | class VoximplantPagesItemResult extends AbstractItem 25 | { 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Url/Result/VoximplantPagesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Url\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class VoximplantPagesResult extends AbstractResult 19 | { 20 | public function getPages(): VoximplantPagesItemResult 21 | { 22 | return new VoximplantPagesItemResult($this->getCoreResponse()->getResponseData()->getResult()); 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/Url/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\Url\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Telephony/Voximplant/User/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Telephony\Voximplant\User\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/User/Result/UserResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\User\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class UserResult extends AbstractResult 20 | { 21 | public function user(): UserItemResult 22 | { 23 | return new UserItemResult($this->getCoreResponse()->getResponseData()->getResult()); 24 | } 25 | } -------------------------------------------------------------------------------- /src/Services/User/Result/UsersResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\User\Result; 16 | 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AbstractResult; 19 | use Bitrix24\SDK\Services\CRM\Contact\Result\ContactItemResult; 20 | 21 | class UsersResult extends AbstractResult 22 | { 23 | /** 24 | * @return UserItemResult[] 25 | * @throws BaseException 26 | */ 27 | public function getUsers(): array 28 | { 29 | $res = []; 30 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 31 | $res[] = new UserItemResult($item); 32 | } 33 | 34 | return $res; 35 | } 36 | } -------------------------------------------------------------------------------- /src/Services/User/UserServiceBuilder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\User; 15 | 16 | use Bitrix24\SDK\Services\AbstractServiceBuilder; 17 | use Bitrix24\SDK\Services\User\Service\User; 18 | 19 | class UserServiceBuilder extends AbstractServiceBuilder 20 | { 21 | public function user(): User 22 | { 23 | if (!isset($this->serviceCache[__METHOD__])) { 24 | $this->serviceCache[__METHOD__] = new User($this->core, $this->log); 25 | } 26 | 27 | return $this->serviceCache[__METHOD__]; 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/UserConsent/Result/UserConsentAgreementResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\UserConsent\Result; 16 | 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AbstractResult; 19 | 20 | class UserConsentAgreementResult extends AbstractResult 21 | { 22 | /** 23 | * @throws BaseException 24 | */ 25 | public function agreement(): UserConsentAgreementItemResult 26 | { 27 | return new UserConsentAgreementItemResult($this->getCoreResponse()->getResponseData()->getResult()); 28 | } 29 | } -------------------------------------------------------------------------------- /src/Services/UserConsent/Result/UserConsentAgreementTextItemResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\UserConsent\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractItem; 17 | 18 | /** 19 | * Class UserConsentAgreementTextItemResult 20 | * 21 | * @property-read string $LABEL 22 | * @property-read string $TEXT 23 | */ 24 | class UserConsentAgreementTextItemResult extends AbstractItem 25 | { 26 | } -------------------------------------------------------------------------------- /src/Services/UserConsent/Result/UserConsentAgreementTextResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | 13 | declare(strict_types=1); 14 | 15 | namespace Bitrix24\SDK\Services\UserConsent\Result; 16 | 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class UserConsentAgreementTextResult extends AbstractResult 20 | { 21 | /** 22 | * @throws \Bitrix24\SDK\Core\Exceptions\BaseException 23 | */ 24 | public function text(): UserConsentAgreementTextItemResult 25 | { 26 | return new UserConsentAgreementTextItemResult($this->getCoreResponse()->getResponseData()->getResult()); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Activity/Result/AddedActivityResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Activity\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class AddedActivityResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Activity/Result/AddedMessageToLogResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Activity\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class AddedMessageToLogResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Activity/Result/UpdateActivityResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Activity\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class UpdateActivityResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Activity/Result/WorkflowActivitiesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Activity\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class WorkflowActivitiesResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function getActivities(): array 25 | { 26 | return $this->getCoreResponse()->getResponseData()->getResult(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Activity/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Activity\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Bitrix24\SDK\Core\Exceptions\BaseException; 18 | use Bitrix24\SDK\Core\Result\AddedItemBatchResult; 19 | use Bitrix24\SDK\Core\Result\DeletedItemBatchResult; 20 | use Bitrix24\SDK\Core\Result\UpdatedItemBatchResult; 21 | use Generator; 22 | use Psr\Log\LoggerInterface; 23 | 24 | readonly class Batch 25 | { 26 | public function __construct( 27 | protected BatchOperationsInterface $batch, 28 | protected LoggerInterface $log) 29 | { 30 | } 31 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowAutoExecutionType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | enum WorkflowAutoExecutionType: int 17 | { 18 | case withoutAutoExecution = 0; 19 | case whenAdded = 1; 20 | case whenModified = 2; 21 | case whenAddedAndModified = 3; 22 | } 23 | -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowDocumentId.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | readonly class WorkflowDocumentId 17 | { 18 | public function __construct( 19 | public string $moduleId, 20 | public string $entityId, 21 | public string $targetDocumentId, 22 | ) 23 | { 24 | } 25 | 26 | public function getId(): int 27 | { 28 | return (int)substr($this->targetDocumentId, 0, strpos('_', $this->targetDocumentId)); 29 | } 30 | 31 | public static function initFromArray(array $data): WorkflowDocumentId 32 | { 33 | return new self($data[0], $data[1], $data[2]); 34 | } 35 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowPropertyType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | enum WorkflowPropertyType: string 17 | { 18 | case bool = 'bool'; 19 | case date = 'date'; 20 | case datetime = 'datetime'; 21 | case double = 'double'; 22 | case int = 'int'; 23 | case select = 'select'; 24 | case string = 'string'; 25 | case text = 'text'; 26 | case user = 'user'; 27 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowTaskActivityType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | enum WorkflowTaskActivityType: string 17 | { 18 | case approveActivity = 'ApproveActivity'; 19 | case reviewActivity = 'ReviewActivity'; 20 | case requestInformationActivity = 'RequestInformationActivity'; 21 | case requestInformationOptionalActivity = 'RequestInformationOptionalActivity'; 22 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowTaskCompleteStatusType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | enum WorkflowTaskCompleteStatusType: int 17 | { 18 | case approved = 1; 19 | case rejected = 2; 20 | case reviewed = 3; 21 | case cancelled = 4; 22 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowTaskStatusType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | enum WorkflowTaskStatusType: int 17 | { 18 | case inProgress = 0; 19 | case approved = 1; 20 | case rejected = 2; 21 | case completed = 3; 22 | case timeOut = 4; 23 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Common/WorkflowTaskUserStatusType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Common; 15 | 16 | enum WorkflowTaskUserStatusType: int 17 | { 18 | case waitingForResponse = 0; 19 | case approved = 1; 20 | case rejected = 2; 21 | case completed = 3; 22 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Event/Result/EventSendResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Event\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class EventSendResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Event/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Event\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Exceptions/ActivityOrRobotAlreadyInstalledException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Bitrix24\SDK\Services\Workflows\Exceptions; 13 | 14 | use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException; 15 | 16 | class ActivityOrRobotAlreadyInstalledException extends InvalidArgumentException 17 | { 18 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Exceptions/ActivityOrRobotValidationFailureException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Bitrix24\SDK\Services\Workflows\Exceptions; 13 | 14 | use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException; 15 | 16 | class ActivityOrRobotValidationFailureException extends InvalidArgumentException 17 | { 18 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Exceptions/WorkflowTaskAlreadyCompletedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Bitrix24\SDK\Services\Workflows\Exceptions; 13 | 14 | use Bitrix24\SDK\Core\Exceptions\InvalidArgumentException; 15 | 16 | class WorkflowTaskAlreadyCompletedException extends InvalidArgumentException 17 | { 18 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Robot/Result/AddedRobotResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Robot\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class AddedRobotResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Robot/Result/UpdateRobotResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Robot\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class UpdateRobotResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Robot/Result/WorkflowRobotsResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Robot\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class WorkflowRobotsResult extends AbstractResult 20 | { 21 | /** 22 | * @throws BaseException 23 | */ 24 | public function getRobots(): array 25 | { 26 | return $this->getCoreResponse()->getResponseData()->getResult(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Task/Result/WorkflowTaskCompleteResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Task\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class WorkflowTaskCompleteResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Task/Result/WorkflowTasksResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Task\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class WorkflowTasksResult extends AbstractResult 20 | { 21 | /** 22 | * @return WorkflowTaskItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getTasks(): array 26 | { 27 | $res = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 29 | $res[] = new WorkflowTaskItemResult($item); 30 | } 31 | 32 | return $res; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Task/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Task\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Template/Result/WorkflowTemplatesResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Template\Result; 15 | 16 | use Bitrix24\SDK\Core\Exceptions\BaseException; 17 | use Bitrix24\SDK\Core\Result\AbstractResult; 18 | 19 | class WorkflowTemplatesResult extends AbstractResult 20 | { 21 | /** 22 | * @return WorkflowTemplateItemResult[] 23 | * @throws BaseException 24 | */ 25 | public function getTemplates(): array 26 | { 27 | $res = []; 28 | foreach ($this->getCoreResponse()->getResponseData()->getResult() as $item) { 29 | $res[] = new WorkflowTemplateItemResult($item); 30 | } 31 | 32 | return $res; 33 | } 34 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Template/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Template\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Workflow/Result/WorkflowInstanceStartResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Workflow\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class WorkflowInstanceStartResult extends AbstractResult 19 | { 20 | public function getRunningWorkflowInstanceId(): string 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Workflow/Result/WorkflowKillResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Workflow\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class WorkflowKillResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Workflow/Result/WorkflowTerminationResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Workflow\Result; 15 | 16 | use Bitrix24\SDK\Core\Result\AbstractResult; 17 | 18 | class WorkflowTerminationResult extends AbstractResult 19 | { 20 | public function isSuccess(): bool 21 | { 22 | return $this->getCoreResponse()->getResponseData()->getResult()[0]; 23 | } 24 | } -------------------------------------------------------------------------------- /src/Services/Workflows/Workflow/Service/Batch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Services\Workflows\Workflow\Service; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BatchOperationsInterface; 17 | use Psr\Log\LoggerInterface; 18 | 19 | readonly class Batch 20 | { 21 | public function __construct( 22 | protected BatchOperationsInterface $batch, 23 | protected LoggerInterface $log) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /tests/ApplicationBridge/.env: -------------------------------------------------------------------------------- 1 | # monolog 2 | LOGS_LEVEL=100 3 | LOGS_FILE_NAME=bitrix24-php-sdk.log 4 | 5 | # local application secret parameters 6 | BITRIX24_PHP_SDK_APPLICATION_CLIENT_ID= 7 | BITRIX24_PHP_SDK_APPLICATION_CLIENT_SECRET= 8 | BITRIX24_PHP_SDK_APPLICATION_SCOPE= 9 | BITRIX24_PHP_SDK_APPLICATION_DOMAIN_URL= -------------------------------------------------------------------------------- /tests/ApplicationBridge/AuthTokenRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Tests\ApplicationBridge; 15 | 16 | 17 | use Bitrix24\SDK\Core\Credentials\AuthToken; 18 | use Bitrix24\SDK\Core\Response\DTO\RenewedAuthToken; 19 | 20 | interface AuthTokenRepositoryInterface 21 | { 22 | public function getToken(): AuthToken; 23 | 24 | public function saveRenewedToken(RenewedAuthToken $renewedAuthToken): void; 25 | 26 | public function saveToken(AuthToken $authToken): void; 27 | 28 | public function isAvailable():bool; 29 | } -------------------------------------------------------------------------------- /tests/ApplicationBridge/install.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the MIT-LICENSE.txt 8 | * file that was distributed with this source code. 9 | */ 10 | ?> 11 | 12 | -------------------------------------------------------------------------------- /tests/Builders/Services/CRM/PhoneNumberBuilder.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Tests\Builders\Services\CRM; 15 | 16 | use Exception; 17 | 18 | class PhoneNumberBuilder 19 | { 20 | private int $length; 21 | 22 | public function __construct() 23 | { 24 | $this->length = 7; 25 | } 26 | 27 | public function withLength(int $length): self 28 | { 29 | $this->length = $length; 30 | return $this; 31 | } 32 | 33 | /** 34 | * @throws Exception 35 | */ 36 | public function build(): string 37 | { 38 | return '+1' . substr((string)time(), 2, $this->length) . substr((string)random_int(1000, PHP_INT_MAX), 0, 3); 39 | } 40 | } -------------------------------------------------------------------------------- /tests/Integration/Services/Telephony/call-record-test.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mesilov/bitrix24-php-sdk/ff264778629f6750a63d3e7e2be735225e8902c4/tests/Integration/Services/Telephony/call-record-test.mp3 -------------------------------------------------------------------------------- /tests/Unit/Stubs/NullBulkItemsReader.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the MIT-LICENSE.txt 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | declare(strict_types=1); 13 | 14 | namespace Bitrix24\SDK\Tests\Unit\Stubs; 15 | 16 | use Bitrix24\SDK\Core\Contracts\BulkItemsReaderInterface; 17 | use Generator; 18 | 19 | class NullBulkItemsReader implements BulkItemsReaderInterface 20 | { 21 | /** 22 | * @inheritDoc 23 | */ 24 | public function getTraversableList(string $apiMethod, array $order, array $filter, array $select, ?int $limit = null): Generator 25 | { 26 | yield []; 27 | } 28 | } -------------------------------------------------------------------------------- /tools/.env: -------------------------------------------------------------------------------- 1 | APP_ENV=dev 2 | LOGS_FILE=tools/logs/cli.log 3 | LOGS_LEVEL=300 --------------------------------------------------------------------------------