@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.
- package/dist/backend.d.ts +38 -38
- package/dist/backend.js +38 -38
- package/dist/client.d.ts +2108 -2108
- package/dist/client.js +265 -265
- package/dist/client.js.map +1 -1
- package/dist/headers.d.ts +57 -57
- package/dist/headers.js +187 -187
- package/dist/headers.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +42 -42
- package/dist/interceptor.d.ts +63 -63
- package/dist/interceptor.js +43 -43
- package/dist/interceptor.js.map +1 -1
- package/dist/module.d.ts +101 -101
- package/dist/module.js +188 -188
- package/dist/module.js.map +1 -1
- package/dist/params.d.ts +98 -98
- package/dist/params.js +184 -184
- package/dist/params.js.map +1 -1
- package/dist/request.d.ts +130 -130
- package/dist/request.js +260 -260
- package/dist/request.js.map +1 -1
- package/dist/response.d.ts +267 -267
- package/dist/response.js +165 -165
- package/dist/response.js.map +1 -1
- package/dist/server.d.ts +28 -28
- package/dist/server.js +119 -119
- package/dist/server.js.map +1 -1
- package/dist/test/client.test.d.ts +8 -8
- package/dist/test/client.test.js +163 -163
- package/dist/test/client.test.js.map +1 -1
- package/dist/test/headers.test.d.ts +1 -1
- package/dist/test/headers.test.js +126 -126
- package/dist/test/module.test.d.ts +1 -1
- package/dist/test/module.test.js +117 -117
- package/dist/test/module.test.js.map +1 -1
- package/dist/test/params.test.d.ts +1 -1
- package/dist/test/params.test.js +63 -63
- package/dist/test/request.test.d.ts +8 -8
- package/dist/test/request.test.js +159 -159
- package/dist/test/request.test.js.map +1 -1
- package/dist/test/response.test.d.ts +1 -1
- package/dist/test/response.test.js +79 -79
- package/dist/test/response.test.js.map +1 -1
- package/dist/test/test.d.ts +1 -1
- package/dist/test/test.js +16 -16
- package/dist/test/xhr.mock.d.ts +48 -48
- package/dist/test/xhr.mock.js +94 -94
- package/dist/test/xhr.mock.js.map +1 -1
- package/dist/test/xhr.test.d.ts +1 -1
- package/dist/test/xhr.test.js +344 -344
- package/dist/test/xhr.test.js.map +1 -1
- package/dist/test/xsrf.test.d.ts +1 -1
- package/dist/test/xsrf.test.js +63 -63
- package/dist/test/xsrf.test.js.map +1 -1
- package/dist/testing/api.d.ts +102 -102
- package/dist/testing/api.js +19 -19
- package/dist/testing/backend.d.ts +63 -63
- package/dist/testing/backend.js +141 -141
- package/dist/testing/backend.js.map +1 -1
- package/dist/testing/index.d.ts +10 -10
- package/dist/testing/index.js +16 -16
- package/dist/testing/module.d.ts +16 -16
- package/dist/testing/module.js +38 -38
- package/dist/testing/module.js.map +1 -1
- package/dist/testing/request.d.ts +56 -56
- package/dist/testing/request.js +177 -177
- package/dist/testing/request.js.map +1 -1
- package/dist/testing/request.test.d.ts +8 -8
- package/dist/testing/request.test.js +24 -24
- package/dist/xhr.d.ts +42 -42
- package/dist/xhr.js +298 -298
- package/dist/xhr.js.map +1 -1
- package/dist/xsrf.d.ts +37 -37
- package/dist/xsrf.js +55 -55
- package/dist/xsrf.js.map +1 -1
- package/dist.esm/backend.d.ts +38 -38
- package/dist.esm/backend.js +33 -33
- package/dist.esm/client.d.ts +2108 -2108
- package/dist.esm/client.js +262 -262
- package/dist.esm/client.js.map +1 -1
- package/dist.esm/headers.d.ts +57 -57
- package/dist.esm/headers.js +183 -183
- package/dist.esm/headers.js.map +1 -1
- package/dist.esm/index.d.ts +18 -18
- package/dist.esm/index.js +18 -18
- package/dist.esm/interceptor.d.ts +63 -63
- package/dist.esm/interceptor.js +39 -39
- package/dist.esm/interceptor.js.map +1 -1
- package/dist.esm/module.d.ts +101 -101
- package/dist.esm/module.js +183 -183
- package/dist.esm/module.js.map +1 -1
- package/dist.esm/params.d.ts +98 -98
- package/dist.esm/params.js +179 -179
- package/dist.esm/params.js.map +1 -1
- package/dist.esm/request.d.ts +130 -130
- package/dist.esm/request.js +256 -256
- package/dist.esm/request.js.map +1 -1
- package/dist.esm/response.d.ts +267 -267
- package/dist.esm/response.js +158 -158
- package/dist.esm/response.js.map +1 -1
- package/dist.esm/server.d.ts +28 -28
- package/dist.esm/server.js +113 -113
- package/dist.esm/server.js.map +1 -1
- package/dist.esm/test/client.test.d.ts +8 -8
- package/dist.esm/test/client.test.js +161 -161
- package/dist.esm/test/client.test.js.map +1 -1
- package/dist.esm/test/headers.test.d.ts +1 -1
- package/dist.esm/test/headers.test.js +124 -124
- package/dist.esm/test/module.test.d.ts +1 -1
- package/dist.esm/test/module.test.js +115 -115
- package/dist.esm/test/module.test.js.map +1 -1
- package/dist.esm/test/params.test.d.ts +1 -1
- package/dist.esm/test/params.test.js +61 -61
- package/dist.esm/test/request.test.d.ts +8 -8
- package/dist.esm/test/request.test.js +157 -157
- package/dist.esm/test/request.test.js.map +1 -1
- package/dist.esm/test/response.test.d.ts +1 -1
- package/dist.esm/test/response.test.js +77 -77
- package/dist.esm/test/response.test.js.map +1 -1
- package/dist.esm/test/test.d.ts +1 -1
- package/dist.esm/test/test.js +14 -14
- package/dist.esm/test/xhr.mock.d.ts +48 -48
- package/dist.esm/test/xhr.mock.js +88 -88
- package/dist.esm/test/xhr.mock.js.map +1 -1
- package/dist.esm/test/xhr.test.d.ts +1 -1
- package/dist.esm/test/xhr.test.js +342 -342
- package/dist.esm/test/xhr.test.js.map +1 -1
- package/dist.esm/test/xsrf.test.d.ts +1 -1
- package/dist.esm/test/xsrf.test.js +61 -61
- package/dist.esm/test/xsrf.test.js.map +1 -1
- package/dist.esm/testing/api.d.ts +102 -102
- package/dist.esm/testing/api.js +15 -15
- package/dist.esm/testing/backend.d.ts +63 -63
- package/dist.esm/testing/backend.js +138 -138
- package/dist.esm/testing/backend.js.map +1 -1
- package/dist.esm/testing/index.d.ts +10 -10
- package/dist.esm/testing/index.js +10 -10
- package/dist.esm/testing/module.d.ts +16 -16
- package/dist.esm/testing/module.js +35 -35
- package/dist.esm/testing/module.js.map +1 -1
- package/dist.esm/testing/request.d.ts +56 -56
- package/dist.esm/testing/request.js +173 -173
- package/dist.esm/testing/request.js.map +1 -1
- package/dist.esm/testing/request.test.d.ts +8 -8
- package/dist.esm/testing/request.test.js +22 -22
- package/dist.esm/xhr.d.ts +42 -42
- package/dist.esm/xhr.js +294 -294
- package/dist.esm/xhr.js.map +1 -1
- package/dist.esm/xsrf.d.ts +37 -37
- package/dist.esm/xsrf.js +51 -51
- package/dist.esm/xsrf.js.map +1 -1
- package/package.json +9 -9
- package/tsconfig.esm.tsbuildinfo +1 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -8046
package/dist.esm/params.js
CHANGED
|
@@ -1,180 +1,180 @@
|
|
|
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 `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
|
|
10
|
-
* serialize and parse URL parameter keys and values.
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export class HttpUrlEncodingCodec {
|
|
15
|
-
encodeKey(key) { return standardEncoding(key); }
|
|
16
|
-
encodeValue(value) { return standardEncoding(value); }
|
|
17
|
-
decodeKey(key) { return decodeURIComponent(key); }
|
|
18
|
-
decodeValue(value) { return decodeURIComponent(value); }
|
|
19
|
-
}
|
|
20
|
-
function paramParser(rawParams, codec) {
|
|
21
|
-
const map = new Map();
|
|
22
|
-
if (rawParams.length > 0) {
|
|
23
|
-
const params = rawParams.split('&');
|
|
24
|
-
params.forEach((param) => {
|
|
25
|
-
const eqIdx = param.indexOf('=');
|
|
26
|
-
const [key, val] = eqIdx == -1 ?
|
|
27
|
-
[codec.decodeKey(param), ''] :
|
|
28
|
-
[codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
|
|
29
|
-
const list = map.get(key) || [];
|
|
30
|
-
list.push(val);
|
|
31
|
-
map.set(key, list);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return map;
|
|
35
|
-
}
|
|
36
|
-
function standardEncoding(v) {
|
|
37
|
-
return encodeURIComponent(v)
|
|
38
|
-
.replace(/%40/gi, '@')
|
|
39
|
-
.replace(/%3A/gi, ':')
|
|
40
|
-
.replace(/%24/gi, '$')
|
|
41
|
-
.replace(/%2C/gi, ',')
|
|
42
|
-
.replace(/%3B/gi, ';')
|
|
43
|
-
.replace(/%2B/gi, '+')
|
|
44
|
-
.replace(/%3D/gi, '=')
|
|
45
|
-
.replace(/%3F/gi, '?')
|
|
46
|
-
.replace(/%2F/gi, '/');
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* An HTTP request/response body that represents serialized parameters,
|
|
50
|
-
* per the MIME type `application/x-www-form-urlencoded`.
|
|
51
|
-
*
|
|
52
|
-
* This class is immutable - all mutation operations return a new instance.
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
export class HttpParams {
|
|
57
|
-
constructor(options = {}) {
|
|
58
|
-
this.updates = null;
|
|
59
|
-
this.cloneFrom = null;
|
|
60
|
-
this.encoder = options.encoder || new HttpUrlEncodingCodec();
|
|
61
|
-
if (!!options.fromString) {
|
|
62
|
-
if (!!options.fromObject) {
|
|
63
|
-
throw new Error(`Cannot specify both fromString and fromObject.`);
|
|
64
|
-
}
|
|
65
|
-
this.map = paramParser(options.fromString, this.encoder);
|
|
66
|
-
}
|
|
67
|
-
else if (!!options.fromObject) {
|
|
68
|
-
this.map = new Map();
|
|
69
|
-
Object.keys(options.fromObject).forEach(key => {
|
|
70
|
-
const value = options.fromObject[key];
|
|
71
|
-
this.map.set(key, Array.isArray(value) ? value : [value]);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
this.map = null;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Check whether the body has one or more values for the given parameter name.
|
|
80
|
-
*/
|
|
81
|
-
has(param) {
|
|
82
|
-
this.init();
|
|
83
|
-
return this.map.has(param);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Get the first value for the given parameter name, or `null` if it's not present.
|
|
87
|
-
*/
|
|
88
|
-
get(param) {
|
|
89
|
-
this.init();
|
|
90
|
-
const res = this.map.get(param);
|
|
91
|
-
return !!res ? res[0] : null;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Get all values for the given parameter name, or `null` if it's not present.
|
|
95
|
-
*/
|
|
96
|
-
getAll(param) {
|
|
97
|
-
this.init();
|
|
98
|
-
return this.map.get(param) || null;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Get all the parameter names for this body.
|
|
102
|
-
*/
|
|
103
|
-
keys() {
|
|
104
|
-
this.init();
|
|
105
|
-
return Array.from(this.map.keys());
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Construct a new body with an appended value for the given parameter name.
|
|
109
|
-
*/
|
|
110
|
-
append(param, value) { return this.clone({ param, value, op: 'a' }); }
|
|
111
|
-
/**
|
|
112
|
-
* Construct a new body with a new value for the given parameter name.
|
|
113
|
-
*/
|
|
114
|
-
set(param, value) { return this.clone({ param, value, op: 's' }); }
|
|
115
|
-
/**
|
|
116
|
-
* Construct a new body with either the given value for the given parameter
|
|
117
|
-
* removed, if a value is given, or all values for the given parameter removed
|
|
118
|
-
* if not.
|
|
119
|
-
*/
|
|
120
|
-
delete(param, value) { return this.clone({ param, value, op: 'd' }); }
|
|
121
|
-
/**
|
|
122
|
-
* Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
|
|
123
|
-
* separated by `&`s.
|
|
124
|
-
*/
|
|
125
|
-
toString() {
|
|
126
|
-
this.init();
|
|
127
|
-
return this.keys()
|
|
128
|
-
.map(key => {
|
|
129
|
-
const eKey = this.encoder.encodeKey(key);
|
|
130
|
-
return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))
|
|
131
|
-
.join('&');
|
|
132
|
-
})
|
|
133
|
-
.join('&');
|
|
134
|
-
}
|
|
135
|
-
clone(update) {
|
|
136
|
-
const clone = new HttpParams({ encoder: this.encoder });
|
|
137
|
-
clone.cloneFrom = this.cloneFrom || this;
|
|
138
|
-
clone.updates = (this.updates || []).concat([update]);
|
|
139
|
-
return clone;
|
|
140
|
-
}
|
|
141
|
-
init() {
|
|
142
|
-
if (this.map === null) {
|
|
143
|
-
this.map = new Map();
|
|
144
|
-
}
|
|
145
|
-
if (this.cloneFrom !== null) {
|
|
146
|
-
this.cloneFrom.init();
|
|
147
|
-
this.cloneFrom.keys().forEach(key => this.map.set(key, this.cloneFrom.map.get(key)));
|
|
148
|
-
this.updates.forEach(update => {
|
|
149
|
-
switch (update.op) {
|
|
150
|
-
case 'a':
|
|
151
|
-
case 's':
|
|
152
|
-
const base = (update.op === 'a' ? this.map.get(update.param) : undefined) || [];
|
|
153
|
-
base.push(update.value);
|
|
154
|
-
this.map.set(update.param, base);
|
|
155
|
-
break;
|
|
156
|
-
case 'd':
|
|
157
|
-
if (update.value !== undefined) {
|
|
158
|
-
let base = this.map.get(update.param) || [];
|
|
159
|
-
const idx = base.indexOf(update.value);
|
|
160
|
-
if (idx !== -1) {
|
|
161
|
-
base.splice(idx, 1);
|
|
162
|
-
}
|
|
163
|
-
if (base.length > 0) {
|
|
164
|
-
this.map.set(update.param, base);
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
this.map.delete(update.param);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
this.map.delete(update.param);
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
this.cloneFrom = null;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
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 `HttpParameterCodec` that uses `encodeURIComponent` and `decodeURIComponent` to
|
|
10
|
+
* serialize and parse URL parameter keys and values.
|
|
11
|
+
*
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export class HttpUrlEncodingCodec {
|
|
15
|
+
encodeKey(key) { return standardEncoding(key); }
|
|
16
|
+
encodeValue(value) { return standardEncoding(value); }
|
|
17
|
+
decodeKey(key) { return decodeURIComponent(key); }
|
|
18
|
+
decodeValue(value) { return decodeURIComponent(value); }
|
|
19
|
+
}
|
|
20
|
+
function paramParser(rawParams, codec) {
|
|
21
|
+
const map = new Map();
|
|
22
|
+
if (rawParams.length > 0) {
|
|
23
|
+
const params = rawParams.split('&');
|
|
24
|
+
params.forEach((param) => {
|
|
25
|
+
const eqIdx = param.indexOf('=');
|
|
26
|
+
const [key, val] = eqIdx == -1 ?
|
|
27
|
+
[codec.decodeKey(param), ''] :
|
|
28
|
+
[codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
|
|
29
|
+
const list = map.get(key) || [];
|
|
30
|
+
list.push(val);
|
|
31
|
+
map.set(key, list);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return map;
|
|
35
|
+
}
|
|
36
|
+
function standardEncoding(v) {
|
|
37
|
+
return encodeURIComponent(v)
|
|
38
|
+
.replace(/%40/gi, '@')
|
|
39
|
+
.replace(/%3A/gi, ':')
|
|
40
|
+
.replace(/%24/gi, '$')
|
|
41
|
+
.replace(/%2C/gi, ',')
|
|
42
|
+
.replace(/%3B/gi, ';')
|
|
43
|
+
.replace(/%2B/gi, '+')
|
|
44
|
+
.replace(/%3D/gi, '=')
|
|
45
|
+
.replace(/%3F/gi, '?')
|
|
46
|
+
.replace(/%2F/gi, '/');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* An HTTP request/response body that represents serialized parameters,
|
|
50
|
+
* per the MIME type `application/x-www-form-urlencoded`.
|
|
51
|
+
*
|
|
52
|
+
* This class is immutable - all mutation operations return a new instance.
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export class HttpParams {
|
|
57
|
+
constructor(options = {}) {
|
|
58
|
+
this.updates = null;
|
|
59
|
+
this.cloneFrom = null;
|
|
60
|
+
this.encoder = options.encoder || new HttpUrlEncodingCodec();
|
|
61
|
+
if (!!options.fromString) {
|
|
62
|
+
if (!!options.fromObject) {
|
|
63
|
+
throw new Error(`Cannot specify both fromString and fromObject.`);
|
|
64
|
+
}
|
|
65
|
+
this.map = paramParser(options.fromString, this.encoder);
|
|
66
|
+
}
|
|
67
|
+
else if (!!options.fromObject) {
|
|
68
|
+
this.map = new Map();
|
|
69
|
+
Object.keys(options.fromObject).forEach(key => {
|
|
70
|
+
const value = options.fromObject[key];
|
|
71
|
+
this.map.set(key, Array.isArray(value) ? value : [value]);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.map = null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Check whether the body has one or more values for the given parameter name.
|
|
80
|
+
*/
|
|
81
|
+
has(param) {
|
|
82
|
+
this.init();
|
|
83
|
+
return this.map.has(param);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get the first value for the given parameter name, or `null` if it's not present.
|
|
87
|
+
*/
|
|
88
|
+
get(param) {
|
|
89
|
+
this.init();
|
|
90
|
+
const res = this.map.get(param);
|
|
91
|
+
return !!res ? res[0] : null;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get all values for the given parameter name, or `null` if it's not present.
|
|
95
|
+
*/
|
|
96
|
+
getAll(param) {
|
|
97
|
+
this.init();
|
|
98
|
+
return this.map.get(param) || null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Get all the parameter names for this body.
|
|
102
|
+
*/
|
|
103
|
+
keys() {
|
|
104
|
+
this.init();
|
|
105
|
+
return Array.from(this.map.keys());
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Construct a new body with an appended value for the given parameter name.
|
|
109
|
+
*/
|
|
110
|
+
append(param, value) { return this.clone({ param, value, op: 'a' }); }
|
|
111
|
+
/**
|
|
112
|
+
* Construct a new body with a new value for the given parameter name.
|
|
113
|
+
*/
|
|
114
|
+
set(param, value) { return this.clone({ param, value, op: 's' }); }
|
|
115
|
+
/**
|
|
116
|
+
* Construct a new body with either the given value for the given parameter
|
|
117
|
+
* removed, if a value is given, or all values for the given parameter removed
|
|
118
|
+
* if not.
|
|
119
|
+
*/
|
|
120
|
+
delete(param, value) { return this.clone({ param, value, op: 'd' }); }
|
|
121
|
+
/**
|
|
122
|
+
* Serialize the body to an encoded string, where key-value pairs (separated by `=`) are
|
|
123
|
+
* separated by `&`s.
|
|
124
|
+
*/
|
|
125
|
+
toString() {
|
|
126
|
+
this.init();
|
|
127
|
+
return this.keys()
|
|
128
|
+
.map(key => {
|
|
129
|
+
const eKey = this.encoder.encodeKey(key);
|
|
130
|
+
return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value))
|
|
131
|
+
.join('&');
|
|
132
|
+
})
|
|
133
|
+
.join('&');
|
|
134
|
+
}
|
|
135
|
+
clone(update) {
|
|
136
|
+
const clone = new HttpParams({ encoder: this.encoder });
|
|
137
|
+
clone.cloneFrom = this.cloneFrom || this;
|
|
138
|
+
clone.updates = (this.updates || []).concat([update]);
|
|
139
|
+
return clone;
|
|
140
|
+
}
|
|
141
|
+
init() {
|
|
142
|
+
if (this.map === null) {
|
|
143
|
+
this.map = new Map();
|
|
144
|
+
}
|
|
145
|
+
if (this.cloneFrom !== null) {
|
|
146
|
+
this.cloneFrom.init();
|
|
147
|
+
this.cloneFrom.keys().forEach(key => this.map.set(key, this.cloneFrom.map.get(key)));
|
|
148
|
+
this.updates.forEach(update => {
|
|
149
|
+
switch (update.op) {
|
|
150
|
+
case 'a':
|
|
151
|
+
case 's':
|
|
152
|
+
const base = (update.op === 'a' ? this.map.get(update.param) : undefined) || [];
|
|
153
|
+
base.push(update.value);
|
|
154
|
+
this.map.set(update.param, base);
|
|
155
|
+
break;
|
|
156
|
+
case 'd':
|
|
157
|
+
if (update.value !== undefined) {
|
|
158
|
+
let base = this.map.get(update.param) || [];
|
|
159
|
+
const idx = base.indexOf(update.value);
|
|
160
|
+
if (idx !== -1) {
|
|
161
|
+
base.splice(idx, 1);
|
|
162
|
+
}
|
|
163
|
+
if (base.length > 0) {
|
|
164
|
+
this.map.set(update.param, base);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
this.map.delete(update.param);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
this.map.delete(update.param);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
this.cloneFrom = null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
180
|
//# sourceMappingURL=params.js.map
|
package/dist.esm/params.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.js","sourceRoot":"","sources":["../src/params.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiBH;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAC/B,SAAS,CAAC,GAAW,IAAY,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEhE,WAAW,CAAC,KAAa,IAAY,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEtE,SAAS,CAAC,GAAW,IAAY,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAElE,WAAW,CAAC,KAAa,IAAI,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAA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4BAC/B,IAAI,IAAI,GAAG,IAAI,CAAC,GAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;4BAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;4BACvC,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;gCACf,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;4BACtB,CAAC;4BACD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gCACpB,IAAI,CAAC,GAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;4BACrC,CAAC;iCAAM,CAAC;gCACN,IAAI,CAAC,GAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;4BAClC,CAAC;wBACH,CAAC;6BAAM,CAAC;4BACN,IAAI,CAAC,GAAK,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;4BAChC,MAAM;wBACR,CAAC;gBACL,CAAC;YACH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACxB,CAAC;IACH,CAAC;CACF"}
|
package/dist.esm/request.d.ts
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
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
|
-
import { HttpHeaders } from './headers';
|
|
9
|
-
import { HttpParams } from './params';
|
|
10
|
-
/**
|
|
11
|
-
* An outgoing HTTP request with an optional typed body.
|
|
12
|
-
*
|
|
13
|
-
* `HttpRequest` represents an outgoing request, including URL, method,
|
|
14
|
-
* headers, body, and other request configuration options. Instances should be
|
|
15
|
-
* assumed to be immutable. To modify a `HttpRequest`, the `clone`
|
|
16
|
-
* method should be used.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
export declare class HttpRequest<T> {
|
|
21
|
-
readonly url: string;
|
|
22
|
-
/**
|
|
23
|
-
* The request body, or `null` if one isn't set.
|
|
24
|
-
*
|
|
25
|
-
* Bodies are not enforced to be immutable, as they can include a reference to any
|
|
26
|
-
* user-defined data type. However, interceptors should take care to preserve
|
|
27
|
-
* idempotence by treating them as such.
|
|
28
|
-
*/
|
|
29
|
-
readonly body: T | null;
|
|
30
|
-
/**
|
|
31
|
-
* Outgoing headers for this request.
|
|
32
|
-
*/
|
|
33
|
-
readonly headers: HttpHeaders;
|
|
34
|
-
/**
|
|
35
|
-
* Whether this request should be made in a way that exposes progress events.
|
|
36
|
-
*
|
|
37
|
-
* Progress events are expensive (change detection runs on each event) and so
|
|
38
|
-
* they should only be requested if the consumer intends to monitor them.
|
|
39
|
-
*/
|
|
40
|
-
readonly reportProgress: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* Whether this request should be sent with outgoing credentials (cookies).
|
|
43
|
-
*/
|
|
44
|
-
readonly withCredentials: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* The expected response type of the server.
|
|
47
|
-
*
|
|
48
|
-
* This is used to parse the response appropriately before returning it to
|
|
49
|
-
* the requestee.
|
|
50
|
-
*/
|
|
51
|
-
readonly responseType: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
52
|
-
/**
|
|
53
|
-
* The outgoing HTTP request method.
|
|
54
|
-
*/
|
|
55
|
-
readonly method: string;
|
|
56
|
-
/**
|
|
57
|
-
* Outgoing URL parameters.
|
|
58
|
-
*/
|
|
59
|
-
readonly params: HttpParams;
|
|
60
|
-
/**
|
|
61
|
-
* The outgoing URL with all URL parameters set.
|
|
62
|
-
*/
|
|
63
|
-
readonly urlWithParams: string;
|
|
64
|
-
constructor(method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS', url: string, init?: {
|
|
65
|
-
headers?: HttpHeaders;
|
|
66
|
-
reportProgress?: boolean;
|
|
67
|
-
params?: HttpParams;
|
|
68
|
-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
69
|
-
withCredentials?: boolean;
|
|
70
|
-
});
|
|
71
|
-
constructor(method: 'POST' | 'PUT' | 'PATCH', url: string, body: T | null, init?: {
|
|
72
|
-
headers?: HttpHeaders;
|
|
73
|
-
reportProgress?: boolean;
|
|
74
|
-
params?: HttpParams;
|
|
75
|
-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
76
|
-
withCredentials?: boolean;
|
|
77
|
-
});
|
|
78
|
-
constructor(method: string, url: string, body: T | null, init?: {
|
|
79
|
-
headers?: HttpHeaders;
|
|
80
|
-
reportProgress?: boolean;
|
|
81
|
-
params?: HttpParams;
|
|
82
|
-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
83
|
-
withCredentials?: boolean;
|
|
84
|
-
});
|
|
85
|
-
/**
|
|
86
|
-
* Transform the free-form body into a serialized format suitable for
|
|
87
|
-
* transmission to the server.
|
|
88
|
-
*/
|
|
89
|
-
serializeBody(): ArrayBuffer | Blob | FormData | string | null;
|
|
90
|
-
/**
|
|
91
|
-
* Examine the body and attempt to infer an appropriate MIME type
|
|
92
|
-
* for it.
|
|
93
|
-
*
|
|
94
|
-
* If no such type can be inferred, this method will return `null`.
|
|
95
|
-
*/
|
|
96
|
-
detectContentTypeHeader(): string | null;
|
|
97
|
-
clone(): HttpRequest<T>;
|
|
98
|
-
clone(update: {
|
|
99
|
-
headers?: HttpHeaders;
|
|
100
|
-
reportProgress?: boolean;
|
|
101
|
-
params?: HttpParams;
|
|
102
|
-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
103
|
-
withCredentials?: boolean;
|
|
104
|
-
body?: T | null;
|
|
105
|
-
method?: string;
|
|
106
|
-
url?: string;
|
|
107
|
-
setHeaders?: {
|
|
108
|
-
[name: string]: string | string[];
|
|
109
|
-
};
|
|
110
|
-
setParams?: {
|
|
111
|
-
[param: string]: string;
|
|
112
|
-
};
|
|
113
|
-
}): HttpRequest<T>;
|
|
114
|
-
clone<V>(update: {
|
|
115
|
-
headers?: HttpHeaders;
|
|
116
|
-
reportProgress?: boolean;
|
|
117
|
-
params?: HttpParams;
|
|
118
|
-
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
119
|
-
withCredentials?: boolean;
|
|
120
|
-
body?: V | null;
|
|
121
|
-
method?: string;
|
|
122
|
-
url?: string;
|
|
123
|
-
setHeaders?: {
|
|
124
|
-
[name: string]: string | string[];
|
|
125
|
-
};
|
|
126
|
-
setParams?: {
|
|
127
|
-
[param: string]: string;
|
|
128
|
-
};
|
|
129
|
-
}): HttpRequest<V>;
|
|
130
|
-
}
|
|
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
|
+
import { HttpHeaders } from './headers';
|
|
9
|
+
import { HttpParams } from './params';
|
|
10
|
+
/**
|
|
11
|
+
* An outgoing HTTP request with an optional typed body.
|
|
12
|
+
*
|
|
13
|
+
* `HttpRequest` represents an outgoing request, including URL, method,
|
|
14
|
+
* headers, body, and other request configuration options. Instances should be
|
|
15
|
+
* assumed to be immutable. To modify a `HttpRequest`, the `clone`
|
|
16
|
+
* method should be used.
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare class HttpRequest<T> {
|
|
21
|
+
readonly url: string;
|
|
22
|
+
/**
|
|
23
|
+
* The request body, or `null` if one isn't set.
|
|
24
|
+
*
|
|
25
|
+
* Bodies are not enforced to be immutable, as they can include a reference to any
|
|
26
|
+
* user-defined data type. However, interceptors should take care to preserve
|
|
27
|
+
* idempotence by treating them as such.
|
|
28
|
+
*/
|
|
29
|
+
readonly body: T | null;
|
|
30
|
+
/**
|
|
31
|
+
* Outgoing headers for this request.
|
|
32
|
+
*/
|
|
33
|
+
readonly headers: HttpHeaders;
|
|
34
|
+
/**
|
|
35
|
+
* Whether this request should be made in a way that exposes progress events.
|
|
36
|
+
*
|
|
37
|
+
* Progress events are expensive (change detection runs on each event) and so
|
|
38
|
+
* they should only be requested if the consumer intends to monitor them.
|
|
39
|
+
*/
|
|
40
|
+
readonly reportProgress: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Whether this request should be sent with outgoing credentials (cookies).
|
|
43
|
+
*/
|
|
44
|
+
readonly withCredentials: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The expected response type of the server.
|
|
47
|
+
*
|
|
48
|
+
* This is used to parse the response appropriately before returning it to
|
|
49
|
+
* the requestee.
|
|
50
|
+
*/
|
|
51
|
+
readonly responseType: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
52
|
+
/**
|
|
53
|
+
* The outgoing HTTP request method.
|
|
54
|
+
*/
|
|
55
|
+
readonly method: string;
|
|
56
|
+
/**
|
|
57
|
+
* Outgoing URL parameters.
|
|
58
|
+
*/
|
|
59
|
+
readonly params: HttpParams;
|
|
60
|
+
/**
|
|
61
|
+
* The outgoing URL with all URL parameters set.
|
|
62
|
+
*/
|
|
63
|
+
readonly urlWithParams: string;
|
|
64
|
+
constructor(method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS', url: string, init?: {
|
|
65
|
+
headers?: HttpHeaders;
|
|
66
|
+
reportProgress?: boolean;
|
|
67
|
+
params?: HttpParams;
|
|
68
|
+
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
69
|
+
withCredentials?: boolean;
|
|
70
|
+
});
|
|
71
|
+
constructor(method: 'POST' | 'PUT' | 'PATCH', url: string, body: T | null, init?: {
|
|
72
|
+
headers?: HttpHeaders;
|
|
73
|
+
reportProgress?: boolean;
|
|
74
|
+
params?: HttpParams;
|
|
75
|
+
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
76
|
+
withCredentials?: boolean;
|
|
77
|
+
});
|
|
78
|
+
constructor(method: string, url: string, body: T | null, init?: {
|
|
79
|
+
headers?: HttpHeaders;
|
|
80
|
+
reportProgress?: boolean;
|
|
81
|
+
params?: HttpParams;
|
|
82
|
+
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
83
|
+
withCredentials?: boolean;
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* Transform the free-form body into a serialized format suitable for
|
|
87
|
+
* transmission to the server.
|
|
88
|
+
*/
|
|
89
|
+
serializeBody(): ArrayBuffer | Blob | FormData | string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Examine the body and attempt to infer an appropriate MIME type
|
|
92
|
+
* for it.
|
|
93
|
+
*
|
|
94
|
+
* If no such type can be inferred, this method will return `null`.
|
|
95
|
+
*/
|
|
96
|
+
detectContentTypeHeader(): string | null;
|
|
97
|
+
clone(): HttpRequest<T>;
|
|
98
|
+
clone(update: {
|
|
99
|
+
headers?: HttpHeaders;
|
|
100
|
+
reportProgress?: boolean;
|
|
101
|
+
params?: HttpParams;
|
|
102
|
+
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
103
|
+
withCredentials?: boolean;
|
|
104
|
+
body?: T | null;
|
|
105
|
+
method?: string;
|
|
106
|
+
url?: string;
|
|
107
|
+
setHeaders?: {
|
|
108
|
+
[name: string]: string | string[];
|
|
109
|
+
};
|
|
110
|
+
setParams?: {
|
|
111
|
+
[param: string]: string;
|
|
112
|
+
};
|
|
113
|
+
}): HttpRequest<T>;
|
|
114
|
+
clone<V>(update: {
|
|
115
|
+
headers?: HttpHeaders;
|
|
116
|
+
reportProgress?: boolean;
|
|
117
|
+
params?: HttpParams;
|
|
118
|
+
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
119
|
+
withCredentials?: boolean;
|
|
120
|
+
body?: V | null;
|
|
121
|
+
method?: string;
|
|
122
|
+
url?: string;
|
|
123
|
+
setHeaders?: {
|
|
124
|
+
[name: string]: string | string[];
|
|
125
|
+
};
|
|
126
|
+
setParams?: {
|
|
127
|
+
[param: string]: string;
|
|
128
|
+
};
|
|
129
|
+
}): HttpRequest<V>;
|
|
130
|
+
}
|
|
131
131
|
//# sourceMappingURL=request.d.ts.map
|