@rxap/remote-method 12.0.9-next.0 → 13.0.0-next.1

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.
Files changed (125) hide show
  1. package/directive/package.json +5 -5
  2. package/esm2020/directive/lib/error.mjs +7 -0
  3. package/esm2020/directive/lib/remote-method-template-collection.directive.mjs +333 -0
  4. package/esm2020/directive/lib/remote-method-template.directive.mjs +201 -0
  5. package/esm2020/directive/lib/remote-method.directive.mjs +165 -0
  6. package/esm2020/directive/lib/tokens.mjs +3 -0
  7. package/esm2020/directive/public_api.mjs +6 -0
  8. package/esm2020/directive/rxap-remote-method-directive.mjs +5 -0
  9. package/esm2020/http/directive/lib/contenteditable.directive.mjs +86 -0
  10. package/esm2020/http/directive/lib/http-remote-method.directive.mjs +79 -0
  11. package/esm2020/http/directive/public_api.mjs +3 -0
  12. package/esm2020/http/directive/rxap-remote-method-http-directive.mjs +5 -0
  13. package/esm2020/http/lib/base-http.remote-method.mjs +82 -0
  14. package/esm2020/http/lib/http-remote-method.loader.mjs +30 -0
  15. package/esm2020/http/lib/http.remote-method.mjs +45 -0
  16. package/esm2020/http/public_api.mjs +4 -0
  17. package/esm2020/http/rxap-remote-method-http.mjs +5 -0
  18. package/esm2020/index.mjs +6 -0
  19. package/esm2020/lib/base.remote-method.mjs +73 -0
  20. package/esm2020/lib/error.mjs +7 -0
  21. package/esm2020/lib/proxy.remote-method.mjs +29 -0
  22. package/esm2020/lib/remote-method-loader.mjs +17 -0
  23. package/esm2020/lib/tokens.mjs +4 -0
  24. package/esm2020/rxap-remote-method.mjs +5 -0
  25. package/esm2020/testing/lib/remote-method-testing-loader.mjs +47 -0
  26. package/esm2020/testing/public_api.mjs +2 -0
  27. package/esm2020/testing/rxap-remote-method-testing.mjs +5 -0
  28. package/fesm2015/rxap-remote-method-directive.mjs +712 -0
  29. package/fesm2015/rxap-remote-method-directive.mjs.map +1 -0
  30. package/fesm2015/rxap-remote-method-http-directive.mjs +172 -0
  31. package/fesm2015/rxap-remote-method-http-directive.mjs.map +1 -0
  32. package/fesm2015/rxap-remote-method-http.mjs +158 -0
  33. package/fesm2015/rxap-remote-method-http.mjs.map +1 -0
  34. package/fesm2015/{rxap-remote-method-testing.js → rxap-remote-method-testing.mjs} +1 -1
  35. package/fesm2015/rxap-remote-method-testing.mjs.map +1 -0
  36. package/fesm2015/{rxap-remote-method.js → rxap-remote-method.mjs} +35 -31
  37. package/fesm2015/rxap-remote-method.mjs.map +1 -0
  38. package/{fesm2015/rxap-remote-method-directive.js → fesm2020/rxap-remote-method-directive.mjs} +64 -72
  39. package/fesm2020/rxap-remote-method-directive.mjs.map +1 -0
  40. package/{fesm2015/rxap-remote-method-http-directive.js → fesm2020/rxap-remote-method-http-directive.mjs} +15 -15
  41. package/fesm2020/rxap-remote-method-http-directive.mjs.map +1 -0
  42. package/{fesm2015/rxap-remote-method-http.js → fesm2020/rxap-remote-method-http.mjs} +18 -16
  43. package/fesm2020/rxap-remote-method-http.mjs.map +1 -0
  44. package/{esm2015/testing/lib/remote-method-testing-loader.js → fesm2020/rxap-remote-method-testing.mjs} +18 -17
  45. package/fesm2020/rxap-remote-method-testing.mjs.map +1 -0
  46. package/fesm2020/rxap-remote-method.mjs +126 -0
  47. package/fesm2020/rxap-remote-method.mjs.map +1 -0
  48. package/http/directive/package.json +5 -5
  49. package/http/package.json +5 -5
  50. package/package.json +62 -14
  51. package/src/schematics/base/index.js +9 -9
  52. package/src/schematics/base/index.js.map +1 -1
  53. package/src/schematics/directive/index.js +6 -6
  54. package/src/schematics/directive/index.js.map +1 -1
  55. package/src/schematics/http/index.js +7 -7
  56. package/src/schematics/http/index.js.map +1 -1
  57. package/src/schematics/ng-add/index.js +1 -1
  58. package/src/schematics/ng-add/index.js.map +1 -1
  59. package/testing/package.json +5 -5
  60. package/bundles/rxap-remote-method-directive.umd.js +0 -1150
  61. package/bundles/rxap-remote-method-directive.umd.js.map +0 -1
  62. package/bundles/rxap-remote-method-http-directive.umd.js +0 -565
  63. package/bundles/rxap-remote-method-http-directive.umd.js.map +0 -1
  64. package/bundles/rxap-remote-method-http.umd.js +0 -520
  65. package/bundles/rxap-remote-method-http.umd.js.map +0 -1
  66. package/bundles/rxap-remote-method-testing.umd.js +0 -388
  67. package/bundles/rxap-remote-method-testing.umd.js.map +0 -1
  68. package/bundles/rxap-remote-method.umd.js +0 -527
  69. package/bundles/rxap-remote-method.umd.js.map +0 -1
  70. package/esm2015/directive/lib/error.js +0 -7
  71. package/esm2015/directive/lib/error.js.map +0 -1
  72. package/esm2015/directive/lib/remote-method-template-collection.directive.js +0 -333
  73. package/esm2015/directive/lib/remote-method-template-collection.directive.js.map +0 -1
  74. package/esm2015/directive/lib/remote-method-template.directive.js +0 -204
  75. package/esm2015/directive/lib/remote-method-template.directive.js.map +0 -1
  76. package/esm2015/directive/lib/remote-method.directive.js +0 -170
  77. package/esm2015/directive/lib/remote-method.directive.js.map +0 -1
  78. package/esm2015/directive/lib/tokens.js +0 -3
  79. package/esm2015/directive/lib/tokens.js.map +0 -1
  80. package/esm2015/directive/public_api.js +0 -6
  81. package/esm2015/directive/public_api.js.map +0 -1
  82. package/esm2015/directive/rxap-remote-method-directive.js +0 -5
  83. package/esm2015/directive/rxap-remote-method-directive.js.map +0 -1
  84. package/esm2015/http/directive/lib/contenteditable.directive.js +0 -86
  85. package/esm2015/http/directive/lib/contenteditable.directive.js.map +0 -1
  86. package/esm2015/http/directive/lib/http-remote-method.directive.js +0 -79
  87. package/esm2015/http/directive/lib/http-remote-method.directive.js.map +0 -1
  88. package/esm2015/http/directive/public_api.js +0 -3
  89. package/esm2015/http/directive/public_api.js.map +0 -1
  90. package/esm2015/http/directive/rxap-remote-method-http-directive.js +0 -5
  91. package/esm2015/http/directive/rxap-remote-method-http-directive.js.map +0 -1
  92. package/esm2015/http/lib/base-http.remote-method.js +0 -79
  93. package/esm2015/http/lib/base-http.remote-method.js.map +0 -1
  94. package/esm2015/http/lib/http-remote-method.loader.js +0 -30
  95. package/esm2015/http/lib/http-remote-method.loader.js.map +0 -1
  96. package/esm2015/http/lib/http.remote-method.js +0 -46
  97. package/esm2015/http/lib/http.remote-method.js.map +0 -1
  98. package/esm2015/http/public_api.js +0 -4
  99. package/esm2015/http/public_api.js.map +0 -1
  100. package/esm2015/http/rxap-remote-method-http.js +0 -5
  101. package/esm2015/http/rxap-remote-method-http.js.map +0 -1
  102. package/esm2015/index.js +0 -6
  103. package/esm2015/index.js.map +0 -1
  104. package/esm2015/lib/base.remote-method.js +0 -76
  105. package/esm2015/lib/base.remote-method.js.map +0 -1
  106. package/esm2015/lib/error.js +0 -7
  107. package/esm2015/lib/error.js.map +0 -1
  108. package/esm2015/lib/proxy.remote-method.js +0 -32
  109. package/esm2015/lib/proxy.remote-method.js.map +0 -1
  110. package/esm2015/lib/remote-method-loader.js +0 -20
  111. package/esm2015/lib/remote-method-loader.js.map +0 -1
  112. package/esm2015/lib/tokens.js +0 -4
  113. package/esm2015/lib/tokens.js.map +0 -1
  114. package/esm2015/rxap-remote-method.js +0 -5
  115. package/esm2015/rxap-remote-method.js.map +0 -1
  116. package/esm2015/testing/lib/remote-method-testing-loader.js.map +0 -1
  117. package/esm2015/testing/public_api.js +0 -2
  118. package/esm2015/testing/public_api.js.map +0 -1
  119. package/esm2015/testing/rxap-remote-method-testing.js +0 -5
  120. package/esm2015/testing/rxap-remote-method-testing.js.map +0 -1
  121. package/fesm2015/rxap-remote-method-directive.js.map +0 -1
  122. package/fesm2015/rxap-remote-method-http-directive.js.map +0 -1
  123. package/fesm2015/rxap-remote-method-http.js.map +0 -1
  124. package/fesm2015/rxap-remote-method-testing.js.map +0 -1
  125. package/fesm2015/rxap-remote-method.js.map +0 -1
@@ -1,170 +0,0 @@
1
- import { __awaiter, __decorate, __metadata } from "tslib";
2
- import { Input, NgModule, Output, EventEmitter, Directive, HostListener, Inject, Injector, INJECTOR, isDevMode, Optional, Self } from '@angular/core';
3
- import { RemoteMethodLoader } from '@rxap/remote-method';
4
- import { Required, coerceBoolean, Deprecated } from '@rxap/utilities';
5
- import { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';
6
- import { ToggleSubject } from '@rxap/utilities/rxjs';
7
- import * as i0 from "@angular/core";
8
- import * as i1 from "@rxap/remote-method";
9
- export class RemoteMethodDirective {
10
- constructor(remoteMethodLoader, injector = Injector.NULL, remoteMethodToken) {
11
- this.remoteMethodLoader = remoteMethodLoader;
12
- this.injector = injector;
13
- this.remoteMethodToken = remoteMethodToken;
14
- this.executed$ = new EventEmitter();
15
- this.failure$ = new EventEmitter();
16
- this.successful$ = new EventEmitter();
17
- this.immediately = false;
18
- /**
19
- * true - a remote method call is in progress
20
- */
21
- this.executing$ = new ToggleSubject();
22
- this._hasConfirmDirective = false;
23
- if (this.remoteMethodToken) {
24
- this._remoteMethodOrIdOrToken = this.remoteMethodToken;
25
- }
26
- }
27
- set remoteMethodOrIdOrToken(value) {
28
- if (value) {
29
- this._remoteMethodOrIdOrToken = value;
30
- }
31
- }
32
- set hasConfirmDirective(value) {
33
- this._hasConfirmDirective = coerceBoolean(value);
34
- }
35
- ngOnInit() {
36
- if (this.immediately) {
37
- this.execute();
38
- }
39
- }
40
- onConfirmed() {
41
- this.execute();
42
- }
43
- onClick() {
44
- if (!this._hasConfirmDirective) {
45
- this.execute();
46
- }
47
- else {
48
- console.debug('skip remote method call. Wait for confirmation.');
49
- }
50
- }
51
- execute() {
52
- return __awaiter(this, void 0, void 0, function* () {
53
- this.executing$.enable();
54
- try {
55
- const result = yield this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, this.parameters, this.metadata, this.injector);
56
- this.executed(result);
57
- this.successful(result);
58
- }
59
- catch (error) {
60
- if (isDevMode()) {
61
- console.error(`Remote method directive execution failed:`, error.message);
62
- }
63
- this.failure(error);
64
- }
65
- finally {
66
- this.executing$.disable();
67
- }
68
- });
69
- }
70
- setParameter(parameterKey, value) {
71
- this.updateParameters({ [parameterKey]: value });
72
- }
73
- updateParameters(parameters) {
74
- var _a;
75
- this.parameters = Object.assign(Object.assign({}, ((_a = this.parameters) !== null && _a !== void 0 ? _a : {})), parameters);
76
- }
77
- executed(result) {
78
- this.executed$.emit(result);
79
- }
80
- failure(error) {
81
- this.failure$.emit(error);
82
- }
83
- successful(result) {
84
- this.successful$.emit(result);
85
- }
86
- /**
87
- * @deprecated removed
88
- * @protected
89
- */
90
- call() {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- this.executing$.enable();
93
- const result = yield this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, this.parameters, this.metadata, this.injector);
94
- this.executing$.disable();
95
- return result;
96
- });
97
- }
98
- }
99
- RemoteMethodDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RemoteMethodDirective, deps: [{ token: RemoteMethodLoader }, { token: INJECTOR }, { token: RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Directive });
100
- RemoteMethodDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: RemoteMethodDirective, selector: "[rxapRemoteMethod]", inputs: { remoteMethodOrIdOrToken: ["rxapRemoteMethod", "remoteMethodOrIdOrToken"], parameters: "parameters", metadata: "metadata", immediately: "immediately", hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"] }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick()" } }, exportAs: ["rxapRemoteMethod"], ngImport: i0 });
101
- __decorate([
102
- Required,
103
- __metadata("design:type", Object)
104
- ], RemoteMethodDirective.prototype, "_remoteMethodOrIdOrToken", void 0);
105
- __decorate([
106
- Deprecated('removed'),
107
- __metadata("design:type", Function),
108
- __metadata("design:paramtypes", []),
109
- __metadata("design:returntype", Promise)
110
- ], RemoteMethodDirective.prototype, "call", null);
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RemoteMethodDirective, decorators: [{
112
- type: Directive,
113
- args: [{
114
- selector: '[rxapRemoteMethod]',
115
- exportAs: 'rxapRemoteMethod'
116
- }]
117
- }], ctorParameters: function () { return [{ type: i1.RemoteMethodLoader, decorators: [{
118
- type: Inject,
119
- args: [RemoteMethodLoader]
120
- }] }, { type: i0.Injector, decorators: [{
121
- type: Inject,
122
- args: [INJECTOR]
123
- }] }, { type: undefined, decorators: [{
124
- type: Optional
125
- }, {
126
- type: Self
127
- }, {
128
- type: Inject,
129
- args: [RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN]
130
- }] }]; }, propDecorators: { remoteMethodOrIdOrToken: [{
131
- type: Input,
132
- args: ['rxapRemoteMethod']
133
- }], parameters: [{
134
- type: Input
135
- }], metadata: [{
136
- type: Input
137
- }], executed$: [{
138
- type: Output,
139
- args: ['executed']
140
- }], failure$: [{
141
- type: Output,
142
- args: ['failure']
143
- }], successful$: [{
144
- type: Output,
145
- args: ['successful']
146
- }], immediately: [{
147
- type: Input
148
- }], hasConfirmDirective: [{
149
- type: Input,
150
- args: ['rxapConfirm']
151
- }], _remoteMethodOrIdOrToken: [], onConfirmed: [{
152
- type: HostListener,
153
- args: ['confirmed']
154
- }], onClick: [{
155
- type: HostListener,
156
- args: ['click']
157
- }], call: [] } });
158
- export class RemoteMethodDirectiveModule {
159
- }
160
- RemoteMethodDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RemoteMethodDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
161
- RemoteMethodDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RemoteMethodDirectiveModule, declarations: [RemoteMethodDirective], exports: [RemoteMethodDirective] });
162
- RemoteMethodDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RemoteMethodDirectiveModule });
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: RemoteMethodDirectiveModule, decorators: [{
164
- type: NgModule,
165
- args: [{
166
- declarations: [RemoteMethodDirective],
167
- exports: [RemoteMethodDirective]
168
- }]
169
- }] });
170
- //# sourceMappingURL=remote-method.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"remote-method.directive.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/directive/src/lib/remote-method.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,EACL,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,SAAS,EAET,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,IAAI,EACL,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAGnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;;;AAMrD,MAAM,OAAO,qBAAqB;IA2ChC,YAEqB,kBAAsC,EAExC,WAAqB,QAAQ,CAAC,IAAI,EAIlC,iBAAuB;QANrB,uBAAkB,GAAlB,kBAAkB,CAAoB;QAExC,aAAQ,GAAR,QAAQ,CAA0B;QAIlC,sBAAiB,GAAjB,iBAAiB,CAAM;QAlCnC,cAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QAG/B,aAAQ,GAAG,IAAI,YAAY,EAAS,CAAC;QAGrC,gBAAW,GAAG,IAAI,YAAY,EAAc,CAAC;QAG7C,gBAAW,GAAY,KAAK,CAAC;QAOpC;;WAEG;QACI,eAAU,GAAG,IAAI,aAAa,EAAE,CAAC;QAKhC,yBAAoB,GAAG,KAAK,CAAC;QAYnC,IAAI,IAAI,CAA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C7B;;0BA6CI,MAAM;2BAAC,kBAAkB;;0BAEzB,MAAM;2BAAC,QAAQ;;0BAEf,QAAQ;;0BACR,IAAI;;0BACJ,MAAM;2BAAC,kCAAkC;4CA9CjC,uBAAuB;sBADjC,KAAK;uBAAC,kBAAkB;gBAQlB,UAAU;sBADhB,KAAK;gBAIC,QAAQ;sBADd,KAAK;gBAIC,SAAS;sBADf,MAAM;uBAAC,UAAU;gBAIX,QAAQ;sBADd,MAAM;uBAAC,SAAS;gBAIV,WAAW;sBADjB,MAAM;uBAAC,YAAY;gBAIb,WAAW;sBADjB,KAAK;gBAIK,mBAAmB;sBAD7B,KAAK;uBAAC,aAAa;gBAWV,wBAAwB,MA0B3B,WAAW;sBADjB,YAAY;uBAAC,WAAW;gBAMlB,OAAO;sBADb,YAAY;uBAAC,OAAO;gBAkDL,IAAI;AAatB,MAAM,OAAO,2BAA2B;;wHAA3B,2BAA2B;yHAA3B,2BAA2B,iBApI3B,qBAAqB,aAArB,qBAAqB;yHAoIrB,2BAA2B;2FAA3B,2BAA2B;kBAJvC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAE,qBAAqB,CAAE;oBACvC,OAAO,EAAO,CAAE,qBAAqB,CAAE;iBACxC","sourcesContent":["import {\n Input,\n NgModule,\n Output,\n EventEmitter,\n Directive,\n OnInit,\n HostListener,\n Inject,\n Injector,\n INJECTOR,\n isDevMode,\n Optional,\n Self\n} from '@angular/core';\nimport {\n RemoteMethodLoader,\n BaseRemoteMethodMetadata,\n BaseRemoteMethod\n} from '@rxap/remote-method';\nimport {\n Required,\n coerceBoolean,\n Deprecated\n} from '@rxap/utilities';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\nimport { RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN } from './tokens';\nimport { ToggleSubject } from '@rxap/utilities/rxjs';\n\n@Directive({\n selector: '[rxapRemoteMethod]',\n exportAs: 'rxapRemoteMethod'\n})\nexport class RemoteMethodDirective<ReturnType = any, Parameters = any, Metadata extends BaseRemoteMethodMetadata = BaseRemoteMethodMetadata>\n implements OnInit {\n\n @Input('rxapRemoteMethod')\n public set remoteMethodOrIdOrToken(value: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>) {\n if (value) {\n this._remoteMethodOrIdOrToken = value;\n }\n }\n\n @Input()\n public parameters?: Parameters;\n\n @Input()\n public metadata?: Metadata;\n\n @Output('executed')\n public executed$ = new EventEmitter();\n\n @Output('failure')\n public failure$ = new EventEmitter<Error>();\n\n @Output('successful')\n public successful$ = new EventEmitter<ReturnType>();\n\n @Input()\n public immediately: boolean = false;\n\n @Input('rxapConfirm')\n public set hasConfirmDirective(value: any) {\n this._hasConfirmDirective = coerceBoolean(value);\n }\n\n /**\n * true - a remote method call is in progress\n */\n public executing$ = new ToggleSubject();\n\n @Required\n protected _remoteMethodOrIdOrToken!: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, Parameters, Metadata>>;\n\n private _hasConfirmDirective = false;\n\n constructor(\n @Inject(RemoteMethodLoader)\n protected readonly remoteMethodLoader: RemoteMethodLoader,\n @Inject(INJECTOR)\n private readonly injector: Injector = Injector.NULL,\n @Optional()\n @Self()\n @Inject(RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN)\n private readonly remoteMethodToken?: any\n ) {\n if (this.remoteMethodToken) {\n this._remoteMethodOrIdOrToken = this.remoteMethodToken;\n }\n }\n\n public ngOnInit(): void {\n if (this.immediately) {\n this.execute();\n }\n }\n\n @HostListener('confirmed')\n public onConfirmed() {\n this.execute();\n }\n\n @HostListener('click')\n public onClick() {\n if (!this._hasConfirmDirective) {\n this.execute();\n } else {\n console.debug('skip remote method call. Wait for confirmation.');\n }\n }\n\n public async execute(): Promise<void> {\n this.executing$.enable();\n try {\n const result = await this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, this.parameters, this.metadata, this.injector);\n this.executed(result);\n this.successful(result);\n } catch (error) {\n if (isDevMode()) {\n console.error(`Remote method directive execution failed:`, error.message);\n }\n this.failure(error);\n } finally {\n this.executing$.disable();\n }\n }\n\n public setParameter<Key extends keyof Parameters>(parameterKey: Key, value: Parameters[Key]): void {\n this.updateParameters({ [parameterKey]: value } as any);\n }\n\n public updateParameters(parameters: Partial<Parameters>): void {\n this.parameters = { ...(this.parameters ?? {}), ...parameters } as any;\n }\n\n protected executed(result: any) {\n this.executed$.emit(result);\n }\n\n protected failure(error: Error) {\n this.failure$.emit(error);\n }\n\n protected successful(result: ReturnType) {\n this.successful$.emit(result);\n }\n\n /**\n * @deprecated removed\n * @protected\n */\n @Deprecated('removed')\n protected async call(): Promise<any> {\n this.executing$.enable();\n const result = await this.remoteMethodLoader.call$(this._remoteMethodOrIdOrToken, this.parameters, this.metadata, this.injector);\n this.executing$.disable();\n return result;\n }\n\n}\n\n@NgModule({\n declarations: [ RemoteMethodDirective ],\n exports: [ RemoteMethodDirective ]\n})\nexport class RemoteMethodDirectiveModule {}\n"]}
@@ -1,3 +0,0 @@
1
- import { InjectionToken } from '@angular/core';
2
- export const RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN = new InjectionToken('rxap/remote-method/directive/token');
3
- //# sourceMappingURL=tokens.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/directive/src/lib/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,cAAc,CAAC,oCAAoC,CAAC,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport const RXAP_REMOTE_METHOD_DIRECTIVE_TOKEN = new InjectionToken('rxap/remote-method/directive/token');\n"]}
@@ -1,6 +0,0 @@
1
- export * from './lib/remote-method.directive';
2
- export * from './lib/remote-method-template-collection.directive';
3
- export * from './lib/remote-method-template.directive';
4
- export * from './lib/error';
5
- export * from './lib/tokens';
6
- //# sourceMappingURL=public_api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../../../../libs/remote-method/directive/src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mDAAmD,CAAC;AAClE,cAAc,wCAAwC,CAAC;AACvD,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC","sourcesContent":["export * from './lib/remote-method.directive';\nexport * from './lib/remote-method-template-collection.directive';\nexport * from './lib/remote-method-template.directive';\nexport * from './lib/error';\nexport * from './lib/tokens';\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
5
- //# sourceMappingURL=rxap-remote-method-directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rxap-remote-method-directive.js","sourceRoot":"","sources":["../../../../../libs/remote-method/directive/src/rxap-remote-method-directive.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"]}
@@ -1,86 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { Directive, Input, HostListener, NgModule, HostBinding, Inject, } from '@angular/core';
3
- import { Required, DebounceCall } from '@rxap/utilities';
4
- import { HttpRemoteMethodLoader } from '@rxap/remote-method/http';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@rxap/remote-method/http";
7
- export class ContenteditableDirective {
8
- constructor(httpRemoteMethodLoader) {
9
- this.httpRemoteMethodLoader = httpRemoteMethodLoader;
10
- this.contenteditable = true;
11
- }
12
- onClick($event) {
13
- $event.stopPropagation();
14
- }
15
- onInput($event) {
16
- const value = $event.target.textContent;
17
- if (value && value.length > 3) {
18
- return this.httpRemoteMethodLoader.request$(this.remoteMethodId, {
19
- pathParams: { uuid: this.uuid },
20
- body: { [this.property]: value },
21
- });
22
- }
23
- return Promise.resolve();
24
- }
25
- }
26
- ContenteditableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ContenteditableDirective, deps: [{ token: HttpRemoteMethodLoader }], target: i0.ɵɵFactoryTarget.Directive });
27
- ContenteditableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: ContenteditableDirective, selector: "[rxapContenteditable]", inputs: { remoteMethodId: ["rxapContenteditable", "remoteMethodId"], property: "property", uuid: "uuid" }, host: { listeners: { "click": "onClick($event)", "input": "onInput($event)" }, properties: { "attr.contenteditable": "this.contenteditable" } }, ngImport: i0 });
28
- __decorate([
29
- Required,
30
- __metadata("design:type", String)
31
- ], ContenteditableDirective.prototype, "remoteMethodId", void 0);
32
- __decorate([
33
- Required,
34
- __metadata("design:type", String)
35
- ], ContenteditableDirective.prototype, "property", void 0);
36
- __decorate([
37
- Required,
38
- __metadata("design:type", String)
39
- ], ContenteditableDirective.prototype, "uuid", void 0);
40
- __decorate([
41
- DebounceCall(1000),
42
- __metadata("design:type", Function),
43
- __metadata("design:paramtypes", [Object]),
44
- __metadata("design:returntype", void 0)
45
- ], ContenteditableDirective.prototype, "onInput", null);
46
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ContenteditableDirective, decorators: [{
47
- type: Directive,
48
- args: [{
49
- selector: '[rxapContenteditable]',
50
- }]
51
- }], ctorParameters: function () { return [{ type: i1.HttpRemoteMethodLoader, decorators: [{
52
- type: Inject,
53
- args: [HttpRemoteMethodLoader]
54
- }] }]; }, propDecorators: { contenteditable: [{
55
- type: HostBinding,
56
- args: ['attr.contenteditable']
57
- }], remoteMethodId: [{
58
- type: Input,
59
- args: ['rxapContenteditable']
60
- }], property: [{
61
- type: Input
62
- }], uuid: [{
63
- type: Input
64
- }], onClick: [{
65
- type: HostListener,
66
- args: ['click', ['$event']]
67
- }], onInput: [{
68
- type: HostListener,
69
- args: ['input', ['$event']]
70
- }] } });
71
- /**
72
- * @deprecated removed
73
- */
74
- export class ContenteditableDirectiveModule {
75
- }
76
- ContenteditableDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ContenteditableDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
77
- ContenteditableDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ContenteditableDirectiveModule, declarations: [ContenteditableDirective], exports: [ContenteditableDirective] });
78
- ContenteditableDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ContenteditableDirectiveModule });
79
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: ContenteditableDirectiveModule, decorators: [{
80
- type: NgModule,
81
- args: [{
82
- declarations: [ContenteditableDirective],
83
- exports: [ContenteditableDirective],
84
- }]
85
- }] });
86
- //# sourceMappingURL=contenteditable.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contenteditable.directive.js","sourceRoot":"","sources":["../../../../../../../libs/remote-method/http/directive/src/lib/contenteditable.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;;;AAKlE,MAAM,OAAO,wBAAwB;IAgBnC,YAEmB,sBAA8C;QAA9C,2BAAsB,GAAtB,sBAAsB,CAAwB;QAhB1D,oBAAe,GAAG,IAAI,CAAC;IAiB3B,CAAC;IAGG,OAAO,CAAC,MAAa;QAC1B,MAAM,CAAC,eAAe,EAAE,CAAC;IAC3B,CAAC;IAIM,OAAO,CAAC,MAAW;QACxB,MAAM,KAAK,GAAI,MAAM,CAA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NgModule,\n HostBinding,\n Inject,\n} from '@angular/core';\nimport { Required, DebounceCall } from '@rxap/utilities';\nimport { HttpRemoteMethodLoader } from '@rxap/remote-method/http';\n\n@Directive({\n selector: '[rxapContenteditable]',\n})\nexport class ContenteditableDirective {\n @HostBinding('attr.contenteditable')\n public contenteditable = true;\n\n @Input('rxapContenteditable')\n @Required\n public remoteMethodId!: string;\n\n @Input()\n @Required\n public property!: string;\n\n @Input()\n @Required\n public uuid!: string;\n\n constructor(\n @Inject(HttpRemoteMethodLoader)\n private readonly httpRemoteMethodLoader: HttpRemoteMethodLoader\n ) {}\n\n @HostListener('click', ['$event'])\n public onClick($event: Event) {\n $event.stopPropagation();\n }\n\n @HostListener('input', ['$event'])\n @DebounceCall(1000)\n public onInput($event: any) {\n const value = ($event.target as HTMLElement).textContent;\n if (value && value.length > 3) {\n return this.httpRemoteMethodLoader.request$(this.remoteMethodId, {\n pathParams: { uuid: this.uuid },\n body: { [this.property]: value },\n });\n }\n return Promise.resolve();\n }\n}\n\n/**\n * @deprecated removed\n */\n@NgModule({\n declarations: [ContenteditableDirective],\n exports: [ContenteditableDirective],\n})\nexport class ContenteditableDirectiveModule {}\n"]}
@@ -1,79 +0,0 @@
1
- import { Directive, Input, NgModule } from '@angular/core';
2
- import { RemoteMethodDirective } from '@rxap/remote-method/directive';
3
- import * as i0 from "@angular/core";
4
- export class HttpRemoteMethodDirective extends RemoteMethodDirective {
5
- set headers(headers) {
6
- this.updateParameters({ headers });
7
- }
8
- set reportProgress(reportProgress) {
9
- this.updateParameters({ reportProgress });
10
- }
11
- set params(params) {
12
- this.updateParameters({ params });
13
- }
14
- set responseType(responseType) {
15
- this.updateParameters({ responseType });
16
- }
17
- set withCredentials(withCredentials) {
18
- this.updateParameters({ withCredentials });
19
- }
20
- set body(body) {
21
- this.updateParameters({ body });
22
- }
23
- set setHeaders(setHeaders) {
24
- this.updateParameters({ setHeaders });
25
- }
26
- set setParams(setParams) {
27
- this.updateParameters({ setParams });
28
- }
29
- set pathParams(pathParams) {
30
- this.updateParameters({ pathParams });
31
- }
32
- set remoteMethodOrIdOrToken(value) {
33
- if (value) {
34
- this._remoteMethodOrIdOrToken = value;
35
- }
36
- }
37
- }
38
- HttpRemoteMethodDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
39
- HttpRemoteMethodDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.0.1", type: HttpRemoteMethodDirective, selector: "button[rxapHttpRemoteMethod]", inputs: { headers: "headers", reportProgress: "reportProgress", params: "params", responseType: "responseType", withCredentials: "withCredentials", body: "body", setHeaders: "setHeaders", setParams: "setParams", pathParams: "pathParams", remoteMethodOrIdOrToken: ["rxapHttpRemoteMethod", "remoteMethodOrIdOrToken"] }, usesInheritance: true, ngImport: i0 });
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodDirective, decorators: [{
41
- type: Directive,
42
- args: [{
43
- selector: 'button[rxapHttpRemoteMethod]'
44
- }]
45
- }], propDecorators: { headers: [{
46
- type: Input
47
- }], reportProgress: [{
48
- type: Input
49
- }], params: [{
50
- type: Input
51
- }], responseType: [{
52
- type: Input
53
- }], withCredentials: [{
54
- type: Input
55
- }], body: [{
56
- type: Input
57
- }], setHeaders: [{
58
- type: Input
59
- }], setParams: [{
60
- type: Input
61
- }], pathParams: [{
62
- type: Input
63
- }], remoteMethodOrIdOrToken: [{
64
- type: Input,
65
- args: ['rxapHttpRemoteMethod']
66
- }] } });
67
- export class HttpRemoteMethodDirectiveModule {
68
- }
69
- HttpRemoteMethodDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
70
- HttpRemoteMethodDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodDirectiveModule, declarations: [HttpRemoteMethodDirective], exports: [HttpRemoteMethodDirective] });
71
- HttpRemoteMethodDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodDirectiveModule });
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodDirectiveModule, decorators: [{
73
- type: NgModule,
74
- args: [{
75
- declarations: [HttpRemoteMethodDirective],
76
- exports: [HttpRemoteMethodDirective]
77
- }]
78
- }] });
79
- //# sourceMappingURL=http-remote-method.directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-remote-method.directive.js","sourceRoot":"","sources":["../../../../../../../libs/remote-method/http/directive/src/lib/http-remote-method.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;;AAWtE,MAAM,OAAO,yBAAkH,SAAQ,qBAAsE;IAE3M,IACW,OAAO,CAAC,OAA6C;QAC9D,IAAI,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACrC,CAAC;IAED,IACW,cAAc,CAAC,cAA2D;QACnF,IAAI,CAAC,gBAAgB,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,IACW,MAAM,CAAC,MAA2C;QAC3D,IAAI,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,IACW,YAAY,CAAC,YAAuD;QAC7E,IAAI,CAAC,gBAAgB,CAAC,EAAE,YAAY,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,IACW,eAAe,CAAC,eAA6D;QACtF,IAA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cesContent":["import {\n Directive,\n Input,\n NgModule\n} from '@angular/core';\nimport { Required } from '@rxap/utilities';\nimport { RemoteMethodDirective } from '@rxap/remote-method/directive';\nimport {\n HttpRemoteMethodParameter,\n HttpRemoteMethodMetadata\n} from '@rxap/remote-method/http';\nimport { BaseRemoteMethod } from '@rxap/remote-method';\nimport { IdOrInstanceOrToken } from '@rxap/definition';\n\n@Directive({\n selector: 'button[rxapHttpRemoteMethod]'\n})\nexport class HttpRemoteMethodDirective<ReturnType = any, Metadata extends HttpRemoteMethodMetadata = HttpRemoteMethodMetadata> extends RemoteMethodDirective<ReturnType, HttpRemoteMethodParameter, Metadata> {\n\n @Input()\n public set headers(headers: HttpRemoteMethodParameter['headers']) {\n this.updateParameters({ headers });\n }\n\n @Input()\n public set reportProgress(reportProgress: HttpRemoteMethodParameter['reportProgress']) {\n this.updateParameters({ reportProgress });\n }\n\n @Input()\n public set params(params: HttpRemoteMethodParameter['params']) {\n this.updateParameters({ params });\n }\n\n @Input()\n public set responseType(responseType: HttpRemoteMethodParameter['responseType']) {\n this.updateParameters({ responseType });\n }\n\n @Input()\n public set withCredentials(withCredentials: HttpRemoteMethodParameter['withCredentials']) {\n this.updateParameters({ withCredentials });\n }\n\n @Input()\n public set body(body: HttpRemoteMethodParameter['body']) {\n this.updateParameters({ body });\n }\n\n @Input()\n public set setHeaders(setHeaders: HttpRemoteMethodParameter['setHeaders']) {\n this.updateParameters({ setHeaders });\n }\n\n @Input()\n public set setParams(setParams: HttpRemoteMethodParameter['setParams']) {\n this.updateParameters({ setParams });\n }\n\n @Input()\n public set pathParams(pathParams: HttpRemoteMethodParameter['pathParams']) {\n this.updateParameters({ pathParams });\n }\n\n @Input('rxapHttpRemoteMethod')\n public set remoteMethodOrIdOrToken(value: IdOrInstanceOrToken<BaseRemoteMethod<ReturnType, HttpRemoteMethodParameter, Metadata>>) {\n if (value) {\n this._remoteMethodOrIdOrToken = value;\n }\n }\n\n}\n\n@NgModule({\n declarations: [ HttpRemoteMethodDirective ],\n exports: [ HttpRemoteMethodDirective ]\n})\nexport class HttpRemoteMethodDirectiveModule {}\n"]}
@@ -1,3 +0,0 @@
1
- export * from './lib/http-remote-method.directive';
2
- export * from './lib/contenteditable.directive';
3
- //# sourceMappingURL=public_api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/http/directive/src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './lib/http-remote-method.directive';\nexport * from './lib/contenteditable.directive';\n"]}
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public_api';
5
- //# sourceMappingURL=rxap-remote-method-http-directive.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rxap-remote-method-http-directive.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/http/directive/src/rxap-remote-method-http-directive.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,cAAc,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"]}
@@ -1,79 +0,0 @@
1
- import { Injectable, Optional, Inject, Injector } from '@angular/core';
2
- import { HttpClient, HttpRequest } from '@angular/common/http';
3
- import { BaseRemoteMethod, REMOTE_METHOD_META_DATA, RxapRemoteMethodError } from '@rxap/remote-method';
4
- import { hasIndexSignature } from '@rxap/utilities';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/common/http";
7
- export class BaseHttpRemoteMethod extends BaseRemoteMethod {
8
- constructor(http, injector, metaData = null) {
9
- var _a;
10
- super(injector, metaData);
11
- this.http = http;
12
- this.timeout = 60 * 1000;
13
- this.timeout = (_a = this.metadata.timeout) !== null && _a !== void 0 ? _a : this.timeout;
14
- if (http === undefined) {
15
- throw new RxapRemoteMethodError('HttpClient is undefined. Ensure that the HttpClient is added to the deps property!', '', this.constructor.name);
16
- }
17
- if (!(http instanceof HttpClient)) {
18
- throw new RxapRemoteMethodError('The property http is not an instance of HttpClinent. Check the deps property!', '', this.constructor.name);
19
- }
20
- }
21
- getRequestUrl() {
22
- if (typeof this.metadata.url === 'function') {
23
- return this.metadata.url();
24
- }
25
- return this.metadata.url;
26
- }
27
- init() {
28
- super.init();
29
- this._httpRequest = new HttpRequest(this.metadata.method, this.getRequestUrl(), null, {
30
- headers: this.metadata.headers,
31
- reportProgress: this.metadata.reportProgress,
32
- params: this.metadata.params,
33
- responseType: this.metadata.responseType || 'json',
34
- withCredentials: this.metadata.withCredentials
35
- });
36
- }
37
- updateRequest(parameters) {
38
- let url = this._httpRequest.url;
39
- if (parameters && parameters.hasOwnProperty('pathParams')) {
40
- url = this.buildUrlWithParams(url, parameters.pathParams);
41
- }
42
- return this._httpRequest.clone(Object.assign(Object.assign({ withCredentials: this.metadata.withCredentials }, parameters), { url }));
43
- }
44
- buildUrlWithParams(url, pathParams) {
45
- if (pathParams) {
46
- if (!hasIndexSignature(pathParams)) {
47
- throw new RxapRemoteMethodError(`Path params for remote method '${this.id}' has not an index signature`, '', this.constructor.name);
48
- }
49
- const matches = url.match(/\{[^\}]+\}/g);
50
- if (matches) {
51
- for (const match of matches) {
52
- const param = match.substr(1, match.length - 2);
53
- if (!pathParams.hasOwnProperty(param)) {
54
- throw new RxapRemoteMethodError(`Path params for remote method '${this.id}' has not a defined value for '${param}'`, '', this.constructor.name);
55
- }
56
- url = url.replace(match, encodeURIComponent(pathParams[param]));
57
- }
58
- }
59
- }
60
- return url;
61
- }
62
- }
63
- BaseHttpRemoteMethod.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: BaseHttpRemoteMethod, deps: [{ token: HttpClient }, { token: Injector }, { token: REMOTE_METHOD_META_DATA, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
64
- BaseHttpRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: BaseHttpRemoteMethod });
65
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: BaseHttpRemoteMethod, decorators: [{
66
- type: Injectable
67
- }], ctorParameters: function () { return [{ type: i1.HttpClient, decorators: [{
68
- type: Inject,
69
- args: [HttpClient]
70
- }] }, { type: i0.Injector, decorators: [{
71
- type: Inject,
72
- args: [Injector]
73
- }] }, { type: undefined, decorators: [{
74
- type: Optional
75
- }, {
76
- type: Inject,
77
- args: [REMOTE_METHOD_META_DATA]
78
- }] }]; } });
79
- //# sourceMappingURL=base-http.remote-method.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-http.remote-method.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/http/src/lib/base-http.remote-method.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,MAAM,EACN,QAAQ,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EAGZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,gBAAgB,EAEhB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;;;AA+BpD,MAAM,OAAgB,oBAIpB,SAAQ,gBAAiD;IAMzD,YACsC,IAAgB,EAClC,QAAkB,EACS,WAAuB,IAAI;;QAExE,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAJU,SAAI,GAAJ,IAAI,CAAY;QAH/C,YAAO,GAAG,EAAE,GAAG,IAAI,CAAC;QAQzB,IAAI,CAAC,OAAO,GAAG,MAAA,IAAI,CAAC,QAAQ,CAAC,OAAO,mCAAI,IAAI,CAAC,OAAO,CAAC;QACrD,IAAI,IAAI,KAAK,SAAS,EAAE;YACtB,MAAM,IAAI,qBAAqB,CAAC,oFAAoF,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC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CAAC;IACL,CAAC;IAEM,kBAAkB,CAAC,GAAW,EAAE,UAAuB;QAC5D,IAAI,UAAU,EAAE;YAEd,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE;gBAClC,MAAM,IAAI,qBAAqB,CAAC,kCAAkC,IAAI,CAAC,EAAE,8BAA8B,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aACrI;YAED,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAEzC,IAAI,OAAO,EAAE;gBACX,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;oBAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;oBAChD,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;wBACrC,MAAM,IAAI,qBAAqB,CAAC,kCAAkC,IAAI,CAAC,EAAE,kCAAkC,KAAK,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;qBACjJ;oBACD,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,UAAU,CAAE,KAAK,CAAE,CAAC,CAAC,CAAC;iBACnE;aACF;SACF;QAED,OAAO,GAAG,CAAC;IACb,CAAC;;iHAnFmB,oBAAoB,kBAW9B,UAAU,aACV,QAAQ,aACI,uBAAuB;qHAbzB,oBAAoB;2FAApB,oBAAoB;kBADzC,UAAU;;0BAYN,MAAM;2BAAC,UAAU;;0BACjB,MAAM;2BAAC,QAAQ;;0BACf,QAAQ;;0BAAI,MAAM;2BAAC,uBAAuB","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"]}
@@ -1,30 +0,0 @@
1
- import { RemoteMethodLoader, RxapRemoteMethodError } from '@rxap/remote-method';
2
- import { HttpRemoteMethod } from './http.remote-method';
3
- import { Injectable, Inject } from '@angular/core';
4
- import * as i0 from "@angular/core";
5
- import * as i1 from "@rxap/remote-method";
6
- export class HttpRemoteMethodLoader {
7
- // Instead of extanding the RemoteMethodLoader class the RemoteMethodLoader instance
8
- // will be injected, else there could be multiple instance of RemoteMethodLoader's. Then
9
- // the RefreshService will not trigger a refresh for HttpRemoteMethod's
10
- constructor(remoteMethodLoader) {
11
- this.remoteMethodLoader = remoteMethodLoader;
12
- }
13
- request$(remoteMethodIdOrInstanceOrToken, parameters, metadata, injector, notFoundValue, flags) {
14
- const remoteMethod = this.remoteMethodLoader.load(remoteMethodIdOrInstanceOrToken, metadata, injector, notFoundValue, flags);
15
- if (!(remoteMethod instanceof HttpRemoteMethod)) {
16
- throw new RxapRemoteMethodError(`The remote method is not a HttpRemoteMethod`, '', 'HttpRemoteMethodLoader');
17
- }
18
- return remoteMethod.call(parameters);
19
- }
20
- }
21
- HttpRemoteMethodLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodLoader, deps: [{ token: RemoteMethodLoader }], target: i0.ɵɵFactoryTarget.Injectable });
22
- HttpRemoteMethodLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodLoader, providedIn: 'root' });
23
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethodLoader, decorators: [{
24
- type: Injectable,
25
- args: [{ providedIn: 'root' }]
26
- }], ctorParameters: function () { return [{ type: i1.RemoteMethodLoader, decorators: [{
27
- type: Inject,
28
- args: [RemoteMethodLoader]
29
- }] }]; } });
30
- //# sourceMappingURL=http-remote-method.loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-remote-method.loader.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/http/src/lib/http-remote-method.loader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EAEtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,UAAU,EACV,MAAM,EAGP,MAAM,eAAe,CAAC;;;AAIvB,MAAM,OAAO,sBAAsB;IAEjC,oFAAoF;IACpF,wFAAwF;IACxF,uEAAuE;IACvE,YAAyD,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;IAAG,CAAC;IAE5F,QAAQ,CACb,+BAAwG,EACxG,UAAsB,EACtB,QAA4C,EAC5C,QAAmB,EACnB,aAAkE,EAClE,KAAmB;QAGnB,MAAM,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAC/C,+BAA+B,EAC/B,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,KAAK,CACN,CAAC;QAEF,IAAI,CAAC,CAAC,YAAY,YAAY,gBAAgB,CAAC,EAAE;YAC/C,MAAM,IAAI,qBAAqB,CAAC,6CAA6C,EAAE,EAAE,EAAE,wBAAwB,CAAC,CAAC;SAC9G;QAED,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACvC,CAAC;;mHA7BU,sBAAsB,kBAKb,kBAAkB;uHAL3B,sBAAsB,cADT,MAAM;2FACnB,sBAAsB;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;0BAMnB,MAAM;2BAAC,kBAAkB","sourcesContent":["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"]}
@@ -1,46 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import { HttpResponse, HttpEventType } from '@angular/common/http';
3
- import { tap, filter, map, timeout, retry } from 'rxjs/operators';
4
- import { BaseHttpRemoteMethod } from './base-http.remote-method';
5
- import * as i0 from "@angular/core";
6
- export class HttpRemoteMethod extends BaseHttpRemoteMethod {
7
- _call(parameters) {
8
- var _a;
9
- return this.http.request(this.updateRequest(this.createHttpRequestParameters(parameters))).pipe(retry((_a = this.metadata.retry) !== null && _a !== void 0 ? _a : 0), tap(event => {
10
- switch (event.type) {
11
- case HttpEventType.Sent:
12
- this.onSentEvent(event);
13
- break;
14
- case HttpEventType.Response:
15
- this.onResponse(event);
16
- break;
17
- case HttpEventType.DownloadProgress:
18
- this.onProgressEvent(event);
19
- break;
20
- case HttpEventType.UploadProgress:
21
- this.onProgressEvent(event);
22
- break;
23
- case HttpEventType.ResponseHeader:
24
- this.onHeaderResponse(event);
25
- break;
26
- }
27
- }), filter((event) => event instanceof HttpResponse), map((event) => event.body), map(body => this.transformer(body)), timeout(this.timeout)).toPromise();
28
- }
29
- onSentEvent(event) { }
30
- onHeaderResponse(event) { }
31
- onResponse(event) { }
32
- onProgressEvent(event) { }
33
- // TODO : make abstract to force implementation to handel parameter transformation
34
- createHttpRequestParameters(parameters) {
35
- return parameters !== null && parameters !== void 0 ? parameters : {};
36
- }
37
- transformer(response) {
38
- return response;
39
- }
40
- }
41
- HttpRemoteMethod.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethod, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
42
- HttpRemoteMethod.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethod });
43
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.0.1", ngImport: i0, type: HttpRemoteMethod, decorators: [{
44
- type: Injectable
45
- }] });
46
- //# sourceMappingURL=http.remote-method.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http.remote-method.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/http/src/lib/http.remote-method.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAGL,YAAY,EAEZ,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,GAAG,EACH,MAAM,EACN,GAAG,EACH,OAAO,EACP,KAAK,EACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,oBAAoB,EAGrB,MAAM,2BAA2B,CAAC;;AAGnC,MAAM,OAAO,gBAIX,SAAQ,oBAAiE;IAE/D,KAAK,CAAC,UAAsB;;QACpC,OAAO,IAAI,C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EzD,kFAAkF;IAC3E,2BAA2B,CAAC,UAAsB;QACvD,OAAO,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,EAAS,CAAC;IACjC,CAAC;IAEM,WAAW,CAAC,QAAa;QAC9B,OAAO,QAAQ,CAAC;IAClB,CAAC;;6GAxDU,gBAAgB;iHAAhB,gBAAgB;2FAAhB,gBAAgB;kBAD5B,UAAU","sourcesContent":["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"]}