@zthun/helpful-internet 9.0.0 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +681 -337
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +678 -343
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,19 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a generic cookie.
|
|
7
|
+
*/ function _class_call_check$5(instance, Constructor) {
|
|
8
|
+
if (!(instance instanceof Constructor)) {
|
|
9
|
+
throw new TypeError("Cannot call a class as a function");
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function _defineProperties$5(target, props) {
|
|
13
|
+
for(var i = 0; i < props.length; i++){
|
|
14
|
+
var descriptor = props[i];
|
|
15
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
16
|
+
descriptor.configurable = true;
|
|
17
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
18
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function _create_class$5(Constructor, protoProps, staticProps) {
|
|
22
|
+
_defineProperties$5(Constructor.prototype, protoProps);
|
|
23
|
+
return Constructor;
|
|
24
|
+
}
|
|
25
|
+
function _define_property$5(obj, key, value) {
|
|
26
|
+
if (key in obj) {
|
|
27
|
+
Object.defineProperty(obj, key, {
|
|
28
|
+
value: value,
|
|
29
|
+
enumerable: true,
|
|
30
|
+
configurable: true,
|
|
31
|
+
writable: true
|
|
32
|
+
});
|
|
33
|
+
} else {
|
|
34
|
+
obj[key] = value;
|
|
35
|
+
}
|
|
36
|
+
return obj;
|
|
37
|
+
}
|
|
38
|
+
function _object_spread(target) {
|
|
39
|
+
for(var i = 1; i < arguments.length; i++){
|
|
40
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
41
|
+
var ownKeys = Object.keys(source);
|
|
42
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
43
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
44
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
ownKeys.forEach(function(key) {
|
|
48
|
+
_define_property$5(target, key, source[key]);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Represents a builder for an IZCookie object.
|
|
55
|
+
*/ var ZCookieBuilder = /*#__PURE__*/ function() {
|
|
56
|
+
function ZCookieBuilder() {
|
|
57
|
+
_class_call_check$5(this, ZCookieBuilder);
|
|
58
|
+
_define_property$5(this, "_cookie", void 0);
|
|
59
|
+
/**
|
|
60
|
+
* Removes the cookie expiration.
|
|
61
|
+
*
|
|
62
|
+
* @returns
|
|
63
|
+
* This object.
|
|
64
|
+
*/ _define_property$5(this, "immortal", this.expires.bind(this, undefined));
|
|
65
|
+
/**
|
|
66
|
+
* Sets the same site policy to 'lax'
|
|
67
|
+
*
|
|
68
|
+
* @returns
|
|
69
|
+
* This object.
|
|
70
|
+
*/ _define_property$5(this, "lax", this.sameSite.bind(this, "lax"));
|
|
71
|
+
/**
|
|
72
|
+
* Sets the same site polity to 'strict'
|
|
73
|
+
*
|
|
74
|
+
* @returns
|
|
75
|
+
* This object.
|
|
76
|
+
*/ _define_property$5(this, "strict", this.sameSite.bind(this, "strict"));
|
|
77
|
+
this._cookie = {
|
|
78
|
+
name: "",
|
|
79
|
+
value: ""
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
_create_class$5(ZCookieBuilder, [
|
|
83
|
+
{
|
|
84
|
+
key: "name",
|
|
85
|
+
value: /**
|
|
17
86
|
* Sets the cookie name.
|
|
18
87
|
*
|
|
19
88
|
* @param val -
|
|
@@ -21,12 +90,14 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
21
90
|
*
|
|
22
91
|
* @returns
|
|
23
92
|
* This object.
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
93
|
+
*/ function name(val) {
|
|
94
|
+
this._cookie.name = val;
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
key: "value",
|
|
100
|
+
value: /**
|
|
30
101
|
* Sets the cookie value.
|
|
31
102
|
*
|
|
32
103
|
* @param val -
|
|
@@ -34,12 +105,14 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
34
105
|
*
|
|
35
106
|
* @returns
|
|
36
107
|
* This object.
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
108
|
+
*/ function value(val) {
|
|
109
|
+
this._cookie.value = val;
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
key: "domain",
|
|
115
|
+
value: /**
|
|
43
116
|
* Sets the cookie domain.
|
|
44
117
|
*
|
|
45
118
|
* @param val -
|
|
@@ -47,12 +120,14 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
47
120
|
*
|
|
48
121
|
* @returns
|
|
49
122
|
* This object.
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
123
|
+
*/ function domain(val) {
|
|
124
|
+
this._cookie.domain = val;
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
key: "expires",
|
|
130
|
+
value: /**
|
|
56
131
|
* Sets the cookie expiration date.
|
|
57
132
|
*
|
|
58
133
|
* @param val -
|
|
@@ -60,27 +135,29 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
60
135
|
*
|
|
61
136
|
* @returns
|
|
62
137
|
* This object.
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
138
|
+
*/ function expires(val) {
|
|
139
|
+
if (val == null) {
|
|
140
|
+
delete this._cookie.expires;
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
this._cookie.expires = typeof val === "string" ? val : val.toJSON();
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
key: "expiresTomorrow",
|
|
149
|
+
value: /**
|
|
73
150
|
* Sets the cookie expiration date to one day from the moment this is invoked.
|
|
74
151
|
*
|
|
75
152
|
* @returns
|
|
76
153
|
* This object.
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
154
|
+
*/ function expiresTomorrow() {
|
|
155
|
+
return this.expires(new Date(Date.now() + ZCookieBuilder.MillisecondsOneDay));
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
key: "secure",
|
|
160
|
+
value: /**
|
|
84
161
|
* Sets the cookie secure flag.
|
|
85
162
|
*
|
|
86
163
|
* @param val -
|
|
@@ -88,12 +165,15 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
88
165
|
*
|
|
89
166
|
* @returns
|
|
90
167
|
* This object.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
168
|
+
*/ function secure() {
|
|
169
|
+
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
170
|
+
this._cookie.secure = val;
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
key: "sameSite",
|
|
176
|
+
value: /**
|
|
97
177
|
* Sets the cookie same site policy.
|
|
98
178
|
*
|
|
99
179
|
* @param val -
|
|
@@ -101,21 +181,25 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
101
181
|
*
|
|
102
182
|
* @returns
|
|
103
183
|
* This object.
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
184
|
+
*/ function sameSite(val) {
|
|
185
|
+
this._cookie.sameSite = val;
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
key: "allowCrossSite",
|
|
191
|
+
value: /**
|
|
110
192
|
* Sets the same site policy to 'none' and turns on the secure flag.
|
|
111
193
|
*
|
|
112
194
|
* @returns
|
|
113
195
|
* This object.
|
|
114
|
-
*/
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
196
|
+
*/ function allowCrossSite() {
|
|
197
|
+
return this.secure().sameSite("none");
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
key: "httpOnly",
|
|
202
|
+
value: /**
|
|
119
203
|
* Sets the cookie http only flag.
|
|
120
204
|
*
|
|
121
205
|
* @param val -
|
|
@@ -123,12 +207,15 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
123
207
|
*
|
|
124
208
|
* @returns
|
|
125
209
|
* This object.
|
|
126
|
-
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
210
|
+
*/ function httpOnly() {
|
|
211
|
+
var val = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
|
|
212
|
+
this._cookie.httpOnly = val;
|
|
213
|
+
return this;
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
key: "authentication",
|
|
218
|
+
value: /**
|
|
132
219
|
* Creates a token based authentication cookie.
|
|
133
220
|
*
|
|
134
221
|
* @param token -
|
|
@@ -138,29 +225,71 @@ const _ZCookieBuilder = class _ZCookieBuilder {
|
|
|
138
225
|
*
|
|
139
226
|
* @returns
|
|
140
227
|
* This object.
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
228
|
+
*/ function authentication(token) {
|
|
229
|
+
var builder = this.name("Authentication").expiresTomorrow().secure().httpOnly();
|
|
230
|
+
return token == null ? builder : builder.value(token);
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: "build",
|
|
235
|
+
value: /**
|
|
147
236
|
* Returns a copy of the built instance of the cookie.
|
|
148
237
|
*
|
|
149
238
|
* @returns
|
|
150
239
|
* A shallow copy of the current cookie object.
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
240
|
+
*/ function build() {
|
|
241
|
+
return _object_spread({}, this._cookie);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
]);
|
|
245
|
+
return ZCookieBuilder;
|
|
246
|
+
}();
|
|
247
|
+
_define_property$5(ZCookieBuilder, "MillisecondsOneDay", 86400000);
|
|
248
|
+
|
|
249
|
+
function _class_call_check$4(instance, Constructor) {
|
|
250
|
+
if (!(instance instanceof Constructor)) {
|
|
251
|
+
throw new TypeError("Cannot call a class as a function");
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function _defineProperties$4(target, props) {
|
|
255
|
+
for(var i = 0; i < props.length; i++){
|
|
256
|
+
var descriptor = props[i];
|
|
257
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
258
|
+
descriptor.configurable = true;
|
|
259
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
260
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function _create_class$4(Constructor, protoProps, staticProps) {
|
|
264
|
+
_defineProperties$4(Constructor.prototype, protoProps);
|
|
265
|
+
return Constructor;
|
|
266
|
+
}
|
|
267
|
+
function _define_property$4(obj, key, value) {
|
|
268
|
+
if (key in obj) {
|
|
269
|
+
Object.defineProperty(obj, key, {
|
|
270
|
+
value: value,
|
|
271
|
+
enumerable: true,
|
|
272
|
+
configurable: true,
|
|
273
|
+
writable: true
|
|
274
|
+
});
|
|
275
|
+
} else {
|
|
276
|
+
obj[key] = value;
|
|
277
|
+
}
|
|
278
|
+
return obj;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Represents a builder that will build a comma separated
|
|
282
|
+
* list of addresses for an email message.
|
|
283
|
+
*/ var ZEmailContactAddressBuilder = /*#__PURE__*/ function() {
|
|
284
|
+
function ZEmailContactAddressBuilder() {
|
|
285
|
+
_class_call_check$4(this, ZEmailContactAddressBuilder);
|
|
286
|
+
_define_property$4(this, "_addresses", []);
|
|
287
|
+
_define_property$4(this, "_delimiter", ", ");
|
|
288
|
+
}
|
|
289
|
+
_create_class$4(ZEmailContactAddressBuilder, [
|
|
290
|
+
{
|
|
291
|
+
key: "address",
|
|
292
|
+
value: /**
|
|
164
293
|
* Adds an address to the list to builder.
|
|
165
294
|
*
|
|
166
295
|
* @param val -
|
|
@@ -169,12 +298,14 @@ class ZEmailContactAddressBuilder {
|
|
|
169
298
|
*
|
|
170
299
|
* @returns
|
|
171
300
|
* This object.
|
|
172
|
-
*/
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
301
|
+
*/ function address(val) {
|
|
302
|
+
this._addresses.push(val);
|
|
303
|
+
return this;
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
key: "addresses",
|
|
308
|
+
value: /**
|
|
178
309
|
* Sets the addresses to build from.
|
|
179
310
|
*
|
|
180
311
|
* @param val -
|
|
@@ -182,12 +313,14 @@ class ZEmailContactAddressBuilder {
|
|
|
182
313
|
*
|
|
183
314
|
* @returns
|
|
184
315
|
* This object.
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
316
|
+
*/ function addresses(val) {
|
|
317
|
+
this._addresses = val.slice();
|
|
318
|
+
return this;
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
key: "delimiter",
|
|
323
|
+
value: /**
|
|
191
324
|
* Sets the delimiter to split the addresses with.
|
|
192
325
|
*
|
|
193
326
|
* The default is a comma with a space.
|
|
@@ -197,40 +330,82 @@ class ZEmailContactAddressBuilder {
|
|
|
197
330
|
*
|
|
198
331
|
* @returns
|
|
199
332
|
* This object.
|
|
200
|
-
*/
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
333
|
+
*/ function delimiter(val) {
|
|
334
|
+
this._delimiter = val;
|
|
335
|
+
return this;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
key: "build",
|
|
340
|
+
value: /**
|
|
206
341
|
* Builds the delimiters separated list of addresses.
|
|
207
342
|
*
|
|
208
343
|
* @returns
|
|
209
344
|
* The delimited separated list of addresses.
|
|
210
|
-
*/
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
345
|
+
*/ function build() {
|
|
346
|
+
var addr = function(ct) {
|
|
347
|
+
if (!ct) {
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
return typeof ct === "string" ? ct : ct.address;
|
|
351
|
+
};
|
|
352
|
+
var truthy = function(ct) {
|
|
353
|
+
return !!ct;
|
|
354
|
+
};
|
|
355
|
+
return this._addresses.map(addr).filter(truthy).join(this._delimiter);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
]);
|
|
359
|
+
return ZEmailContactAddressBuilder;
|
|
360
|
+
}();
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Represents an email contact.
|
|
364
|
+
*/ function _class_call_check$3(instance, Constructor) {
|
|
365
|
+
if (!(instance instanceof Constructor)) {
|
|
366
|
+
throw new TypeError("Cannot call a class as a function");
|
|
367
|
+
}
|
|
223
368
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
|
|
369
|
+
function _defineProperties$3(target, props) {
|
|
370
|
+
for(var i = 0; i < props.length; i++){
|
|
371
|
+
var descriptor = props[i];
|
|
372
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
373
|
+
descriptor.configurable = true;
|
|
374
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
375
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
function _create_class$3(Constructor, protoProps, staticProps) {
|
|
379
|
+
_defineProperties$3(Constructor.prototype, protoProps);
|
|
380
|
+
return Constructor;
|
|
381
|
+
}
|
|
382
|
+
function _define_property$3(obj, key, value) {
|
|
383
|
+
if (key in obj) {
|
|
384
|
+
Object.defineProperty(obj, key, {
|
|
385
|
+
value: value,
|
|
386
|
+
enumerable: true,
|
|
387
|
+
configurable: true,
|
|
388
|
+
writable: true
|
|
389
|
+
});
|
|
390
|
+
} else {
|
|
391
|
+
obj[key] = value;
|
|
392
|
+
}
|
|
393
|
+
return obj;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Represents a builder for an email contact.
|
|
397
|
+
*/ var ZEmailContactBuilder = /*#__PURE__*/ function() {
|
|
398
|
+
function ZEmailContactBuilder() {
|
|
399
|
+
_class_call_check$3(this, ZEmailContactBuilder);
|
|
400
|
+
_define_property$3(this, "_contact", void 0);
|
|
401
|
+
this._contact = {
|
|
402
|
+
address: ""
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
_create_class$3(ZEmailContactBuilder, [
|
|
406
|
+
{
|
|
407
|
+
key: "address",
|
|
408
|
+
value: /**
|
|
234
409
|
* Sets the address of the contact.
|
|
235
410
|
*
|
|
236
411
|
* @param val -
|
|
@@ -238,12 +413,14 @@ class ZEmailContactBuilder {
|
|
|
238
413
|
*
|
|
239
414
|
* @returns
|
|
240
415
|
* This object.
|
|
241
|
-
*/
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
416
|
+
*/ function address(val) {
|
|
417
|
+
this._contact.address = val;
|
|
418
|
+
return this;
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
key: "type",
|
|
423
|
+
value: /**
|
|
247
424
|
* Sets the type of the contact.
|
|
248
425
|
*
|
|
249
426
|
* @param val -
|
|
@@ -251,12 +428,14 @@ class ZEmailContactBuilder {
|
|
|
251
428
|
*
|
|
252
429
|
* @returns
|
|
253
430
|
* This object.
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
431
|
+
*/ function type(val) {
|
|
432
|
+
this._contact.type = val;
|
|
433
|
+
return this;
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
key: "display",
|
|
438
|
+
value: /**
|
|
260
439
|
* Sets the display of the contact.
|
|
261
440
|
*
|
|
262
441
|
* @param val -
|
|
@@ -264,12 +443,14 @@ class ZEmailContactBuilder {
|
|
|
264
443
|
*
|
|
265
444
|
* @returns
|
|
266
445
|
* This object.
|
|
267
|
-
*/
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
446
|
+
*/ function display(val) {
|
|
447
|
+
this._contact.display = val;
|
|
448
|
+
return this;
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
key: "assign",
|
|
453
|
+
value: /**
|
|
273
454
|
* Assigns the values in other to this object.
|
|
274
455
|
*
|
|
275
456
|
* @param other -
|
|
@@ -277,13 +458,15 @@ class ZEmailContactBuilder {
|
|
|
277
458
|
*
|
|
278
459
|
* @returns
|
|
279
460
|
* This object.
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
461
|
+
*/ function assign(other) {
|
|
462
|
+
this._contact = Object.assign({}, this._contact, other);
|
|
463
|
+
this._contact = JSON.parse(JSON.stringify(this._contact));
|
|
464
|
+
return this;
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
key: "copy",
|
|
469
|
+
value: /**
|
|
287
470
|
* Copies another object.
|
|
288
471
|
*
|
|
289
472
|
* @param other -
|
|
@@ -291,31 +474,71 @@ class ZEmailContactBuilder {
|
|
|
291
474
|
*
|
|
292
475
|
* @returns
|
|
293
476
|
* This object.
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
477
|
+
*/ function copy(other) {
|
|
478
|
+
this._contact = JSON.parse(JSON.stringify(other));
|
|
479
|
+
return this;
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
key: "build",
|
|
484
|
+
value: /**
|
|
300
485
|
* Returns a copy of the built object.
|
|
301
486
|
*
|
|
302
487
|
* @returns
|
|
303
488
|
* A copy of the built email contact.
|
|
304
|
-
*/
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
489
|
+
*/ function build() {
|
|
490
|
+
return JSON.parse(JSON.stringify(this._contact));
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
]);
|
|
494
|
+
return ZEmailContactBuilder;
|
|
495
|
+
}();
|
|
496
|
+
|
|
497
|
+
function _class_call_check$2(instance, Constructor) {
|
|
498
|
+
if (!(instance instanceof Constructor)) {
|
|
499
|
+
throw new TypeError("Cannot call a class as a function");
|
|
500
|
+
}
|
|
308
501
|
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
502
|
+
function _defineProperties$2(target, props) {
|
|
503
|
+
for(var i = 0; i < props.length; i++){
|
|
504
|
+
var descriptor = props[i];
|
|
505
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
506
|
+
descriptor.configurable = true;
|
|
507
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
508
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
function _create_class$2(Constructor, protoProps, staticProps) {
|
|
512
|
+
_defineProperties$2(Constructor.prototype, protoProps);
|
|
513
|
+
return Constructor;
|
|
514
|
+
}
|
|
515
|
+
function _define_property$2(obj, key, value) {
|
|
516
|
+
if (key in obj) {
|
|
517
|
+
Object.defineProperty(obj, key, {
|
|
518
|
+
value: value,
|
|
519
|
+
enumerable: true,
|
|
520
|
+
configurable: true,
|
|
521
|
+
writable: true
|
|
522
|
+
});
|
|
523
|
+
} else {
|
|
524
|
+
obj[key] = value;
|
|
525
|
+
}
|
|
526
|
+
return obj;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Represents a builder for an email envelope.
|
|
530
|
+
*/ var ZEmailEnvelopeBuilder = /*#__PURE__*/ function() {
|
|
531
|
+
function ZEmailEnvelopeBuilder() {
|
|
532
|
+
_class_call_check$2(this, ZEmailEnvelopeBuilder);
|
|
533
|
+
_define_property$2(this, "_envelope", void 0);
|
|
534
|
+
this._envelope = {
|
|
535
|
+
from: ""
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
_create_class$2(ZEmailEnvelopeBuilder, [
|
|
539
|
+
{
|
|
540
|
+
key: "from",
|
|
541
|
+
value: /**
|
|
319
542
|
* Sets the from field.
|
|
320
543
|
*
|
|
321
544
|
* @param val -
|
|
@@ -323,12 +546,14 @@ class ZEmailEnvelopeBuilder {
|
|
|
323
546
|
*
|
|
324
547
|
* @returns
|
|
325
548
|
* This object.
|
|
326
|
-
*/
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
549
|
+
*/ function from(val) {
|
|
550
|
+
this._envelope.from = val;
|
|
551
|
+
return this;
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
key: "to",
|
|
556
|
+
value: /**
|
|
332
557
|
* Adds a value to the 'to' field.
|
|
333
558
|
*
|
|
334
559
|
* @param val -
|
|
@@ -336,13 +561,15 @@ class ZEmailEnvelopeBuilder {
|
|
|
336
561
|
*
|
|
337
562
|
* @returns
|
|
338
563
|
* This object.
|
|
339
|
-
*/
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
564
|
+
*/ function to(val) {
|
|
565
|
+
this._envelope.to = this._envelope.to || [];
|
|
566
|
+
this._envelope.to.push(val);
|
|
567
|
+
return this;
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
key: "tos",
|
|
572
|
+
value: /**
|
|
346
573
|
* Sets the to field.
|
|
347
574
|
*
|
|
348
575
|
* @param val -
|
|
@@ -350,12 +577,14 @@ class ZEmailEnvelopeBuilder {
|
|
|
350
577
|
*
|
|
351
578
|
* @returns
|
|
352
579
|
* This object.
|
|
353
|
-
*/
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
580
|
+
*/ function tos(val) {
|
|
581
|
+
this._envelope.to = val;
|
|
582
|
+
return this;
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
key: "cc",
|
|
587
|
+
value: /**
|
|
359
588
|
* Adds a value to the cc field.
|
|
360
589
|
*
|
|
361
590
|
* @param val -
|
|
@@ -363,13 +592,15 @@ class ZEmailEnvelopeBuilder {
|
|
|
363
592
|
*
|
|
364
593
|
* @returns
|
|
365
594
|
* This object.
|
|
366
|
-
*/
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
595
|
+
*/ function cc(val) {
|
|
596
|
+
this._envelope.cc = this._envelope.cc || [];
|
|
597
|
+
this._envelope.cc.push(val);
|
|
598
|
+
return this;
|
|
599
|
+
}
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
key: "ccs",
|
|
603
|
+
value: /**
|
|
373
604
|
* Sets the cc field.
|
|
374
605
|
*
|
|
375
606
|
* @param val -
|
|
@@ -377,12 +608,14 @@ class ZEmailEnvelopeBuilder {
|
|
|
377
608
|
*
|
|
378
609
|
* @returns
|
|
379
610
|
* This object.
|
|
380
|
-
*/
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
611
|
+
*/ function ccs(val) {
|
|
612
|
+
this._envelope.cc = val;
|
|
613
|
+
return this;
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
key: "bcc",
|
|
618
|
+
value: /**
|
|
386
619
|
* Adds a value to the bcc field.
|
|
387
620
|
*
|
|
388
621
|
* @param val -
|
|
@@ -390,13 +623,15 @@ class ZEmailEnvelopeBuilder {
|
|
|
390
623
|
*
|
|
391
624
|
* @returns
|
|
392
625
|
* This object.
|
|
393
|
-
*/
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
626
|
+
*/ function bcc(val) {
|
|
627
|
+
this._envelope.bcc = this._envelope.bcc || [];
|
|
628
|
+
this._envelope.bcc.push(val);
|
|
629
|
+
return this;
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
key: "bccs",
|
|
634
|
+
value: /**
|
|
400
635
|
* Sets the bcc field.
|
|
401
636
|
*
|
|
402
637
|
* @param val -
|
|
@@ -404,12 +639,14 @@ class ZEmailEnvelopeBuilder {
|
|
|
404
639
|
*
|
|
405
640
|
* @returns
|
|
406
641
|
* This object.
|
|
407
|
-
*/
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
642
|
+
*/ function bccs(val) {
|
|
643
|
+
this._envelope.bcc = val;
|
|
644
|
+
return this;
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
key: "assign",
|
|
649
|
+
value: /**
|
|
413
650
|
* Assigns another partial email envelope to this object.
|
|
414
651
|
*
|
|
415
652
|
* @param other -
|
|
@@ -417,13 +654,15 @@ class ZEmailEnvelopeBuilder {
|
|
|
417
654
|
*
|
|
418
655
|
* @returns
|
|
419
656
|
* This object.
|
|
420
|
-
*/
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
657
|
+
*/ function assign(other) {
|
|
658
|
+
this._envelope = Object.assign({}, this._envelope, other);
|
|
659
|
+
this._envelope = JSON.parse(JSON.stringify(this._envelope));
|
|
660
|
+
return this;
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
key: "copy",
|
|
665
|
+
value: /**
|
|
427
666
|
* Copies another email envelope to this object.
|
|
428
667
|
*
|
|
429
668
|
* @param other -
|
|
@@ -431,31 +670,71 @@ class ZEmailEnvelopeBuilder {
|
|
|
431
670
|
*
|
|
432
671
|
* @returns
|
|
433
672
|
* This object.
|
|
434
|
-
*/
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
673
|
+
*/ function copy(other) {
|
|
674
|
+
this._envelope = JSON.parse(JSON.stringify(other));
|
|
675
|
+
return this;
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
key: "build",
|
|
680
|
+
value: /**
|
|
440
681
|
* Returns a copy of the built envelope.
|
|
441
682
|
*
|
|
442
683
|
* @returns
|
|
443
684
|
* A copy of the currently built up envelope object.
|
|
444
|
-
*/
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
685
|
+
*/ function build() {
|
|
686
|
+
return JSON.parse(JSON.stringify(this._envelope));
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
]);
|
|
690
|
+
return ZEmailEnvelopeBuilder;
|
|
691
|
+
}();
|
|
692
|
+
|
|
693
|
+
function _class_call_check$1(instance, Constructor) {
|
|
694
|
+
if (!(instance instanceof Constructor)) {
|
|
695
|
+
throw new TypeError("Cannot call a class as a function");
|
|
696
|
+
}
|
|
448
697
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
|
|
698
|
+
function _defineProperties$1(target, props) {
|
|
699
|
+
for(var i = 0; i < props.length; i++){
|
|
700
|
+
var descriptor = props[i];
|
|
701
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
702
|
+
descriptor.configurable = true;
|
|
703
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
704
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
function _create_class$1(Constructor, protoProps, staticProps) {
|
|
708
|
+
_defineProperties$1(Constructor.prototype, protoProps);
|
|
709
|
+
return Constructor;
|
|
710
|
+
}
|
|
711
|
+
function _define_property$1(obj, key, value) {
|
|
712
|
+
if (key in obj) {
|
|
713
|
+
Object.defineProperty(obj, key, {
|
|
714
|
+
value: value,
|
|
715
|
+
enumerable: true,
|
|
716
|
+
configurable: true,
|
|
717
|
+
writable: true
|
|
718
|
+
});
|
|
719
|
+
} else {
|
|
720
|
+
obj[key] = value;
|
|
721
|
+
}
|
|
722
|
+
return obj;
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Represents a builder for an email.
|
|
726
|
+
*/ var ZEmailBuilder = /*#__PURE__*/ function() {
|
|
727
|
+
function ZEmailBuilder() {
|
|
728
|
+
_class_call_check$1(this, ZEmailBuilder);
|
|
729
|
+
_define_property$1(this, "_email", void 0);
|
|
730
|
+
this._email = {
|
|
731
|
+
envelope: new ZEmailEnvelopeBuilder().build()
|
|
732
|
+
};
|
|
733
|
+
}
|
|
734
|
+
_create_class$1(ZEmailBuilder, [
|
|
735
|
+
{
|
|
736
|
+
key: "envelope",
|
|
737
|
+
value: /**
|
|
459
738
|
* Sets the envelope of where the email is going.
|
|
460
739
|
*
|
|
461
740
|
* @param val -
|
|
@@ -463,12 +742,14 @@ class ZEmailBuilder {
|
|
|
463
742
|
*
|
|
464
743
|
* @returns
|
|
465
744
|
* This object.
|
|
466
|
-
*/
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
745
|
+
*/ function envelope(val) {
|
|
746
|
+
this._email.envelope = val;
|
|
747
|
+
return this;
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
key: "subject",
|
|
752
|
+
value: /**
|
|
472
753
|
* Sets the subject line of the email.
|
|
473
754
|
*
|
|
474
755
|
* @param val -
|
|
@@ -476,12 +757,14 @@ class ZEmailBuilder {
|
|
|
476
757
|
*
|
|
477
758
|
* @returns
|
|
478
759
|
* This object.
|
|
479
|
-
*/
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
760
|
+
*/ function subject(val) {
|
|
761
|
+
this._email.subject = val;
|
|
762
|
+
return this;
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
key: "message",
|
|
767
|
+
value: /**
|
|
485
768
|
* Sets the message of the email.
|
|
486
769
|
*
|
|
487
770
|
* The message can be raw text or html.
|
|
@@ -491,12 +774,14 @@ class ZEmailBuilder {
|
|
|
491
774
|
*
|
|
492
775
|
* @returns
|
|
493
776
|
* This object.
|
|
494
|
-
*/
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
777
|
+
*/ function message(val) {
|
|
778
|
+
this._email.message = val;
|
|
779
|
+
return this;
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
key: "assign",
|
|
784
|
+
value: /**
|
|
500
785
|
* Assigns the other object to the current email object.
|
|
501
786
|
*
|
|
502
787
|
* @param other -
|
|
@@ -504,13 +789,15 @@ class ZEmailBuilder {
|
|
|
504
789
|
*
|
|
505
790
|
* @returns
|
|
506
791
|
* This object.
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
792
|
+
*/ function assign(other) {
|
|
793
|
+
this._email = Object.assign(this._email, other);
|
|
794
|
+
this._email = JSON.parse(JSON.stringify(this._email));
|
|
795
|
+
return this;
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
key: "copy",
|
|
800
|
+
value: /**
|
|
514
801
|
* Copies another email into the builder.
|
|
515
802
|
*
|
|
516
803
|
* @param other -
|
|
@@ -518,31 +805,73 @@ class ZEmailBuilder {
|
|
|
518
805
|
*
|
|
519
806
|
* @returns
|
|
520
807
|
* This object.
|
|
521
|
-
*/
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
808
|
+
*/ function copy(other) {
|
|
809
|
+
this._email = JSON.parse(JSON.stringify(other));
|
|
810
|
+
return this;
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
key: "build",
|
|
815
|
+
value: /**
|
|
527
816
|
* Returns a copy of the built object.
|
|
528
817
|
*
|
|
529
818
|
* @returns
|
|
530
819
|
* A copy of the built object.
|
|
531
|
-
*/
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
820
|
+
*/ function build() {
|
|
821
|
+
return JSON.parse(JSON.stringify(this._email));
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
]);
|
|
825
|
+
return ZEmailBuilder;
|
|
826
|
+
}();
|
|
827
|
+
|
|
828
|
+
/**
|
|
829
|
+
* Represents an abstract server connection.
|
|
830
|
+
*/ function _class_call_check(instance, Constructor) {
|
|
831
|
+
if (!(instance instanceof Constructor)) {
|
|
832
|
+
throw new TypeError("Cannot call a class as a function");
|
|
833
|
+
}
|
|
535
834
|
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
|
|
835
|
+
function _defineProperties(target, props) {
|
|
836
|
+
for(var i = 0; i < props.length; i++){
|
|
837
|
+
var descriptor = props[i];
|
|
838
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
839
|
+
descriptor.configurable = true;
|
|
840
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
841
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
845
|
+
_defineProperties(Constructor.prototype, protoProps);
|
|
846
|
+
return Constructor;
|
|
847
|
+
}
|
|
848
|
+
function _define_property(obj, key, value) {
|
|
849
|
+
if (key in obj) {
|
|
850
|
+
Object.defineProperty(obj, key, {
|
|
851
|
+
value: value,
|
|
852
|
+
enumerable: true,
|
|
853
|
+
configurable: true,
|
|
854
|
+
writable: true
|
|
855
|
+
});
|
|
856
|
+
} else {
|
|
857
|
+
obj[key] = value;
|
|
858
|
+
}
|
|
859
|
+
return obj;
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Represents a builder for a server object.
|
|
863
|
+
*/ var ZServerBuilder = /*#__PURE__*/ function() {
|
|
864
|
+
function ZServerBuilder() {
|
|
865
|
+
_class_call_check(this, ZServerBuilder);
|
|
866
|
+
_define_property(this, "_server", void 0);
|
|
867
|
+
this._server = {
|
|
868
|
+
address: ""
|
|
869
|
+
};
|
|
870
|
+
}
|
|
871
|
+
_create_class(ZServerBuilder, [
|
|
872
|
+
{
|
|
873
|
+
key: "address",
|
|
874
|
+
value: /**
|
|
546
875
|
* The server ip address or hostname.
|
|
547
876
|
*
|
|
548
877
|
* @param val -
|
|
@@ -550,12 +879,14 @@ class ZServerBuilder {
|
|
|
550
879
|
*
|
|
551
880
|
* @returns
|
|
552
881
|
* This object.
|
|
553
|
-
*/
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
882
|
+
*/ function address(val) {
|
|
883
|
+
this._server.address = val;
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
},
|
|
887
|
+
{
|
|
888
|
+
key: "port",
|
|
889
|
+
value: /**
|
|
559
890
|
* Sets the optional port to connect on.
|
|
560
891
|
*
|
|
561
892
|
* @param val -
|
|
@@ -563,12 +894,14 @@ class ZServerBuilder {
|
|
|
563
894
|
*
|
|
564
895
|
* @returns
|
|
565
896
|
* This object.
|
|
566
|
-
*/
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
897
|
+
*/ function port(val) {
|
|
898
|
+
this._server.port = val;
|
|
899
|
+
return this;
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
key: "username",
|
|
904
|
+
value: /**
|
|
572
905
|
* Sets the optional username to connect on.
|
|
573
906
|
*
|
|
574
907
|
* @param val -
|
|
@@ -576,12 +909,14 @@ class ZServerBuilder {
|
|
|
576
909
|
*
|
|
577
910
|
* @returns
|
|
578
911
|
* This object.
|
|
579
|
-
*/
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
912
|
+
*/ function username(val) {
|
|
913
|
+
this._server.username = val;
|
|
914
|
+
return this;
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
key: "password",
|
|
919
|
+
value: /**
|
|
585
920
|
* Sets the password to connect on.
|
|
586
921
|
*
|
|
587
922
|
* @param val -
|
|
@@ -589,12 +924,14 @@ class ZServerBuilder {
|
|
|
589
924
|
*
|
|
590
925
|
* @returns
|
|
591
926
|
* This object.
|
|
592
|
-
*/
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
927
|
+
*/ function password(val) {
|
|
928
|
+
this._server.password = val;
|
|
929
|
+
return this;
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
key: "assign",
|
|
934
|
+
value: /**
|
|
598
935
|
* Assigns all truthy properties in other to this object.
|
|
599
936
|
*
|
|
600
937
|
* @param other -
|
|
@@ -602,12 +939,14 @@ class ZServerBuilder {
|
|
|
602
939
|
*
|
|
603
940
|
* @returns
|
|
604
941
|
* This object.
|
|
605
|
-
*/
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
942
|
+
*/ function assign(other) {
|
|
943
|
+
this._server = Object.assign({}, this._server, other);
|
|
944
|
+
return this;
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
key: "copy",
|
|
949
|
+
value: /**
|
|
611
950
|
* Copies all properties in other to this object.
|
|
612
951
|
*
|
|
613
952
|
* @param other -
|
|
@@ -615,21 +954,26 @@ class ZServerBuilder {
|
|
|
615
954
|
*
|
|
616
955
|
* @returns
|
|
617
956
|
* This object.
|
|
618
|
-
*/
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
957
|
+
*/ function copy(other) {
|
|
958
|
+
this._server = JSON.parse(JSON.stringify(other));
|
|
959
|
+
return this;
|
|
960
|
+
}
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
key: "build",
|
|
964
|
+
value: /**
|
|
624
965
|
* Returns a copy of the built object.
|
|
625
966
|
*
|
|
626
967
|
* @returns
|
|
627
968
|
* A copy of the built object.
|
|
628
|
-
*/
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
969
|
+
*/ function build() {
|
|
970
|
+
return JSON.parse(JSON.stringify(this._server));
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
]);
|
|
974
|
+
return ZServerBuilder;
|
|
975
|
+
}();
|
|
976
|
+
|
|
633
977
|
exports.ZCookieBuilder = ZCookieBuilder;
|
|
634
978
|
exports.ZEmailBuilder = ZEmailBuilder;
|
|
635
979
|
exports.ZEmailContactAddressBuilder = ZEmailContactAddressBuilder;
|