@tilde-nlp/ngx-services 6.0.21 → 6.0.22
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.
|
@@ -25,6 +25,9 @@ export class AnonymisationService extends BaseService {
|
|
|
25
25
|
getDocumentList() {
|
|
26
26
|
return this.#http.get(`${this.configuration.url}/anonymisation/document/list`);
|
|
27
27
|
}
|
|
28
|
+
updateDocument(id, document) {
|
|
29
|
+
return this.#http.put(`${this.configuration.url}/anonymisation/document/${id}`, document);
|
|
30
|
+
}
|
|
28
31
|
downloadDocument(id) {
|
|
29
32
|
return this.#http.get(`${this.configuration.url}/anonymisation/document/${id}/file`, { responseType: 'blob' });
|
|
30
33
|
}
|
|
@@ -48,4 +51,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImpor
|
|
|
48
51
|
providedIn: 'root'
|
|
49
52
|
}]
|
|
50
53
|
}], ctorParameters: () => [] });
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYW5vbnltaXNhdGlvbi5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNlcnZpY2VzL3NyYy9saWIvYW5vbnltaXNhdGlvbi9hbm9ueW1pc2F0aW9uLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBYSxNQUFNLHNCQUFzQixDQUFDO0FBQzdELE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25ELE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQzs7QUFXM0QsTUFBTSxPQUFPLG9CQUFxQixTQUFRLFdBQThD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ndXJhdGlvbi51cmx9L2Fub255bWlzYXRpb24vZG9jdW1lbnRgLCBmb3JtRGF0YSwgeyByZXBvcnRQcm9ncmVzczogdHJ1ZSwgb2JzZXJ2ZTogXCJldmVudHNcIiB9KTtcclxuICB9XHJcbn1cclxuIl19
|
|
@@ -139,6 +139,9 @@ class AnonymisationService extends BaseService {
|
|
|
139
139
|
getDocumentList() {
|
|
140
140
|
return this.#http.get(`${this.configuration.url}/anonymisation/document/list`);
|
|
141
141
|
}
|
|
142
|
+
updateDocument(id, document) {
|
|
143
|
+
return this.#http.put(`${this.configuration.url}/anonymisation/document/${id}`, document);
|
|
144
|
+
}
|
|
142
145
|
downloadDocument(id) {
|
|
143
146
|
return this.#http.get(`${this.configuration.url}/anonymisation/document/${id}/file`, { responseType: 'blob' });
|
|
144
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tilde-nlp-ngx-services.mjs","sources":["../../../projects/ngx-services/src/lib/tokens/service-configuration.token.ts","../../../projects/ngx-services/src/lib/base-service/base.service.ts","../../../projects/ngx-services/src/lib/mt-proxy/mt-proxy.service.ts","../../../projects/ngx-services/src/lib/llm-service/models/llm-writing-style.enum.ts","../../../projects/ngx-services/src/lib/llm-service/models/llm-use-case.enum.ts","../../../projects/ngx-services/src/lib/helpers/custom-headers.helper.ts","../../../projects/ngx-services/src/lib/llm-service/llm.service.ts","../../../projects/ngx-services/src/lib/quota-service/models/quota-type.enum.ts","../../../projects/ngx-services/src/lib/quota-service/quota.service.ts","../../../projects/ngx-services/src/lib/anonymisation/anonymisation.service.ts","../../../projects/ngx-services/src/public-api.ts","../../../projects/ngx-services/src/tilde-nlp-ngx-services.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { ServiceConfiguration } from \"../configuration/service-configuration.model\";\r\n\r\nexport const serviceConfigurationToken = new InjectionToken<ServiceConfiguration>(\"ngx-tld-services Api service configuration.\");\r\n","import { inject } from \"@angular/core\";\r\nimport { serviceConfigurationToken } from \"../tokens/service-configuration.token\";\r\nimport { ServiceConfiguration } from \"../configuration/service-configuration.model\";\r\nimport { HttpClient } from \"@angular/common/http\";\r\nimport { SharedServiceConfiguration } from \"../configuration/shared-service-configuration.model\";\r\n\r\nexport abstract class BaseService<ConfigType> {\r\n readonly configuration: ConfigType;\r\n readonly sharedServiceConfiguration: SharedServiceConfiguration;\r\n\r\n readonly http: HttpClient = inject(HttpClient);\r\n\r\n readonly #allServiceConfiguration = inject(serviceConfigurationToken);\r\n\r\n constructor(getConfig: (allServiceConfiguration: ServiceConfiguration) => ConfigType | undefined) {\r\n const serviceConfig = getConfig(this.#allServiceConfiguration);\r\n\r\n if (!serviceConfig) {\r\n throw new Error(`${Object.getPrototypeOf(this).constructor.name} is created, but no service configuration defined in 'serviceConfigurationToken'. Config: ${JSON.stringify(this.#allServiceConfiguration)}`);\r\n }\r\n this.configuration = serviceConfig;\r\n this.sharedServiceConfiguration = this.#allServiceConfiguration.sharedConfiguration;\r\n }\r\n\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { LanguageDirectionResponse } from './models/language-direction-response.model';\r\nimport { MtProxyConfiguration } from './models/mt-proxy-configuration.model';\r\nimport { TextTranslationRequest } from './models/text-translation-request.model';\r\nimport { TextTranslationResponse } from './models/text-translation-response.model';\r\nimport { BaseService } from '../base-service/base.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MtProxyService extends BaseService<MtProxyConfiguration> {\r\n\r\n readonly #httpClient = inject(HttpClient);\r\n\r\n get #baseUrl() {\r\n return `${this.configuration.url}/translate`\r\n }\r\n\r\n constructor() {\r\n super(config => config.mtProxyService);\r\n }\r\n\r\n /**\r\n *\r\n * @returns available language directions.\r\n */\r\n getLanguageDirections(): Observable<LanguageDirectionResponse> {\r\n return this.#httpClient.get<LanguageDirectionResponse>(`${this.#baseUrl}/language-directions`);\r\n }\r\n\r\n translateText(request: TextTranslationRequest): Observable<TextTranslationResponse> {\r\n return this.#httpClient.post<TextTranslationResponse>(`${this.#baseUrl}/text`, request);\r\n }\r\n}\r\n","export enum LLMWritingStyle {\r\n GENERAL = 'General',\r\n PROFESSIONAL = 'Professional',\r\n ACADEMIC = 'Academic'\r\n}","export enum LLMUseCase {\r\n Event = \"event\",\r\n General = \"general\"\r\n}\r\n","export class CustomHeadersHelper {\r\n static xAppIdHeader(appId: string) {\r\n return { \"X-App-Id\": appId };\r\n }\r\n}\r\n","import { HttpClient } from \"@angular/common/http\";\r\nimport { inject, Injectable } from \"@angular/core\";\r\nimport { Observable } from \"rxjs\";\r\nimport { BaseService } from \"../base-service/base.service\";\r\nimport { CustomHeadersHelper } from \"../helpers/custom-headers.helper\";\r\nimport { LLMRephraseRequest } from \"./models/llm-rephrase-request.model\";\r\nimport { LLMServiceConfiguration } from \"./models/llm-service-configuration.model\";\r\nimport { LLMSummarizeRequest } from \"./models/llm-summarize-request.model\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class LLMService extends BaseService<LLMServiceConfiguration> {\r\n readonly #http = inject(HttpClient);\r\n\r\n constructor() {\r\n super(config => config.llmService);\r\n }\r\n\r\n rephrase(request: LLMRephraseRequest): Observable<string> {\r\n const headers = CustomHeadersHelper.xAppIdHeader(this.sharedServiceConfiguration.xAppId);\r\n return this.#http.post(`${this.configuration.url}/rewrite`, request, { responseType: \"text\", headers })\r\n\r\n }\r\n\r\n summarize(request: LLMSummarizeRequest): Observable<string> {\r\n const headers = CustomHeadersHelper.xAppIdHeader(this.sharedServiceConfiguration.xAppId);\r\n return this.#http.post(`${this.configuration.url}/summarize/`, request, { responseType: \"text\", headers })\r\n }\r\n}\r\n","export enum QuotaType {\r\n\tTRANSLATION_DOCUMENTS = 'TranslationDocuments',\r\n\tLLM_CHARACTER_COUNT = 'LlmCharacterCount',\r\n\tLLM_REQUESTS = 'LlmRequests',\r\n LEGACY_TRANSLATION_DOCUMENTS= 5,\r\n LEGACY_LLM_CHARACTER_COUNT = 6,\r\n\tLEGACY_LLM_REQUESTS = 7,\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { QuotaServiceConfiguration } from \"./models/quota-service-configuration.model\";\r\nimport { BaseService } from \"../base-service/base.service\";\r\nimport { Observable } from \"rxjs\";\r\nimport { QuotaUsage } from \"./models/quota-usage.model\";\r\nimport { CustomHeadersHelper } from \"../helpers/custom-headers.helper\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class QuotaService extends BaseService<QuotaServiceConfiguration> {\r\n\r\n constructor() {\r\n super(config => config.quotaService);\r\n }\r\n\r\n getQuotaUsage(): Observable<{ usage: QuotaUsage[] }> {\r\n const headers = CustomHeadersHelper.xAppIdHeader(this.sharedServiceConfiguration.xAppId);\r\n return this.http.get<{ usage: QuotaUsage[] }>(this.configuration.url, { headers });\r\n }\r\n}\r\n","import { HttpClient, HttpEvent } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { BaseService } from '../base-service/base.service';\r\nimport { AnonymisationServiceConfiguration } from './models/anonymisation-configuration.model';\r\nimport { Observable } from 'rxjs';\r\nimport { Document } from './models/document.model';\r\nimport { DocumentJson, UploadDocument } from './models';\r\nimport { ClassCategory } from './models/class-category.model';\r\nimport { ClassCategories } from './models/class-categories.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AnonymisationService extends BaseService<AnonymisationServiceConfiguration> {\r\n readonly #http = inject(HttpClient);\r\n\r\n constructor() {\r\n super(config => config.anonymisationsService);\r\n }\r\n\r\n getSettings(): Observable<ClassCategories> {\r\n return this.#http.get<ClassCategories>(`${this.configuration.url}/anonymisation/settings`);\r\n }\r\n\r\n setSettings(settings: ClassCategory[]): Observable<ClassCategories> {\r\n return this.#http.put<ClassCategories>(`${this.configuration.url}/anonymisation/settings`, { classCategories: settings });\r\n }\r\n\r\n getDocumentJson(id: string): Observable<DocumentJson> {\r\n return this.#http.get<DocumentJson>(`${this.configuration.url}/anonymisation/document/${id}/json`);\r\n }\r\n\r\n saveDocumentJson(document: DocumentJson): Observable<DocumentJson> {\r\n return this.#http.put<DocumentJson>(`${this.configuration.url}/anonymisation/document/${document.id}/json`, document);\r\n }\r\n\r\n getDocumentById(id: string): Observable<Document> {\r\n return this.#http.get<Document>(`${this.configuration.url}/anonymisation/document/${id}`);\r\n }\r\n\r\n getDocumentList(): Observable<Document[]> {\r\n return this.#http.get<Document[]>(`${this.configuration.url}/anonymisation/document/list`);\r\n }\r\n\r\n downloadDocument(id: string): Observable<Blob> {\r\n return this.#http.get(`${this.configuration.url}/anonymisation/document/${id}/file`, { responseType: 'blob' });\r\n }\r\n\r\n deleteDocument(id: string): Observable<void> {\r\n return this.#http.delete<void>(`${this.configuration.url}/anonymisation/document/${id}`);\r\n }\r\n\r\n uploadDocument(body: UploadDocument): Observable<HttpEvent<Document>> {\r\n const formData = new FormData;\r\n formData.append('Title', body.title);\r\n formData.append('Language', body.language);\r\n formData.append('File', body.file);\r\n formData.append('ClassCategories', JSON.stringify(body.classCategories));\r\n\r\n return this.#http.post<Document>(`${this.configuration.url}/anonymisation/document`, formData, { reportProgress: true, observe: \"events\" });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-services\r\n */\r\n\r\nexport * from './lib';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAGa,yBAAyB,GAAG,IAAI,cAAc,CAAuB,6CAA6C;;MCGzG,WAAW,CAAA;AAMtB,IAAA,wBAAwB,CAAqC;AAEtE,IAAA,WAAA,CAAY,SAAoF,EAAA;AAJvF,QAAA,IAAA,CAAA,IAAI,GAAe,MAAM,CAAC,UAAU,CAAC,CAAC;AAEtC,QAAA,IAAA,CAAA,wBAAwB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;QAGpE,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CA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,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACZD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"tilde-nlp-ngx-services.mjs","sources":["../../../projects/ngx-services/src/lib/tokens/service-configuration.token.ts","../../../projects/ngx-services/src/lib/base-service/base.service.ts","../../../projects/ngx-services/src/lib/mt-proxy/mt-proxy.service.ts","../../../projects/ngx-services/src/lib/llm-service/models/llm-writing-style.enum.ts","../../../projects/ngx-services/src/lib/llm-service/models/llm-use-case.enum.ts","../../../projects/ngx-services/src/lib/helpers/custom-headers.helper.ts","../../../projects/ngx-services/src/lib/llm-service/llm.service.ts","../../../projects/ngx-services/src/lib/quota-service/models/quota-type.enum.ts","../../../projects/ngx-services/src/lib/quota-service/quota.service.ts","../../../projects/ngx-services/src/lib/anonymisation/anonymisation.service.ts","../../../projects/ngx-services/src/public-api.ts","../../../projects/ngx-services/src/tilde-nlp-ngx-services.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { ServiceConfiguration } from \"../configuration/service-configuration.model\";\r\n\r\nexport const serviceConfigurationToken = new InjectionToken<ServiceConfiguration>(\"ngx-tld-services Api service configuration.\");\r\n","import { inject } from \"@angular/core\";\r\nimport { serviceConfigurationToken } from \"../tokens/service-configuration.token\";\r\nimport { ServiceConfiguration } from \"../configuration/service-configuration.model\";\r\nimport { HttpClient } from \"@angular/common/http\";\r\nimport { SharedServiceConfiguration } from \"../configuration/shared-service-configuration.model\";\r\n\r\nexport abstract class BaseService<ConfigType> {\r\n readonly configuration: ConfigType;\r\n readonly sharedServiceConfiguration: SharedServiceConfiguration;\r\n\r\n readonly http: HttpClient = inject(HttpClient);\r\n\r\n readonly #allServiceConfiguration = inject(serviceConfigurationToken);\r\n\r\n constructor(getConfig: (allServiceConfiguration: ServiceConfiguration) => ConfigType | undefined) {\r\n const serviceConfig = getConfig(this.#allServiceConfiguration);\r\n\r\n if (!serviceConfig) {\r\n throw new Error(`${Object.getPrototypeOf(this).constructor.name} is created, but no service configuration defined in 'serviceConfigurationToken'. Config: ${JSON.stringify(this.#allServiceConfiguration)}`);\r\n }\r\n this.configuration = serviceConfig;\r\n this.sharedServiceConfiguration = this.#allServiceConfiguration.sharedConfiguration;\r\n }\r\n\r\n}\r\n","import { HttpClient } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { LanguageDirectionResponse } from './models/language-direction-response.model';\r\nimport { MtProxyConfiguration } from './models/mt-proxy-configuration.model';\r\nimport { TextTranslationRequest } from './models/text-translation-request.model';\r\nimport { TextTranslationResponse } from './models/text-translation-response.model';\r\nimport { BaseService } from '../base-service/base.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MtProxyService extends BaseService<MtProxyConfiguration> {\r\n\r\n readonly #httpClient = inject(HttpClient);\r\n\r\n get #baseUrl() {\r\n return `${this.configuration.url}/translate`\r\n }\r\n\r\n constructor() {\r\n super(config => config.mtProxyService);\r\n }\r\n\r\n /**\r\n *\r\n * @returns available language directions.\r\n */\r\n getLanguageDirections(): Observable<LanguageDirectionResponse> {\r\n return this.#httpClient.get<LanguageDirectionResponse>(`${this.#baseUrl}/language-directions`);\r\n }\r\n\r\n translateText(request: TextTranslationRequest): Observable<TextTranslationResponse> {\r\n return this.#httpClient.post<TextTranslationResponse>(`${this.#baseUrl}/text`, request);\r\n }\r\n}\r\n","export enum LLMWritingStyle {\r\n GENERAL = 'General',\r\n PROFESSIONAL = 'Professional',\r\n ACADEMIC = 'Academic'\r\n}","export enum LLMUseCase {\r\n Event = \"event\",\r\n General = \"general\"\r\n}\r\n","export class CustomHeadersHelper {\r\n static xAppIdHeader(appId: string) {\r\n return { \"X-App-Id\": appId };\r\n }\r\n}\r\n","import { HttpClient } from \"@angular/common/http\";\r\nimport { inject, Injectable } from \"@angular/core\";\r\nimport { Observable } from \"rxjs\";\r\nimport { BaseService } from \"../base-service/base.service\";\r\nimport { CustomHeadersHelper } from \"../helpers/custom-headers.helper\";\r\nimport { LLMRephraseRequest } from \"./models/llm-rephrase-request.model\";\r\nimport { LLMServiceConfiguration } from \"./models/llm-service-configuration.model\";\r\nimport { LLMSummarizeRequest } from \"./models/llm-summarize-request.model\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class LLMService extends BaseService<LLMServiceConfiguration> {\r\n readonly #http = inject(HttpClient);\r\n\r\n constructor() {\r\n super(config => config.llmService);\r\n }\r\n\r\n rephrase(request: LLMRephraseRequest): Observable<string> {\r\n const headers = CustomHeadersHelper.xAppIdHeader(this.sharedServiceConfiguration.xAppId);\r\n return this.#http.post(`${this.configuration.url}/rewrite`, request, { responseType: \"text\", headers })\r\n\r\n }\r\n\r\n summarize(request: LLMSummarizeRequest): Observable<string> {\r\n const headers = CustomHeadersHelper.xAppIdHeader(this.sharedServiceConfiguration.xAppId);\r\n return this.#http.post(`${this.configuration.url}/summarize/`, request, { responseType: \"text\", headers })\r\n }\r\n}\r\n","export enum QuotaType {\r\n\tTRANSLATION_DOCUMENTS = 'TranslationDocuments',\r\n\tLLM_CHARACTER_COUNT = 'LlmCharacterCount',\r\n\tLLM_REQUESTS = 'LlmRequests',\r\n LEGACY_TRANSLATION_DOCUMENTS= 5,\r\n LEGACY_LLM_CHARACTER_COUNT = 6,\r\n\tLEGACY_LLM_REQUESTS = 7,\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { QuotaServiceConfiguration } from \"./models/quota-service-configuration.model\";\r\nimport { BaseService } from \"../base-service/base.service\";\r\nimport { Observable } from \"rxjs\";\r\nimport { QuotaUsage } from \"./models/quota-usage.model\";\r\nimport { CustomHeadersHelper } from \"../helpers/custom-headers.helper\";\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class QuotaService extends BaseService<QuotaServiceConfiguration> {\r\n\r\n constructor() {\r\n super(config => config.quotaService);\r\n }\r\n\r\n getQuotaUsage(): Observable<{ usage: QuotaUsage[] }> {\r\n const headers = CustomHeadersHelper.xAppIdHeader(this.sharedServiceConfiguration.xAppId);\r\n return this.http.get<{ usage: QuotaUsage[] }>(this.configuration.url, { headers });\r\n }\r\n}\r\n","import { HttpClient, HttpEvent } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { BaseService } from '../base-service/base.service';\r\nimport { AnonymisationServiceConfiguration } from './models/anonymisation-configuration.model';\r\nimport { Observable } from 'rxjs';\r\nimport { Document } from './models/document.model';\r\nimport { DocumentJson, UploadDocument } from './models';\r\nimport { ClassCategory } from './models/class-category.model';\r\nimport { ClassCategories } from './models/class-categories.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AnonymisationService extends BaseService<AnonymisationServiceConfiguration> {\r\n readonly #http = inject(HttpClient);\r\n\r\n constructor() {\r\n super(config => config.anonymisationsService);\r\n }\r\n\r\n getSettings(): Observable<ClassCategories> {\r\n return this.#http.get<ClassCategories>(`${this.configuration.url}/anonymisation/settings`);\r\n }\r\n\r\n setSettings(settings: ClassCategory[]): Observable<ClassCategories> {\r\n return this.#http.put<ClassCategories>(`${this.configuration.url}/anonymisation/settings`, { classCategories: settings });\r\n }\r\n\r\n getDocumentJson(id: string): Observable<DocumentJson> {\r\n return this.#http.get<DocumentJson>(`${this.configuration.url}/anonymisation/document/${id}/json`);\r\n }\r\n\r\n saveDocumentJson(document: DocumentJson): Observable<DocumentJson> {\r\n return this.#http.put<DocumentJson>(`${this.configuration.url}/anonymisation/document/${document.id}/json`, document);\r\n }\r\n\r\n getDocumentById(id: string): Observable<Document> {\r\n return this.#http.get<Document>(`${this.configuration.url}/anonymisation/document/${id}`);\r\n }\r\n\r\n getDocumentList(): Observable<Document[]> {\r\n return this.#http.get<Document[]>(`${this.configuration.url}/anonymisation/document/list`);\r\n }\r\n \r\n updateDocument(id: string, document: Document): Observable<Document> {\r\n return this.#http.put<Document>(`${this.configuration.url}/anonymisation/document/${id}`, document);\r\n }\r\n\r\n downloadDocument(id: string): Observable<Blob> {\r\n return this.#http.get(`${this.configuration.url}/anonymisation/document/${id}/file`, { responseType: 'blob' });\r\n }\r\n\r\n deleteDocument(id: string): Observable<void> {\r\n return this.#http.delete<void>(`${this.configuration.url}/anonymisation/document/${id}`);\r\n }\r\n\r\n uploadDocument(body: UploadDocument): Observable<HttpEvent<Document>> {\r\n const formData = new FormData;\r\n formData.append('Title', body.title);\r\n formData.append('Language', body.language);\r\n formData.append('File', body.file);\r\n formData.append('ClassCategories', JSON.stringify(body.classCategories));\r\n\r\n return this.#http.post<Document>(`${this.configuration.url}/anonymisation/document`, formData, { reportProgress: true, observe: \"events\" });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of ngx-services\r\n */\r\n\r\nexport * from './lib';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAGa,yBAAyB,GAAG,IAAI,cAAc,CAAuB,6CAA6C;;MCGzG,WAAW,CAAA;AAMtB,IAAA,wBAAwB,CAAqC;AAEtE,IAAA,WAAA,CAAY,SAAoF,EAAA;AAJvF,QAAA,IAAA,CAAA,IAAI,GAAe,MAAM,CAAC,UAAU,CAAC,CAAC;AAEtC,QAAA,IAAA,CAAA,wBAAwB,GAAG,MAAM,CAAC,yBAAyB,CAAC,CAAC;QAGpE,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAE/D,IAAI,CAAC,aAAa,EAAE;YAClB,MAAM,IAAI,KAAK,CAAC,CAAG,EAAA,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,CAAA,0FAAA,EAA6F,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAE,CAAA,CAAC,CAAC;SAC9M;AACD,QAAA,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,wBAAwB,CAAC,mBAAmB,CAAC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ocumentJson): Observable<DocumentJson>;
|
|
17
17
|
getDocumentById(id: string): Observable<Document>;
|
|
18
18
|
getDocumentList(): Observable<Document[]>;
|
|
19
|
+
updateDocument(id: string, document: Document): Observable<Document>;
|
|
19
20
|
downloadDocument(id: string): Observable<Blob>;
|
|
20
21
|
deleteDocument(id: string): Observable<void>;
|
|
21
22
|
uploadDocument(body: UploadDocument): Observable<HttpEvent<Document>>;
|