@rxap/remote-method 14.0.2 → 16.0.0-dev.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/directive/lib/remote-method-template-collection.directive.d.ts +1 -1
- package/directive/lib/remote-method-template.directive.d.ts +1 -1
- package/directive/lib/remote-method.directive.d.ts +1 -1
- package/esm2022/directive/lib/remote-method-template-collection.directive.mjs +335 -0
- package/esm2022/directive/lib/remote-method-template.directive.mjs +203 -0
- package/esm2022/directive/lib/remote-method.directive.mjs +167 -0
- package/esm2022/http/directive/lib/contenteditable.directive.mjs +88 -0
- package/esm2022/http/directive/lib/http-remote-method.directive.mjs +81 -0
- package/esm2022/http/lib/base-http.remote-method.mjs +83 -0
- package/esm2022/http/lib/http-remote-method.loader.mjs +31 -0
- package/esm2022/http/lib/http.remote-method.mjs +46 -0
- package/esm2022/lib/base.remote-method.mjs +74 -0
- package/esm2022/lib/proxy.remote-method.mjs +30 -0
- package/esm2022/lib/remote-method-loader.mjs +18 -0
- package/{fesm2020 → fesm2022}/rxap-remote-method-directive.mjs +91 -91
- package/{fesm2020 → fesm2022}/rxap-remote-method-directive.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/rxap-remote-method-http-directive.mjs +14 -14
- package/fesm2022/rxap-remote-method-http-directive.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/rxap-remote-method-http.mjs +9 -9
- package/{fesm2020 → fesm2022}/rxap-remote-method-http.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/rxap-remote-method.mjs +9 -9
- package/{fesm2020 → fesm2022}/rxap-remote-method.mjs.map +1 -1
- package/http/directive/lib/contenteditable.directive.d.ts +1 -1
- package/http/directive/lib/http-remote-method.directive.d.ts +1 -1
- package/package.json +30 -43
- package/testing/lib/remote-method-testing-loader.d.ts +1 -1
- package/esm2020/directive/lib/remote-method-template-collection.directive.mjs +0 -333
- package/esm2020/directive/lib/remote-method-template.directive.mjs +0 -201
- package/esm2020/directive/lib/remote-method.directive.mjs +0 -165
- package/esm2020/http/directive/lib/contenteditable.directive.mjs +0 -86
- package/esm2020/http/directive/lib/http-remote-method.directive.mjs +0 -79
- package/esm2020/http/lib/base-http.remote-method.mjs +0 -82
- package/esm2020/http/lib/http-remote-method.loader.mjs +0 -30
- package/esm2020/http/lib/http.remote-method.mjs +0 -45
- package/esm2020/lib/base.remote-method.mjs +0 -73
- package/esm2020/lib/proxy.remote-method.mjs +0 -29
- package/esm2020/lib/remote-method-loader.mjs +0 -17
- package/fesm2015/rxap-remote-method-directive.mjs +0 -712
- package/fesm2015/rxap-remote-method-directive.mjs.map +0 -1
- package/fesm2015/rxap-remote-method-http-directive.mjs +0 -172
- package/fesm2015/rxap-remote-method-http-directive.mjs.map +0 -1
- package/fesm2015/rxap-remote-method-http.mjs +0 -158
- package/fesm2015/rxap-remote-method-http.mjs.map +0 -1
- package/fesm2015/rxap-remote-method-testing.mjs +0 -60
- package/fesm2015/rxap-remote-method-testing.mjs.map +0 -1
- package/fesm2015/rxap-remote-method.mjs +0 -137
- package/fesm2015/rxap-remote-method.mjs.map +0 -1
- package/fesm2020/rxap-remote-method-http-directive.mjs.map +0 -1
- /package/{esm2020 → esm2022}/directive/lib/error.mjs +0 -0
- /package/{esm2020 → esm2022}/directive/lib/tokens.mjs +0 -0
- /package/{esm2020 → esm2022}/directive/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/directive/rxap-remote-method-directive.mjs +0 -0
- /package/{esm2020 → esm2022}/http/directive/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/http/directive/rxap-remote-method-http-directive.mjs +0 -0
- /package/{esm2020 → esm2022}/http/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/http/rxap-remote-method-http.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/error.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/tokens.mjs +0 -0
- /package/{esm2020 → esm2022}/rxap-remote-method.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/lib/remote-method-testing-loader.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/rxap-remote-method-testing.mjs +0 -0
- /package/{fesm2020 → fesm2022}/rxap-remote-method-testing.mjs +0 -0
- /package/{fesm2020 → fesm2022}/rxap-remote-method-testing.mjs.map +0 -0
|
@@ -65,10 +65,10 @@ class BaseHttpRemoteMethod extends BaseRemoteMethod {
|
|
|
65
65
|
}
|
|
66
66
|
return url;
|
|
67
67
|
}
|
|
68
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: BaseHttpRemoteMethod, deps: [{ token: HttpClient }, { token: Injector }, { token: REMOTE_METHOD_META_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
69
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: BaseHttpRemoteMethod }); }
|
|
68
70
|
}
|
|
69
|
-
|
|
70
|
-
BaseHttpRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseHttpRemoteMethod });
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseHttpRemoteMethod, decorators: [{
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: BaseHttpRemoteMethod, decorators: [{
|
|
72
72
|
type: Injectable
|
|
73
73
|
}], ctorParameters: function () { return [{ type: i1.HttpClient, decorators: [{
|
|
74
74
|
type: Inject,
|
|
@@ -116,10 +116,10 @@ class HttpRemoteMethod extends BaseHttpRemoteMethod {
|
|
|
116
116
|
transformer(response) {
|
|
117
117
|
return response;
|
|
118
118
|
}
|
|
119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: HttpRemoteMethod, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
120
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: HttpRemoteMethod }); }
|
|
119
121
|
}
|
|
120
|
-
|
|
121
|
-
HttpRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: HttpRemoteMethod });
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: HttpRemoteMethod, decorators: [{
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: HttpRemoteMethod, decorators: [{
|
|
123
123
|
type: Injectable
|
|
124
124
|
}] });
|
|
125
125
|
|
|
@@ -137,10 +137,10 @@ class HttpRemoteMethodLoader {
|
|
|
137
137
|
}
|
|
138
138
|
return remoteMethod.call(parameters);
|
|
139
139
|
}
|
|
140
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: HttpRemoteMethodLoader, deps: [{ token: RemoteMethodLoader }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
141
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: HttpRemoteMethodLoader, providedIn: 'root' }); }
|
|
140
142
|
}
|
|
141
|
-
|
|
142
|
-
HttpRemoteMethodLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: HttpRemoteMethodLoader, providedIn: 'root' });
|
|
143
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: HttpRemoteMethodLoader, decorators: [{
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: HttpRemoteMethodLoader, decorators: [{
|
|
144
144
|
type: Injectable,
|
|
145
145
|
args: [{ providedIn: 'root' }]
|
|
146
146
|
}], ctorParameters: function () { return [{ type: i1$1.RemoteMethodLoader, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-remote-method-http.mjs","sources":["../../../../libs/remote-method/http/src/lib/base-http.remote-method.ts","../../../../libs/remote-method/http/src/lib/http.remote-method.ts","../../../../libs/remote-method/http/src/lib/http-remote-method.loader.ts","../../../../libs/remote-method/http/src/rxap-remote-method-http.ts"],"sourcesContent":["import {\n Injectable,\n Optional,\n Inject,\n Injector\n} from '@angular/core';\nimport {\n HttpClient,\n HttpRequest,\n HttpHeaders,\n HttpParams\n} from '@angular/common/http';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n REMOTE_METHOD_META_DATA,\n RxapRemoteMethodError\n} from '@rxap/remote-method';\nimport { hasIndexSignature } from '@rxap/utilities';\n\nexport interface HttpRemoteMethodMetadata extends BaseRemoteMethodMetadata {\n url: string | (() => string);\n method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH';\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n timeout?: number;\n retry?: number;\n}\n\nexport interface HttpRemoteMethodParameter<PathParams = any> {\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n body?: any | null;\n setHeaders?: {\n [ name: string ]: string | string[];\n };\n setParams?: {\n [ param: string ]: string;\n };\n pathParams?: PathParams;\n}\n\n@Injectable()\nexport abstract class BaseHttpRemoteMethod<ReturnType = any,\n PathParams = any,\n Parameter extends object = HttpRemoteMethodParameter<PathParams>,\n MetaData extends HttpRemoteMethodMetadata = HttpRemoteMethodMetadata>\n extends BaseRemoteMethod<ReturnType, Parameter, MetaData> {\n\n protected _httpRequest!: HttpRequest<ReturnType>;\n\n public timeout = 60 * 1000;\n\n constructor(\n @Inject(HttpClient) public readonly http: HttpClient,\n @Inject(Injector) injector: Injector,\n @Optional() @Inject(REMOTE_METHOD_META_DATA) metaData: any | null = null\n ) {\n super(injector, metaData);\n this.timeout = this.metadata.timeout ?? this.timeout;\n if (http === undefined) {\n throw new RxapRemoteMethodError('HttpClient is undefined. Ensure that the HttpClient is added to the deps property!', '', this.constructor.name);\n }\n if (!(http instanceof HttpClient)) {\n throw new RxapRemoteMethodError('The property http is not an instance of HttpClinent. Check the deps property!', '', this.constructor.name);\n }\n }\n\n protected getRequestUrl(): string {\n if (typeof this.metadata.url === 'function') {\n return this.metadata.url();\n }\n return this.metadata.url;\n }\n\n public init() {\n super.init();\n this._httpRequest = new HttpRequest<ReturnType>(\n this.metadata.method,\n this.getRequestUrl(),\n null,\n {\n headers: this.metadata.headers,\n reportProgress: this.metadata.reportProgress,\n params: this.metadata.params,\n responseType: this.metadata.responseType || 'json',\n withCredentials: this.metadata.withCredentials\n }\n );\n }\n\n public updateRequest(parameters: Partial<HttpRemoteMethodParameter>): HttpRequest<ReturnType> {\n let url = this._httpRequest.url;\n\n if (parameters && parameters.hasOwnProperty('pathParams')) {\n url = this.buildUrlWithParams(url, (parameters as any).pathParams);\n }\n\n return this._httpRequest.clone({\n withCredentials: this.metadata.withCredentials,\n ...parameters,\n url\n });\n }\n\n public buildUrlWithParams(url: string, pathParams?: PathParams): string {\n if (pathParams) {\n\n if (!hasIndexSignature(pathParams)) {\n throw new RxapRemoteMethodError(`Path params for remote method '${this.id}' has not an index signature`, '', this.constructor.name);\n }\n\n const matches = url.match(/\\{[^\\}]+\\}/g);\n\n if (matches) {\n for (const match of matches) {\n const param = match.substr(1, match.length - 2);\n if (!pathParams.hasOwnProperty(param)) {\n throw new RxapRemoteMethodError(`Path params for remote method '${this.id}' has not a defined value for '${param}'`, '', this.constructor.name);\n }\n url = url.replace(match, encodeURIComponent(pathParams[ param ]));\n }\n }\n }\n\n return url;\n }\n\n}\n\nexport interface HttpRemoteMethodMetadata extends BaseRemoteMethodMetadata {\n url: string | (() => string);\n method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH';\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n}\n\nexport interface HttpRemoteMethodParameter<PathParams = any> {\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n body?: any | null;\n setHeaders?: {\n [ name: string ]: string | string[];\n };\n setParams?: {\n [ param: string ]: string;\n };\n pathParams?: PathParams;\n}\n","import { Injectable } from '@angular/core';\nimport {\n HttpSentEvent,\n HttpHeaderResponse,\n HttpResponse,\n HttpProgressEvent,\n HttpEventType\n} from '@angular/common/http';\nimport {\n tap,\n filter,\n map,\n timeout,\n retry\n} from 'rxjs/operators';\nimport {\n BaseHttpRemoteMethod,\n HttpRemoteMethodParameter,\n HttpRemoteMethodMetadata\n} from './base-http.remote-method';\n\n@Injectable()\nexport class HttpRemoteMethod<ReturnType = any,\n PathParams = any,\n Parameter extends object = HttpRemoteMethodParameter<PathParams>,\n MetaData extends HttpRemoteMethodMetadata = HttpRemoteMethodMetadata>\n extends BaseHttpRemoteMethod<ReturnType, PathParams, Parameter, MetaData> {\n\n protected _call(parameters?: Parameter): Promise<ReturnType> {\n return this.http.request<ReturnType>(this.updateRequest(this.createHttpRequestParameters(parameters))).pipe(\n retry(this.metadata.retry ?? 0),\n tap(event => {\n switch (event.type) {\n\n case HttpEventType.Sent:\n this.onSentEvent(event);\n break;\n\n case HttpEventType.Response:\n this.onResponse(event);\n break;\n\n case HttpEventType.DownloadProgress:\n this.onProgressEvent(event);\n break;\n\n case HttpEventType.UploadProgress:\n this.onProgressEvent(event);\n break;\n\n case HttpEventType.ResponseHeader:\n this.onHeaderResponse(event);\n break;\n\n }\n }),\n filter((event: any) => event instanceof HttpResponse),\n map((event: HttpResponse<ReturnType>) => event.body),\n map(body => this.transformer(body)),\n timeout(this.timeout),\n ).toPromise();\n }\n\n public onSentEvent(event: HttpSentEvent): void {}\n\n public onHeaderResponse(event: HttpHeaderResponse): void {}\n\n public onResponse(event: HttpResponse<ReturnType>): void {}\n\n public onProgressEvent(event: HttpProgressEvent): void {}\n\n // TODO : make abstract to force implementation to handel parameter transformation\n public createHttpRequestParameters(parameters?: Parameter): Partial<HttpRemoteMethodParameter> {\n return parameters ?? {} as any;\n }\n\n public transformer(response: any): ReturnType {\n return response;\n }\n\n}\n","import {\n RemoteMethodLoader,\n BaseRemoteMethodMetadata,\n RxapRemoteMethodError,\n BaseRemoteMethod\n} from '@rxap/remote-method';\nimport { HttpRemoteMethod } from './http.remote-method';\nimport {\n Injectable,\n Inject,\n Injector,\n InjectFlags\n} from '@angular/core';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\n\n@Injectable({ providedIn: 'root' })\nexport class HttpRemoteMethodLoader {\n\n // Instead of extanding the RemoteMethodLoader class the RemoteMethodLoader instance\n // will be injected, else there could be multiple instance of RemoteMethodLoader's. Then\n // the RefreshService will not trigger a refresh for HttpRemoteMethod's\n constructor(@Inject(RemoteMethodLoader) private readonly remoteMethodLoader: RemoteMethodLoader) {}\n\n public request$<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>(\n remoteMethodIdOrInstanceOrToken: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>,\n parameters: Parameters,\n metadata?: Partial<BaseRemoteMethodMetadata>,\n injector?: Injector,\n notFoundValue?: BaseRemoteMethod<ReturnType, Parameters, Metadata>,\n flags?: InjectFlags\n ) {\n\n const remoteMethod = this.remoteMethodLoader.load(\n remoteMethodIdOrInstanceOrToken,\n metadata,\n injector,\n notFoundValue,\n flags\n );\n\n if (!(remoteMethod instanceof HttpRemoteMethod)) {\n throw new RxapRemoteMethodError(`The remote method is not a HttpRemoteMethod`, '', 'HttpRemoteMethodLoader');\n }\n\n return remoteMethod.call(parameters);\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAiDM,MAAgB,oBAIpB,SAAQ,gBAAiD,CAAA;AAMzD,IAAA,WAAA,CACsC,IAAgB,EAClC,QAAkB,EACS,WAAuB,IAAI,EAAA;AAExE,QAAA,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAJU,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAH/C,QAAA,IAAA,CAAA,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC;AAQzB,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;QACrD,IAAI,IAAI,KAAK,SAAS,EAAE;AACtB,YAAA,MAAM,IAAI,qBAAqB,CAAC,oFAAoF,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAClJ,SAAA;AACD,QAAA,IAAI,EAAE,IAAI,YAAY,UAAU,CAAC,EAAE;AACjC,YAAA,MAAM,IAAI,qBAAqB,CAAC,+EAA+E,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7I,SAAA;KACF;IAES,aAAa,GAAA;QACrB,IAAI,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,KAAK,UAAU,EAAE;AAC3C,YAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;AAC5B,SAAA;AACD,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC;KAC1B;IAEM,IAAI,GAAA;Q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A,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAL3B,sBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;0BAMnB,MAAM;2BAAC,kBAAkB,CAAA;;;ACrBxC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rxap-remote-method-http.mjs","sources":["../../../../libs/remote-method/http/src/lib/base-http.remote-method.ts","../../../../libs/remote-method/http/src/lib/http.remote-method.ts","../../../../libs/remote-method/http/src/lib/http-remote-method.loader.ts","../../../../libs/remote-method/http/src/rxap-remote-method-http.ts"],"sourcesContent":["import {\n Injectable,\n Optional,\n Inject,\n Injector\n} from '@angular/core';\nimport {\n HttpClient,\n HttpRequest,\n HttpHeaders,\n HttpParams\n} from '@angular/common/http';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata,\n REMOTE_METHOD_META_DATA,\n RxapRemoteMethodError\n} from '@rxap/remote-method';\nimport { hasIndexSignature } from '@rxap/utilities';\n\nexport interface HttpRemoteMethodMetadata extends BaseRemoteMethodMetadata {\n url: string | (() => string);\n method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH';\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n timeout?: number;\n retry?: number;\n}\n\nexport interface HttpRemoteMethodParameter<PathParams = any> {\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n body?: any | null;\n setHeaders?: {\n [ name: string ]: string | string[];\n };\n setParams?: {\n [ param: string ]: string;\n };\n pathParams?: PathParams;\n}\n\n@Injectable()\nexport abstract class BaseHttpRemoteMethod<ReturnType = any,\n PathParams = any,\n Parameter extends object = HttpRemoteMethodParameter<PathParams>,\n MetaData extends HttpRemoteMethodMetadata = HttpRemoteMethodMetadata>\n extends BaseRemoteMethod<ReturnType, Parameter, MetaData> {\n\n protected _httpRequest!: HttpRequest<ReturnType>;\n\n public timeout = 60 * 1000;\n\n constructor(\n @Inject(HttpClient) public readonly http: HttpClient,\n @Inject(Injector) injector: Injector,\n @Optional() @Inject(REMOTE_METHOD_META_DATA) metaData: any | null = null\n ) {\n super(injector, metaData);\n this.timeout = this.metadata.timeout ?? this.timeout;\n if (http === undefined) {\n throw new RxapRemoteMethodError('HttpClient is undefined. Ensure that the HttpClient is added to the deps property!', '', this.constructor.name);\n }\n if (!(http instanceof HttpClient)) {\n throw new RxapRemoteMethodError('The property http is not an instance of HttpClinent. Check the deps property!', '', this.constructor.name);\n }\n }\n\n protected getRequestUrl(): string {\n if (typeof this.metadata.url === 'function') {\n return this.metadata.url();\n }\n return this.metadata.url;\n }\n\n public init() {\n super.init();\n this._httpRequest = new HttpRequest<ReturnType>(\n this.metadata.method,\n this.getRequestUrl(),\n null,\n {\n headers: this.metadata.headers,\n reportProgress: this.metadata.reportProgress,\n params: this.metadata.params,\n responseType: this.metadata.responseType || 'json',\n withCredentials: this.metadata.withCredentials\n }\n );\n }\n\n public updateRequest(parameters: Partial<HttpRemoteMethodParameter>): HttpRequest<ReturnType> {\n let url = this._httpRequest.url;\n\n if (parameters && parameters.hasOwnProperty('pathParams')) {\n url = this.buildUrlWithParams(url, (parameters as any).pathParams);\n }\n\n return this._httpRequest.clone({\n withCredentials: this.metadata.withCredentials,\n ...parameters,\n url\n });\n }\n\n public buildUrlWithParams(url: string, pathParams?: PathParams): string {\n if (pathParams) {\n\n if (!hasIndexSignature(pathParams)) {\n throw new RxapRemoteMethodError(`Path params for remote method '${this.id}' has not an index signature`, '', this.constructor.name);\n }\n\n const matches = url.match(/\\{[^\\}]+\\}/g);\n\n if (matches) {\n for (const match of matches) {\n const param = match.substr(1, match.length - 2);\n if (!pathParams.hasOwnProperty(param)) {\n throw new RxapRemoteMethodError(`Path params for remote method '${this.id}' has not a defined value for '${param}'`, '', this.constructor.name);\n }\n url = url.replace(match, encodeURIComponent(pathParams[ param ]));\n }\n }\n }\n\n return url;\n }\n\n}\n\nexport interface HttpRemoteMethodMetadata extends BaseRemoteMethodMetadata {\n url: string | (() => string);\n method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH';\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n}\n\nexport interface HttpRemoteMethodParameter<PathParams = any> {\n headers?: HttpHeaders;\n reportProgress?: boolean;\n params?: HttpParams;\n responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';\n withCredentials?: boolean;\n body?: any | null;\n setHeaders?: {\n [ name: string ]: string | string[];\n };\n setParams?: {\n [ param: string ]: string;\n };\n pathParams?: PathParams;\n}\n","import { Injectable } from '@angular/core';\nimport {\n HttpSentEvent,\n HttpHeaderResponse,\n HttpResponse,\n HttpProgressEvent,\n HttpEventType\n} from '@angular/common/http';\nimport {\n tap,\n filter,\n map,\n timeout,\n retry\n} from 'rxjs/operators';\nimport {\n BaseHttpRemoteMethod,\n HttpRemoteMethodParameter,\n HttpRemoteMethodMetadata\n} from './base-http.remote-method';\n\n@Injectable()\nexport class HttpRemoteMethod<ReturnType = any,\n PathParams = any,\n Parameter extends object = HttpRemoteMethodParameter<PathParams>,\n MetaData extends HttpRemoteMethodMetadata = HttpRemoteMethodMetadata>\n extends BaseHttpRemoteMethod<ReturnType, PathParams, Parameter, MetaData> {\n\n protected _call(parameters?: Parameter): Promise<ReturnType> {\n return this.http.request<ReturnType>(this.updateRequest(this.createHttpRequestParameters(parameters))).pipe(\n retry(this.metadata.retry ?? 0),\n tap(event => {\n switch (event.type) {\n\n case HttpEventType.Sent:\n this.onSentEvent(event);\n break;\n\n case HttpEventType.Response:\n this.onResponse(event);\n break;\n\n case HttpEventType.DownloadProgress:\n this.onProgressEvent(event);\n break;\n\n case HttpEventType.UploadProgress:\n this.onProgressEvent(event);\n break;\n\n case HttpEventType.ResponseHeader:\n this.onHeaderResponse(event);\n break;\n\n }\n }),\n filter((event: any) => event instanceof HttpResponse),\n map((event: HttpResponse<ReturnType>) => event.body),\n map(body => this.transformer(body)),\n timeout(this.timeout),\n ).toPromise();\n }\n\n public onSentEvent(event: HttpSentEvent): void {}\n\n public onHeaderResponse(event: HttpHeaderResponse): void {}\n\n public onResponse(event: HttpResponse<ReturnType>): void {}\n\n public onProgressEvent(event: HttpProgressEvent): void {}\n\n // TODO : make abstract to force implementation to handel parameter transformation\n public createHttpRequestParameters(parameters?: Parameter): Partial<HttpRemoteMethodParameter> {\n return parameters ?? {} as any;\n }\n\n public transformer(response: any): ReturnType {\n return response;\n }\n\n}\n","import {\n RemoteMethodLoader,\n BaseRemoteMethodMetadata,\n RxapRemoteMethodError,\n BaseRemoteMethod\n} from '@rxap/remote-method';\nimport { HttpRemoteMethod } from './http.remote-method';\nimport {\n Injectable,\n Inject,\n Injector,\n InjectFlags\n} from '@angular/core';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\n\n@Injectable({ providedIn: 'root' })\nexport class HttpRemoteMethodLoader {\n\n // Instead of extanding the RemoteMethodLoader class the RemoteMethodLoader instance\n // will be injected, else there could be multiple instance of RemoteMethodLoader's. Then\n // the RefreshService will not trigger a refresh for HttpRemoteMethod's\n constructor(@Inject(RemoteMethodLoader) private readonly remoteMethodLoader: RemoteMethodLoader) {}\n\n public request$<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>(\n remoteMethodIdOrInstanceOrToken: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>,\n parameters: Parameters,\n metadata?: Partial<BaseRemoteMethodMetadata>,\n injector?: Injector,\n notFoundValue?: BaseRemoteMethod<ReturnType, Parameters, Metadata>,\n flags?: InjectFlags\n ) {\n\n const remoteMethod = this.remoteMethodLoader.load(\n remoteMethodIdOrInstanceOrToken,\n metadata,\n injector,\n notFoundValue,\n flags\n );\n\n if (!(remoteMethod instanceof HttpRemoteMethod)) {\n throw new RxapRemoteMethodError(`The remote method is not a HttpRemoteMethod`, '', 'HttpRemoteMethodLoader');\n }\n\n return remoteMethod.call(parameters);\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAgDA,MACsB,oBAIpB,SAAQ,gBAAiD,CAAA;AAMzD,IAAA,WAAA,CACsC,IAAgB,EAClC,QAAkB,EACS,WAAuB,IAAI,EAAA;AAExE,QAAA,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAJU,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAY;AAH/C,QAAA,IAAA,CAAA,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC;AAQzB,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC;QACrD,IAAI,IAAI,KAAK,SAAS,EAAE;AACtB,YAAA,MAAM,IAAI,qBAAqB,CAAC,oFAAoF,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAClJ,SAAA;AACD,QAAA,IAAI,EAAE,IAAI,YAAY,UAAU,CAAC,EAAE;AACjC,YAAA,MAAM,IAAI,qBAAqB,CAAC,+EAA+E,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7I,SAAA;KACF;IAES,aAAa,GAAA;QACrB,IAAI,OAA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AA,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KACtC;AA7BU,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,kBAKb,kBAAkB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAL3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA,EAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;0BAMnB,MAAM;2BAAC,kBAAkB,CAAA;;;ACrBxC;;AAEG;;;;"}
|
|
@@ -63,10 +63,10 @@ class BaseRemoteMethod extends BaseDefinition {
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: BaseRemoteMethod, deps: [{ token: INJECTOR, optional: true }, { token: REMOTE_METHOD_META_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
67
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: BaseRemoteMethod }); }
|
|
66
68
|
}
|
|
67
|
-
|
|
68
|
-
BaseRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseRemoteMethod });
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: BaseRemoteMethod, decorators: [{
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: BaseRemoteMethod, decorators: [{
|
|
70
70
|
type: Injectable
|
|
71
71
|
}], ctorParameters: function () { return [{ type: i0.Injector, decorators: [{
|
|
72
72
|
type: Optional
|
|
@@ -86,10 +86,10 @@ class RemoteMethodLoader extends DefinitionLoader {
|
|
|
86
86
|
.load(remoteMethodIdOrInstanceOrToken, metadata, injector, notFoundValue, flags)
|
|
87
87
|
.call(parameters);
|
|
88
88
|
}
|
|
89
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: RemoteMethodLoader, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
90
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: RemoteMethodLoader, providedIn: 'root' }); }
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
RemoteMethodLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RemoteMethodLoader, providedIn: 'root' });
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: RemoteMethodLoader, decorators: [{
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: RemoteMethodLoader, decorators: [{
|
|
93
93
|
type: Injectable,
|
|
94
94
|
args: [{ providedIn: 'root' }]
|
|
95
95
|
}] });
|
|
@@ -102,10 +102,10 @@ class ProxyRemoteMethod extends BaseRemoteMethod {
|
|
|
102
102
|
async _call(parameters) {
|
|
103
103
|
return this.remoteMethod.call(await this.transformParameters(parameters));
|
|
104
104
|
}
|
|
105
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ProxyRemoteMethod, deps: [{ token: RXAP_PROXY_REMOTE_METHOD_TARGET }, { token: INJECTOR }, { token: REMOTE_METHOD_META_DATA }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
106
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ProxyRemoteMethod }); }
|
|
105
107
|
}
|
|
106
|
-
|
|
107
|
-
ProxyRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProxyRemoteMethod });
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.2", ngImport: i0, type: ProxyRemoteMethod, decorators: [{
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.2", ngImport: i0, type: ProxyRemoteMethod, decorators: [{
|
|
109
109
|
type: Injectable
|
|
110
110
|
}], ctorParameters: function () { return [{ type: BaseRemoteMethod, decorators: [{
|
|
111
111
|
type: Inject,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxap-remote-method.mjs","sources":["../../../../libs/remote-method/src/lib/tokens.ts","../../../../libs/remote-method/src/lib/error.ts","../../../../libs/remote-method/src/lib/base.remote-method.ts","../../../../libs/remote-method/src/lib/remote-method-loader.ts","../../../../libs/remote-method/src/lib/proxy.remote-method.ts","../../../../libs/remote-method/src/rxap-remote-method.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const REMOTE_METHOD_META_DATA = new InjectionToken('rxap/remote-method/REMOTE_METHOD_META_DATA');\nexport const RXAP_PROXY_REMOTE_METHOD_TARGET = new InjectionToken('rxap/remote-method/proxy/target');\n","import { RxapError } from '@rxap/utilities';\n\nexport class RxapRemoteMethodError extends RxapError {\n\n constructor(message: string, code: string, className?: string) {\n super('@rxap/remote-method', message, code, className);\n }\n\n}\n\n","import {\n Injectable,\n Optional,\n Inject,\n Injector,\n Type,\n InjectionToken,\n AbstractType,\n InjectFlags,\n INJECTOR\n} from '@angular/core';\nimport { REMOTE_METHOD_META_DATA } from './tokens';\nimport {\n BaseDefinition,\n BaseDefinitionMetadata,\n DefinitionMetadata\n} from '@rxap/definition';\nimport { Subject } from 'rxjs';\nimport { RxapRemoteMethodError } from './error';\nimport { Refreshable } from '@rxap/utilities';\nimport { CounterSubject } from '@rxap/utilities/rxjs';\n\nexport interface BaseRemoteMethodMetadata extends BaseDefinitionMetadata {\n refresh?: Array<Type<Refreshable> | InjectionToken<Refreshable> | AbstractType<Refreshable>>;\n}\n\nexport function RxapRemoteMethod<MetaData extends BaseDefinitionMetadata = BaseDefinitionMetadata>(\n metadataOrId: MetaData | string,\n className: string = 'BaseRemoteMethod',\n packageName: string = '@rxap/remote-method'\n) {\n return function(target: any) {\n DefinitionMetadata(metadataOrId, className, packageName)(target);\n };\n}\n\n@Injectable()\nexport abstract class BaseRemoteMethod<ReturnType = any,\n Parameter = any,\n Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata> extends BaseDefinition<Metadata> {\n\n public executed$: Subject<ReturnType> = new Subject<ReturnType>();\n\n public executionsInProgress$: CounterSubject = new CounterSubject();\n\n public readonly injector: Injector;\n\n private _pauseRefresh = false;\n\n constructor(\n @Optional()\n @Inject(INJECTOR)\n injector: Injector | null = null,\n @Optional()\n @Inject(REMOTE_METHOD_META_DATA)\n metaData: any | null = null\n ) {\n super(metaData);\n if (injector === undefined) {\n throw new RxapRemoteMethodError('Injector is undefined. Ensure that the Injector is added to the deps property!', '', this.constructor.name);\n }\n this.injector = injector ?? Injector.NULL;\n if (typeof this.injector.get !== 'function') {\n throw new RxapRemoteMethodError('The property injector is not Injector like. Check the deps property!', '', this.constructor.name);\n }\n }\n\n public async call(parameters?: Parameter): Promise<ReturnType> {\n this.init();\n this.executionsInProgress$.increase();\n const result = await this._call(parameters);\n this.executionsInProgress$.decrease();\n this.executed$.next(result);\n this.executed(result);\n return result;\n }\n\n public executed(result: ReturnType): void {\n if (!this._pauseRefresh) {\n this.refresh();\n }\n }\n\n public pauseRefresh(): void {\n this._pauseRefresh = true;\n }\n\n public resumeRefresh(): void {\n this._pauseRefresh = false;\n }\n\n public refresh(): void {\n if (this.metadata.refresh) {\n for (const refresh of this.metadata.refresh) {\n const canRefresh = this.injector.get(refresh, null, InjectFlags.Optional);\n if (canRefresh) {\n canRefresh.refresh();\n }\n }\n }\n }\n\n protected abstract _call(parameters?: Parameter): Promise<ReturnType> | ReturnType;\n\n}\n\n\n","import {\n Injectable,\n Injector,\n InjectFlags\n} from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata\n} from './base.remote-method';\nimport {\n DefinitionLoader,\n IdOrInstanceOrToken\n} from '@rxap/definition';\n\n@Injectable({ providedIn: 'root' })\nexport class RemoteMethodLoader extends DefinitionLoader {\n\n public async call$<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>(\n remoteMethodIdOrInstanceOrToken: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>,\n parameters: Parameters,\n metadata?: Partial<BaseRemoteMethodMetadata>,\n injector?: Injector,\n notFoundValue?: BaseRemoteMethod<ReturnType, Parameters, Metadata>,\n flags?: InjectFlags\n ): Promise<ReturnType> {\n return this\n .load(\n remoteMethodIdOrInstanceOrToken,\n metadata,\n injector,\n notFoundValue,\n flags\n )\n .call(parameters);\n }\n\n}\n","import {\n Injectable,\n Inject,\n INJECTOR,\n Injector\n} from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata\n} from './base.remote-method';\nimport {\n RXAP_PROXY_REMOTE_METHOD_TARGET,\n REMOTE_METHOD_META_DATA\n} from './tokens';\n\n@Injectable()\nexport abstract class ProxyRemoteMethod<ReturnType = any, SourceParameter = any, TargetParameter = SourceParameter>\n extends BaseRemoteMethod<ReturnType, SourceParameter> {\n\n constructor(\n @Inject(RXAP_PROXY_REMOTE_METHOD_TARGET)\n private readonly remoteMethod: BaseRemoteMethod,\n @Inject(INJECTOR)\n injector: Injector | null = null,\n @Inject(REMOTE_METHOD_META_DATA)\n metadata: BaseRemoteMethodMetadata = remoteMethod.metadata,\n ) {\n super(injector, metadata);\n }\n\n protected async _call(parameters?: SourceParameter): Promise<any> {\n return this.remoteMethod.call(await this.transformParameters(parameters));\n }\n\n public abstract transformParameters(parameters?: SourceParameter): TargetParameter | Promise<TargetParameter>;\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAEa,uBAAuB,GAAG,IAAI,cAAc,CAAC,4CAA4C,EAAE;MAC3F,+BAA+B,GAAG,IAAI,cAAc,CAAC,iCAAiC;;ACD7F,MAAO,qBAAsB,SAAQ,SAAS,CAAA;AAElD,IAAA,WAAA,CAAY,OAAe,EAAE,IAAY,EAAE,SAAkB,EAAA;QAC3D,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;KACxD;AAEF;;ACkBK,SAAU,gBAAgB,CAC9B,YAA+B,EAC/B,SAAsB,GAAA,kBAAkB,EACxC,WAAA,GAAsB,qBAAqB,EAAA;AAE3C,IAAA,OAAO,UAAS,MAAW,EAAA;QACzB,kBAAkB,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AACnE,KAAC,CAAC;AACJ,CAAC;AAGK,MAAgB,gBAEkD,SAAQ,cAAwB,CAAA;AAUtG,IAAA,WAAA,CAGI,QAA4B,GAAA,IAAI,EAGhC,QAAA,GAAuB,IAAI,EAAA;QAE7B,KAAK,CAAC,QAAQ,CAAC,CAAC;AAhBX,QAAA,IAAA,CAAA,SAAS,GAAwB,IAAI,OAAO,EAAc,CAAC;AAE3D,QAAA,IAAA,CAAA,qBAAqB,GAAmB,IAAI,cAAc,EA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-method/src/lib/tokens.ts","../../../../libs/remote-method/src/lib/error.ts","../../../../libs/remote-method/src/lib/base.remote-method.ts","../../../../libs/remote-method/src/lib/remote-method-loader.ts","../../../../libs/remote-method/src/lib/proxy.remote-method.ts","../../../../libs/remote-method/src/rxap-remote-method.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const REMOTE_METHOD_META_DATA = new InjectionToken('rxap/remote-method/REMOTE_METHOD_META_DATA');\nexport const RXAP_PROXY_REMOTE_METHOD_TARGET = new InjectionToken('rxap/remote-method/proxy/target');\n","import { RxapError } from '@rxap/utilities';\n\nexport class RxapRemoteMethodError extends RxapError {\n\n constructor(message: string, code: string, className?: string) {\n super('@rxap/remote-method', message, code, className);\n }\n\n}\n\n","import {\n Injectable,\n Optional,\n Inject,\n Injector,\n Type,\n InjectionToken,\n AbstractType,\n InjectFlags,\n INJECTOR\n} from '@angular/core';\nimport { REMOTE_METHOD_META_DATA } from './tokens';\nimport {\n BaseDefinition,\n BaseDefinitionMetadata,\n DefinitionMetadata\n} from '@rxap/definition';\nimport { Subject } from 'rxjs';\nimport { RxapRemoteMethodError } from './error';\nimport { Refreshable } from '@rxap/utilities';\nimport { CounterSubject } from '@rxap/utilities/rxjs';\n\nexport interface BaseRemoteMethodMetadata extends BaseDefinitionMetadata {\n refresh?: Array<Type<Refreshable> | InjectionToken<Refreshable> | AbstractType<Refreshable>>;\n}\n\nexport function RxapRemoteMethod<MetaData extends BaseDefinitionMetadata = BaseDefinitionMetadata>(\n metadataOrId: MetaData | string,\n className: string = 'BaseRemoteMethod',\n packageName: string = '@rxap/remote-method'\n) {\n return function(target: any) {\n DefinitionMetadata(metadataOrId, className, packageName)(target);\n };\n}\n\n@Injectable()\nexport abstract class BaseRemoteMethod<ReturnType = any,\n Parameter = any,\n Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata> extends BaseDefinition<Metadata> {\n\n public executed$: Subject<ReturnType> = new Subject<ReturnType>();\n\n public executionsInProgress$: CounterSubject = new CounterSubject();\n\n public readonly injector: Injector;\n\n private _pauseRefresh = false;\n\n constructor(\n @Optional()\n @Inject(INJECTOR)\n injector: Injector | null = null,\n @Optional()\n @Inject(REMOTE_METHOD_META_DATA)\n metaData: any | null = null\n ) {\n super(metaData);\n if (injector === undefined) {\n throw new RxapRemoteMethodError('Injector is undefined. Ensure that the Injector is added to the deps property!', '', this.constructor.name);\n }\n this.injector = injector ?? Injector.NULL;\n if (typeof this.injector.get !== 'function') {\n throw new RxapRemoteMethodError('The property injector is not Injector like. Check the deps property!', '', this.constructor.name);\n }\n }\n\n public async call(parameters?: Parameter): Promise<ReturnType> {\n this.init();\n this.executionsInProgress$.increase();\n const result = await this._call(parameters);\n this.executionsInProgress$.decrease();\n this.executed$.next(result);\n this.executed(result);\n return result;\n }\n\n public executed(result: ReturnType): void {\n if (!this._pauseRefresh) {\n this.refresh();\n }\n }\n\n public pauseRefresh(): void {\n this._pauseRefresh = true;\n }\n\n public resumeRefresh(): void {\n this._pauseRefresh = false;\n }\n\n public refresh(): void {\n if (this.metadata.refresh) {\n for (const refresh of this.metadata.refresh) {\n const canRefresh = this.injector.get(refresh, null, InjectFlags.Optional);\n if (canRefresh) {\n canRefresh.refresh();\n }\n }\n }\n }\n\n protected abstract _call(parameters?: Parameter): Promise<ReturnType> | ReturnType;\n\n}\n\n\n","import {\n Injectable,\n Injector,\n InjectFlags\n} from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata\n} from './base.remote-method';\nimport {\n DefinitionLoader,\n IdOrInstanceOrToken\n} from '@rxap/definition';\n\n@Injectable({ providedIn: 'root' })\nexport class RemoteMethodLoader extends DefinitionLoader {\n\n public async call$<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>(\n remoteMethodIdOrInstanceOrToken: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>,\n parameters: Parameters,\n metadata?: Partial<BaseRemoteMethodMetadata>,\n injector?: Injector,\n notFoundValue?: BaseRemoteMethod<ReturnType, Parameters, Metadata>,\n flags?: InjectFlags\n ): Promise<ReturnType> {\n return this\n .load(\n remoteMethodIdOrInstanceOrToken,\n metadata,\n injector,\n notFoundValue,\n flags\n )\n .call(parameters);\n }\n\n}\n","import {\n Injectable,\n Inject,\n INJECTOR,\n Injector\n} from '@angular/core';\nimport {\n BaseRemoteMethod,\n BaseRemoteMethodMetadata\n} from './base.remote-method';\nimport {\n RXAP_PROXY_REMOTE_METHOD_TARGET,\n REMOTE_METHOD_META_DATA\n} from './tokens';\n\n@Injectable()\nexport abstract class ProxyRemoteMethod<ReturnType = any, SourceParameter = any, TargetParameter = SourceParameter>\n extends BaseRemoteMethod<ReturnType, SourceParameter> {\n\n constructor(\n @Inject(RXAP_PROXY_REMOTE_METHOD_TARGET)\n private readonly remoteMethod: BaseRemoteMethod,\n @Inject(INJECTOR)\n injector: Injector | null = null,\n @Inject(REMOTE_METHOD_META_DATA)\n metadata: BaseRemoteMethodMetadata = remoteMethod.metadata,\n ) {\n super(injector, metadata);\n }\n\n protected async _call(parameters?: SourceParameter): Promise<any> {\n return this.remoteMethod.call(await this.transformParameters(parameters));\n }\n\n public abstract transformParameters(parameters?: SourceParameter): TargetParameter | Promise<TargetParameter>;\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAEa,uBAAuB,GAAG,IAAI,cAAc,CAAC,4CAA4C,EAAE;MAC3F,+BAA+B,GAAG,IAAI,cAAc,CAAC,iCAAiC;;ACD7F,MAAO,qBAAsB,SAAQ,SAAS,CAAA;AAElD,IAAA,WAAA,CAAY,OAAe,EAAE,IAAY,EAAE,SAAkB,EAAA;QAC3D,KAAK,CAAC,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;KACxD;AAEF;;ACkBK,SAAU,gBAAgB,CAC9B,YAA+B,EAC/B,SAAsB,GAAA,kBAAkB,EACxC,W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AAA,EAAA,IAAA,EAAA,iBAAiB,EAI3B,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,+BAA+B,EAE/B,EAAA,EAAA,KAAA,EAAA,QAAQ,aAER,uBAAuB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;kHARb,iBAAiB,EAAA,CAAA,CAAA,EAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;;0BAKN,MAAM;2BAAC,+BAA+B,CAAA;;0BAEtC,MAAM;2BAAC,QAAQ,CAAA;;0BAEf,MAAM;2BAAC,uBAAuB,CAAA;;;ACxBnC;;AAEG;;;;"}
|
|
@@ -10,7 +10,7 @@ export declare class ContenteditableDirective {
|
|
|
10
10
|
onClick($event: Event): void;
|
|
11
11
|
onInput($event: any): Promise<any>;
|
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<ContenteditableDirective, never>;
|
|
13
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ContenteditableDirective, "[rxapContenteditable]", never, { "remoteMethodId": "rxapContenteditable"; "property": "property"; "uuid": "uuid"; }, {}, never, never, false>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ContenteditableDirective, "[rxapContenteditable]", never, { "remoteMethodId": { "alias": "rxapContenteditable"; "required": false; }; "property": { "alias": "property"; "required": false; }; "uuid": { "alias": "uuid"; "required": false; }; }, {}, never, never, false, never>;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated removed
|
|
@@ -15,7 +15,7 @@ export declare class HttpRemoteMethodDirective<ReturnType = any, Metadata extend
|
|
|
15
15
|
set pathParams(pathParams: HttpRemoteMethodParameter['pathParams']);
|
|
16
16
|
set remoteMethodOrIdOrToken(value: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, HttpRemoteMethodParameter, Metadata>>);
|
|
17
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<HttpRemoteMethodDirective<any, any>, never>;
|
|
18
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<HttpRemoteMethodDirective<any, any>, "button[rxapHttpRemoteMethod]", never, { "headers": "headers"; "reportProgress": "reportProgress"; "params": "params"; "responseType": "responseType"; "withCredentials": "withCredentials"; "body": "body"; "setHeaders": "setHeaders"; "setParams": "setParams"; "pathParams": "pathParams"; "remoteMethodOrIdOrToken": "rxapHttpRemoteMethod"; }, {}, never, never, false>;
|
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HttpRemoteMethodDirective<any, any>, "button[rxapHttpRemoteMethod]", never, { "headers": { "alias": "headers"; "required": false; }; "reportProgress": { "alias": "reportProgress"; "required": false; }; "params": { "alias": "params"; "required": false; }; "responseType": { "alias": "responseType"; "required": false; }; "withCredentials": { "alias": "withCredentials"; "required": false; }; "body": { "alias": "body"; "required": false; }; "setHeaders": { "alias": "setHeaders"; "required": false; }; "setParams": { "alias": "setParams"; "required": false; }; "pathParams": { "alias": "pathParams"; "required": false; }; "remoteMethodOrIdOrToken": { "alias": "rxapHttpRemoteMethod"; "required": false; }; }, {}, never, never, false, never>;
|
|
19
19
|
}
|
|
20
20
|
export declare class HttpRemoteMethodDirectiveModule {
|
|
21
21
|
static ɵfac: i0.ɵɵFactoryDeclaration<HttpRemoteMethodDirectiveModule, never>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxap/remote-method",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0-dev.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Merzough Münker",
|
|
6
6
|
"homepage": "https://gitlab.com/rxap/packages/libs/remote-method",
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
},
|
|
18
18
|
"description": "Provides the RemoteMethod concept for RxAP.",
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@angular-devkit/
|
|
21
|
-
"@angular/
|
|
22
|
-
"@angular/
|
|
23
|
-
"@angular/
|
|
24
|
-
"@angular/platform-browser
|
|
25
|
-
"@
|
|
26
|
-
"@rxap/
|
|
27
|
-
"@
|
|
20
|
+
"@angular-devkit/core": "^15.0.3",
|
|
21
|
+
"@angular-devkit/schematics": "^15.0.3",
|
|
22
|
+
"@angular/common": "^16.0.2",
|
|
23
|
+
"@angular/core": "^16.0.2",
|
|
24
|
+
"@angular/platform-browser": "^16.0.2",
|
|
25
|
+
"@angular/platform-browser-dynamic": "^16.0.2",
|
|
26
|
+
"@rxap/definition": "^16.0.0-dev.0",
|
|
27
|
+
"@rxap/utilities": "^16.0.0-dev.0",
|
|
28
|
+
"@schematics/angular": "^15.0.3",
|
|
28
29
|
"reflect-metadata": "^0.1.13",
|
|
29
30
|
"rxjs": "^6.6.0"
|
|
30
31
|
},
|
|
@@ -45,15 +46,11 @@
|
|
|
45
46
|
"save": "dependencies"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@rxap/schematics-utilities": "^
|
|
49
|
+
"@rxap/schematics-utilities": "^16.0.0-dev.0",
|
|
49
50
|
"ts-morph": "^13.0.3",
|
|
50
51
|
"tslib": "^2.3.1"
|
|
51
52
|
},
|
|
52
|
-
"module": "
|
|
53
|
-
"es2020": "fesm2020/rxap-remote-method.mjs",
|
|
54
|
-
"esm2020": "esm2020/rxap-remote-method.mjs",
|
|
55
|
-
"fesm2020": "fesm2020/rxap-remote-method.mjs",
|
|
56
|
-
"fesm2015": "fesm2015/rxap-remote-method.mjs",
|
|
53
|
+
"module": "fesm2022/rxap-remote-method.mjs",
|
|
57
54
|
"typings": "index.d.ts",
|
|
58
55
|
"exports": {
|
|
59
56
|
"./package.json": {
|
|
@@ -61,43 +58,33 @@
|
|
|
61
58
|
},
|
|
62
59
|
".": {
|
|
63
60
|
"types": "./index.d.ts",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"node": "./fesm2015/rxap-remote-method.mjs",
|
|
68
|
-
"default": "./fesm2020/rxap-remote-method.mjs"
|
|
61
|
+
"esm2022": "./esm2022/rxap-remote-method.mjs",
|
|
62
|
+
"esm": "./esm2022/rxap-remote-method.mjs",
|
|
63
|
+
"default": "./fesm2022/rxap-remote-method.mjs"
|
|
69
64
|
},
|
|
70
65
|
"./directive": {
|
|
71
66
|
"types": "./directive/index.d.ts",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"node": "./fesm2015/rxap-remote-method-directive.mjs",
|
|
76
|
-
"default": "./fesm2020/rxap-remote-method-directive.mjs"
|
|
77
|
-
},
|
|
78
|
-
"./http/directive": {
|
|
79
|
-
"types": "./http/directive/index.d.ts",
|
|
80
|
-
"esm2020": "./esm2020/http/directive/rxap-remote-method-http-directive.mjs",
|
|
81
|
-
"es2020": "./fesm2020/rxap-remote-method-http-directive.mjs",
|
|
82
|
-
"es2015": "./fesm2015/rxap-remote-method-http-directive.mjs",
|
|
83
|
-
"node": "./fesm2015/rxap-remote-method-http-directive.mjs",
|
|
84
|
-
"default": "./fesm2020/rxap-remote-method-http-directive.mjs"
|
|
67
|
+
"esm2022": "./esm2022/directive/rxap-remote-method-directive.mjs",
|
|
68
|
+
"esm": "./esm2022/directive/rxap-remote-method-directive.mjs",
|
|
69
|
+
"default": "./fesm2022/rxap-remote-method-directive.mjs"
|
|
85
70
|
},
|
|
86
71
|
"./http": {
|
|
87
72
|
"types": "./http/index.d.ts",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"node": "./fesm2015/rxap-remote-method-http.mjs",
|
|
92
|
-
"default": "./fesm2020/rxap-remote-method-http.mjs"
|
|
73
|
+
"esm2022": "./esm2022/http/rxap-remote-method-http.mjs",
|
|
74
|
+
"esm": "./esm2022/http/rxap-remote-method-http.mjs",
|
|
75
|
+
"default": "./fesm2022/rxap-remote-method-http.mjs"
|
|
93
76
|
},
|
|
94
77
|
"./testing": {
|
|
95
78
|
"types": "./testing/index.d.ts",
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
79
|
+
"esm2022": "./esm2022/testing/rxap-remote-method-testing.mjs",
|
|
80
|
+
"esm": "./esm2022/testing/rxap-remote-method-testing.mjs",
|
|
81
|
+
"default": "./fesm2022/rxap-remote-method-testing.mjs"
|
|
82
|
+
},
|
|
83
|
+
"./http/directive": {
|
|
84
|
+
"types": "./http/directive/index.d.ts",
|
|
85
|
+
"esm2022": "./esm2022/http/directive/rxap-remote-method-http-directive.mjs",
|
|
86
|
+
"esm": "./esm2022/http/directive/rxap-remote-method-http-directive.mjs",
|
|
87
|
+
"default": "./fesm2022/rxap-remote-method-http-directive.mjs"
|
|
101
88
|
}
|
|
102
89
|
},
|
|
103
90
|
"sideEffects": false
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RemoteMethodLoader, BaseRemoteMethod, BaseRemoteMethodMetadata } from '@rxap/remote-method';
|
|
2
2
|
import { Provider, Type, InjectionToken, AbstractType } from '@angular/core';
|
|
3
|
-
export
|
|
3
|
+
export type MockRemoteMethod = (parameters?: any, metadata?: any) => any;
|
|
4
4
|
export declare class RemoteMethodTestingLoader extends RemoteMethodLoader {
|
|
5
5
|
private mockedRemoteMethods;
|
|
6
6
|
mock(remoteMethodId: string, resultOrFunction: any | MockRemoteMethod): void;
|