@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
1 lines • 20.9 kB
Source Map (JSON)
{"version":3,"file":"c8y-ngx-components-api.mjs","sources":["../../api/interceptor.model.ts","../../api/http-handler.model.ts","../../api/api.service.ts","../../api/services.ts","../../api/data.module.ts","../../api/index.ts","../../api/c8y-ngx-components-api.ts"],"sourcesContent":["import { ApiCall } from './api.model';\nimport { Observable } from 'rxjs';\nimport { IFetchResponse } from '@c8y/client';\n\nexport interface HttpInterceptor {\n intercept(req: ApiCall, next: HttpHandler): Observable<IFetchResponse>;\n}\n\nexport abstract class HttpHandler {\n abstract handle(req: ApiCall): Observable<IFetchResponse>;\n}\n","import { ApiCall } from './api.model';\nimport { Observable, from } from 'rxjs';\nimport { FetchClient, IFetchResponse } from '@c8y/client';\nimport { HttpHandler, HttpInterceptor } from './interceptor.model';\n\nexport class HttpInterceptHandler extends HttpHandler {\n constructor(protected interceptor: HttpInterceptor, protected nextHandler: HttpHandler) {\n super();\n }\n\n handle(req: ApiCall): Observable<IFetchResponse> {\n return this.interceptor.intercept(req, this.nextHandler);\n }\n}\n\nexport interface RequestStartAndFinish {\n onStart(req: ApiCall): void;\n onFinish(res: ApiCall): void;\n}\n\nexport class HttpRequestHandler extends HttpHandler {\n constructor(protected fetch: FetchClient['fetch'], protected apiService?: RequestStartAndFinish) {\n super();\n }\n\n handle(req: ApiCall): Observable<IFetchResponse> {\n const { options, url } = req;\n const { method } = options;\n this.apiService?.onStart({ method, options, url });\n let fetchPromise = this.fetch(url, options);\n if (typeof options.responseInterceptor === 'function') {\n fetchPromise = fetchPromise.then(options.responseInterceptor);\n }\n fetchPromise.then(\n (response: IFetchResponse) => this.apiService?.onFinish({ method, options, url, response }),\n (response: IFetchResponse) => this.apiService?.onFinish({ method, options, url, response })\n );\n return from(fetchPromise);\n }\n}\n","import { Injectable } from '@angular/core';\nimport { FetchClient, IFetchOptions, IFetchResponse } from '@c8y/client';\nimport { MonoTypeOperatorFunction, Observable, Subject, pipe } from 'rxjs';\nimport { distinctUntilChanged, filter, map, scan, shareReplay } from 'rxjs/operators';\nimport { ApiCall, ApiCallOptions } from './api.model';\nimport {\n HttpInterceptHandler,\n HttpRequestHandler,\n RequestStartAndFinish\n} from './http-handler.model';\nimport { HttpHandler, HttpInterceptor } from './interceptor.model';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApiService implements RequestStartAndFinish {\n calls: Observable<ApiCall>;\n isLoading$: Observable<boolean>;\n private callsSubject = new Subject<ApiCall>();\n private interceptors = new Map<string, HttpInterceptor>();\n private interceptorCounter = 0;\n\n constructor(private client: FetchClient) {\n this.calls = this.callsSubject.asObservable();\n this.hookIntoClientFetch();\n\n this.isLoading$ = this.calls.pipe(\n filter(({ url }) => !/notification\\/realtime/.test(url)),\n map(({ phase }) => (phase === 'start' ? 1 : -1)),\n scan((count, item) => count + item, 0),\n map(count => count > 0),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n\n /**\n * Allows to hook into the responses received by the FetchClient.\n * This is meant to be used to react on the responses, not for manipulation of the responses.\n * @param hookFilter A filter function to filter for specific responses.\n * @returns An Observable of the filtered responses.\n */\n hookResponse(hookFilter: (call: ApiCall) => boolean): Observable<ApiCall> {\n return this.callsSubject.pipe(\n filter(({ phase }) => phase === 'finish'),\n filter(hookFilter)\n );\n }\n\n /**\n * Allows to hook into the requests performed by the FetchClient.\n * This is meant to be used to react on the requests, not for manipulation of the requests.\n * @param hookFilter A filter function to filter for specific requests.\n * @returns An Observable of the filtered requests.\n */\n hookRequest(hookFilter: (call: ApiCall) => boolean): Observable<ApiCall> {\n return this.callsSubject.pipe(\n filter(({ phase }) => phase === 'start'),\n filter(hookFilter)\n );\n }\n\n /**\n * Notifies observers that an API call has finished.\n * @param call The API call that has finished.\n */\n onFinish(call: ApiCall): void {\n this.callsSubject.next({ phase: 'finish', ...call });\n }\n\n /**\n * Notifies observers that an API call has started.\n * @param call The API call that has started.\n */\n onStart(call: ApiCall): void {\n this.callsSubject.next({ phase: 'start', ...call });\n }\n\n /**\n * Resolves data from an API call response.\n * @returns A Promise containing an object with resolved data, method, and URL.\n */\n resolveData<T = unknown>(call: ApiCall): Promise<{ data: T; method: string; url: string }> {\n const { response, method, url } = call;\n if ('data' in response) {\n return Promise.resolve({ data: response.data, method, url });\n } else {\n // No Content success status, for example DELETE request.\n if ((response as Response)?.status === 204) {\n return Promise.resolve({ data: null, method, url });\n }\n const cb = data => ({ data, method, url });\n return (response as Response).clone().json().then(cb, cb);\n }\n }\n\n /**\n * Can be added to a pipe to exclude any permission call. Permission calls are PUT\n * request with only an id in it, to verify if the user has access to this managed object.\n * @returns The operator to be added to a pipe.\n */\n excludePermissionCall(): MonoTypeOperatorFunction<ApiCall> {\n return pipe(\n filter(({ method, options }) => {\n if (method === 'PUT' && options.body && typeof options.body === 'string') {\n const parsedBody = JSON.parse(options.body as string);\n const bodyKeys = Object.keys(parsedBody);\n return !(bodyKeys.length === 1 && bodyKeys[0] === 'id');\n }\n return true;\n })\n );\n }\n\n /**\n * Allows to intercept requests performed via the FetchClient requests.\n * @param interceptor The interceptor to be added.\n * @param id An optional unique identifier for the interceptor. The chain of interceptors is ordered by this id. And it can be used to remove the interceptor later on.\n * @returns The id of the interceptor (same as provided id if one was provided, otherwise an id will be generated).\n */\n addInterceptor(interceptor: HttpInterceptor, id?: string): string {\n if (!id) {\n id = `${++this.interceptorCounter}`;\n }\n this.interceptors.set(id, interceptor);\n return id;\n }\n\n /**\n * Allows to remove a previously added interceptor by it's id.\n * @param id The id of the interceptor that should be removed.\n * @returns true if an interceptor existed and has been removed, or false if id does not exist.\n */\n removeInterceptor(id: string): boolean {\n return this.interceptors.delete(id);\n }\n\n /**\n * Checks if an interceptor with a given id exists.\n * @param id The id of the interceptor.\n * @returns - Returns true if an interceptor with the given id exists, otherwise false.\n */\n hasInterceptor(id: string): boolean {\n return this.interceptors.has(id);\n }\n\n private hookIntoClientFetch() {\n const fetch: FetchClient['fetch'] = this.client.fetch.bind(this.client);\n const requestHandler = new HttpRequestHandler(fetch, this);\n this.client.fetch = async (\n url,\n options: ApiCallOptions & IFetchOptions = { method: 'GET' }\n ) => {\n const { method } = options;\n return this.createInterceptorChain({ url, options, method }, requestHandler).toPromise();\n };\n }\n\n private createInterceptorChain(\n call: ApiCall,\n requestHandler: HttpRequestHandler\n ): Observable<IFetchResponse> {\n let handler: HttpHandler = requestHandler;\n // Do some sorting to always apply the interceptors in the specific order\n const sortedInterceptorIds = Array.from(this.interceptors.keys()).sort((a, b) =>\n b.localeCompare(a)\n );\n for (const interceptorId of sortedInterceptorIds) {\n handler = new HttpInterceptHandler(this.interceptors.get(interceptorId), handler);\n }\n return handler.handle(call);\n }\n}\n","import {\n FetchClient,\n BasicAuth,\n CookieAuth,\n Realtime,\n EventBinaryService,\n EventService,\n InventoryService,\n MeasurementService,\n AlarmService,\n OperationBulkService,\n OperationService,\n ApplicationService,\n UserService,\n TenantService,\n SystemOptionsService,\n TenantOptionsService,\n TenantSecurityOptionsService,\n TenantLoginOptionsService,\n AuditService,\n InventoryRoleService,\n InventoryBinaryService,\n DeviceRegistrationService,\n DeviceRegistrationBulkService,\n UserRoleService,\n UserGroupService,\n IdentityService,\n TrustedCertificateService,\n CrlService,\n SmartGroupsService,\n SmartRulesService,\n FeatureService\n} from '@c8y/client';\n\nexport const defaultServicesFromClientLib = [\n FetchClient,\n BasicAuth,\n CookieAuth,\n Realtime,\n EventBinaryService,\n EventService,\n InventoryService,\n MeasurementService,\n AlarmService,\n OperationBulkService,\n OperationService,\n ApplicationService,\n UserService,\n TenantService,\n SystemOptionsService,\n TenantOptionsService,\n TenantSecurityOptionsService,\n TenantLoginOptionsService,\n AuditService,\n InventoryRoleService,\n InventoryBinaryService,\n DeviceRegistrationService,\n DeviceRegistrationBulkService,\n UserRoleService,\n UserGroupService,\n IdentityService,\n TrustedCertificateService,\n CrlService,\n SmartGroupsService,\n SmartRulesService,\n FeatureService\n] as const;\n","import {\n inject,\n Injector,\n ModuleWithProviders,\n NgModule,\n Optional,\n provideAppInitializer,\n Provider,\n runInInjectionContext,\n SkipSelf,\n Type,\n ValueProvider\n} from '@angular/core';\nimport {\n BasicAuth,\n FetchClient,\n Realtime,\n CookieAuth,\n BearerAuthFromSessionStorage\n} from '@c8y/client';\nimport { ApiService } from './api.service';\nimport { defaultServicesFromClientLib } from './services';\nimport { pickAuthStrategy } from '@c8y/bootstrap';\n\nfunction toProvider<T>(provide: Type<T>): Provider {\n let deps: Array<Type<FetchClient | Realtime | CookieAuth>> = [FetchClient, Realtime];\n if (provide === FetchClient) {\n deps = [CookieAuth];\n }\n if (provide === BasicAuth || provide === CookieAuth) {\n deps = [];\n }\n if (provide === Realtime) {\n deps = [FetchClient];\n }\n const depsWithExistingProvider = [\n [provide, new Optional(), new SkipSelf()], // let's see if we can find an existing provider (possibly null)\n ...deps\n ];\n return {\n provide,\n deps: depsWithExistingProvider,\n useFactory: (...args) => {\n // if there was an existing provider, it would be first in the list and we can return it\n if (args.length && args[0] !== null) {\n return args[0];\n }\n\n // otherwise we need to drop the first element as it would be null\n const providers = args.slice(1);\n // the other providers are the dependencies we need. They match the order of the deps array\n const existingProviders: ValueProvider[] = deps.map((dep, index) => {\n return { provide: dep, useValue: providers[index] };\n });\n\n // use this to dependency inject the dependencies and instantiate the class\n return runInInjectionContext(\n Injector.create({\n providers: [...existingProviders, { provide, useClass: provide, deps: deps }]\n }),\n () => {\n return inject(provide);\n }\n );\n }\n };\n}\n\n/**\n * Provides all services from `@c8y/client` library.\n * @returns An array of providers for all services from `@c8y/client` library.\n */\nexport function provideClientLibServices(): Provider[] {\n const providers: Provider[] = defaultServicesFromClientLib\n .map(service => toProvider(service as any))\n .concat([\n { provide: ApiService, useClass: ApiService, deps: [FetchClient] },\n // ensure that the auth strategy is set before the app is initialized\n provideAppInitializer(() => {\n const client = inject(FetchClient);\n const auth = pickAuthStrategy(BearerAuthFromSessionStorage, BasicAuth, CookieAuth);\n client.setAuth(auth);\n })\n ]);\n return providers;\n}\n\n/**\n * @deprecated use provideClientLibServices instead\n */\n@NgModule({\n providers: provideClientLibServices()\n})\nexport class DataModule {\n static providers(): Provider[] {\n return provideClientLibServices();\n }\n static forRoot(): ModuleWithProviders<DataModule> {\n return {\n ngModule: DataModule,\n providers: provideClientLibServices()\n };\n }\n}\n","export * from './api.service';\nexport * from './api.model';\nexport * from './data.module';\nexport * from './services';\nexport * from './interceptor.model';\n// do not expose as it might confuse people on what to implement\n// export * from './http-handler.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MAQsB,WAAW,CAAA;AAEhC;;ACLK,MAAO,oBAAqB,SAAQ,WAAW,CAAA;IACnD,WAAA,CAAsB,WAA4B,EAAY,WAAwB,EAAA;AACpF,QAAA,KAAK,EAAE;QADa,IAAA,CAAA,WAAW,GAAX,WAAW;QAA6B,IAAA,CAAA,WAAW,GAAX,WAAW;IAEzE;AAEA,IAAA,MAAM,CAAC,GAAY,EAAA;AACjB,QAAA,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC;IAC1D;AACD;AAOK,MAAO,kBAAmB,SAAQ,WAAW,CAAA;IACjD,WAAA,CAAsB,KAA2B,EAAY,UAAkC,EAAA;AAC7F,QAAA,KAAK,EAAE;QADa,IAAA,CAAA,KAAK,GAAL,KAAK;QAAkC,IAAA,CAAA,UAAU,GAAV,UAAU;IAEvE;AAEA,IAAA,MAAM,CAAC,GAAY,EAAA;AACjB,QAAA,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG;AAC5B,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO;AAC1B,QAAA,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAClD,IAAI,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC;AAC3C,QAAA,IAAI,OAAO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