@meshmakers/octo-services 3.2.112-0 → 3.2.113-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/meshmakers-octo-services.mjs +11 -15
- package/fesm2022/meshmakers-octo-services.mjs.map +1 -1
- package/index.d.ts +209 -5
- package/package.json +4 -4
- package/lib/models/pagedGraphResultDto.d.ts +0 -5
- package/lib/octo-services.module.d.ts +0 -9
- package/lib/options/octo-service-options.d.ts +0 -5
- package/lib/services/assetRepoGraphQlDataSource.d.ts +0 -30
- package/lib/services/octo-graph-ql-service-base.d.ts +0 -22
- package/lib/services/octo-message.service.d.ts +0 -9
- package/lib/shared/globalTypes.d.ts +0 -122
- package/lib/shared/graphQL.d.ts +0 -6
- package/public-api.d.ts +0 -8
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { map, finalize } from 'rxjs/operators';
|
|
2
|
-
import
|
|
3
|
-
import { PagedResultDto, DataSourceBase } from '@meshmakers/shared-services';
|
|
2
|
+
import { PagedResultDto, MessageService, DataSourceBase } from '@meshmakers/shared-services';
|
|
4
3
|
import { InMemoryCache } from '@apollo/client/core';
|
|
5
4
|
import * as i0 from '@angular/core';
|
|
6
|
-
import { Injectable, NgModule } from '@angular/core';
|
|
5
|
+
import { inject, Injectable, NgModule } from '@angular/core';
|
|
7
6
|
import { ApolloError } from '@apollo/client/errors';
|
|
8
7
|
import { map as map$1 } from 'rxjs';
|
|
9
8
|
|
|
@@ -137,10 +136,7 @@ class OctoGraphQLServiceBase {
|
|
|
137
136
|
}
|
|
138
137
|
|
|
139
138
|
class OctoMessageService {
|
|
140
|
-
messageService;
|
|
141
|
-
constructor(messageService) {
|
|
142
|
-
this.messageService = messageService;
|
|
143
|
-
}
|
|
139
|
+
messageService = inject(MessageService);
|
|
144
140
|
showErrorWithDetails(error) {
|
|
145
141
|
if (error.constructor.name === ApolloError.prototype.constructor.name) {
|
|
146
142
|
console.info("is apollo error");
|
|
@@ -179,12 +175,12 @@ class OctoMessageService {
|
|
|
179
175
|
}
|
|
180
176
|
}
|
|
181
177
|
}
|
|
182
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
183
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
178
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: OctoMessageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
179
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: OctoMessageService });
|
|
184
180
|
}
|
|
185
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: OctoMessageService, decorators: [{
|
|
186
182
|
type: Injectable
|
|
187
|
-
}]
|
|
183
|
+
}] });
|
|
188
184
|
|
|
189
185
|
class OctoServiceOptions {
|
|
190
186
|
assetServices;
|
|
@@ -208,11 +204,11 @@ class OctoServicesModule {
|
|
|
208
204
|
]
|
|
209
205
|
};
|
|
210
206
|
}
|
|
211
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
212
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
213
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: OctoServicesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
208
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.2", ngImport: i0, type: OctoServicesModule });
|
|
209
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: OctoServicesModule });
|
|
214
210
|
}
|
|
215
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.2", ngImport: i0, type: OctoServicesModule, decorators: [{
|
|
216
212
|
type: NgModule,
|
|
217
213
|
args: [{
|
|
218
214
|
declarations: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meshmakers-octo-services.mjs","sources":["../../../../projects/meshmakers/octo-services/src/lib/models/pagedGraphResultDto.ts","../../../../projects/meshmakers/octo-services/src/lib/services/octo-graph-ql-service-base.ts","../../../../projects/meshmakers/octo-services/src/lib/services/octo-message.service.ts","../../../../projects/meshmakers/octo-services/src/lib/options/octo-service-options.ts","../../../../projects/meshmakers/octo-services/src/lib/octo-services.module.ts","../../../../projects/meshmakers/octo-services/src/lib/shared/graphQL.ts","../../../../projects/meshmakers/octo-services/src/lib/services/assetRepoGraphQlDataSource.ts","../../../../projects/meshmakers/octo-services/src/lib/shared/globalTypes.ts","../../../../projects/meshmakers/octo-services/src/public-api.ts","../../../../projects/meshmakers/octo-services/src/meshmakers-octo-services.ts"],"sourcesContent":["import { PagedResultDto } from '@meshmakers/shared-services';\n\nexport class PagedGraphResultDto<P, C> extends PagedResultDto<C> {\n document: P | null;\n\n constructor() {\n super();\n\n this.document = null;\n }\n}\n","import { DocumentNode } from 'graphql';\nimport { finalize, map } from 'rxjs/operators';\nimport { Apollo } from 'apollo-angular';\nimport { OctoServiceOptions } from '../options/octo-service-options';\nimport { PagedGraphResultDto } from '../models/pagedGraphResultDto';\nimport { PagedResultDto } from '@meshmakers/shared-services';\nimport { HttpLink } from 'apollo-angular/http';\nimport { ApolloQueryResult, InMemoryCache } from '@apollo/client/core';\nimport { OperationVariables } from '@apollo/client/core/types';\nimport { Observable } from 'rxjs';\n\nexport class OctoGraphQLServiceBase {\n constructor(\n private readonly apollo: Apollo,\n private readonly httpLink: HttpLink,\n private readonly octoServiceOptions: OctoServiceOptions\n ) {}\n\n protected getEntities<TResult, TEntity, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n watchQuery: boolean,\n f: (resultSet: PagedResultDto<TEntity>, result: TResult) => void\n ): Observable<PagedResultDto<TEntity>> {\n const query = watchQuery\n ? this.prepareWatchQuery<TResult, TVariable>(tenantId, variables, queryNode)\n : this.prepareQuery<TResult, TVariable>(tenantId, variables, queryNode);\n return query.pipe(\n map((result) => {\n const resultSet = new PagedResultDto<TEntity>();\n\n if (result.errors != null) {\n console.error(result.errors);\n throw Error('Error in GraphQL statement.');\n } else if (result.data) {\n f(resultSet, result.data);\n }\n return resultSet;\n })\n );\n }\n\n protected getGraphEntities<TResult, TP, TC, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n watchQuery: boolean,\n f: (resultSet: PagedGraphResultDto<TP, TC>, result: TResult) => void\n ): Observable<PagedGraphResultDto<TP, TC>> {\n const query = watchQuery\n ? this.prepareWatchQuery<TResult, TVariable>(tenantId, variables, queryNode)\n : this.prepareQuery<TResult, TVariable>(tenantId, variables, queryNode);\n return query.pipe(\n map((result) => {\n const resultSet = new PagedGraphResultDto<TP, TC>();\n\n if (result.errors != null) {\n console.error(result.errors);\n throw Error('Error in GraphQL statement.');\n } else if (result.data) {\n f(resultSet, result.data);\n }\n return resultSet;\n })\n );\n }\n\n protected getEntityDetail<TResult, TEntity, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n watchQuery: boolean,\n f: (result: TResult) => TEntity\n ): Observable<TEntity | null> {\n const query = watchQuery\n ? this.prepareWatchQuery<TResult, TVariable>(tenantId, variables, queryNode)\n : this.prepareQuery<TResult, TVariable>(tenantId, variables, queryNode);\n return query.pipe(\n map((result) => {\n if (result.errors != null) {\n console.error(result.errors);\n throw Error('Error in GraphQL statement.');\n } else if (result.data) {\n return f(result.data);\n }\n return null;\n })\n );\n }\n\n protected createUpdateEntity<TResult, TEntity, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n f: (result: TResult | null | undefined) => TEntity\n ): Observable<TEntity> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo\n .use(tenantId)\n .mutate<TResult>({\n mutation: queryNode,\n variables\n })\n .pipe(\n map((value) => f(value.data)),\n finalize(() => {\n const promise = this.apollo.use(tenantId).client.reFetchObservableQueries(true);\n promise\n .then(() => {})\n .catch((error: string) => {\n console.error(error);\n });\n })\n );\n }\n\n protected deleteEntity<TResult, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n f: (result: TResult | null | undefined) => boolean\n ): Observable<boolean> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo\n .use(tenantId)\n .mutate<TResult>({\n mutation: queryNode,\n variables\n })\n .pipe(\n map((value) => f(value.data)),\n finalize(() => {\n const promise = this.apollo.use(tenantId).client.reFetchObservableQueries(true);\n promise\n .then(() => {})\n .catch((error: string) => {\n console.error(error);\n });\n })\n );\n }\n\n private createApolloForTenant(tenantId: string): void {\n const result = this.apollo.use(tenantId);\n if (result) {\n return;\n }\n\n const service = this.octoServiceOptions.assetServices ?? '';\n const uri = `${service}tenants/${tenantId}/GraphQL`;\n\n this.apollo.createNamed(tenantId, {\n link: this.httpLink.create({ uri }),\n cache: new InMemoryCache({\n dataIdFromObject: (o) => (o['rtId'] as string)\n })\n });\n }\n\n private prepareWatchQuery<TResult, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode\n ): Observable<ApolloQueryResult<TResult>> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo.use(tenantId).watchQuery<TResult>({\n query: queryNode,\n variables\n }).valueChanges;\n }\n\n private prepareQuery<TResult, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode\n ): Observable<ApolloQueryResult<TResult>> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo.use(tenantId).query<TResult>({\n query: queryNode,\n variables,\n fetchPolicy: 'network-only'\n });\n }\n}\n","import { Injectable } from '@angular/core';\nimport { MessageService } from \"@meshmakers/shared-services\";\nimport { ApolloError } from \"@apollo/client/errors\";\n\n@Injectable()\nexport class OctoMessageService{\n\n constructor(private readonly messageService: MessageService) {\n }\n\n showErrorWithDetails(error: any): void {\n if (error.constructor.name === ApolloError.prototype.constructor.name)\n {\n console.info(\"is apollo error\");\n\n if (error.graphQLErrors) {\n for (const graphQLError of error.graphQLErrors) {\n const path = graphQLError.path?.join('.');\n const message = `${path}: ${graphQLError.message}`;\n this.messageService.showError(message, \"Request because of GraphQL error failed\");\n }\n }\n else if (error.networkError) {\n this.messageService.showError(error.networkError.message, \"Request because of network error failed\");\n }\n else if (error.clientErrors) {\n let message = \"\";\n for (const clientError of error.clientErrors) {\n if (message.length > 0) {\n message += \"\\n\";\n }\n message += `${clientError.message}`;\n }\n this.messageService.showError(message, \"Request because of client error failed\");\n }\n else if (error.protocolErrors) {\n let message = \"\";\n for (const clientError of error.protocolErrors) {\n if (message.length > 0) {\n message += \"\\n\";\n }\n message += `${clientError.message}`;\n }\n this.messageService.showError(message, \"Request because of protocol error failed\");\n }\n else {\n this.messageService.showErrorWithDetails(error);\n }\n }\n }\n\n}\n","export class OctoServiceOptions {\n assetServices: string | null;\n defaultDataSourceId?: string;\n\n constructor() {\n this.assetServices = null;\n this.defaultDataSourceId = undefined;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { OctoServiceOptions } from './options/octo-service-options';\nimport { OctoMessageService } from \"./services/octo-message.service\";\n\n@NgModule({\n declarations: [],\n imports: [],\n exports: []\n})\nexport class OctoServicesModule {\n static forRoot(octoServiceOptions: OctoServiceOptions): ModuleWithProviders<OctoServicesModule> {\n return {\n ngModule: OctoServicesModule,\n providers: [\n {\n provide: OctoServiceOptions,\n useValue: octoServiceOptions\n },\n OctoMessageService\n ]\n };\n }\n}\n","export class GraphQL {\n public static getCursor(position: number): string {\n return btoa(`arrayconnection:${position}`);\n }\n\n public static offsetToCursor(offset: number): string | null {\n if (!offset) {\n return null;\n }\n\n return this.getCursor(offset - 1);\n }\n}\n\nexport const GraphQLCommonIgnoredProperties = ['__typename'];\nexport const GraphQLCloneIgnoredProperties = ['id', 'rtId', 'ckTypeId', '__typename'];\n","import { map, Subscription } from 'rxjs';\nimport { DataSourceBase, MessageService, PagedResultDto } from '@meshmakers/shared-services';\nimport { FieldFilterDto, InputMaybe, SearchFilterDto, SortDto } from '../shared/globalTypes';\nimport { Query, QueryRef } from 'apollo-angular';\nimport type { ApolloQueryResult, OperationVariables } from '@apollo/client/core';\nimport { GraphQL } from \"../shared/graphQL\";\n\nexport interface IQueryVariablesDto extends OperationVariables {\n first?: number | null | undefined;\n after?: string | null | undefined;\n sort?: InputMaybe<InputMaybe<SortDto> | InputMaybe<SortDto>[]> | undefined;\n searchFilter?: InputMaybe<SearchFilterDto> | undefined;\n fieldFilters?: InputMaybe<InputMaybe<FieldFilterDto>[] | InputMaybe<FieldFilterDto>>;\n}\n\nexport abstract class GraphQlDataSource<TDto> extends DataSourceBase<TDto> {\n public abstract refetch(): Promise<void>;\n\n public abstract refetchWith(\n skip?: number,\n take?: number,\n searchFilter?: SearchFilterDto | null,\n fieldFilter?: FieldFilterDto[] | null,\n sort?: SortDto[] | null\n ): Promise<void>;\n\n public abstract loadData(\n skip?: number,\n take?: number,\n searchFilter?: SearchFilterDto | null,\n fieldFilter?: FieldFilterDto[] | null,\n sort?: SortDto[] | null\n ): void;\n}\n\nexport class AssetRepoGraphQlDataSource<TDto, TQueryDto, TVariablesDto extends IQueryVariablesDto> extends GraphQlDataSource<TDto> {\n private queryRef: QueryRef<TQueryDto, TVariablesDto> | null;\n private subscription: Subscription | null;\n\n constructor(\n protected messageService: MessageService,\n private readonly query: Query<TQueryDto, TVariablesDto>,\n private readonly defaultSort: SortDto[] | null = null\n ) {\n super();\n this.queryRef = null;\n this.subscription = null;\n }\n\n override clear(): void {\n super.clear();\n this.queryRef?.stopPolling();\n this.queryRef = null;\n this.subscription?.unsubscribe();\n this.subscription = null;\n }\n\n public async refetch(): Promise<void> {\n await this.queryRef?.refetch();\n }\n\n public async refetchWith(\n skip = 0,\n take = 10,\n searchFilter: SearchFilterDto | null = null,\n fieldFilter: FieldFilterDto[] | null = null,\n sort: SortDto[] | null = null\n ): Promise<void> {\n const variables = this.createVariables(skip, take, searchFilter, fieldFilter, sort);\n await this.queryRef?.refetch(variables);\n }\n\n protected createVariables(\n skip = 0,\n take = 10,\n searchFilter: SearchFilterDto | null = null,\n fieldFilter: FieldFilterDto[] | null = null,\n sort: SortDto[] | null = null\n ): TVariablesDto {\n // Default sort\n if ((!sort || (sort && sort.length === 0)) && searchFilter === null) {\n sort = new Array<SortDto>();\n if (this.defaultSort) {\n sort = this.defaultSort;\n }\n }\n\n return {\n first: take,\n after: GraphQL.offsetToCursor(skip),\n sort,\n searchFilter,\n fieldFilters: fieldFilter\n } as TVariablesDto;\n }\n\n public loadData(\n skip = 0,\n take = 10,\n searchFilter: SearchFilterDto | null = null,\n fieldFilter: FieldFilterDto[] | null = null,\n sort: SortDto[] | null = null\n ): void {\n super.onBeginLoad();\n this.clear();\n\n const variables = this.createVariables(skip, take, searchFilter, fieldFilter, sort);\n this.queryRef = this.query.watch(variables, { errorPolicy: 'all' });\n\n this.subscription = this.queryRef.valueChanges\n .pipe(\n map((v, i) => this.executeLoad(v, i)))\n .subscribe({\n next: (pagedResult) => super.onCompleteLoad(pagedResult),\n error: (e) => {\n this.messageService.showErrorWithDetails(e);\n super.onCompleteLoad(new PagedResultDto<TDto>());\n }\n });\n }\n\n protected executeLoad(_value: ApolloQueryResult<TQueryDto>, _index: number): PagedResultDto<TDto> {\n return new PagedResultDto<TDto>();\n }\n}\n","/* eslint-disable */\n// @generated\n// This file was automatically generated and should not be edited.\n\n//==============================================================\n// START Enums and Input Objects\n//==============================================================\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\n\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n BigInt: { input: any; output: any; }\n CkAttributeId: { input: string; output: string; }\n CkEnumId: { input: string; output: string; }\n CkModelId: { input: any; output: any; }\n CkRecordId: { input: string; output: string; }\n CkTypeId: { input: string; output: string; }\n DateTime: { input: any; output: any; }\n Decimal: { input: any; output: any; }\n LargeBinary: { input: any; output: any; }\n OctoObjectId: { input: string; output: string; }\n Seconds: { input: any; output: any; }\n SimpleScalar: { input: any; output: any; }\n ULong: { input: any; output: any; }\n Uri: { input: any; output: any; }\n};\n\nexport type FieldFilterDto = {\n attributePath: Scalars['String']['input'];\n comparisonValue?: InputMaybe<Scalars['SimpleScalar']['input']>;\n operator: FieldFilterOperatorsDto;\n};\n\n/** Defines the operator of field compare */\nexport enum FieldFilterOperatorsDto {\n AnyEqDto = 'ANY_EQ',\n AnyLikeDto = 'ANY_LIKE',\n EqualsDto = 'EQUALS',\n GreaterEqualThanDto = 'GREATER_EQUAL_THAN',\n GreaterThanDto = 'GREATER_THAN',\n InDto = 'IN',\n LessEqualThanDto = 'LESS_EQUAL_THAN',\n LessThanDto = 'LESS_THAN',\n LikeDto = 'LIKE',\n MatchRegExDto = 'MATCH_REG_EX',\n NotEqualsDto = 'NOT_EQUALS',\n NotInDto = 'NOT_IN'\n}\n\n\nexport type SearchFilterDto = {\n attributePaths?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n language?: InputMaybe<Scalars['String']['input']>;\n searchTerm: Scalars['String']['input'];\n type?: InputMaybe<SearchFilterTypesDto>;\n};\n\n/** The type of search that is used (a text based search using text analysis (high performance, scoring, maybe more false positives) or filtering of attributes (lower performance, more exact results) */\nexport enum SearchFilterTypesDto {\n AttributeFilterDto = 'ATTRIBUTE_FILTER',\n TextSearchDto = 'TEXT_SEARCH'\n}\n\nexport type SortDto = {\n attributePath: Scalars['String']['input'];\n sortOrder?: InputMaybe<SortOrdersDto>;\n};\n\n/** Defines the sort order */\nexport enum SortOrdersDto {\n AscendingDto = 'ASCENDING',\n DefaultDto = 'DEFAULT',\n DescendingDto = 'DESCENDING'\n}\n\n//==============================================================\n// END Enums and Input Objects\n//==============================================================\n","/*\n * Public API Surface of octo-services\n */\n\nexport * from './lib/services/octo-graph-ql-service-base';\nexport * from './lib/services/octo-message.service';\nexport * from './lib/options/octo-service-options';\nexport * from './lib/octo-services.module';\nexport * from './lib/models/pagedGraphResultDto';\nexport * from './lib/shared/graphQL';\nexport * from './lib/services/assetRepoGraphQlDataSource';\nexport * from './lib/shared/globalTypes';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map"],"mappings":";;;;;;;;;AAEM,MAAO,mBAA0B,SAAQ,cAAiB,CAAA;AAC9D,IAAA,QAAQ;AAER,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAEP,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;;AAEvB;;MCCY,sBAAsB,CAAA;AAEd,IAAA,MAAA;AACA,IAAA,QAAA;AACA,IAAA,kBAAA;AAHnB,IAAA,WAAA,CACmB,MAAc,EACd,QAAkB,EAClB,kBAAsC,EAAA;QAFtC,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACR,IAAkB,CAAA,kBAAA,GAAlB,kBAAkB;;IAG3B,WAAW,CACnB,QAAgB,EAChB,SAAoB,EACpB,SAAuB,EACvB,UAAmB,EACnB,CAAgE,EAAA;QAEhE,MAAM,KAAK,GAAG;cACV,IAAI,CAAC,iBAAiB,CAAqB,QAAQ,EAAE,SAAS,EAAE,SAAS;cACzE,IAAI,CAAC,YAAY,CAAqB,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;QACzE,OAAO,KAAK,CAAC,I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../../../projects/meshmakers/octo-services/src/lib/services/octo-graph-ql-service-base.ts","../../../../projects/meshmakers/octo-services/src/lib/services/octo-message.service.ts","../../../../projects/meshmakers/octo-services/src/lib/options/octo-service-options.ts","../../../../projects/meshmakers/octo-services/src/lib/octo-services.module.ts","../../../../projects/meshmakers/octo-services/src/lib/shared/graphQL.ts","../../../../projects/meshmakers/octo-services/src/lib/services/assetRepoGraphQlDataSource.ts","../../../../projects/meshmakers/octo-services/src/lib/shared/globalTypes.ts","../../../../projects/meshmakers/octo-services/src/public-api.ts","../../../../projects/meshmakers/octo-services/src/meshmakers-octo-services.ts"],"sourcesContent":["import { PagedResultDto } from '@meshmakers/shared-services';\n\nexport class PagedGraphResultDto<P, C> extends PagedResultDto<C> {\n document: P | null;\n\n constructor() {\n super();\n\n this.document = null;\n }\n}\n","import { DocumentNode } from 'graphql';\nimport { finalize, map } from 'rxjs/operators';\nimport { Apollo } from 'apollo-angular';\nimport { OctoServiceOptions } from '../options/octo-service-options';\nimport { PagedGraphResultDto } from '../models/pagedGraphResultDto';\nimport { PagedResultDto } from '@meshmakers/shared-services';\nimport { HttpLink } from 'apollo-angular/http';\nimport { ApolloQueryResult, InMemoryCache } from '@apollo/client/core';\nimport { OperationVariables } from '@apollo/client/core/types';\nimport { Observable } from 'rxjs';\n\nexport class OctoGraphQLServiceBase {\n constructor(\n private readonly apollo: Apollo,\n private readonly httpLink: HttpLink,\n private readonly octoServiceOptions: OctoServiceOptions\n ) {}\n\n protected getEntities<TResult, TEntity, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n watchQuery: boolean,\n f: (resultSet: PagedResultDto<TEntity>, result: TResult) => void\n ): Observable<PagedResultDto<TEntity>> {\n const query = watchQuery\n ? this.prepareWatchQuery<TResult, TVariable>(tenantId, variables, queryNode)\n : this.prepareQuery<TResult, TVariable>(tenantId, variables, queryNode);\n return query.pipe(\n map((result) => {\n const resultSet = new PagedResultDto<TEntity>();\n\n if (result.errors != null) {\n console.error(result.errors);\n throw Error('Error in GraphQL statement.');\n } else if (result.data) {\n f(resultSet, result.data);\n }\n return resultSet;\n })\n );\n }\n\n protected getGraphEntities<TResult, TP, TC, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n watchQuery: boolean,\n f: (resultSet: PagedGraphResultDto<TP, TC>, result: TResult) => void\n ): Observable<PagedGraphResultDto<TP, TC>> {\n const query = watchQuery\n ? this.prepareWatchQuery<TResult, TVariable>(tenantId, variables, queryNode)\n : this.prepareQuery<TResult, TVariable>(tenantId, variables, queryNode);\n return query.pipe(\n map((result) => {\n const resultSet = new PagedGraphResultDto<TP, TC>();\n\n if (result.errors != null) {\n console.error(result.errors);\n throw Error('Error in GraphQL statement.');\n } else if (result.data) {\n f(resultSet, result.data);\n }\n return resultSet;\n })\n );\n }\n\n protected getEntityDetail<TResult, TEntity, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n watchQuery: boolean,\n f: (result: TResult) => TEntity\n ): Observable<TEntity | null> {\n const query = watchQuery\n ? this.prepareWatchQuery<TResult, TVariable>(tenantId, variables, queryNode)\n : this.prepareQuery<TResult, TVariable>(tenantId, variables, queryNode);\n return query.pipe(\n map((result) => {\n if (result.errors != null) {\n console.error(result.errors);\n throw Error('Error in GraphQL statement.');\n } else if (result.data) {\n return f(result.data);\n }\n return null;\n })\n );\n }\n\n protected createUpdateEntity<TResult, TEntity, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n f: (result: TResult | null | undefined) => TEntity\n ): Observable<TEntity> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo\n .use(tenantId)\n .mutate<TResult>({\n mutation: queryNode,\n variables\n })\n .pipe(\n map((value) => f(value.data)),\n finalize(() => {\n const promise = this.apollo.use(tenantId).client.reFetchObservableQueries(true);\n promise\n .then(() => {})\n .catch((error: string) => {\n console.error(error);\n });\n })\n );\n }\n\n protected deleteEntity<TResult, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode,\n f: (result: TResult | null | undefined) => boolean\n ): Observable<boolean> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo\n .use(tenantId)\n .mutate<TResult>({\n mutation: queryNode,\n variables\n })\n .pipe(\n map((value) => f(value.data)),\n finalize(() => {\n const promise = this.apollo.use(tenantId).client.reFetchObservableQueries(true);\n promise\n .then(() => {})\n .catch((error: string) => {\n console.error(error);\n });\n })\n );\n }\n\n private createApolloForTenant(tenantId: string): void {\n const result = this.apollo.use(tenantId);\n if (result) {\n return;\n }\n\n const service = this.octoServiceOptions.assetServices ?? '';\n const uri = `${service}tenants/${tenantId}/GraphQL`;\n\n this.apollo.createNamed(tenantId, {\n link: this.httpLink.create({ uri }),\n cache: new InMemoryCache({\n dataIdFromObject: (o) => (o['rtId'] as string)\n })\n });\n }\n\n private prepareWatchQuery<TResult, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode\n ): Observable<ApolloQueryResult<TResult>> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo.use(tenantId).watchQuery<TResult>({\n query: queryNode,\n variables\n }).valueChanges;\n }\n\n private prepareQuery<TResult, TVariable extends OperationVariables>(\n tenantId: string,\n variables: TVariable,\n queryNode: DocumentNode\n ): Observable<ApolloQueryResult<TResult>> {\n this.createApolloForTenant(tenantId);\n\n return this.apollo.use(tenantId).query<TResult>({\n query: queryNode,\n variables,\n fetchPolicy: 'network-only'\n });\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { MessageService } from \"@meshmakers/shared-services\";\nimport { ApolloError } from \"@apollo/client/errors\";\n\n@Injectable()\nexport class OctoMessageService{\n private readonly messageService = inject(MessageService);\n\n\n showErrorWithDetails(error: any): void {\n if (error.constructor.name === ApolloError.prototype.constructor.name)\n {\n console.info(\"is apollo error\");\n\n if (error.graphQLErrors) {\n for (const graphQLError of error.graphQLErrors) {\n const path = graphQLError.path?.join('.');\n const message = `${path}: ${graphQLError.message}`;\n this.messageService.showError(message, \"Request because of GraphQL error failed\");\n }\n }\n else if (error.networkError) {\n this.messageService.showError(error.networkError.message, \"Request because of network error failed\");\n }\n else if (error.clientErrors) {\n let message = \"\";\n for (const clientError of error.clientErrors) {\n if (message.length > 0) {\n message += \"\\n\";\n }\n message += `${clientError.message}`;\n }\n this.messageService.showError(message, \"Request because of client error failed\");\n }\n else if (error.protocolErrors) {\n let message = \"\";\n for (const clientError of error.protocolErrors) {\n if (message.length > 0) {\n message += \"\\n\";\n }\n message += `${clientError.message}`;\n }\n this.messageService.showError(message, \"Request because of protocol error failed\");\n }\n else {\n this.messageService.showErrorWithDetails(error);\n }\n }\n }\n\n}\n","export class OctoServiceOptions {\n assetServices: string | null;\n defaultDataSourceId?: string;\n\n constructor() {\n this.assetServices = null;\n this.defaultDataSourceId = undefined;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { OctoServiceOptions } from './options/octo-service-options';\nimport { OctoMessageService } from \"./services/octo-message.service\";\n\n@NgModule({\n declarations: [],\n imports: [],\n exports: []\n})\nexport class OctoServicesModule {\n static forRoot(octoServiceOptions: OctoServiceOptions): ModuleWithProviders<OctoServicesModule> {\n return {\n ngModule: OctoServicesModule,\n providers: [\n {\n provide: OctoServiceOptions,\n useValue: octoServiceOptions\n },\n OctoMessageService\n ]\n };\n }\n}\n","export class GraphQL {\n public static getCursor(position: number): string {\n return btoa(`arrayconnection:${position}`);\n }\n\n public static offsetToCursor(offset: number): string | null {\n if (!offset) {\n return null;\n }\n\n return this.getCursor(offset - 1);\n }\n}\n\nexport const GraphQLCommonIgnoredProperties = ['__typename'];\nexport const GraphQLCloneIgnoredProperties = ['id', 'rtId', 'ckTypeId', '__typename'];\n","import { map, Subscription } from 'rxjs';\nimport { DataSourceBase, MessageService, PagedResultDto } from '@meshmakers/shared-services';\nimport { FieldFilterDto, InputMaybe, SearchFilterDto, SortDto } from '../shared/globalTypes';\nimport { Query, QueryRef } from 'apollo-angular';\nimport type { ApolloQueryResult, OperationVariables } from '@apollo/client/core';\nimport { GraphQL } from \"../shared/graphQL\";\n\nexport interface IQueryVariablesDto extends OperationVariables {\n first?: number | null | undefined;\n after?: string | null | undefined;\n sort?: InputMaybe<InputMaybe<SortDto> | InputMaybe<SortDto>[]> | undefined;\n searchFilter?: InputMaybe<SearchFilterDto> | undefined;\n fieldFilters?: InputMaybe<InputMaybe<FieldFilterDto>[] | InputMaybe<FieldFilterDto>>;\n}\n\nexport abstract class GraphQlDataSource<TDto> extends DataSourceBase<TDto> {\n public abstract refetch(): Promise<void>;\n\n public abstract refetchWith(\n skip?: number,\n take?: number,\n searchFilter?: SearchFilterDto | null,\n fieldFilter?: FieldFilterDto[] | null,\n sort?: SortDto[] | null\n ): Promise<void>;\n\n public abstract loadData(\n skip?: number,\n take?: number,\n searchFilter?: SearchFilterDto | null,\n fieldFilter?: FieldFilterDto[] | null,\n sort?: SortDto[] | null\n ): void;\n}\n\nexport class AssetRepoGraphQlDataSource<TDto, TQueryDto, TVariablesDto extends IQueryVariablesDto> extends GraphQlDataSource<TDto> {\n private queryRef: QueryRef<TQueryDto, TVariablesDto> | null;\n private subscription: Subscription | null;\n\n constructor(\n protected messageService: MessageService,\n private readonly query: Query<TQueryDto, TVariablesDto>,\n private readonly defaultSort: SortDto[] | null = null\n ) {\n super();\n this.queryRef = null;\n this.subscription = null;\n }\n\n override clear(): void {\n super.clear();\n this.queryRef?.stopPolling();\n this.queryRef = null;\n this.subscription?.unsubscribe();\n this.subscription = null;\n }\n\n public async refetch(): Promise<void> {\n await this.queryRef?.refetch();\n }\n\n public async refetchWith(\n skip = 0,\n take = 10,\n searchFilter: SearchFilterDto | null = null,\n fieldFilter: FieldFilterDto[] | null = null,\n sort: SortDto[] | null = null\n ): Promise<void> {\n const variables = this.createVariables(skip, take, searchFilter, fieldFilter, sort);\n await this.queryRef?.refetch(variables);\n }\n\n protected createVariables(\n skip = 0,\n take = 10,\n searchFilter: SearchFilterDto | null = null,\n fieldFilter: FieldFilterDto[] | null = null,\n sort: SortDto[] | null = null\n ): TVariablesDto {\n // Default sort\n if ((!sort || (sort && sort.length === 0)) && searchFilter === null) {\n sort = new Array<SortDto>();\n if (this.defaultSort) {\n sort = this.defaultSort;\n }\n }\n\n return {\n first: take,\n after: GraphQL.offsetToCursor(skip),\n sort,\n searchFilter,\n fieldFilters: fieldFilter\n } as TVariablesDto;\n }\n\n public loadData(\n skip = 0,\n take = 10,\n searchFilter: SearchFilterDto | null = null,\n fieldFilter: FieldFilterDto[] | null = null,\n sort: SortDto[] | null = null\n ): void {\n super.onBeginLoad();\n this.clear();\n\n const variables = this.createVariables(skip, take, searchFilter, fieldFilter, sort);\n this.queryRef = this.query.watch(variables, { errorPolicy: 'all' });\n\n this.subscription = this.queryRef.valueChanges\n .pipe(\n map((v, i) => this.executeLoad(v, i)))\n .subscribe({\n next: (pagedResult) => super.onCompleteLoad(pagedResult),\n error: (e) => {\n this.messageService.showErrorWithDetails(e);\n super.onCompleteLoad(new PagedResultDto<TDto>());\n }\n });\n }\n\n protected executeLoad(_value: ApolloQueryResult<TQueryDto>, _index: number): PagedResultDto<TDto> {\n return new PagedResultDto<TDto>();\n }\n}\n","/* eslint-disable */\n// @generated\n// This file was automatically generated and should not be edited.\n\n//==============================================================\n// START Enums and Input Objects\n//==============================================================\nexport type Maybe<T> = T | null;\nexport type InputMaybe<T> = Maybe<T>;\n\n/** All built-in and custom scalars, mapped to their actual values */\nexport type Scalars = {\n ID: { input: string; output: string; }\n String: { input: string; output: string; }\n Boolean: { input: boolean; output: boolean; }\n Int: { input: number; output: number; }\n Float: { input: number; output: number; }\n BigInt: { input: any; output: any; }\n CkAttributeId: { input: string; output: string; }\n CkEnumId: { input: string; output: string; }\n CkModelId: { input: any; output: any; }\n CkRecordId: { input: string; output: string; }\n CkTypeId: { input: string; output: string; }\n DateTime: { input: any; output: any; }\n Decimal: { input: any; output: any; }\n LargeBinary: { input: any; output: any; }\n OctoObjectId: { input: string; output: string; }\n Seconds: { input: any; output: any; }\n SimpleScalar: { input: any; output: any; }\n ULong: { input: any; output: any; }\n Uri: { input: any; output: any; }\n};\n\nexport type FieldFilterDto = {\n attributePath: Scalars['String']['input'];\n comparisonValue?: InputMaybe<Scalars['SimpleScalar']['input']>;\n operator: FieldFilterOperatorsDto;\n};\n\n/** Defines the operator of field compare */\nexport enum FieldFilterOperatorsDto {\n AnyEqDto = 'ANY_EQ',\n AnyLikeDto = 'ANY_LIKE',\n EqualsDto = 'EQUALS',\n GreaterEqualThanDto = 'GREATER_EQUAL_THAN',\n GreaterThanDto = 'GREATER_THAN',\n InDto = 'IN',\n LessEqualThanDto = 'LESS_EQUAL_THAN',\n LessThanDto = 'LESS_THAN',\n LikeDto = 'LIKE',\n MatchRegExDto = 'MATCH_REG_EX',\n NotEqualsDto = 'NOT_EQUALS',\n NotInDto = 'NOT_IN'\n}\n\n\nexport type SearchFilterDto = {\n attributePaths?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;\n language?: InputMaybe<Scalars['String']['input']>;\n searchTerm: Scalars['String']['input'];\n type?: InputMaybe<SearchFilterTypesDto>;\n};\n\n/** The type of search that is used (a text based search using text analysis (high performance, scoring, maybe more false positives) or filtering of attributes (lower performance, more exact results) */\nexport enum SearchFilterTypesDto {\n AttributeFilterDto = 'ATTRIBUTE_FILTER',\n TextSearchDto = 'TEXT_SEARCH'\n}\n\nexport type SortDto = {\n attributePath: Scalars['String']['input'];\n sortOrder?: InputMaybe<SortOrdersDto>;\n};\n\n/** Defines the sort order */\nexport enum SortOrdersDto {\n AscendingDto = 'ASCENDING',\n DefaultDto = 'DEFAULT',\n DescendingDto = 'DESCENDING'\n}\n\n//==============================================================\n// END Enums and Input Objects\n//==============================================================\n","/*\n * Public API Surface of octo-services\n */\n\nexport * from './lib/services/octo-graph-ql-service-base';\nexport * from './lib/services/octo-message.service';\nexport * from './lib/options/octo-service-options';\nexport * from './lib/octo-services.module';\nexport * from './lib/models/pagedGraphResultDto';\nexport * from './lib/shared/graphQL';\nexport * from './lib/services/assetRepoGraphQlDataSource';\nexport * from './lib/shared/globalTypes';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["map"],"mappings":";;;;;;;;AAEM,MAAO,mBAA0B,SAAQ,cAAiB,CAAA;AAC9D,IAAA,QAAQ;AAER,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;AAEP,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;;AAEvB;;MCCY,sBAAsB,CAAA;AAEd,IAAA,MAAA;AACA,IAAA,QAAA;AACA,IAAA,kBAAA;AAHnB,IAAA,WAAA,CACmB,MAAc,EACd,QAAkB,EAClB,kBAAsC,EAAA;QAFtC,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,QAAQ,GAAR,QAAQ;QACR,IAAA,CAAA,kBAAkB,GAAlB,kBAAkB;;IAG3B,WAAW,CACnB,QAAgB,EAChB,SAAoB,EACpB,SAAuB,EACvB,UAAmB,EACnB,CAAgE,EAAA;QAEhE,MAAM,KAAK,GAAG;cACV,IAAI,CAAC,iBAAiB,CAAqB,QAAQ,EAAE,SAAS,EAAE,SAAS;cACzE,IAAI,CAAC,YAAY,CAAqB,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC;QACzE,OAAO,KAAK,CAAC,IAAI,CACf,GAAG,CAAC,CAAC,MAAM,KAAI;AACb,YAAA,MAAM,SAAS,GAAG,IAAI,cAAc,EAAW;AAE/C,YAAA,IAAI,MAAM,CAAC,MAAM,IAAI,IAAI,EAAE;AACzB,gBAAA,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;AAC5B,gBAAA,MAAM,KAAK,CAAC,6BAA6B,CAAC;;AACrC,iBAAA,IAAI,MAAM,CAAC,IAAI,EAAE;AACtB,gBAAA,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC;;AAE3B,YAAA,OAAO,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AAA,CAAA,GAAA,YAA2B;AAC3B,IAAA,uBAAA,CAAA,UAAA,CAAA,GAAA,QAAmB;AACrB,CAAC,EAbW,uBAAuB,KAAvB,uBAAuB,GAAA,EAAA,CAAA,CAAA;AAuBnC;IACY;AAAZ,CAAA,UAAY,oBAAoB,EAAA;AAC9B,IAAA,oBAAA,CAAA,oBAAA,CAAA,GAAA,kBAAuC;AACvC,IAAA,oBAAA,CAAA,eAAA,CAAA,GAAA,aAA6B;AAC/B,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,GAAA,EAAA,CAAA,CAAA;AAUhC;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,cAAA,CAAA,GAAA,WAA0B;AAC1B,IAAA,aAAA,CAAA,YAAA,CAAA,GAAA,SAAsB;AACtB,IAAA,aAAA,CAAA,eAAA,CAAA,GAAA,YAA4B;AAC9B,CAAC,EAJW,aAAa,KAAb,aAAa,GAAA,EAAA,CAAA,CAAA;AAMzB;AACA;AACA;;ACnFA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,209 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { DocumentNode } from 'graphql';
|
|
2
|
+
import { Apollo, Query } from 'apollo-angular';
|
|
3
|
+
import { PagedResultDto, DataSourceBase, MessageService } from '@meshmakers/shared-services';
|
|
4
|
+
import { HttpLink } from 'apollo-angular/http';
|
|
5
|
+
import { OperationVariables } from '@apollo/client/core/types';
|
|
6
|
+
import { Observable } from 'rxjs';
|
|
7
|
+
import * as i0 from '@angular/core';
|
|
8
|
+
import { ModuleWithProviders } from '@angular/core';
|
|
9
|
+
import { OperationVariables as OperationVariables$1, ApolloQueryResult } from '@apollo/client/core';
|
|
10
|
+
|
|
11
|
+
declare class OctoServiceOptions {
|
|
12
|
+
assetServices: string | null;
|
|
13
|
+
defaultDataSourceId?: string;
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare class PagedGraphResultDto<P, C> extends PagedResultDto<C> {
|
|
18
|
+
document: P | null;
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class OctoGraphQLServiceBase {
|
|
23
|
+
private readonly apollo;
|
|
24
|
+
private readonly httpLink;
|
|
25
|
+
private readonly octoServiceOptions;
|
|
26
|
+
constructor(apollo: Apollo, httpLink: HttpLink, octoServiceOptions: OctoServiceOptions);
|
|
27
|
+
protected getEntities<TResult, TEntity, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, watchQuery: boolean, f: (resultSet: PagedResultDto<TEntity>, result: TResult) => void): Observable<PagedResultDto<TEntity>>;
|
|
28
|
+
protected getGraphEntities<TResult, TP, TC, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, watchQuery: boolean, f: (resultSet: PagedGraphResultDto<TP, TC>, result: TResult) => void): Observable<PagedGraphResultDto<TP, TC>>;
|
|
29
|
+
protected getEntityDetail<TResult, TEntity, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, watchQuery: boolean, f: (result: TResult) => TEntity): Observable<TEntity | null>;
|
|
30
|
+
protected createUpdateEntity<TResult, TEntity, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, f: (result: TResult | null | undefined) => TEntity): Observable<TEntity>;
|
|
31
|
+
protected deleteEntity<TResult, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, f: (result: TResult | null | undefined) => boolean): Observable<boolean>;
|
|
32
|
+
private createApolloForTenant;
|
|
33
|
+
private prepareWatchQuery;
|
|
34
|
+
private prepareQuery;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class OctoMessageService {
|
|
38
|
+
private readonly messageService;
|
|
39
|
+
showErrorWithDetails(error: any): void;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OctoMessageService, never>;
|
|
41
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<OctoMessageService>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare class OctoServicesModule {
|
|
45
|
+
static forRoot(octoServiceOptions: OctoServiceOptions): ModuleWithProviders<OctoServicesModule>;
|
|
46
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OctoServicesModule, never>;
|
|
47
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<OctoServicesModule, never, never, never>;
|
|
48
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<OctoServicesModule>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
declare class GraphQL {
|
|
52
|
+
static getCursor(position: number): string;
|
|
53
|
+
static offsetToCursor(offset: number): string | null;
|
|
54
|
+
}
|
|
55
|
+
declare const GraphQLCommonIgnoredProperties: string[];
|
|
56
|
+
declare const GraphQLCloneIgnoredProperties: string[];
|
|
57
|
+
|
|
58
|
+
type Maybe<T> = T | null;
|
|
59
|
+
type InputMaybe<T> = Maybe<T>;
|
|
60
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
61
|
+
type Scalars = {
|
|
62
|
+
ID: {
|
|
63
|
+
input: string;
|
|
64
|
+
output: string;
|
|
65
|
+
};
|
|
66
|
+
String: {
|
|
67
|
+
input: string;
|
|
68
|
+
output: string;
|
|
69
|
+
};
|
|
70
|
+
Boolean: {
|
|
71
|
+
input: boolean;
|
|
72
|
+
output: boolean;
|
|
73
|
+
};
|
|
74
|
+
Int: {
|
|
75
|
+
input: number;
|
|
76
|
+
output: number;
|
|
77
|
+
};
|
|
78
|
+
Float: {
|
|
79
|
+
input: number;
|
|
80
|
+
output: number;
|
|
81
|
+
};
|
|
82
|
+
BigInt: {
|
|
83
|
+
input: any;
|
|
84
|
+
output: any;
|
|
85
|
+
};
|
|
86
|
+
CkAttributeId: {
|
|
87
|
+
input: string;
|
|
88
|
+
output: string;
|
|
89
|
+
};
|
|
90
|
+
CkEnumId: {
|
|
91
|
+
input: string;
|
|
92
|
+
output: string;
|
|
93
|
+
};
|
|
94
|
+
CkModelId: {
|
|
95
|
+
input: any;
|
|
96
|
+
output: any;
|
|
97
|
+
};
|
|
98
|
+
CkRecordId: {
|
|
99
|
+
input: string;
|
|
100
|
+
output: string;
|
|
101
|
+
};
|
|
102
|
+
CkTypeId: {
|
|
103
|
+
input: string;
|
|
104
|
+
output: string;
|
|
105
|
+
};
|
|
106
|
+
DateTime: {
|
|
107
|
+
input: any;
|
|
108
|
+
output: any;
|
|
109
|
+
};
|
|
110
|
+
Decimal: {
|
|
111
|
+
input: any;
|
|
112
|
+
output: any;
|
|
113
|
+
};
|
|
114
|
+
LargeBinary: {
|
|
115
|
+
input: any;
|
|
116
|
+
output: any;
|
|
117
|
+
};
|
|
118
|
+
OctoObjectId: {
|
|
119
|
+
input: string;
|
|
120
|
+
output: string;
|
|
121
|
+
};
|
|
122
|
+
Seconds: {
|
|
123
|
+
input: any;
|
|
124
|
+
output: any;
|
|
125
|
+
};
|
|
126
|
+
SimpleScalar: {
|
|
127
|
+
input: any;
|
|
128
|
+
output: any;
|
|
129
|
+
};
|
|
130
|
+
ULong: {
|
|
131
|
+
input: any;
|
|
132
|
+
output: any;
|
|
133
|
+
};
|
|
134
|
+
Uri: {
|
|
135
|
+
input: any;
|
|
136
|
+
output: any;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
type FieldFilterDto = {
|
|
140
|
+
attributePath: Scalars['String']['input'];
|
|
141
|
+
comparisonValue?: InputMaybe<Scalars['SimpleScalar']['input']>;
|
|
142
|
+
operator: FieldFilterOperatorsDto;
|
|
143
|
+
};
|
|
144
|
+
/** Defines the operator of field compare */
|
|
145
|
+
declare enum FieldFilterOperatorsDto {
|
|
146
|
+
AnyEqDto = "ANY_EQ",
|
|
147
|
+
AnyLikeDto = "ANY_LIKE",
|
|
148
|
+
EqualsDto = "EQUALS",
|
|
149
|
+
GreaterEqualThanDto = "GREATER_EQUAL_THAN",
|
|
150
|
+
GreaterThanDto = "GREATER_THAN",
|
|
151
|
+
InDto = "IN",
|
|
152
|
+
LessEqualThanDto = "LESS_EQUAL_THAN",
|
|
153
|
+
LessThanDto = "LESS_THAN",
|
|
154
|
+
LikeDto = "LIKE",
|
|
155
|
+
MatchRegExDto = "MATCH_REG_EX",
|
|
156
|
+
NotEqualsDto = "NOT_EQUALS",
|
|
157
|
+
NotInDto = "NOT_IN"
|
|
158
|
+
}
|
|
159
|
+
type SearchFilterDto = {
|
|
160
|
+
attributePaths?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
161
|
+
language?: InputMaybe<Scalars['String']['input']>;
|
|
162
|
+
searchTerm: Scalars['String']['input'];
|
|
163
|
+
type?: InputMaybe<SearchFilterTypesDto>;
|
|
164
|
+
};
|
|
165
|
+
/** The type of search that is used (a text based search using text analysis (high performance, scoring, maybe more false positives) or filtering of attributes (lower performance, more exact results) */
|
|
166
|
+
declare enum SearchFilterTypesDto {
|
|
167
|
+
AttributeFilterDto = "ATTRIBUTE_FILTER",
|
|
168
|
+
TextSearchDto = "TEXT_SEARCH"
|
|
169
|
+
}
|
|
170
|
+
type SortDto = {
|
|
171
|
+
attributePath: Scalars['String']['input'];
|
|
172
|
+
sortOrder?: InputMaybe<SortOrdersDto>;
|
|
173
|
+
};
|
|
174
|
+
/** Defines the sort order */
|
|
175
|
+
declare enum SortOrdersDto {
|
|
176
|
+
AscendingDto = "ASCENDING",
|
|
177
|
+
DefaultDto = "DEFAULT",
|
|
178
|
+
DescendingDto = "DESCENDING"
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
interface IQueryVariablesDto extends OperationVariables$1 {
|
|
182
|
+
first?: number | null | undefined;
|
|
183
|
+
after?: string | null | undefined;
|
|
184
|
+
sort?: InputMaybe<InputMaybe<SortDto> | InputMaybe<SortDto>[]> | undefined;
|
|
185
|
+
searchFilter?: InputMaybe<SearchFilterDto> | undefined;
|
|
186
|
+
fieldFilters?: InputMaybe<InputMaybe<FieldFilterDto>[] | InputMaybe<FieldFilterDto>>;
|
|
187
|
+
}
|
|
188
|
+
declare abstract class GraphQlDataSource<TDto> extends DataSourceBase<TDto> {
|
|
189
|
+
abstract refetch(): Promise<void>;
|
|
190
|
+
abstract refetchWith(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): Promise<void>;
|
|
191
|
+
abstract loadData(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): void;
|
|
192
|
+
}
|
|
193
|
+
declare class AssetRepoGraphQlDataSource<TDto, TQueryDto, TVariablesDto extends IQueryVariablesDto> extends GraphQlDataSource<TDto> {
|
|
194
|
+
protected messageService: MessageService;
|
|
195
|
+
private readonly query;
|
|
196
|
+
private readonly defaultSort;
|
|
197
|
+
private queryRef;
|
|
198
|
+
private subscription;
|
|
199
|
+
constructor(messageService: MessageService, query: Query<TQueryDto, TVariablesDto>, defaultSort?: SortDto[] | null);
|
|
200
|
+
clear(): void;
|
|
201
|
+
refetch(): Promise<void>;
|
|
202
|
+
refetchWith(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): Promise<void>;
|
|
203
|
+
protected createVariables(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): TVariablesDto;
|
|
204
|
+
loadData(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): void;
|
|
205
|
+
protected executeLoad(_value: ApolloQueryResult<TQueryDto>, _index: number): PagedResultDto<TDto>;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export { AssetRepoGraphQlDataSource, FieldFilterOperatorsDto, GraphQL, GraphQLCloneIgnoredProperties, GraphQLCommonIgnoredProperties, GraphQlDataSource, OctoGraphQLServiceBase, OctoMessageService, OctoServiceOptions, OctoServicesModule, PagedGraphResultDto, SearchFilterTypesDto, SortOrdersDto };
|
|
209
|
+
export type { FieldFilterDto, IQueryVariablesDto, InputMaybe, Maybe, Scalars, SearchFilterDto, SortDto };
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshmakers/octo-services",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.113-0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "^
|
|
6
|
-
"@angular/core": "^
|
|
7
|
-
"apollo-angular": "
|
|
5
|
+
"@angular/common": "^20.1.2",
|
|
6
|
+
"@angular/core": "^20.1.2",
|
|
7
|
+
"apollo-angular": "11.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"tslib": "^2.8.1"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ModuleWithProviders } from '@angular/core';
|
|
2
|
-
import { OctoServiceOptions } from './options/octo-service-options';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class OctoServicesModule {
|
|
5
|
-
static forRoot(octoServiceOptions: OctoServiceOptions): ModuleWithProviders<OctoServicesModule>;
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OctoServicesModule, never>;
|
|
7
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<OctoServicesModule, never, never, never>;
|
|
8
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<OctoServicesModule>;
|
|
9
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { DataSourceBase, MessageService, PagedResultDto } from '@meshmakers/shared-services';
|
|
2
|
-
import { FieldFilterDto, InputMaybe, SearchFilterDto, SortDto } from '../shared/globalTypes';
|
|
3
|
-
import { Query } from 'apollo-angular';
|
|
4
|
-
import type { ApolloQueryResult, OperationVariables } from '@apollo/client/core';
|
|
5
|
-
export interface IQueryVariablesDto extends OperationVariables {
|
|
6
|
-
first?: number | null | undefined;
|
|
7
|
-
after?: string | null | undefined;
|
|
8
|
-
sort?: InputMaybe<InputMaybe<SortDto> | InputMaybe<SortDto>[]> | undefined;
|
|
9
|
-
searchFilter?: InputMaybe<SearchFilterDto> | undefined;
|
|
10
|
-
fieldFilters?: InputMaybe<InputMaybe<FieldFilterDto>[] | InputMaybe<FieldFilterDto>>;
|
|
11
|
-
}
|
|
12
|
-
export declare abstract class GraphQlDataSource<TDto> extends DataSourceBase<TDto> {
|
|
13
|
-
abstract refetch(): Promise<void>;
|
|
14
|
-
abstract refetchWith(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): Promise<void>;
|
|
15
|
-
abstract loadData(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): void;
|
|
16
|
-
}
|
|
17
|
-
export declare class AssetRepoGraphQlDataSource<TDto, TQueryDto, TVariablesDto extends IQueryVariablesDto> extends GraphQlDataSource<TDto> {
|
|
18
|
-
protected messageService: MessageService;
|
|
19
|
-
private readonly query;
|
|
20
|
-
private readonly defaultSort;
|
|
21
|
-
private queryRef;
|
|
22
|
-
private subscription;
|
|
23
|
-
constructor(messageService: MessageService, query: Query<TQueryDto, TVariablesDto>, defaultSort?: SortDto[] | null);
|
|
24
|
-
clear(): void;
|
|
25
|
-
refetch(): Promise<void>;
|
|
26
|
-
refetchWith(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): Promise<void>;
|
|
27
|
-
protected createVariables(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): TVariablesDto;
|
|
28
|
-
loadData(skip?: number, take?: number, searchFilter?: SearchFilterDto | null, fieldFilter?: FieldFilterDto[] | null, sort?: SortDto[] | null): void;
|
|
29
|
-
protected executeLoad(_value: ApolloQueryResult<TQueryDto>, _index: number): PagedResultDto<TDto>;
|
|
30
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { DocumentNode } from 'graphql';
|
|
2
|
-
import { Apollo } from 'apollo-angular';
|
|
3
|
-
import { OctoServiceOptions } from '../options/octo-service-options';
|
|
4
|
-
import { PagedGraphResultDto } from '../models/pagedGraphResultDto';
|
|
5
|
-
import { PagedResultDto } from '@meshmakers/shared-services';
|
|
6
|
-
import { HttpLink } from 'apollo-angular/http';
|
|
7
|
-
import { OperationVariables } from '@apollo/client/core/types';
|
|
8
|
-
import { Observable } from 'rxjs';
|
|
9
|
-
export declare class OctoGraphQLServiceBase {
|
|
10
|
-
private readonly apollo;
|
|
11
|
-
private readonly httpLink;
|
|
12
|
-
private readonly octoServiceOptions;
|
|
13
|
-
constructor(apollo: Apollo, httpLink: HttpLink, octoServiceOptions: OctoServiceOptions);
|
|
14
|
-
protected getEntities<TResult, TEntity, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, watchQuery: boolean, f: (resultSet: PagedResultDto<TEntity>, result: TResult) => void): Observable<PagedResultDto<TEntity>>;
|
|
15
|
-
protected getGraphEntities<TResult, TP, TC, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, watchQuery: boolean, f: (resultSet: PagedGraphResultDto<TP, TC>, result: TResult) => void): Observable<PagedGraphResultDto<TP, TC>>;
|
|
16
|
-
protected getEntityDetail<TResult, TEntity, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, watchQuery: boolean, f: (result: TResult) => TEntity): Observable<TEntity | null>;
|
|
17
|
-
protected createUpdateEntity<TResult, TEntity, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, f: (result: TResult | null | undefined) => TEntity): Observable<TEntity>;
|
|
18
|
-
protected deleteEntity<TResult, TVariable extends OperationVariables>(tenantId: string, variables: TVariable, queryNode: DocumentNode, f: (result: TResult | null | undefined) => boolean): Observable<boolean>;
|
|
19
|
-
private createApolloForTenant;
|
|
20
|
-
private prepareWatchQuery;
|
|
21
|
-
private prepareQuery;
|
|
22
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MessageService } from "@meshmakers/shared-services";
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class OctoMessageService {
|
|
4
|
-
private readonly messageService;
|
|
5
|
-
constructor(messageService: MessageService);
|
|
6
|
-
showErrorWithDetails(error: any): void;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<OctoMessageService, never>;
|
|
8
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<OctoMessageService>;
|
|
9
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
export type Maybe<T> = T | null;
|
|
2
|
-
export type InputMaybe<T> = Maybe<T>;
|
|
3
|
-
/** All built-in and custom scalars, mapped to their actual values */
|
|
4
|
-
export type Scalars = {
|
|
5
|
-
ID: {
|
|
6
|
-
input: string;
|
|
7
|
-
output: string;
|
|
8
|
-
};
|
|
9
|
-
String: {
|
|
10
|
-
input: string;
|
|
11
|
-
output: string;
|
|
12
|
-
};
|
|
13
|
-
Boolean: {
|
|
14
|
-
input: boolean;
|
|
15
|
-
output: boolean;
|
|
16
|
-
};
|
|
17
|
-
Int: {
|
|
18
|
-
input: number;
|
|
19
|
-
output: number;
|
|
20
|
-
};
|
|
21
|
-
Float: {
|
|
22
|
-
input: number;
|
|
23
|
-
output: number;
|
|
24
|
-
};
|
|
25
|
-
BigInt: {
|
|
26
|
-
input: any;
|
|
27
|
-
output: any;
|
|
28
|
-
};
|
|
29
|
-
CkAttributeId: {
|
|
30
|
-
input: string;
|
|
31
|
-
output: string;
|
|
32
|
-
};
|
|
33
|
-
CkEnumId: {
|
|
34
|
-
input: string;
|
|
35
|
-
output: string;
|
|
36
|
-
};
|
|
37
|
-
CkModelId: {
|
|
38
|
-
input: any;
|
|
39
|
-
output: any;
|
|
40
|
-
};
|
|
41
|
-
CkRecordId: {
|
|
42
|
-
input: string;
|
|
43
|
-
output: string;
|
|
44
|
-
};
|
|
45
|
-
CkTypeId: {
|
|
46
|
-
input: string;
|
|
47
|
-
output: string;
|
|
48
|
-
};
|
|
49
|
-
DateTime: {
|
|
50
|
-
input: any;
|
|
51
|
-
output: any;
|
|
52
|
-
};
|
|
53
|
-
Decimal: {
|
|
54
|
-
input: any;
|
|
55
|
-
output: any;
|
|
56
|
-
};
|
|
57
|
-
LargeBinary: {
|
|
58
|
-
input: any;
|
|
59
|
-
output: any;
|
|
60
|
-
};
|
|
61
|
-
OctoObjectId: {
|
|
62
|
-
input: string;
|
|
63
|
-
output: string;
|
|
64
|
-
};
|
|
65
|
-
Seconds: {
|
|
66
|
-
input: any;
|
|
67
|
-
output: any;
|
|
68
|
-
};
|
|
69
|
-
SimpleScalar: {
|
|
70
|
-
input: any;
|
|
71
|
-
output: any;
|
|
72
|
-
};
|
|
73
|
-
ULong: {
|
|
74
|
-
input: any;
|
|
75
|
-
output: any;
|
|
76
|
-
};
|
|
77
|
-
Uri: {
|
|
78
|
-
input: any;
|
|
79
|
-
output: any;
|
|
80
|
-
};
|
|
81
|
-
};
|
|
82
|
-
export type FieldFilterDto = {
|
|
83
|
-
attributePath: Scalars['String']['input'];
|
|
84
|
-
comparisonValue?: InputMaybe<Scalars['SimpleScalar']['input']>;
|
|
85
|
-
operator: FieldFilterOperatorsDto;
|
|
86
|
-
};
|
|
87
|
-
/** Defines the operator of field compare */
|
|
88
|
-
export declare enum FieldFilterOperatorsDto {
|
|
89
|
-
AnyEqDto = "ANY_EQ",
|
|
90
|
-
AnyLikeDto = "ANY_LIKE",
|
|
91
|
-
EqualsDto = "EQUALS",
|
|
92
|
-
GreaterEqualThanDto = "GREATER_EQUAL_THAN",
|
|
93
|
-
GreaterThanDto = "GREATER_THAN",
|
|
94
|
-
InDto = "IN",
|
|
95
|
-
LessEqualThanDto = "LESS_EQUAL_THAN",
|
|
96
|
-
LessThanDto = "LESS_THAN",
|
|
97
|
-
LikeDto = "LIKE",
|
|
98
|
-
MatchRegExDto = "MATCH_REG_EX",
|
|
99
|
-
NotEqualsDto = "NOT_EQUALS",
|
|
100
|
-
NotInDto = "NOT_IN"
|
|
101
|
-
}
|
|
102
|
-
export type SearchFilterDto = {
|
|
103
|
-
attributePaths?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
|
|
104
|
-
language?: InputMaybe<Scalars['String']['input']>;
|
|
105
|
-
searchTerm: Scalars['String']['input'];
|
|
106
|
-
type?: InputMaybe<SearchFilterTypesDto>;
|
|
107
|
-
};
|
|
108
|
-
/** The type of search that is used (a text based search using text analysis (high performance, scoring, maybe more false positives) or filtering of attributes (lower performance, more exact results) */
|
|
109
|
-
export declare enum SearchFilterTypesDto {
|
|
110
|
-
AttributeFilterDto = "ATTRIBUTE_FILTER",
|
|
111
|
-
TextSearchDto = "TEXT_SEARCH"
|
|
112
|
-
}
|
|
113
|
-
export type SortDto = {
|
|
114
|
-
attributePath: Scalars['String']['input'];
|
|
115
|
-
sortOrder?: InputMaybe<SortOrdersDto>;
|
|
116
|
-
};
|
|
117
|
-
/** Defines the sort order */
|
|
118
|
-
export declare enum SortOrdersDto {
|
|
119
|
-
AscendingDto = "ASCENDING",
|
|
120
|
-
DefaultDto = "DEFAULT",
|
|
121
|
-
DescendingDto = "DESCENDING"
|
|
122
|
-
}
|
package/lib/shared/graphQL.d.ts
DELETED
package/public-api.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from './lib/services/octo-graph-ql-service-base';
|
|
2
|
-
export * from './lib/services/octo-message.service';
|
|
3
|
-
export * from './lib/options/octo-service-options';
|
|
4
|
-
export * from './lib/octo-services.module';
|
|
5
|
-
export * from './lib/models/pagedGraphResultDto';
|
|
6
|
-
export * from './lib/shared/graphQL';
|
|
7
|
-
export * from './lib/services/assetRepoGraphQlDataSource';
|
|
8
|
-
export * from './lib/shared/globalTypes';
|