@alterior/http 3.13.3 → 3.13.4

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 (156) hide show
  1. package/dist/backend.d.ts +38 -38
  2. package/dist/backend.js +38 -38
  3. package/dist/client.d.ts +2108 -2108
  4. package/dist/client.js +265 -265
  5. package/dist/client.js.map +1 -1
  6. package/dist/headers.d.ts +57 -57
  7. package/dist/headers.js +187 -187
  8. package/dist/headers.js.map +1 -1
  9. package/dist/index.d.ts +18 -18
  10. package/dist/index.js +42 -42
  11. package/dist/interceptor.d.ts +63 -63
  12. package/dist/interceptor.js +43 -43
  13. package/dist/interceptor.js.map +1 -1
  14. package/dist/module.d.ts +101 -101
  15. package/dist/module.js +188 -188
  16. package/dist/module.js.map +1 -1
  17. package/dist/params.d.ts +98 -98
  18. package/dist/params.js +184 -184
  19. package/dist/params.js.map +1 -1
  20. package/dist/request.d.ts +130 -130
  21. package/dist/request.js +260 -260
  22. package/dist/request.js.map +1 -1
  23. package/dist/response.d.ts +267 -267
  24. package/dist/response.js +165 -165
  25. package/dist/response.js.map +1 -1
  26. package/dist/server.d.ts +28 -28
  27. package/dist/server.js +119 -119
  28. package/dist/server.js.map +1 -1
  29. package/dist/test/client.test.d.ts +8 -8
  30. package/dist/test/client.test.js +163 -163
  31. package/dist/test/client.test.js.map +1 -1
  32. package/dist/test/headers.test.d.ts +1 -1
  33. package/dist/test/headers.test.js +126 -126
  34. package/dist/test/module.test.d.ts +1 -1
  35. package/dist/test/module.test.js +117 -117
  36. package/dist/test/module.test.js.map +1 -1
  37. package/dist/test/params.test.d.ts +1 -1
  38. package/dist/test/params.test.js +63 -63
  39. package/dist/test/request.test.d.ts +8 -8
  40. package/dist/test/request.test.js +159 -159
  41. package/dist/test/request.test.js.map +1 -1
  42. package/dist/test/response.test.d.ts +1 -1
  43. package/dist/test/response.test.js +79 -79
  44. package/dist/test/response.test.js.map +1 -1
  45. package/dist/test/test.d.ts +1 -1
  46. package/dist/test/test.js +16 -16
  47. package/dist/test/xhr.mock.d.ts +48 -48
  48. package/dist/test/xhr.mock.js +94 -94
  49. package/dist/test/xhr.mock.js.map +1 -1
  50. package/dist/test/xhr.test.d.ts +1 -1
  51. package/dist/test/xhr.test.js +344 -344
  52. package/dist/test/xhr.test.js.map +1 -1
  53. package/dist/test/xsrf.test.d.ts +1 -1
  54. package/dist/test/xsrf.test.js +63 -63
  55. package/dist/test/xsrf.test.js.map +1 -1
  56. package/dist/testing/api.d.ts +102 -102
  57. package/dist/testing/api.js +19 -19
  58. package/dist/testing/backend.d.ts +63 -63
  59. package/dist/testing/backend.js +141 -141
  60. package/dist/testing/backend.js.map +1 -1
  61. package/dist/testing/index.d.ts +10 -10
  62. package/dist/testing/index.js +16 -16
  63. package/dist/testing/module.d.ts +16 -16
  64. package/dist/testing/module.js +38 -38
  65. package/dist/testing/module.js.map +1 -1
  66. package/dist/testing/request.d.ts +56 -56
  67. package/dist/testing/request.js +177 -177
  68. package/dist/testing/request.js.map +1 -1
  69. package/dist/testing/request.test.d.ts +8 -8
  70. package/dist/testing/request.test.js +24 -24
  71. package/dist/xhr.d.ts +42 -42
  72. package/dist/xhr.js +298 -298
  73. package/dist/xhr.js.map +1 -1
  74. package/dist/xsrf.d.ts +37 -37
  75. package/dist/xsrf.js +55 -55
  76. package/dist/xsrf.js.map +1 -1
  77. package/dist.esm/backend.d.ts +38 -38
  78. package/dist.esm/backend.js +33 -33
  79. package/dist.esm/client.d.ts +2108 -2108
  80. package/dist.esm/client.js +262 -262
  81. package/dist.esm/client.js.map +1 -1
  82. package/dist.esm/headers.d.ts +57 -57
  83. package/dist.esm/headers.js +183 -183
  84. package/dist.esm/headers.js.map +1 -1
  85. package/dist.esm/index.d.ts +18 -18
  86. package/dist.esm/index.js +18 -18
  87. package/dist.esm/interceptor.d.ts +63 -63
  88. package/dist.esm/interceptor.js +39 -39
  89. package/dist.esm/interceptor.js.map +1 -1
  90. package/dist.esm/module.d.ts +101 -101
  91. package/dist.esm/module.js +183 -183
  92. package/dist.esm/module.js.map +1 -1
  93. package/dist.esm/params.d.ts +98 -98
  94. package/dist.esm/params.js +179 -179
  95. package/dist.esm/params.js.map +1 -1
  96. package/dist.esm/request.d.ts +130 -130
  97. package/dist.esm/request.js +256 -256
  98. package/dist.esm/request.js.map +1 -1
  99. package/dist.esm/response.d.ts +267 -267
  100. package/dist.esm/response.js +158 -158
  101. package/dist.esm/response.js.map +1 -1
  102. package/dist.esm/server.d.ts +28 -28
  103. package/dist.esm/server.js +113 -113
  104. package/dist.esm/server.js.map +1 -1
  105. package/dist.esm/test/client.test.d.ts +8 -8
  106. package/dist.esm/test/client.test.js +161 -161
  107. package/dist.esm/test/client.test.js.map +1 -1
  108. package/dist.esm/test/headers.test.d.ts +1 -1
  109. package/dist.esm/test/headers.test.js +124 -124
  110. package/dist.esm/test/module.test.d.ts +1 -1
  111. package/dist.esm/test/module.test.js +115 -115
  112. package/dist.esm/test/module.test.js.map +1 -1
  113. package/dist.esm/test/params.test.d.ts +1 -1
  114. package/dist.esm/test/params.test.js +61 -61
  115. package/dist.esm/test/request.test.d.ts +8 -8
  116. package/dist.esm/test/request.test.js +157 -157
  117. package/dist.esm/test/request.test.js.map +1 -1
  118. package/dist.esm/test/response.test.d.ts +1 -1
  119. package/dist.esm/test/response.test.js +77 -77
  120. package/dist.esm/test/response.test.js.map +1 -1
  121. package/dist.esm/test/test.d.ts +1 -1
  122. package/dist.esm/test/test.js +14 -14
  123. package/dist.esm/test/xhr.mock.d.ts +48 -48
  124. package/dist.esm/test/xhr.mock.js +88 -88
  125. package/dist.esm/test/xhr.mock.js.map +1 -1
  126. package/dist.esm/test/xhr.test.d.ts +1 -1
  127. package/dist.esm/test/xhr.test.js +342 -342
  128. package/dist.esm/test/xhr.test.js.map +1 -1
  129. package/dist.esm/test/xsrf.test.d.ts +1 -1
  130. package/dist.esm/test/xsrf.test.js +61 -61
  131. package/dist.esm/test/xsrf.test.js.map +1 -1
  132. package/dist.esm/testing/api.d.ts +102 -102
  133. package/dist.esm/testing/api.js +15 -15
  134. package/dist.esm/testing/backend.d.ts +63 -63
  135. package/dist.esm/testing/backend.js +138 -138
  136. package/dist.esm/testing/backend.js.map +1 -1
  137. package/dist.esm/testing/index.d.ts +10 -10
  138. package/dist.esm/testing/index.js +10 -10
  139. package/dist.esm/testing/module.d.ts +16 -16
  140. package/dist.esm/testing/module.js +35 -35
  141. package/dist.esm/testing/module.js.map +1 -1
  142. package/dist.esm/testing/request.d.ts +56 -56
  143. package/dist.esm/testing/request.js +173 -173
  144. package/dist.esm/testing/request.js.map +1 -1
  145. package/dist.esm/testing/request.test.d.ts +8 -8
  146. package/dist.esm/testing/request.test.js +22 -22
  147. package/dist.esm/xhr.d.ts +42 -42
  148. package/dist.esm/xhr.js +294 -294
  149. package/dist.esm/xhr.js.map +1 -1
  150. package/dist.esm/xsrf.d.ts +37 -37
  151. package/dist.esm/xsrf.js +51 -51
  152. package/dist.esm/xsrf.js.map +1 -1
  153. package/package.json +9 -9
  154. package/tsconfig.esm.tsbuildinfo +1 -0
  155. package/tsconfig.json +0 -2
  156. package/tsconfig.tsbuildinfo +1 -8046
package/dist/module.js CHANGED
@@ -1,189 +1,189 @@
1
- "use strict";
2
- /**
3
- * @license
4
- * Copyright Google Inc. All Rights Reserved.
5
- *
6
- * Use of this source code is governed by an MIT-style license that can be
7
- * found in the LICENSE file at https://angular.io/license
8
- */
9
- var HttpClientXsrfModule_1, HttpClientModule_1;
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.HttpClientModule = exports.HttpClientXsrfModule = exports.jsonpCallbackContext = exports.interceptingHandler = exports.HttpInterceptingHandler = void 0;
12
- const tslib_1 = require("tslib");
13
- const di_1 = require("@alterior/di");
14
- const backend_1 = require("./backend");
15
- const client_1 = require("./client");
16
- const interceptor_1 = require("./interceptor");
17
- const xhr_1 = require("./xhr");
18
- const xsrf_1 = require("./xsrf");
19
- const server_1 = require("./server");
20
- /**
21
- * An injectable `HttpHandler` that applies multiple interceptors
22
- * to a request before passing it to the given `HttpBackend`.
23
- *
24
- * The interceptors are loaded lazily from the injector, to allow
25
- * interceptors to themselves inject classes depending indirectly
26
- * on `HttpInterceptingHandler` itself.
27
- * @see `HttpInterceptor`
28
- */
29
- let HttpInterceptingHandler = class HttpInterceptingHandler {
30
- constructor(backend, injector) {
31
- this.backend = backend;
32
- this.injector = injector;
33
- this.chain = null;
34
- }
35
- handle(req) {
36
- if (this.chain === null) {
37
- const interceptors = this.injector.get(interceptor_1.HTTP_INTERCEPTORS, []);
38
- this.chain = interceptors.reduceRight((next, interceptor) => new interceptor_1.HttpInterceptorHandler(next, interceptor), this.backend);
39
- }
40
- return this.chain.handle(req);
41
- }
42
- };
43
- HttpInterceptingHandler = tslib_1.__decorate([
44
- (0, di_1.Injectable)(),
45
- tslib_1.__metadata("design:paramtypes", [backend_1.HttpBackend, di_1.Injector])
46
- ], HttpInterceptingHandler);
47
- exports.HttpInterceptingHandler = HttpInterceptingHandler;
48
- /**
49
- * Constructs an `HttpHandler` that applies interceptors
50
- * to a request before passing it to the given `HttpBackend`.
51
- *
52
- * Use as a factory function within `HttpClientModule`.
53
- *
54
- *
55
- */
56
- function interceptingHandler(backend, interceptors = []) {
57
- if (!interceptors) {
58
- return backend;
59
- }
60
- return interceptors.reduceRight((next, interceptor) => new interceptor_1.HttpInterceptorHandler(next, interceptor), backend);
61
- }
62
- exports.interceptingHandler = interceptingHandler;
63
- /**
64
- * Factory function that determines where to store JSONP callbacks.
65
- *
66
- * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
67
- * in test environments. In that case, callbacks are stored on an anonymous object instead.
68
- *
69
- *
70
- */
71
- function jsonpCallbackContext() {
72
- if (typeof window === 'object') {
73
- return window;
74
- }
75
- return {};
76
- }
77
- exports.jsonpCallbackContext = jsonpCallbackContext;
78
- /**
79
- * An NgModule that adds XSRF protection support to outgoing requests.
80
- *
81
- * For a server that supports a cookie-based XSRF protection system,
82
- * use directly to configure XSRF protection with the correct
83
- * cookie and header names.
84
- *
85
- * If no names are supplied, the default cookie name is `XSRF-TOKEN`
86
- * and the default header name is `X-XSRF-TOKEN`.
87
- *
88
- *
89
- */
90
- let HttpClientXsrfModule = HttpClientXsrfModule_1 = class HttpClientXsrfModule {
91
- /**
92
- * Disable the default XSRF protection.
93
- */
94
- static disable() {
95
- return {
96
- $module: HttpClientXsrfModule_1,
97
- providers: [
98
- { provide: xsrf_1.HttpXsrfInterceptor, useClass: interceptor_1.NoopInterceptor },
99
- ],
100
- };
101
- }
102
- /**
103
- * Configure XSRF protection.
104
- * @param options An object that can specify either or both
105
- * cookie name or header name.
106
- * - Cookie name default is `XSRF-TOKEN`.
107
- * - Header name default is `X-XSRF-TOKEN`.
108
- *
109
- */
110
- static withOptions(options = {}) {
111
- return {
112
- $module: HttpClientXsrfModule_1,
113
- providers: [
114
- options.cookieName ? { provide: xsrf_1.XSRF_COOKIE_NAME, useValue: options.cookieName } : [],
115
- options.headerName ? { provide: xsrf_1.XSRF_HEADER_NAME, useValue: options.headerName } : [],
116
- ],
117
- };
118
- }
119
- };
120
- HttpClientXsrfModule = HttpClientXsrfModule_1 = tslib_1.__decorate([
121
- (0, di_1.Module)({
122
- providers: [
123
- xsrf_1.HttpXsrfInterceptor,
124
- { provide: interceptor_1.HTTP_INTERCEPTORS, useExisting: xsrf_1.HttpXsrfInterceptor, multi: true },
125
- { provide: xsrf_1.XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },
126
- { provide: xsrf_1.XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },
127
- ],
128
- })
129
- ], HttpClientXsrfModule);
130
- exports.HttpClientXsrfModule = HttpClientXsrfModule;
131
- /**
132
- * An NgModule that provides the `HttpClient` and associated services.
133
- *
134
- * Interceptors can be added to the chain behind `HttpClient` by binding them
135
- * to the multiprovider for `HTTP_INTERCEPTORS`.
136
- *
137
- *
138
- */
139
- let HttpClientModule = HttpClientModule_1 = class HttpClientModule {
140
- static forRoot(config) {
141
- let providers = [];
142
- if (!config)
143
- config = {};
144
- if (!config.platform) {
145
- // Autodetect the backend
146
- if (typeof document !== 'undefined')
147
- config.platform = 'browser';
148
- else
149
- config.platform = 'server';
150
- }
151
- if (config.platform === 'server') {
152
- providers.push({ provide: xhr_1.XhrFactory, useClass: server_1.ServerXhr }, {
153
- provide: backend_1.HttpHandler,
154
- useFactory: server_1.zoneWrappedInterceptingHandler,
155
- deps: [backend_1.HttpBackend, di_1.Injector]
156
- });
157
- }
158
- else if (config.platform === 'browser') {
159
- // Default configuration is browser.
160
- }
161
- return { $module: HttpClientModule_1, providers };
162
- }
163
- };
164
- HttpClientModule = HttpClientModule_1 = tslib_1.__decorate([
165
- (0, di_1.Module)({
166
- /**
167
- * Optional configuration for XSRF protection.
168
- */
169
- imports: [
170
- // HttpClientXsrfModule.withOptions({
171
- // cookieName: 'XSRF-TOKEN',
172
- // headerName: 'X-XSRF-TOKEN',
173
- // }),
174
- ],
175
- /**
176
- * The module provides `HttpClient` itself, and supporting services.
177
- */
178
- providers: [
179
- client_1.HttpClient,
180
- { provide: backend_1.HttpHandler, useClass: HttpInterceptingHandler },
181
- xhr_1.HttpXhrBackend,
182
- { provide: backend_1.HttpBackend, useExisting: xhr_1.HttpXhrBackend },
183
- xhr_1.BrowserXhr,
184
- { provide: xhr_1.XhrFactory, useExisting: xhr_1.BrowserXhr },
185
- ],
186
- })
187
- ], HttpClientModule);
188
- exports.HttpClientModule = HttpClientModule;
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google Inc. All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ var HttpClientXsrfModule_1, HttpClientModule_1;
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.HttpClientModule = exports.HttpClientXsrfModule = exports.HttpInterceptingHandler = void 0;
12
+ exports.interceptingHandler = interceptingHandler;
13
+ exports.jsonpCallbackContext = jsonpCallbackContext;
14
+ const tslib_1 = require("tslib");
15
+ const di_1 = require("@alterior/di");
16
+ const backend_1 = require("./backend");
17
+ const client_1 = require("./client");
18
+ const interceptor_1 = require("./interceptor");
19
+ const xhr_1 = require("./xhr");
20
+ const xsrf_1 = require("./xsrf");
21
+ const server_1 = require("./server");
22
+ /**
23
+ * An injectable `HttpHandler` that applies multiple interceptors
24
+ * to a request before passing it to the given `HttpBackend`.
25
+ *
26
+ * The interceptors are loaded lazily from the injector, to allow
27
+ * interceptors to themselves inject classes depending indirectly
28
+ * on `HttpInterceptingHandler` itself.
29
+ * @see `HttpInterceptor`
30
+ */
31
+ let HttpInterceptingHandler = class HttpInterceptingHandler {
32
+ constructor(backend, injector) {
33
+ this.backend = backend;
34
+ this.injector = injector;
35
+ this.chain = null;
36
+ }
37
+ handle(req) {
38
+ if (this.chain === null) {
39
+ const interceptors = this.injector.get(interceptor_1.HTTP_INTERCEPTORS, []);
40
+ this.chain = interceptors.reduceRight((next, interceptor) => new interceptor_1.HttpInterceptorHandler(next, interceptor), this.backend);
41
+ }
42
+ return this.chain.handle(req);
43
+ }
44
+ };
45
+ exports.HttpInterceptingHandler = HttpInterceptingHandler;
46
+ exports.HttpInterceptingHandler = HttpInterceptingHandler = tslib_1.__decorate([
47
+ (0, di_1.Injectable)(),
48
+ tslib_1.__metadata("design:paramtypes", [backend_1.HttpBackend, di_1.Injector])
49
+ ], HttpInterceptingHandler);
50
+ /**
51
+ * Constructs an `HttpHandler` that applies interceptors
52
+ * to a request before passing it to the given `HttpBackend`.
53
+ *
54
+ * Use as a factory function within `HttpClientModule`.
55
+ *
56
+ *
57
+ */
58
+ function interceptingHandler(backend, interceptors = []) {
59
+ if (!interceptors) {
60
+ return backend;
61
+ }
62
+ return interceptors.reduceRight((next, interceptor) => new interceptor_1.HttpInterceptorHandler(next, interceptor), backend);
63
+ }
64
+ /**
65
+ * Factory function that determines where to store JSONP callbacks.
66
+ *
67
+ * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
68
+ * in test environments. In that case, callbacks are stored on an anonymous object instead.
69
+ *
70
+ *
71
+ */
72
+ function jsonpCallbackContext() {
73
+ if (typeof window === 'object') {
74
+ return window;
75
+ }
76
+ return {};
77
+ }
78
+ /**
79
+ * An NgModule that adds XSRF protection support to outgoing requests.
80
+ *
81
+ * For a server that supports a cookie-based XSRF protection system,
82
+ * use directly to configure XSRF protection with the correct
83
+ * cookie and header names.
84
+ *
85
+ * If no names are supplied, the default cookie name is `XSRF-TOKEN`
86
+ * and the default header name is `X-XSRF-TOKEN`.
87
+ *
88
+ *
89
+ */
90
+ let HttpClientXsrfModule = HttpClientXsrfModule_1 = class HttpClientXsrfModule {
91
+ /**
92
+ * Disable the default XSRF protection.
93
+ */
94
+ static disable() {
95
+ return {
96
+ $module: HttpClientXsrfModule_1,
97
+ providers: [
98
+ { provide: xsrf_1.HttpXsrfInterceptor, useClass: interceptor_1.NoopInterceptor },
99
+ ],
100
+ };
101
+ }
102
+ /**
103
+ * Configure XSRF protection.
104
+ * @param options An object that can specify either or both
105
+ * cookie name or header name.
106
+ * - Cookie name default is `XSRF-TOKEN`.
107
+ * - Header name default is `X-XSRF-TOKEN`.
108
+ *
109
+ */
110
+ static withOptions(options = {}) {
111
+ return {
112
+ $module: HttpClientXsrfModule_1,
113
+ providers: [
114
+ options.cookieName ? { provide: xsrf_1.XSRF_COOKIE_NAME, useValue: options.cookieName } : [],
115
+ options.headerName ? { provide: xsrf_1.XSRF_HEADER_NAME, useValue: options.headerName } : [],
116
+ ],
117
+ };
118
+ }
119
+ };
120
+ exports.HttpClientXsrfModule = HttpClientXsrfModule;
121
+ exports.HttpClientXsrfModule = HttpClientXsrfModule = HttpClientXsrfModule_1 = tslib_1.__decorate([
122
+ (0, di_1.Module)({
123
+ providers: [
124
+ xsrf_1.HttpXsrfInterceptor,
125
+ { provide: interceptor_1.HTTP_INTERCEPTORS, useExisting: xsrf_1.HttpXsrfInterceptor, multi: true },
126
+ { provide: xsrf_1.XSRF_COOKIE_NAME, useValue: 'XSRF-TOKEN' },
127
+ { provide: xsrf_1.XSRF_HEADER_NAME, useValue: 'X-XSRF-TOKEN' },
128
+ ],
129
+ })
130
+ ], HttpClientXsrfModule);
131
+ /**
132
+ * An NgModule that provides the `HttpClient` and associated services.
133
+ *
134
+ * Interceptors can be added to the chain behind `HttpClient` by binding them
135
+ * to the multiprovider for `HTTP_INTERCEPTORS`.
136
+ *
137
+ *
138
+ */
139
+ let HttpClientModule = HttpClientModule_1 = class HttpClientModule {
140
+ static forRoot(config) {
141
+ let providers = [];
142
+ if (!config)
143
+ config = {};
144
+ if (!config.platform) {
145
+ // Autodetect the backend
146
+ if (typeof document !== 'undefined')
147
+ config.platform = 'browser';
148
+ else
149
+ config.platform = 'server';
150
+ }
151
+ if (config.platform === 'server') {
152
+ providers.push({ provide: xhr_1.XhrFactory, useClass: server_1.ServerXhr }, {
153
+ provide: backend_1.HttpHandler,
154
+ useFactory: server_1.zoneWrappedInterceptingHandler,
155
+ deps: [backend_1.HttpBackend, di_1.Injector]
156
+ });
157
+ }
158
+ else if (config.platform === 'browser') {
159
+ // Default configuration is browser.
160
+ }
161
+ return { $module: HttpClientModule_1, providers };
162
+ }
163
+ };
164
+ exports.HttpClientModule = HttpClientModule;
165
+ exports.HttpClientModule = HttpClientModule = HttpClientModule_1 = tslib_1.__decorate([
166
+ (0, di_1.Module)({
167
+ /**
168
+ * Optional configuration for XSRF protection.
169
+ */
170
+ imports: [
171
+ // HttpClientXsrfModule.withOptions({
172
+ // cookieName: 'XSRF-TOKEN',
173
+ // headerName: 'X-XSRF-TOKEN',
174
+ // }),
175
+ ],
176
+ /**
177
+ * The module provides `HttpClient` itself, and supporting services.
178
+ */
179
+ providers: [
180
+ client_1.HttpClient,
181
+ { provide: backend_1.HttpHandler, useClass: HttpInterceptingHandler },
182
+ xhr_1.HttpXhrBackend,
183
+ { provide: backend_1.HttpBackend, useExisting: xhr_1.HttpXhrBackend },
184
+ xhr_1.BrowserXhr,
185
+ { provide: xhr_1.XhrFactory, useExisting: xhr_1.BrowserXhr },
186
+ ],
187
+ })
188
+ ], HttpClientModule);
189
189
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAEH,qCAA4E;AAG5E,uCAAmD;AACnD,qCAAoC;AACpC,+CAA0G;AAG1G,+BAA6D;AAC7D,iCAAuG;AACvG,qCAAqE;AAErE;;;;;;;;GAQG;AAEI,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAGlC,YAAoB,OAAoB,EAAU,QAAkB;QAAhD,YAAO,GAAP,OAAO,CAAa;QAAU,aAAQ,GAAR,QAAQ,CAAU;QAF5D,UAAK,GAAqB,IAAI,CAAC;IAEgC,CAAC;IAExE,MAAM,CAAC,GAAqB;QAC1B,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE;YACvB,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,+BAAiB,EAAE,EAAE,CAAC,CAAC;YAC9D,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,WAAW,CACjC,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,IAAI,oCAAsB,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SACzF;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;CACF,CAAA;AAdY,uBAAuB;IADnC,IAAA,eAAU,GAAE;6CAIkB,qBAAW,EAAoB,aAAQ;GAHzD,uBAAuB,CAcnC;AAdY,0DAAuB;AAgBpC;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAC/B,OAAoB,EAAE,eAAyC,EAAE;IACnE,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,OAAO,CAAC;KAChB;IACD,OAAO,YAAY,CAAC,WAAW,CA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C;YACzD,oBAAc;YACd,EAAC,OAAO,EAAE,qBAAW,EAAE,WAAW,EAAE,oBAAc,EAAC;YACnD,gBAAU;YACV,EAAC,OAAO,EAAE,gBAAU,EAAE,WAAW,EAAE,gBAAU,EAAC;SAC/C;KACF,CAAC;GACW,gBAAgB,CAiC5B"}
package/dist/params.d.ts CHANGED
@@ -1,99 +1,99 @@
1
- /**
2
- * @license
3
- * Copyright Google Inc. All Rights Reserved.
4
- *
5
- * Use of this source code is governed by an MIT-style license that can be
6
- * found in the LICENSE file at https://angular.io/license
7
- */
8
- /**
9
- * A codec for encoding and decoding parameters in URLs.
10
- *
11
- * Used by `HttpParams`.
12
- *
13
- *
14
- **/
15
- export interface HttpParameterCodec {
16
- encodeKey(key: string): string;
17
- encodeValue(value: string): string;
18
- decodeKey(key: string): string;
19
- decodeValue(value: string): string;
20
- }
21
- /**
22
- * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
23
- * serialize and parse URL parameter keys and values.
24
- *
25
- *
26
- */
27
- export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
28
- encodeKey(key: string): string;
29
- encodeValue(value: string): string;
30
- decodeKey(key: string): string;
31
- decodeValue(value: string): string;
32
- }
33
- /** Options used to construct an `HttpParams` instance. */
34
- export interface HttpParamsOptions {
35
- /**
36
- * String representation of the HTTP params in URL-query-string format. Mutually exclusive with
37
- * `fromObject`.
38
- */
39
- fromString?: string;
40
- /** Object map of the HTTP params. Mutally exclusive with `fromString`. */
41
- fromObject?: {
42
- [param: string]: string | string[];
43
- };
44
- /** Encoding codec used to parse and serialize the params. */
45
- encoder?: HttpParameterCodec;
46
- }
47
- /**
48
- * An HTTP request/response body that represents serialized parameters,
49
- * per the MIME type `application/x-www-form-urlencoded`.
50
- *
51
- * This class is immutable - all mutation operations return a new instance.
52
- *
53
- *
54
- */
55
- export declare class HttpParams {
56
- private map;
57
- private encoder;
58
- private updates;
59
- private cloneFrom;
60
- constructor(options?: HttpParamsOptions);
61
- /**
62
- * Check whether the body has one or more values for the given parameter name.
63
- */
64
- has(param: string): boolean;
65
- /**
66
- * Get the first value for the given parameter name, or `null` if it's not present.
67
- */
68
- get(param: string): string | null;
69
- /**
70
- * Get all values for the given parameter name, or `null` if it's not present.
71
- */
72
- getAll(param: string): string[] | null;
73
- /**
74
- * Get all the parameter names for this body.
75
- */
76
- keys(): string[];
77
- /**
78
- * Construct a new body with an appended value for the given parameter name.
79
- */
80
- append(param: string, value: string): HttpParams;
81
- /**
82
- * Construct a new body with a new value for the given parameter name.
83
- */
84
- set(param: string, value: string): HttpParams;
85
- /**
86
- * Construct a new body with either the given value for the given parameter
87
- * removed, if a value is given, or all values for the given parameter removed
88
- * if not.
89
- */
90
- delete(param: string, value?: string): HttpParams;
91
- /**
92
- * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
93
- * separated by `&`s.
94
- */
95
- toString(): string;
96
- private clone;
97
- private init;
98
- }
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ /**
9
+ * A codec for encoding and decoding parameters in URLs.
10
+ *
11
+ * Used by `HttpParams`.
12
+ *
13
+ *
14
+ **/
15
+ export interface HttpParameterCodec {
16
+ encodeKey(key: string): string;
17
+ encodeValue(value: string): string;
18
+ decodeKey(key: string): string;
19
+ decodeValue(value: string): string;
20
+ }
21
+ /**
22
+ * A `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
23
+ * serialize and parse URL parameter keys and values.
24
+ *
25
+ *
26
+ */
27
+ export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
28
+ encodeKey(key: string): string;
29
+ encodeValue(value: string): string;
30
+ decodeKey(key: string): string;
31
+ decodeValue(value: string): string;
32
+ }
33
+ /** Options used to construct an `HttpParams` instance. */
34
+ export interface HttpParamsOptions {
35
+ /**
36
+ * String representation of the HTTP params in URL-query-string format. Mutually exclusive with
37
+ * `fromObject`.
38
+ */
39
+ fromString?: string;
40
+ /** Object map of the HTTP params. Mutally exclusive with `fromString`. */
41
+ fromObject?: {
42
+ [param: string]: string | string[];
43
+ };
44
+ /** Encoding codec used to parse and serialize the params. */
45
+ encoder?: HttpParameterCodec;
46
+ }
47
+ /**
48
+ * An HTTP request/response body that represents serialized parameters,
49
+ * per the MIME type `application/x-www-form-urlencoded`.
50
+ *
51
+ * This class is immutable - all mutation operations return a new instance.
52
+ *
53
+ *
54
+ */
55
+ export declare class HttpParams {
56
+ private map;
57
+ private encoder;
58
+ private updates;
59
+ private cloneFrom;
60
+ constructor(options?: HttpParamsOptions);
61
+ /**
62
+ * Check whether the body has one or more values for the given parameter name.
63
+ */
64
+ has(param: string): boolean;
65
+ /**
66
+ * Get the first value for the given parameter name, or `null` if it's not present.
67
+ */
68
+ get(param: string): string | null;
69
+ /**
70
+ * Get all values for the given parameter name, or `null` if it's not present.
71
+ */
72
+ getAll(param: string): string[] | null;
73
+ /**
74
+ * Get all the parameter names for this body.
75
+ */
76
+ keys(): string[];
77
+ /**
78
+ * Construct a new body with an appended value for the given parameter name.
79
+ */
80
+ append(param: string, value: string): HttpParams;
81
+ /**
82
+ * Construct a new body with a new value for the given parameter name.
83
+ */
84
+ set(param: string, value: string): HttpParams;
85
+ /**
86
+ * Construct a new body with either the given value for the given parameter
87
+ * removed, if a value is given, or all values for the given parameter removed
88
+ * if not.
89
+ */
90
+ delete(param: string, value?: string): HttpParams;
91
+ /**
92
+ * Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
93
+ * separated by `&`s.
94
+ */
95
+ toString(): string;
96
+ private clone;
97
+ private init;
98
+ }
99
99
  //# sourceMappingURL=params.d.ts.map