@meshmakers/octo-services 3.3.560 → 3.3.570

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ import { CombinedGraphQLErrors } from '@apollo/client';
7
7
  import * as i1 from 'apollo-angular';
8
8
  import { gql } from 'apollo-angular';
9
9
  import { map, catchError, finalize } from 'rxjs/operators';
10
- import { of, firstValueFrom, map as map$1, Subject, throwError, filter } from 'rxjs';
10
+ import { of, firstValueFrom, map as map$1, Subject, throwError, from, filter } from 'rxjs';
11
11
  import { HttpClient, HttpParams, HttpErrorResponse, HttpHeaders } from '@angular/common/http';
12
12
  import { Upload } from 'tus-js-client';
13
13
  import { AuthorizeService } from '@meshmakers/shared-auth';
@@ -3637,6 +3637,147 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImpor
3637
3637
  */
3638
3638
  const TENANT_ID_PROVIDER = new InjectionToken('TENANT_ID_PROVIDER');
3639
3639
 
3640
+ const GetEntitiesByCkTypeDocumentDto = gql `
3641
+ query getEntitiesByCkType($ckTypeId: String!, $rtId: OctoObjectId, $after: String, $first: Int, $searchFilter: SearchFilter, $fieldFilters: [FieldFilter], $sort: [Sort]) {
3642
+ runtime {
3643
+ runtimeEntities(
3644
+ ckId: $ckTypeId
3645
+ rtId: $rtId
3646
+ after: $after
3647
+ first: $first
3648
+ searchFilter: $searchFilter
3649
+ fieldFilter: $fieldFilters
3650
+ sortOrder: $sort
3651
+ ) {
3652
+ totalCount
3653
+ items {
3654
+ rtId
3655
+ ckTypeId
3656
+ rtWellKnownName
3657
+ rtCreationDateTime
3658
+ rtChangedDateTime
3659
+ attributes(resolveEnumValuesToNames: true) {
3660
+ items {
3661
+ attributeName
3662
+ value
3663
+ }
3664
+ }
3665
+ }
3666
+ }
3667
+ }
3668
+ }
3669
+ `;
3670
+ class GetEntitiesByCkTypeDtoGQL extends i1.Query {
3671
+ document = GetEntitiesByCkTypeDocumentDto;
3672
+ constructor(apollo) {
3673
+ super(apollo);
3674
+ }
3675
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GetEntitiesByCkTypeDtoGQL, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable });
3676
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GetEntitiesByCkTypeDtoGQL, providedIn: 'root' });
3677
+ }
3678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: GetEntitiesByCkTypeDtoGQL, decorators: [{
3679
+ type: Injectable,
3680
+ args: [{
3681
+ providedIn: 'root'
3682
+ }]
3683
+ }], ctorParameters: () => [{ type: i1.Apollo }] });
3684
+
3685
+ /**
3686
+ * Data source for entity autocomplete input - filters entities by CK Type
3687
+ */
3688
+ class RuntimeEntitySelectDataSource {
3689
+ getEntitiesByCkTypeGQL;
3690
+ ckTypeId;
3691
+ constructor(getEntitiesByCkTypeGQL, ckTypeId) {
3692
+ this.getEntitiesByCkTypeGQL = getEntitiesByCkTypeGQL;
3693
+ this.ckTypeId = ckTypeId;
3694
+ }
3695
+ async onFilter(filter, take) {
3696
+ const result = await firstValueFrom(this.getEntitiesByCkTypeGQL.fetch({
3697
+ variables: {
3698
+ ckTypeId: this.ckTypeId,
3699
+ first: take ?? 10,
3700
+ fieldFilters: [
3701
+ { attributePath: 'rtId', operator: FieldFilterOperatorsDto.LikeDto, comparisonValue: filter }
3702
+ ]
3703
+ }
3704
+ }));
3705
+ const items = (result.data?.runtime?.runtimeEntities?.items ?? [])
3706
+ .filter((item) => item !== null)
3707
+ .map(item => ({
3708
+ rtId: item.rtId,
3709
+ ckTypeId: item.ckTypeId,
3710
+ rtWellKnownName: item.rtWellKnownName ?? undefined,
3711
+ displayName: item.rtWellKnownName || item.rtId
3712
+ }));
3713
+ return {
3714
+ totalCount: result.data?.runtime?.runtimeEntities?.totalCount ?? 0,
3715
+ items
3716
+ };
3717
+ }
3718
+ onDisplayEntity(entity) {
3719
+ return entity.displayName;
3720
+ }
3721
+ getIdEntity(entity) {
3722
+ return entity.rtId;
3723
+ }
3724
+ }
3725
+ /**
3726
+ * Dialog data source for entity selection grid with pagination and search
3727
+ */
3728
+ class RuntimeEntityDialogDataSource {
3729
+ getEntitiesByCkTypeGQL;
3730
+ ckTypeId;
3731
+ constructor(getEntitiesByCkTypeGQL, ckTypeId) {
3732
+ this.getEntitiesByCkTypeGQL = getEntitiesByCkTypeGQL;
3733
+ this.ckTypeId = ckTypeId;
3734
+ }
3735
+ getColumns() {
3736
+ return [
3737
+ { field: 'rtId', displayName: 'RT-ID' },
3738
+ { field: 'rtWellKnownName', displayName: 'Name' },
3739
+ { field: 'ckTypeId', displayName: 'CK Type' }
3740
+ ];
3741
+ }
3742
+ fetchData(options) {
3743
+ const fieldFilters = [];
3744
+ if (options.textSearch && options.textSearch.trim()) {
3745
+ fieldFilters.push({
3746
+ attributePath: 'rtId',
3747
+ operator: FieldFilterOperatorsDto.LikeDto,
3748
+ comparisonValue: options.textSearch.trim()
3749
+ });
3750
+ }
3751
+ return from(this.getEntitiesByCkTypeGQL.fetch({
3752
+ variables: {
3753
+ ckTypeId: this.ckTypeId,
3754
+ first: options.take,
3755
+ after: options.skip > 0 ? btoa(`arrayconnection:${options.skip - 1}`) : undefined,
3756
+ fieldFilters: fieldFilters.length > 0 ? fieldFilters : undefined
3757
+ }
3758
+ })).pipe(map$1(result => {
3759
+ const items = (result.data?.runtime?.runtimeEntities?.items ?? [])
3760
+ .filter((item) => item !== null)
3761
+ .map(item => ({
3762
+ rtId: item.rtId,
3763
+ ckTypeId: item.ckTypeId,
3764
+ rtWellKnownName: item.rtWellKnownName ?? undefined,
3765
+ displayName: item.rtWellKnownName || item.rtId
3766
+ }));
3767
+ return {
3768
+ data: items,
3769
+ totalCount: result.data?.runtime?.runtimeEntities?.totalCount ?? 0
3770
+ };
3771
+ }));
3772
+ }
3773
+ onDisplayEntity(entity) {
3774
+ return entity.displayName;
3775
+ }
3776
+ getIdEntity(entity) {
3777
+ return entity.rtId;
3778
+ }
3779
+ }
3780
+
3640
3781
  /**
3641
3782
  * Backward-compatible OctoServicesModule for legacy apps that use
3642
3783
  * importProvidersFrom(OctoServicesModule.forRoot(options)).
@@ -3927,5 +4068,5 @@ function provideOctoServices(octoServiceOptions) {
3927
4068
  * Generated bundle index. Do not edit.
3928
4069
  */
3929
4070
 
3930
- export { AggregationInputTypesDto, AggregationTypeDto, AggregationTypesDto, AssetRepoGraphQlDataSource, AssetRepoService, AssociationModOptionsDto, AttributeSelectorService, AttributeValueTypeDto, BasicLegalEntityTypeDto, BasicSalutationDto, BasicTypeOfTelephoneBasicDto, BasicTypeOfTelephoneEnhancedDto, BasicUnitOfMeasureDto, BotService, CONFIGURATION_SERVICE, CkExtensionUpdateOperationsDto, CkModelService, CkTypeAttributeService, CkTypeMetaData, CkTypeSelectorService, CommunicationService, DeleteStrategiesDto, DeploymentState, EnergyCommunityBillingCycleDto, EnergyCommunityBillingDocumentStateDto, EnergyCommunityBillingTypeDto, EnergyCommunityDataQualityDto, EnergyCommunityFacilityTypeDto, EnergyCommunityProductionTypeDto, EnergyCommunityStateDto, EnergyCommunityTaxProcedureCreditNoteDto, EnvironmentGoalStateDto, FieldFilterOperatorsDto, GetCkModelByIdDocumentDto, GetCkModelByIdDtoGQL, GetCkRecordAttributesDocumentDto, GetCkRecordAttributesDtoGQL, GetCkTypeAttributesDocumentDto, GetCkTypeAttributesDtoGQL, GetCkTypeAvailableQueryColumnsDocumentDto, GetCkTypeAvailableQueryColumnsDtoGQL, GetCkTypesDocumentDto, GetCkTypesDtoGQL, GetDerivedCkTypesDocumentDto, GetDerivedCkTypesDtoGQL, GraphDirectionDto, GraphQL, GraphQLCloneIgnoredProperties, GraphQLCommonIgnoredProperties, GraphQlDataSource, HealthService, HealthStatus, IdentityService, ImportStrategyDto, IndustryBasicAlarmPriorityDto, IndustryBasicAlarmSourceTypeDto, IndustryBasicAlarmStateDto, IndustryBasicAlarmTypeDto, IndustryBasicIecDataTypeDto, IndustryBasicMachineCapabilitiesDto, IndustryBasicMachineStateDto, IndustryMaintenanceAggregationTypeDto, IndustryMaintenanceCostCategoryDto, IndustryMaintenanceEnergyBalanceGroupDto, IndustryMaintenanceEnergyBalanceProductDto, IndustryMaintenanceEnergyBalanceUnitDto, IndustryMaintenanceOrderPriorityDto, IndustryMaintenanceOrderStateDto, IndustryMaintenanceOrderTypeDto, IndustryMaintenanceServiceTypeDto, JobManagementService, LevelMetaData, LoggerSeverity, ModelStateDto, MultiplicitiesDto, NavigationFilterModeDto, OctoErrorLink, OctoGraphQLServiceBase, OctoSdkDemoCustomerStatusDto, OctoSdkDemoNetworkOperatorDto, OctoSdkDemoOperatingStatusDto, OctoServiceOptions, OctoServicesModule, PagedGraphResultDto, ProgressValue, ProgressWindowService, QueryModeDto, RtAssociationMetaData, SearchFilterTypesDto, SortOrderDto, SortOrdersDto, SystemAggregationTypesDto, SystemCommunicationCommunicationStateDto, SystemCommunicationConfigurationStateDto, SystemCommunicationDeploymentStateDto, SystemCommunicationPipelineExecutionStatusDto, SystemCommunicationPipelineTriggerTypeDto, SystemEnvironmentModesDto, SystemFieldFilterOperatorDto, SystemIdentityTokenExpirationDto, SystemIdentityTokenTypeDto, SystemIdentityTokenUsageDto, SystemMaintenanceLevelsDto, SystemNavigationFilterModesDto, SystemNotificationEventLevelsDto, SystemNotificationEventSourcesDto, SystemNotificationEventStatesDto, SystemNotificationNotificationTypesDto, SystemNotificationRenderingTypesDto, SystemQueryTypesDto, SystemSortOrdersDto, TENANT_ID_PROVIDER, TusUploadService, UpdateTypeDto, result as possibleTypes, provideOctoServices };
4071
+ export { AggregationInputTypesDto, AggregationTypeDto, AggregationTypesDto, AssetRepoGraphQlDataSource, AssetRepoService, AssociationModOptionsDto, AttributeSelectorService, AttributeValueTypeDto, BasicLegalEntityTypeDto, BasicSalutationDto, BasicTypeOfTelephoneBasicDto, BasicTypeOfTelephoneEnhancedDto, BasicUnitOfMeasureDto, BotService, CONFIGURATION_SERVICE, CkExtensionUpdateOperationsDto, CkModelService, CkTypeAttributeService, CkTypeMetaData, CkTypeSelectorService, CommunicationService, DeleteStrategiesDto, DeploymentState, EnergyCommunityBillingCycleDto, EnergyCommunityBillingDocumentStateDto, EnergyCommunityBillingTypeDto, EnergyCommunityDataQualityDto, EnergyCommunityFacilityTypeDto, EnergyCommunityProductionTypeDto, EnergyCommunityStateDto, EnergyCommunityTaxProcedureCreditNoteDto, EnvironmentGoalStateDto, FieldFilterOperatorsDto, GetCkModelByIdDocumentDto, GetCkModelByIdDtoGQL, GetCkRecordAttributesDocumentDto, GetCkRecordAttributesDtoGQL, GetCkTypeAttributesDocumentDto, GetCkTypeAttributesDtoGQL, GetCkTypeAvailableQueryColumnsDocumentDto, GetCkTypeAvailableQueryColumnsDtoGQL, GetCkTypesDocumentDto, GetCkTypesDtoGQL, GetDerivedCkTypesDocumentDto, GetDerivedCkTypesDtoGQL, GetEntitiesByCkTypeDocumentDto, GetEntitiesByCkTypeDtoGQL, GraphDirectionDto, GraphQL, GraphQLCloneIgnoredProperties, GraphQLCommonIgnoredProperties, GraphQlDataSource, HealthService, HealthStatus, IdentityService, ImportStrategyDto, IndustryBasicAlarmPriorityDto, IndustryBasicAlarmSourceTypeDto, IndustryBasicAlarmStateDto, IndustryBasicAlarmTypeDto, IndustryBasicIecDataTypeDto, IndustryBasicMachineCapabilitiesDto, IndustryBasicMachineStateDto, IndustryMaintenanceAggregationTypeDto, IndustryMaintenanceCostCategoryDto, IndustryMaintenanceEnergyBalanceGroupDto, IndustryMaintenanceEnergyBalanceProductDto, IndustryMaintenanceEnergyBalanceUnitDto, IndustryMaintenanceOrderPriorityDto, IndustryMaintenanceOrderStateDto, IndustryMaintenanceOrderTypeDto, IndustryMaintenanceServiceTypeDto, JobManagementService, LevelMetaData, LoggerSeverity, ModelStateDto, MultiplicitiesDto, NavigationFilterModeDto, OctoErrorLink, OctoGraphQLServiceBase, OctoSdkDemoCustomerStatusDto, OctoSdkDemoNetworkOperatorDto, OctoSdkDemoOperatingStatusDto, OctoServiceOptions, OctoServicesModule, PagedGraphResultDto, ProgressValue, ProgressWindowService, QueryModeDto, RtAssociationMetaData, RuntimeEntityDialogDataSource, RuntimeEntitySelectDataSource, SearchFilterTypesDto, SortOrderDto, SortOrdersDto, SystemAggregationTypesDto, SystemCommunicationCommunicationStateDto, SystemCommunicationConfigurationStateDto, SystemCommunicationDeploymentStateDto, SystemCommunicationPipelineExecutionStatusDto, SystemCommunicationPipelineTriggerTypeDto, SystemEnvironmentModesDto, SystemFieldFilterOperatorDto, SystemIdentityTokenExpirationDto, SystemIdentityTokenTypeDto, SystemIdentityTokenUsageDto, SystemMaintenanceLevelsDto, SystemNavigationFilterModesDto, SystemNotificationEventLevelsDto, SystemNotificationEventSourcesDto, SystemNotificationEventStatesDto, SystemNotificationNotificationTypesDto, SystemNotificationRenderingTypesDto, SystemQueryTypesDto, SystemSortOrdersDto, TENANT_ID_PROVIDER, TusUploadService, UpdateTypeDto, result as possibleTypes, provideOctoServices };
3931
4072
  //# sourceMappingURL=meshmakers-octo-services.mjs.map