mythix 1.2.0 → 2.0.2

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 (32) hide show
  1. package/package.json +6 -13
  2. package/src/application.js +5 -2
  3. package/src/cli/migrations/makemigrations-command.js +1 -2
  4. package/src/cli/migrations/migrate-command.js +4 -4
  5. package/src/cli/shell-command.js +0 -2
  6. package/src/controllers/controller-module.js +0 -9
  7. package/src/http-server/http-server.js +0 -5
  8. package/src/models/index.js +0 -4
  9. package/src/models/migration-model.js +2 -2
  10. package/src/models/model-module.js +19 -32
  11. package/src/models/model-utils.js +24 -374
  12. package/src/models/model.js +29 -150
  13. package/src/modules/database-module.js +23 -18
  14. package/src/tasks/task-module.js +1 -11
  15. package/src/tasks/task-utils.js +1 -2
  16. package/src/utils/test-utils.js +38 -50
  17. package/.eslintrc.js +0 -94
  18. package/.vscode/settings.json +0 -7
  19. package/spec/controllers/controller-utils-spec.js +0 -145
  20. package/spec/controllers/generate-client-api-interface-spec.js +0 -156
  21. package/spec/controllers/generateClientAPIInterface01.snapshot +0 -552
  22. package/spec/controllers/generateClientAPIInterface02.snapshot +0 -465
  23. package/spec/controllers/generateClientAPIInterface03.snapshot +0 -418
  24. package/spec/controllers/generateClientAPIInterface04.snapshot +0 -552
  25. package/spec/controllers/generateClientAPIInterface05.snapshot +0 -552
  26. package/spec/support/application.js +0 -50
  27. package/spec/support/config/index.js +0 -3
  28. package/spec/support/jasmine.json +0 -13
  29. package/spec/support/snapshots.js +0 -63
  30. package/spec/utils/crypto-utils-spec.js +0 -28
  31. package/spec/utils/file-utils-spec.js +0 -14
  32. package/spec/utils/mime-utils-spec.js +0 -175
@@ -1,552 +0,0 @@
1
- "'use strict';
2
-
3
- (function(globalScope, environmentType) {
4
-
5
- var Utils = (function() {
6
- function instanceOf(obj) {
7
- function testType(obj, _val) {
8
- function isDeferredType(obj) {
9
- if (obj instanceof Promise)
10
- return true;
11
-
12
- if (typeof obj.then === 'function')
13
- return true;
14
-
15
- return false;
16
- }
17
-
18
- var val = _val,
19
- typeOf = (typeof obj);
20
-
21
- if (val === String)
22
- val = 'string';
23
- else if (val === Number)
24
- val = 'number';
25
- else if (val === Boolean)
26
- val = 'boolean';
27
- else if (val === Function)
28
- val = 'function';
29
- else if (val === Array)
30
- val = 'array';
31
- else if (val === Object)
32
- val = 'object';
33
- else if (val === Promise)
34
- val = 'promise';
35
- else if (val === BigInt)
36
- val = 'bigint';
37
-
38
- if (val === 'object' && (obj.constructor === Object.prototype.constructor || obj.constructor.name === 'Object'))
39
- return true;
40
-
41
- if ((val === 'promise' || val === 'deferred') && isDeferredType(obj))
42
- return true;
43
-
44
- if (val !== 'object' && val === typeOf)
45
- return true;
46
-
47
- if (val === 'number' && (typeof obj === 'number' || (obj instanceof Number)) && !isFinite(obj))
48
- return false;
49
-
50
- if (val === 'number' && obj instanceof Number)
51
- return true;
52
-
53
- if (val === 'string' && obj instanceof String)
54
- return true;
55
-
56
- if (val === 'boolean' && obj instanceof Boolean)
57
- return true;
58
-
59
- if (val === 'function' && typeOf === 'function')
60
- return true;
61
-
62
- if (val === 'array' && obj instanceof Array)
63
- return true;
64
-
65
- if (typeof val === 'function' && obj instanceof val)
66
- return true;
67
-
68
- return false;
69
- }
70
-
71
- if (obj == null)
72
- return false;
73
-
74
- for (var i = 1, len = arguments.length; i < len; i++) {
75
- if (testType(obj, arguments[i]) === true)
76
- return true;
77
- }
78
-
79
- return false;
80
- }
81
-
82
- function sizeOf(obj) {
83
- if (obj == null)
84
- return 0;
85
-
86
- if ((typeof obj.length === 'number' || obj.length instanceof Number) && isFinite(obj.length))
87
- return obj.length;
88
-
89
- if (obj.constructor === Object.prototype.constructor || obj.constructor.name === 'Object')
90
- return Object.keys(obj).length + Object.getOwnPropertySymbols(obj).length;
91
-
92
- return 0;
93
- }
94
-
95
- function isEmpty() {
96
- for (var i = 0, len = arguments.length; i < len; i++) {
97
- var value = arguments[i];
98
- if (value == null)
99
- return true;
100
-
101
- if (value === Infinity)
102
- continue;
103
-
104
- if (instanceOf(value, 'string'))
105
- return !value.match(/\S/);
106
- else if (instanceOf(value, 'number') && isFinite(value))
107
- continue;
108
- else if (!instanceOf(value, 'boolean', 'bigint', 'function') && sizeOf(value) == 0)
109
- return true;
110
- }
111
-
112
- return false;
113
- }
114
-
115
- function dataToQueryString(data, nameFormatter, resolveInitial) {
116
- function fromObject(path, data) {
117
- let parts = [];
118
- let keys = Object.keys(data);
119
-
120
- for (let i = 0, il = keys.length; i < il; i++) {
121
- let key = keys[i];
122
- let value = data[key];
123
-
124
- if (value && typeof value === 'object' && typeof value.valueOf === 'function')
125
- value = value.valueOf();
126
-
127
- if (Array.isArray(value))
128
- parts = parts.concat(fromArray(`${path}[${key}]`, value));
129
- else if (value instanceof Object)
130
- parts = parts.concat(fromObject(`${path}[${key}]`, value));
131
- else
132
- parts.push(`${encodeURIComponent(`${path}[${key}]`)}=${encodeURIComponent(value)}`);
133
- }
134
-
135
- return parts.filter(Boolean);
136
- }
137
-
138
- function fromArray(path, data) {
139
- let parts = [];
140
-
141
- for (let i = 0, il = data.length; i < il; i++) {
142
- let value = data[i];
143
- if (value && typeof value === 'object' && typeof value.valueOf === 'function')
144
- value = value.valueOf();
145
-
146
- if (Array.isArray(value))
147
- parts = parts.concat(fromArray(`${path}[]`, value));
148
- else if (value instanceof Object)
149
- parts = parts.concat(fromObject(`${path}[]`, value));
150
- else
151
- parts.push(`${encodeURIComponent(`${path}[]`)}=${encodeURIComponent(value)}`);
152
- }
153
-
154
- return parts.filter(Boolean);
155
- }
156
-
157
- if (!data || Utils.sizeOf(data) === 0)
158
- return '';
159
-
160
- let initial = '?';
161
- let parts = [];
162
- let keys = Object.keys(data);
163
-
164
- if (resolveInitial != null)
165
- initial = (typeof resolveInitial === 'function') ? resolveInitial.call(this) : resolveInitial;
166
-
167
- for (let i = 0, il = keys.length; i < il; i++) {
168
- let name = keys[i];
169
- let value = data[name];
170
-
171
- if (Utils.isEmpty(value))
172
- continue;
173
-
174
- if (value && typeof value === 'object' && typeof value.valueOf === 'function')
175
- value = value.valueOf();
176
-
177
- name = (typeof nameFormatter === 'function') ? nameFormatter.call(this, name, value) : name;
178
- if (!name)
179
- continue;
180
-
181
- if (Array.isArray(value))
182
- parts = parts.concat(fromArray(name, value));
183
- else if (value instanceof Object)
184
- parts = parts.concat(fromObject(name, value));
185
- else
186
- parts.push(encodeURIComponent(name) + '=' + encodeURIComponent(value));
187
- }
188
-
189
- if (parts.length === 0)
190
- return '';
191
-
192
- return initial + parts.join('&');
193
- }
194
-
195
- function keysToLowerCase(obj) {
196
- var keys = Object.keys(obj || {});
197
- var newObj = {};
198
-
199
- for (var i = 0, il = keys.length; i < il; i++) {
200
- var key = keys[i];
201
- var value = obj[key];
202
- newObj[key.toLowerCase()] = value;
203
- }
204
-
205
- return newObj;
206
- }
207
-
208
- function injectURLParams(routeName, _options) {
209
- var options = _options || {};
210
- var params = options.params || {};
211
-
212
- if (Utils.isEmpty(options.url))
213
- throw new Error([ 'API::', routeName, ': \"url\" is required.' ].join(''));
214
-
215
- return options.url.replace(/<<(\w+)(\?)?>>/g, function(m, name, _optional) {
216
- var optional = (_optional === '?');
217
- var param = params[name];
218
-
219
- if (Utils.isEmpty(param)) {
220
- if (!optional)
221
- throw new Error([ 'API::', routeName, ': Parameter \"', name, '\" is required. You need to add the following to your call: ', routeName, '({ params: { \"', name, '\": (value) } })' ].join(''));
222
-
223
- param = '';
224
- }
225
-
226
- return param;
227
- });
228
- }
229
-
230
- return {
231
- instanceOf,
232
- sizeOf,
233
- isEmpty,
234
- dataToQueryString,
235
- keysToLowerCase,
236
- injectURLParams,
237
- };
238
- })();
239
-
240
-
241
- function generateAPIInterface(globalScope, environmentType) {
242
- function getDefaultHeader(headerName) {
243
- return apiInterface.defaultHeaders[headerName];
244
- }
245
-
246
- function getDefaultHeaders() {
247
- return apiInterface.defaultHeaders;
248
- }
249
-
250
- function setDefaultHeader(headerName, value) {
251
- if (value == null) {
252
- delete apiInterface.defaultHeaders[headerName];
253
- return;
254
- }
255
-
256
- apiInterface.defaultHeaders[headerName] = value;
257
- }
258
-
259
- function setDefaultHeaders(headers) {
260
- var headerNames = Object.keys(headers);
261
- for (var i = 0, il = headerNames.length; i < il; i++) {
262
- var headerName = headerNames[i];
263
- var value = headers[headerName];
264
-
265
- if (value == null) {
266
- delete apiInterface.defaultHeaders[headerName];
267
- continue;
268
- }
269
-
270
- apiInterface.defaultHeaders[headerName] = value;
271
- }
272
- }
273
-
274
- function nodeRequestHandler(routeName, requestOptions) {
275
- return new Promise((function(resolve, reject) {
276
- if (!requestOptions || Utils.isEmpty(requestOptions.url)) {
277
- reject([ 'API::', routeName, ': \"url\" is required.' ].join(''));
278
- return;
279
- }
280
-
281
- var HTTP = (requestOptions.httpModule) ? requestOptions.httpModule : require('http');
282
- var URL = require('url');
283
-
284
- var method = (requestOptions.method || 'GET').toUpperCase();
285
- var url = new URL.URL(requestOptions.url);
286
- var data = requestOptions.data;
287
- var extraConfig = {};
288
- var headers = Object.assign({}, Utils.keysToLowerCase(this.defaultHeaders || {}), Utils.keysToLowerCase(requestOptions.headers || {}));
289
-
290
- if (data) {
291
- if (!method.match(/^(GET|HEAD)$/i)) {
292
- if (data.constructor.name === 'FormData') {
293
- extraConfig = {
294
- headers: data.getHeaders(),
295
- };
296
- } else {
297
- if ((headers['content-type'] || '').match(/application\/json/i))
298
- data = JSON.stringify(data);
299
-
300
- extraConfig = {
301
- headers: {
302
- 'content-length': Buffer.byteLength(data),
303
- },
304
- };
305
- }
306
- } else {
307
- var queryString = Utils.dataToQueryString(data);
308
- if (queryString) {
309
- var newParams = new URL.URLSearchParams(queryString);
310
- var keys = Array.from(newParams.keys());
311
-
312
- for (var i = 0, il = keys.length; i < il; i++) {
313
- var key = keys[i];
314
- url.searchParams.set(key, newParams.get(key));
315
- }
316
- }
317
-
318
- data = undefined;
319
- }
320
- }
321
-
322
- var options = Object.assign(
323
- {
324
- protocol: url.protocol,
325
- hostname: url.hostname,
326
- port: url.port,
327
- path: `${url.pathname}${url.search}`,
328
- method,
329
- },
330
- requestOptions,
331
- extraConfig,
332
- { headers: Object.assign({}, headers, Utils.keysToLowerCase(extraConfig.headers || {})) },
333
- );
334
-
335
- delete options.data;
336
-
337
- var thisRequest = HTTP.request(options, function(response) {
338
- var responseData = Buffer.alloc(0);
339
-
340
- response.on('data', function(chunk) {
341
- responseData = Buffer.concat([ responseData, chunk ]);
342
- });
343
-
344
- response.on('error', function(error) {
345
- reject(error);
346
- });
347
-
348
- response.on('end', function() {
349
- response.rawBody = response.body = responseData;
350
-
351
- try {
352
- var contentType = response.headers['content-type'];
353
-
354
- if (contentType && contentType.match(/application\/json/i)) {
355
- var data = JSON.parse(responseData.toString('utf8'));
356
-
357
- Object.defineProperties(data, {
358
- '__response': {
359
- writable: true,
360
- enumberable: false,
361
- configurable: true,
362
- value: response,
363
- },
364
- '__statusCode': {
365
- writable: true,
366
- enumberable: false,
367
- configurable: true,
368
- value: response.status,
369
- },
370
- '__statusText': {
371
- writable: true,
372
- enumberable: false,
373
- configurable: true,
374
- value: response.statusText,
375
- },
376
- });
377
-
378
- response.body = data;
379
-
380
- resolve(data);
381
- } else if (contentType && contentType.match(/text\/(plain|html)/)) {
382
- response.body = responseData.toString('utf8');
383
- resolve(response.body);
384
- } else {
385
- resolve(response);
386
- }
387
- } catch (error) {
388
- return reject(error);
389
- }
390
- });
391
- });
392
-
393
- thisRequest.on('error', function(error) {
394
- reject(error);
395
- });
396
-
397
- if (data) {
398
- if (data.constructor.name === 'FormData') {
399
- data.pipe(thisRequest);
400
- } else if (data) {
401
- thisRequest.write(data);
402
- thisRequest.end();
403
- }
404
- } else {
405
- thisRequest.end();
406
- }
407
- }).bind(this));
408
- }
409
-
410
- function browserRequestHandler(routeName, requestOptions) {
411
- return new Promise((function(resolve, reject) {
412
- if (!requestOptions || Utils.isEmpty(requestOptions.url)) {
413
- reject([ 'API::', routeName, ': \"url\" is required.' ].join(''));
414
- return;
415
- }
416
-
417
- var method = (requestOptions.method || 'GET').toUpperCase();
418
- var url = requestOptions.url;
419
- var data = requestOptions.data;
420
- var extraConfig = {};
421
- var headers = Object.assign({ 'content-type': 'application/json; charset=UTF-8' }, Utils.keysToLowerCase(this.defaultHeaders || {}), Utils.keysToLowerCase(requestOptions.headers || {}));
422
-
423
- if (data) {
424
- if (!method.match(/^(GET|HEAD)$/i)) {
425
- if ((headers['content-type'] || '').match(/application\/json/i))
426
- data = JSON.stringify(data);
427
-
428
- extraConfig = {
429
- body: data,
430
- };
431
- } else {
432
- var queryString = Utils.dataToQueryString(data);
433
- if (queryString)
434
- url = url + queryString;
435
- }
436
- }
437
-
438
- var options = Object.assign(
439
- { method },
440
- requestOptions,
441
- extraConfig,
442
- { headers: Object.assign({}, headers, Utils.keysToLowerCase(extraConfig.headers || {})) },
443
- );
444
-
445
- delete options.data;
446
-
447
- globalScope.fetch(url, options).then(
448
- function(response) {
449
- if (typeof requestOptions.responseHandler === 'function')
450
- return requestOptions.responseHandler(response);
451
-
452
- if (!response.ok) {
453
- var error = new Error(response.statusText);
454
- error.response = response;
455
-
456
- reject(error);
457
- return;
458
- }
459
-
460
- var contentType = response.headers.get('Content-Type');
461
- if (contentType && contentType.match(/application\/json/i)) {
462
- var data = response.json();
463
-
464
- Object.defineProperties(data, {
465
- '__response': {
466
- writable: true,
467
- enumberable: false,
468
- configurable: true,
469
- value: response,
470
- },
471
- '__statusCode': {
472
- writable: true,
473
- enumberable: false,
474
- configurable: true,
475
- value: response.status,
476
- },
477
- '__statusText': {
478
- writable: true,
479
- enumberable: false,
480
- configurable: true,
481
- value: response.statusText,
482
- },
483
- });
484
-
485
- resolve(data);
486
- } else if (contentType && contentType.match(/text\/(plain|html)/i)) {
487
- resolve(response.text());
488
- } else {
489
- resolve(response);
490
- }
491
- },
492
- function(error) {
493
- reject(error);
494
- },
495
- );
496
- }).bind(this));
497
- }
498
-
499
- function makeRequest(routeName, options) {
500
-
501
-
502
- return (environmentType === 'browser') ? browserRequestHandler.call(this, routeName, options) : nodeRequestHandler.call(this, routeName, options);
503
- }
504
-
505
- var apiInterface = Object.create({
506
- defaultHeaders: {},
507
- makeRequest,
508
- getDefaultHeader,
509
- getDefaultHeaders,
510
- setDefaultHeader,
511
- setDefaultHeaders,
512
- });
513
-
514
- var defaultRouteOptions = {};
515
-
516
- apiInterface['createOrganization'] = (function createOrganization(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/organization/', method: 'PUT' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('createOrganization', options); delete options.params; return makeRequest.call(this, 'createOrganization', options); }).bind(apiInterface);
517
-
518
- apiInterface['getOrganization'] = (function getOrganization(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/organization/<<organizationID>>', method: 'GET' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('getOrganization', options); delete options.params; return makeRequest.call(this, 'getOrganization', options); }).bind(apiInterface);
519
-
520
- apiInterface['getOrganizations'] = (function getOrganizations(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/organization/', method: 'GET' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('getOrganizations', options); delete options.params; return makeRequest.call(this, 'getOrganizations', options); }).bind(apiInterface);
521
-
522
- apiInterface['getUser'] = (function getUser(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/user/<<userID>>', method: 'GET' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('getUser', options); delete options.params; return makeRequest.call(this, 'getUser', options); }).bind(apiInterface);
523
-
524
- apiInterface['getUsers'] = (function getUsers(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/user/', method: 'GET' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('getUsers', options); delete options.params; return makeRequest.call(this, 'getUsers', options); }).bind(apiInterface);
525
-
526
- apiInterface['inviteUserToOrganization'] = (function inviteUserToOrganization(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/organization/<<organizationID>>/inviteUser', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('inviteUserToOrganization', options); delete options.params; return makeRequest.call(this, 'inviteUserToOrganization', options); }).bind(apiInterface);
527
-
528
- apiInterface['login'] = (function login(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/auth/authenticate', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('login', options); delete options.params; return makeRequest.call(this, 'login', options); }).bind(apiInterface);
529
-
530
- apiInterface['registerUser'] = (function registerUser(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/auth/registerUser', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('registerUser', options); delete options.params; return makeRequest.call(this, 'registerUser', options); }).bind(apiInterface);
531
-
532
- apiInterface['searchOrganizations'] = (function searchOrganizations(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/organization/search', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('searchOrganizations', options); delete options.params; return makeRequest.call(this, 'searchOrganizations', options); }).bind(apiInterface);
533
-
534
- apiInterface['searchUsers'] = (function searchUsers(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/user/search', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('searchUsers', options); delete options.params; return makeRequest.call(this, 'searchUsers', options); }).bind(apiInterface);
535
-
536
- apiInterface['sendMagicLink'] = (function sendMagicLink(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/auth/sendMagicLink', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('sendMagicLink', options); delete options.params; return makeRequest.call(this, 'sendMagicLink', options); }).bind(apiInterface);
537
-
538
- apiInterface['updateOrganization'] = (function updateOrganization(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/organization/<<organizationID>>', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('updateOrganization', options); delete options.params; return makeRequest.call(this, 'updateOrganization', options); }).bind(apiInterface);
539
-
540
- apiInterface['updateUser'] = (function updateUser(_options) { var clientOptions = {\"credentials\":\"same-origin\",\"headers\":{\"Content-Type\":\"application/json\"}}; var options = Object.assign({ url: '/api/v1/user/<<userID>>', method: 'POST' }, defaultRouteOptions, clientOptions, Object.assign({}, _options || {}, { headers: Object.assign({}, defaultRouteOptions.headers || {}, clientOptions.headers || {}, ((_options || {}).headers) || {}) })); options.url = Utils.injectURLParams('updateUser', options); delete options.params; return makeRequest.call(this, 'updateUser', options); }).bind(apiInterface);
541
-
542
- return apiInterface;
543
- }
544
-
545
-
546
- var APIInterface = generateAPIInterface(globalScope, environmentType);
547
-
548
- globalScope['API'] = APIInterface
549
-
550
- return APIInterface;
551
- }).call(this, (typeof window === 'undefined') ? global : window, (typeof window !== 'undefined') ? 'browser' : 'node');
552
- "