@malevich-studio/strapi-sdk-typescript 1.2.7 → 1.2.9

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/cli.mjs CHANGED
@@ -4,7 +4,8 @@ import fs__default from 'fs';
4
4
  import * as path from 'path';
5
5
  import path__default from 'path';
6
6
  import require$$0 from 'util';
7
- import require$$2 from 'os';
7
+ import require$$1 from 'tty';
8
+ import require$$0$1 from 'os';
8
9
  import require$$3 from 'crypto';
9
10
 
10
11
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -20078,6 +20079,1221 @@ function requireLib () {
20078
20079
  var libExports = requireLib();
20079
20080
  var qs = /*@__PURE__*/getDefaultExportFromCjs(libExports);
20080
20081
 
20082
+ var src = {exports: {}};
20083
+
20084
+ var browser = {exports: {}};
20085
+
20086
+ /**
20087
+ * Helpers.
20088
+ */
20089
+
20090
+ var ms;
20091
+ var hasRequiredMs;
20092
+
20093
+ function requireMs () {
20094
+ if (hasRequiredMs) return ms;
20095
+ hasRequiredMs = 1;
20096
+ var s = 1000;
20097
+ var m = s * 60;
20098
+ var h = m * 60;
20099
+ var d = h * 24;
20100
+ var w = d * 7;
20101
+ var y = d * 365.25;
20102
+
20103
+ /**
20104
+ * Parse or format the given `val`.
20105
+ *
20106
+ * Options:
20107
+ *
20108
+ * - `long` verbose formatting [false]
20109
+ *
20110
+ * @param {String|Number} val
20111
+ * @param {Object} [options]
20112
+ * @throws {Error} throw an error if val is not a non-empty string or a number
20113
+ * @return {String|Number}
20114
+ * @api public
20115
+ */
20116
+
20117
+ ms = function (val, options) {
20118
+ options = options || {};
20119
+ var type = typeof val;
20120
+ if (type === 'string' && val.length > 0) {
20121
+ return parse(val);
20122
+ } else if (type === 'number' && isFinite(val)) {
20123
+ return options.long ? fmtLong(val) : fmtShort(val);
20124
+ }
20125
+ throw new Error(
20126
+ 'val is not a non-empty string or a valid number. val=' +
20127
+ JSON.stringify(val)
20128
+ );
20129
+ };
20130
+
20131
+ /**
20132
+ * Parse the given `str` and return milliseconds.
20133
+ *
20134
+ * @param {String} str
20135
+ * @return {Number}
20136
+ * @api private
20137
+ */
20138
+
20139
+ function parse(str) {
20140
+ str = String(str);
20141
+ if (str.length > 100) {
20142
+ return;
20143
+ }
20144
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
20145
+ str
20146
+ );
20147
+ if (!match) {
20148
+ return;
20149
+ }
20150
+ var n = parseFloat(match[1]);
20151
+ var type = (match[2] || 'ms').toLowerCase();
20152
+ switch (type) {
20153
+ case 'years':
20154
+ case 'year':
20155
+ case 'yrs':
20156
+ case 'yr':
20157
+ case 'y':
20158
+ return n * y;
20159
+ case 'weeks':
20160
+ case 'week':
20161
+ case 'w':
20162
+ return n * w;
20163
+ case 'days':
20164
+ case 'day':
20165
+ case 'd':
20166
+ return n * d;
20167
+ case 'hours':
20168
+ case 'hour':
20169
+ case 'hrs':
20170
+ case 'hr':
20171
+ case 'h':
20172
+ return n * h;
20173
+ case 'minutes':
20174
+ case 'minute':
20175
+ case 'mins':
20176
+ case 'min':
20177
+ case 'm':
20178
+ return n * m;
20179
+ case 'seconds':
20180
+ case 'second':
20181
+ case 'secs':
20182
+ case 'sec':
20183
+ case 's':
20184
+ return n * s;
20185
+ case 'milliseconds':
20186
+ case 'millisecond':
20187
+ case 'msecs':
20188
+ case 'msec':
20189
+ case 'ms':
20190
+ return n;
20191
+ default:
20192
+ return undefined;
20193
+ }
20194
+ }
20195
+
20196
+ /**
20197
+ * Short format for `ms`.
20198
+ *
20199
+ * @param {Number} ms
20200
+ * @return {String}
20201
+ * @api private
20202
+ */
20203
+
20204
+ function fmtShort(ms) {
20205
+ var msAbs = Math.abs(ms);
20206
+ if (msAbs >= d) {
20207
+ return Math.round(ms / d) + 'd';
20208
+ }
20209
+ if (msAbs >= h) {
20210
+ return Math.round(ms / h) + 'h';
20211
+ }
20212
+ if (msAbs >= m) {
20213
+ return Math.round(ms / m) + 'm';
20214
+ }
20215
+ if (msAbs >= s) {
20216
+ return Math.round(ms / s) + 's';
20217
+ }
20218
+ return ms + 'ms';
20219
+ }
20220
+
20221
+ /**
20222
+ * Long format for `ms`.
20223
+ *
20224
+ * @param {Number} ms
20225
+ * @return {String}
20226
+ * @api private
20227
+ */
20228
+
20229
+ function fmtLong(ms) {
20230
+ var msAbs = Math.abs(ms);
20231
+ if (msAbs >= d) {
20232
+ return plural(ms, msAbs, d, 'day');
20233
+ }
20234
+ if (msAbs >= h) {
20235
+ return plural(ms, msAbs, h, 'hour');
20236
+ }
20237
+ if (msAbs >= m) {
20238
+ return plural(ms, msAbs, m, 'minute');
20239
+ }
20240
+ if (msAbs >= s) {
20241
+ return plural(ms, msAbs, s, 'second');
20242
+ }
20243
+ return ms + ' ms';
20244
+ }
20245
+
20246
+ /**
20247
+ * Pluralization helper.
20248
+ */
20249
+
20250
+ function plural(ms, msAbs, n, name) {
20251
+ var isPlural = msAbs >= n * 1.5;
20252
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
20253
+ }
20254
+ return ms;
20255
+ }
20256
+
20257
+ var common;
20258
+ var hasRequiredCommon;
20259
+
20260
+ function requireCommon () {
20261
+ if (hasRequiredCommon) return common;
20262
+ hasRequiredCommon = 1;
20263
+ /**
20264
+ * This is the common logic for both the Node.js and web browser
20265
+ * implementations of `debug()`.
20266
+ */
20267
+
20268
+ function setup(env) {
20269
+ createDebug.debug = createDebug;
20270
+ createDebug.default = createDebug;
20271
+ createDebug.coerce = coerce;
20272
+ createDebug.disable = disable;
20273
+ createDebug.enable = enable;
20274
+ createDebug.enabled = enabled;
20275
+ createDebug.humanize = requireMs();
20276
+ createDebug.destroy = destroy;
20277
+
20278
+ Object.keys(env).forEach(key => {
20279
+ createDebug[key] = env[key];
20280
+ });
20281
+
20282
+ /**
20283
+ * The currently active debug mode names, and names to skip.
20284
+ */
20285
+
20286
+ createDebug.names = [];
20287
+ createDebug.skips = [];
20288
+
20289
+ /**
20290
+ * Map of special "%n" handling functions, for the debug "format" argument.
20291
+ *
20292
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
20293
+ */
20294
+ createDebug.formatters = {};
20295
+
20296
+ /**
20297
+ * Selects a color for a debug namespace
20298
+ * @param {String} namespace The namespace string for the debug instance to be colored
20299
+ * @return {Number|String} An ANSI color code for the given namespace
20300
+ * @api private
20301
+ */
20302
+ function selectColor(namespace) {
20303
+ let hash = 0;
20304
+
20305
+ for (let i = 0; i < namespace.length; i++) {
20306
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
20307
+ hash |= 0; // Convert to 32bit integer
20308
+ }
20309
+
20310
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
20311
+ }
20312
+ createDebug.selectColor = selectColor;
20313
+
20314
+ /**
20315
+ * Create a debugger with the given `namespace`.
20316
+ *
20317
+ * @param {String} namespace
20318
+ * @return {Function}
20319
+ * @api public
20320
+ */
20321
+ function createDebug(namespace) {
20322
+ let prevTime;
20323
+ let enableOverride = null;
20324
+ let namespacesCache;
20325
+ let enabledCache;
20326
+
20327
+ function debug(...args) {
20328
+ // Disabled?
20329
+ if (!debug.enabled) {
20330
+ return;
20331
+ }
20332
+
20333
+ const self = debug;
20334
+
20335
+ // Set `diff` timestamp
20336
+ const curr = Number(new Date());
20337
+ const ms = curr - (prevTime || curr);
20338
+ self.diff = ms;
20339
+ self.prev = prevTime;
20340
+ self.curr = curr;
20341
+ prevTime = curr;
20342
+
20343
+ args[0] = createDebug.coerce(args[0]);
20344
+
20345
+ if (typeof args[0] !== 'string') {
20346
+ // Anything else let's inspect with %O
20347
+ args.unshift('%O');
20348
+ }
20349
+
20350
+ // Apply any `formatters` transformations
20351
+ let index = 0;
20352
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
20353
+ // If we encounter an escaped % then don't increase the array index
20354
+ if (match === '%%') {
20355
+ return '%';
20356
+ }
20357
+ index++;
20358
+ const formatter = createDebug.formatters[format];
20359
+ if (typeof formatter === 'function') {
20360
+ const val = args[index];
20361
+ match = formatter.call(self, val);
20362
+
20363
+ // Now we need to remove `args[index]` since it's inlined in the `format`
20364
+ args.splice(index, 1);
20365
+ index--;
20366
+ }
20367
+ return match;
20368
+ });
20369
+
20370
+ // Apply env-specific formatting (colors, etc.)
20371
+ createDebug.formatArgs.call(self, args);
20372
+
20373
+ const logFn = self.log || createDebug.log;
20374
+ logFn.apply(self, args);
20375
+ }
20376
+
20377
+ debug.namespace = namespace;
20378
+ debug.useColors = createDebug.useColors();
20379
+ debug.color = createDebug.selectColor(namespace);
20380
+ debug.extend = extend;
20381
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
20382
+
20383
+ Object.defineProperty(debug, 'enabled', {
20384
+ enumerable: true,
20385
+ configurable: false,
20386
+ get: () => {
20387
+ if (enableOverride !== null) {
20388
+ return enableOverride;
20389
+ }
20390
+ if (namespacesCache !== createDebug.namespaces) {
20391
+ namespacesCache = createDebug.namespaces;
20392
+ enabledCache = createDebug.enabled(namespace);
20393
+ }
20394
+
20395
+ return enabledCache;
20396
+ },
20397
+ set: v => {
20398
+ enableOverride = v;
20399
+ }
20400
+ });
20401
+
20402
+ // Env-specific initialization logic for debug instances
20403
+ if (typeof createDebug.init === 'function') {
20404
+ createDebug.init(debug);
20405
+ }
20406
+
20407
+ return debug;
20408
+ }
20409
+
20410
+ function extend(namespace, delimiter) {
20411
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
20412
+ newDebug.log = this.log;
20413
+ return newDebug;
20414
+ }
20415
+
20416
+ /**
20417
+ * Enables a debug mode by namespaces. This can include modes
20418
+ * separated by a colon and wildcards.
20419
+ *
20420
+ * @param {String} namespaces
20421
+ * @api public
20422
+ */
20423
+ function enable(namespaces) {
20424
+ createDebug.save(namespaces);
20425
+ createDebug.namespaces = namespaces;
20426
+
20427
+ createDebug.names = [];
20428
+ createDebug.skips = [];
20429
+
20430
+ const split = (typeof namespaces === 'string' ? namespaces : '')
20431
+ .trim()
20432
+ .replace(' ', ',')
20433
+ .split(',')
20434
+ .filter(Boolean);
20435
+
20436
+ for (const ns of split) {
20437
+ if (ns[0] === '-') {
20438
+ createDebug.skips.push(ns.slice(1));
20439
+ } else {
20440
+ createDebug.names.push(ns);
20441
+ }
20442
+ }
20443
+ }
20444
+
20445
+ /**
20446
+ * Checks if the given string matches a namespace template, honoring
20447
+ * asterisks as wildcards.
20448
+ *
20449
+ * @param {String} search
20450
+ * @param {String} template
20451
+ * @return {Boolean}
20452
+ */
20453
+ function matchesTemplate(search, template) {
20454
+ let searchIndex = 0;
20455
+ let templateIndex = 0;
20456
+ let starIndex = -1;
20457
+ let matchIndex = 0;
20458
+
20459
+ while (searchIndex < search.length) {
20460
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
20461
+ // Match character or proceed with wildcard
20462
+ if (template[templateIndex] === '*') {
20463
+ starIndex = templateIndex;
20464
+ matchIndex = searchIndex;
20465
+ templateIndex++; // Skip the '*'
20466
+ } else {
20467
+ searchIndex++;
20468
+ templateIndex++;
20469
+ }
20470
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
20471
+ // Backtrack to the last '*' and try to match more characters
20472
+ templateIndex = starIndex + 1;
20473
+ matchIndex++;
20474
+ searchIndex = matchIndex;
20475
+ } else {
20476
+ return false; // No match
20477
+ }
20478
+ }
20479
+
20480
+ // Handle trailing '*' in template
20481
+ while (templateIndex < template.length && template[templateIndex] === '*') {
20482
+ templateIndex++;
20483
+ }
20484
+
20485
+ return templateIndex === template.length;
20486
+ }
20487
+
20488
+ /**
20489
+ * Disable debug output.
20490
+ *
20491
+ * @return {String} namespaces
20492
+ * @api public
20493
+ */
20494
+ function disable() {
20495
+ const namespaces = [
20496
+ ...createDebug.names,
20497
+ ...createDebug.skips.map(namespace => '-' + namespace)
20498
+ ].join(',');
20499
+ createDebug.enable('');
20500
+ return namespaces;
20501
+ }
20502
+
20503
+ /**
20504
+ * Returns true if the given mode name is enabled, false otherwise.
20505
+ *
20506
+ * @param {String} name
20507
+ * @return {Boolean}
20508
+ * @api public
20509
+ */
20510
+ function enabled(name) {
20511
+ for (const skip of createDebug.skips) {
20512
+ if (matchesTemplate(name, skip)) {
20513
+ return false;
20514
+ }
20515
+ }
20516
+
20517
+ for (const ns of createDebug.names) {
20518
+ if (matchesTemplate(name, ns)) {
20519
+ return true;
20520
+ }
20521
+ }
20522
+
20523
+ return false;
20524
+ }
20525
+
20526
+ /**
20527
+ * Coerce `val`.
20528
+ *
20529
+ * @param {Mixed} val
20530
+ * @return {Mixed}
20531
+ * @api private
20532
+ */
20533
+ function coerce(val) {
20534
+ if (val instanceof Error) {
20535
+ return val.stack || val.message;
20536
+ }
20537
+ return val;
20538
+ }
20539
+
20540
+ /**
20541
+ * XXX DO NOT USE. This is a temporary stub function.
20542
+ * XXX It WILL be removed in the next major release.
20543
+ */
20544
+ function destroy() {
20545
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
20546
+ }
20547
+
20548
+ createDebug.enable(createDebug.load());
20549
+
20550
+ return createDebug;
20551
+ }
20552
+
20553
+ common = setup;
20554
+ return common;
20555
+ }
20556
+
20557
+ /* eslint-env browser */
20558
+
20559
+ var hasRequiredBrowser;
20560
+
20561
+ function requireBrowser () {
20562
+ if (hasRequiredBrowser) return browser.exports;
20563
+ hasRequiredBrowser = 1;
20564
+ (function (module, exports) {
20565
+ /**
20566
+ * This is the web browser implementation of `debug()`.
20567
+ */
20568
+
20569
+ exports.formatArgs = formatArgs;
20570
+ exports.save = save;
20571
+ exports.load = load;
20572
+ exports.useColors = useColors;
20573
+ exports.storage = localstorage();
20574
+ exports.destroy = (() => {
20575
+ let warned = false;
20576
+
20577
+ return () => {
20578
+ if (!warned) {
20579
+ warned = true;
20580
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
20581
+ }
20582
+ };
20583
+ })();
20584
+
20585
+ /**
20586
+ * Colors.
20587
+ */
20588
+
20589
+ exports.colors = [
20590
+ '#0000CC',
20591
+ '#0000FF',
20592
+ '#0033CC',
20593
+ '#0033FF',
20594
+ '#0066CC',
20595
+ '#0066FF',
20596
+ '#0099CC',
20597
+ '#0099FF',
20598
+ '#00CC00',
20599
+ '#00CC33',
20600
+ '#00CC66',
20601
+ '#00CC99',
20602
+ '#00CCCC',
20603
+ '#00CCFF',
20604
+ '#3300CC',
20605
+ '#3300FF',
20606
+ '#3333CC',
20607
+ '#3333FF',
20608
+ '#3366CC',
20609
+ '#3366FF',
20610
+ '#3399CC',
20611
+ '#3399FF',
20612
+ '#33CC00',
20613
+ '#33CC33',
20614
+ '#33CC66',
20615
+ '#33CC99',
20616
+ '#33CCCC',
20617
+ '#33CCFF',
20618
+ '#6600CC',
20619
+ '#6600FF',
20620
+ '#6633CC',
20621
+ '#6633FF',
20622
+ '#66CC00',
20623
+ '#66CC33',
20624
+ '#9900CC',
20625
+ '#9900FF',
20626
+ '#9933CC',
20627
+ '#9933FF',
20628
+ '#99CC00',
20629
+ '#99CC33',
20630
+ '#CC0000',
20631
+ '#CC0033',
20632
+ '#CC0066',
20633
+ '#CC0099',
20634
+ '#CC00CC',
20635
+ '#CC00FF',
20636
+ '#CC3300',
20637
+ '#CC3333',
20638
+ '#CC3366',
20639
+ '#CC3399',
20640
+ '#CC33CC',
20641
+ '#CC33FF',
20642
+ '#CC6600',
20643
+ '#CC6633',
20644
+ '#CC9900',
20645
+ '#CC9933',
20646
+ '#CCCC00',
20647
+ '#CCCC33',
20648
+ '#FF0000',
20649
+ '#FF0033',
20650
+ '#FF0066',
20651
+ '#FF0099',
20652
+ '#FF00CC',
20653
+ '#FF00FF',
20654
+ '#FF3300',
20655
+ '#FF3333',
20656
+ '#FF3366',
20657
+ '#FF3399',
20658
+ '#FF33CC',
20659
+ '#FF33FF',
20660
+ '#FF6600',
20661
+ '#FF6633',
20662
+ '#FF9900',
20663
+ '#FF9933',
20664
+ '#FFCC00',
20665
+ '#FFCC33'
20666
+ ];
20667
+
20668
+ /**
20669
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
20670
+ * and the Firebug extension (any Firefox version) are known
20671
+ * to support "%c" CSS customizations.
20672
+ *
20673
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
20674
+ */
20675
+
20676
+ // eslint-disable-next-line complexity
20677
+ function useColors() {
20678
+ // NB: In an Electron preload script, document will be defined but not fully
20679
+ // initialized. Since we know we're in Chrome, we'll just detect this case
20680
+ // explicitly
20681
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
20682
+ return true;
20683
+ }
20684
+
20685
+ // Internet Explorer and Edge do not support colors.
20686
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
20687
+ return false;
20688
+ }
20689
+
20690
+ let m;
20691
+
20692
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
20693
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
20694
+ // eslint-disable-next-line no-return-assign
20695
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
20696
+ // Is firebug? http://stackoverflow.com/a/398120/376773
20697
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
20698
+ // Is firefox >= v31?
20699
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
20700
+ (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
20701
+ // Double check webkit in userAgent just in case we are in a worker
20702
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
20703
+ }
20704
+
20705
+ /**
20706
+ * Colorize log arguments if enabled.
20707
+ *
20708
+ * @api public
20709
+ */
20710
+
20711
+ function formatArgs(args) {
20712
+ args[0] = (this.useColors ? '%c' : '') +
20713
+ this.namespace +
20714
+ (this.useColors ? ' %c' : ' ') +
20715
+ args[0] +
20716
+ (this.useColors ? '%c ' : ' ') +
20717
+ '+' + module.exports.humanize(this.diff);
20718
+
20719
+ if (!this.useColors) {
20720
+ return;
20721
+ }
20722
+
20723
+ const c = 'color: ' + this.color;
20724
+ args.splice(1, 0, c, 'color: inherit');
20725
+
20726
+ // The final "%c" is somewhat tricky, because there could be other
20727
+ // arguments passed either before or after the %c, so we need to
20728
+ // figure out the correct index to insert the CSS into
20729
+ let index = 0;
20730
+ let lastC = 0;
20731
+ args[0].replace(/%[a-zA-Z%]/g, match => {
20732
+ if (match === '%%') {
20733
+ return;
20734
+ }
20735
+ index++;
20736
+ if (match === '%c') {
20737
+ // We only are interested in the *last* %c
20738
+ // (the user may have provided their own)
20739
+ lastC = index;
20740
+ }
20741
+ });
20742
+
20743
+ args.splice(lastC, 0, c);
20744
+ }
20745
+
20746
+ /**
20747
+ * Invokes `console.debug()` when available.
20748
+ * No-op when `console.debug` is not a "function".
20749
+ * If `console.debug` is not available, falls back
20750
+ * to `console.log`.
20751
+ *
20752
+ * @api public
20753
+ */
20754
+ exports.log = console.debug || console.log || (() => {});
20755
+
20756
+ /**
20757
+ * Save `namespaces`.
20758
+ *
20759
+ * @param {String} namespaces
20760
+ * @api private
20761
+ */
20762
+ function save(namespaces) {
20763
+ try {
20764
+ if (namespaces) {
20765
+ exports.storage.setItem('debug', namespaces);
20766
+ } else {
20767
+ exports.storage.removeItem('debug');
20768
+ }
20769
+ } catch (error) {
20770
+ // Swallow
20771
+ // XXX (@Qix-) should we be logging these?
20772
+ }
20773
+ }
20774
+
20775
+ /**
20776
+ * Load `namespaces`.
20777
+ *
20778
+ * @return {String} returns the previously persisted debug modes
20779
+ * @api private
20780
+ */
20781
+ function load() {
20782
+ let r;
20783
+ try {
20784
+ r = exports.storage.getItem('debug');
20785
+ } catch (error) {
20786
+ // Swallow
20787
+ // XXX (@Qix-) should we be logging these?
20788
+ }
20789
+
20790
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
20791
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
20792
+ r = process.env.DEBUG;
20793
+ }
20794
+
20795
+ return r;
20796
+ }
20797
+
20798
+ /**
20799
+ * Localstorage attempts to return the localstorage.
20800
+ *
20801
+ * This is necessary because safari throws
20802
+ * when a user disables cookies/localstorage
20803
+ * and you attempt to access it.
20804
+ *
20805
+ * @return {LocalStorage}
20806
+ * @api private
20807
+ */
20808
+
20809
+ function localstorage() {
20810
+ try {
20811
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
20812
+ // The Browser also has localStorage in the global context.
20813
+ return localStorage;
20814
+ } catch (error) {
20815
+ // Swallow
20816
+ // XXX (@Qix-) should we be logging these?
20817
+ }
20818
+ }
20819
+
20820
+ module.exports = requireCommon()(exports);
20821
+
20822
+ const {formatters} = module.exports;
20823
+
20824
+ /**
20825
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
20826
+ */
20827
+
20828
+ formatters.j = function (v) {
20829
+ try {
20830
+ return JSON.stringify(v);
20831
+ } catch (error) {
20832
+ return '[UnexpectedJSONParseError]: ' + error.message;
20833
+ }
20834
+ };
20835
+ } (browser, browser.exports));
20836
+ return browser.exports;
20837
+ }
20838
+
20839
+ var node = {exports: {}};
20840
+
20841
+ var hasFlag;
20842
+ var hasRequiredHasFlag;
20843
+
20844
+ function requireHasFlag () {
20845
+ if (hasRequiredHasFlag) return hasFlag;
20846
+ hasRequiredHasFlag = 1;
20847
+
20848
+ hasFlag = (flag, argv = process.argv) => {
20849
+ const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
20850
+ const position = argv.indexOf(prefix + flag);
20851
+ const terminatorPosition = argv.indexOf('--');
20852
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
20853
+ };
20854
+ return hasFlag;
20855
+ }
20856
+
20857
+ var supportsColor_1;
20858
+ var hasRequiredSupportsColor;
20859
+
20860
+ function requireSupportsColor () {
20861
+ if (hasRequiredSupportsColor) return supportsColor_1;
20862
+ hasRequiredSupportsColor = 1;
20863
+ const os = require$$0$1;
20864
+ const tty = require$$1;
20865
+ const hasFlag = requireHasFlag();
20866
+
20867
+ const {env} = process;
20868
+
20869
+ let forceColor;
20870
+ if (hasFlag('no-color') ||
20871
+ hasFlag('no-colors') ||
20872
+ hasFlag('color=false') ||
20873
+ hasFlag('color=never')) {
20874
+ forceColor = 0;
20875
+ } else if (hasFlag('color') ||
20876
+ hasFlag('colors') ||
20877
+ hasFlag('color=true') ||
20878
+ hasFlag('color=always')) {
20879
+ forceColor = 1;
20880
+ }
20881
+
20882
+ if ('FORCE_COLOR' in env) {
20883
+ if (env.FORCE_COLOR === 'true') {
20884
+ forceColor = 1;
20885
+ } else if (env.FORCE_COLOR === 'false') {
20886
+ forceColor = 0;
20887
+ } else {
20888
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
20889
+ }
20890
+ }
20891
+
20892
+ function translateLevel(level) {
20893
+ if (level === 0) {
20894
+ return false;
20895
+ }
20896
+
20897
+ return {
20898
+ level,
20899
+ hasBasic: true,
20900
+ has256: level >= 2,
20901
+ has16m: level >= 3
20902
+ };
20903
+ }
20904
+
20905
+ function supportsColor(haveStream, streamIsTTY) {
20906
+ if (forceColor === 0) {
20907
+ return 0;
20908
+ }
20909
+
20910
+ if (hasFlag('color=16m') ||
20911
+ hasFlag('color=full') ||
20912
+ hasFlag('color=truecolor')) {
20913
+ return 3;
20914
+ }
20915
+
20916
+ if (hasFlag('color=256')) {
20917
+ return 2;
20918
+ }
20919
+
20920
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
20921
+ return 0;
20922
+ }
20923
+
20924
+ const min = forceColor || 0;
20925
+
20926
+ if (env.TERM === 'dumb') {
20927
+ return min;
20928
+ }
20929
+
20930
+ if (process.platform === 'win32') {
20931
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
20932
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
20933
+ const osRelease = os.release().split('.');
20934
+ if (
20935
+ Number(osRelease[0]) >= 10 &&
20936
+ Number(osRelease[2]) >= 10586
20937
+ ) {
20938
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
20939
+ }
20940
+
20941
+ return 1;
20942
+ }
20943
+
20944
+ if ('CI' in env) {
20945
+ if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
20946
+ return 1;
20947
+ }
20948
+
20949
+ return min;
20950
+ }
20951
+
20952
+ if ('TEAMCITY_VERSION' in env) {
20953
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
20954
+ }
20955
+
20956
+ if (env.COLORTERM === 'truecolor') {
20957
+ return 3;
20958
+ }
20959
+
20960
+ if ('TERM_PROGRAM' in env) {
20961
+ const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
20962
+
20963
+ switch (env.TERM_PROGRAM) {
20964
+ case 'iTerm.app':
20965
+ return version >= 3 ? 3 : 2;
20966
+ case 'Apple_Terminal':
20967
+ return 2;
20968
+ // No default
20969
+ }
20970
+ }
20971
+
20972
+ if (/-256(color)?$/i.test(env.TERM)) {
20973
+ return 2;
20974
+ }
20975
+
20976
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
20977
+ return 1;
20978
+ }
20979
+
20980
+ if ('COLORTERM' in env) {
20981
+ return 1;
20982
+ }
20983
+
20984
+ return min;
20985
+ }
20986
+
20987
+ function getSupportLevel(stream) {
20988
+ const level = supportsColor(stream, stream && stream.isTTY);
20989
+ return translateLevel(level);
20990
+ }
20991
+
20992
+ supportsColor_1 = {
20993
+ supportsColor: getSupportLevel,
20994
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
20995
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
20996
+ };
20997
+ return supportsColor_1;
20998
+ }
20999
+
21000
+ /**
21001
+ * Module dependencies.
21002
+ */
21003
+
21004
+ var hasRequiredNode;
21005
+
21006
+ function requireNode () {
21007
+ if (hasRequiredNode) return node.exports;
21008
+ hasRequiredNode = 1;
21009
+ (function (module, exports) {
21010
+ const tty = require$$1;
21011
+ const util = require$$0;
21012
+
21013
+ /**
21014
+ * This is the Node.js implementation of `debug()`.
21015
+ */
21016
+
21017
+ exports.init = init;
21018
+ exports.log = log;
21019
+ exports.formatArgs = formatArgs;
21020
+ exports.save = save;
21021
+ exports.load = load;
21022
+ exports.useColors = useColors;
21023
+ exports.destroy = util.deprecate(
21024
+ () => {},
21025
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
21026
+ );
21027
+
21028
+ /**
21029
+ * Colors.
21030
+ */
21031
+
21032
+ exports.colors = [6, 2, 3, 4, 5, 1];
21033
+
21034
+ try {
21035
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
21036
+ // eslint-disable-next-line import/no-extraneous-dependencies
21037
+ const supportsColor = requireSupportsColor();
21038
+
21039
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
21040
+ exports.colors = [
21041
+ 20,
21042
+ 21,
21043
+ 26,
21044
+ 27,
21045
+ 32,
21046
+ 33,
21047
+ 38,
21048
+ 39,
21049
+ 40,
21050
+ 41,
21051
+ 42,
21052
+ 43,
21053
+ 44,
21054
+ 45,
21055
+ 56,
21056
+ 57,
21057
+ 62,
21058
+ 63,
21059
+ 68,
21060
+ 69,
21061
+ 74,
21062
+ 75,
21063
+ 76,
21064
+ 77,
21065
+ 78,
21066
+ 79,
21067
+ 80,
21068
+ 81,
21069
+ 92,
21070
+ 93,
21071
+ 98,
21072
+ 99,
21073
+ 112,
21074
+ 113,
21075
+ 128,
21076
+ 129,
21077
+ 134,
21078
+ 135,
21079
+ 148,
21080
+ 149,
21081
+ 160,
21082
+ 161,
21083
+ 162,
21084
+ 163,
21085
+ 164,
21086
+ 165,
21087
+ 166,
21088
+ 167,
21089
+ 168,
21090
+ 169,
21091
+ 170,
21092
+ 171,
21093
+ 172,
21094
+ 173,
21095
+ 178,
21096
+ 179,
21097
+ 184,
21098
+ 185,
21099
+ 196,
21100
+ 197,
21101
+ 198,
21102
+ 199,
21103
+ 200,
21104
+ 201,
21105
+ 202,
21106
+ 203,
21107
+ 204,
21108
+ 205,
21109
+ 206,
21110
+ 207,
21111
+ 208,
21112
+ 209,
21113
+ 214,
21114
+ 215,
21115
+ 220,
21116
+ 221
21117
+ ];
21118
+ }
21119
+ } catch (error) {
21120
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
21121
+ }
21122
+
21123
+ /**
21124
+ * Build up the default `inspectOpts` object from the environment variables.
21125
+ *
21126
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
21127
+ */
21128
+
21129
+ exports.inspectOpts = Object.keys(process.env).filter(key => {
21130
+ return /^debug_/i.test(key);
21131
+ }).reduce((obj, key) => {
21132
+ // Camel-case
21133
+ const prop = key
21134
+ .substring(6)
21135
+ .toLowerCase()
21136
+ .replace(/_([a-z])/g, (_, k) => {
21137
+ return k.toUpperCase();
21138
+ });
21139
+
21140
+ // Coerce string value into JS value
21141
+ let val = process.env[key];
21142
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
21143
+ val = true;
21144
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
21145
+ val = false;
21146
+ } else if (val === 'null') {
21147
+ val = null;
21148
+ } else {
21149
+ val = Number(val);
21150
+ }
21151
+
21152
+ obj[prop] = val;
21153
+ return obj;
21154
+ }, {});
21155
+
21156
+ /**
21157
+ * Is stdout a TTY? Colored output is enabled when `true`.
21158
+ */
21159
+
21160
+ function useColors() {
21161
+ return 'colors' in exports.inspectOpts ?
21162
+ Boolean(exports.inspectOpts.colors) :
21163
+ tty.isatty(process.stderr.fd);
21164
+ }
21165
+
21166
+ /**
21167
+ * Adds ANSI color escape codes if enabled.
21168
+ *
21169
+ * @api public
21170
+ */
21171
+
21172
+ function formatArgs(args) {
21173
+ const {namespace: name, useColors} = this;
21174
+
21175
+ if (useColors) {
21176
+ const c = this.color;
21177
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
21178
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
21179
+
21180
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
21181
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
21182
+ } else {
21183
+ args[0] = getDate() + name + ' ' + args[0];
21184
+ }
21185
+ }
21186
+
21187
+ function getDate() {
21188
+ if (exports.inspectOpts.hideDate) {
21189
+ return '';
21190
+ }
21191
+ return new Date().toISOString() + ' ';
21192
+ }
21193
+
21194
+ /**
21195
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
21196
+ */
21197
+
21198
+ function log(...args) {
21199
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
21200
+ }
21201
+
21202
+ /**
21203
+ * Save `namespaces`.
21204
+ *
21205
+ * @param {String} namespaces
21206
+ * @api private
21207
+ */
21208
+ function save(namespaces) {
21209
+ if (namespaces) {
21210
+ process.env.DEBUG = namespaces;
21211
+ } else {
21212
+ // If you set a process.env field to null or undefined, it gets cast to the
21213
+ // string 'null' or 'undefined'. Just delete instead.
21214
+ delete process.env.DEBUG;
21215
+ }
21216
+ }
21217
+
21218
+ /**
21219
+ * Load `namespaces`.
21220
+ *
21221
+ * @return {String} returns the previously persisted debug modes
21222
+ * @api private
21223
+ */
21224
+
21225
+ function load() {
21226
+ return process.env.DEBUG;
21227
+ }
21228
+
21229
+ /**
21230
+ * Init logic for `debug` instances.
21231
+ *
21232
+ * Create a new `inspectOpts` object in case `useColors` is set
21233
+ * differently for a particular `debug` instance.
21234
+ */
21235
+
21236
+ function init(debug) {
21237
+ debug.inspectOpts = {};
21238
+
21239
+ const keys = Object.keys(exports.inspectOpts);
21240
+ for (let i = 0; i < keys.length; i++) {
21241
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
21242
+ }
21243
+ }
21244
+
21245
+ module.exports = requireCommon()(exports);
21246
+
21247
+ const {formatters} = module.exports;
21248
+
21249
+ /**
21250
+ * Map %o to `util.inspect()`, all on a single line.
21251
+ */
21252
+
21253
+ formatters.o = function (v) {
21254
+ this.inspectOpts.colors = this.useColors;
21255
+ return util.inspect(v, this.inspectOpts)
21256
+ .split('\n')
21257
+ .map(str => str.trim())
21258
+ .join(' ');
21259
+ };
21260
+
21261
+ /**
21262
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
21263
+ */
21264
+
21265
+ formatters.O = function (v) {
21266
+ this.inspectOpts.colors = this.useColors;
21267
+ return util.inspect(v, this.inspectOpts);
21268
+ };
21269
+ } (node, node.exports));
21270
+ return node.exports;
21271
+ }
21272
+
21273
+ /**
21274
+ * Detect Electron renderer / nwjs process, which is node, but we should
21275
+ * treat as a browser.
21276
+ */
21277
+
21278
+ var hasRequiredSrc;
21279
+
21280
+ function requireSrc () {
21281
+ if (hasRequiredSrc) return src.exports;
21282
+ hasRequiredSrc = 1;
21283
+ if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
21284
+ src.exports = requireBrowser();
21285
+ } else {
21286
+ src.exports = requireNode();
21287
+ }
21288
+ return src.exports;
21289
+ }
21290
+
21291
+ var srcExports = requireSrc();
21292
+ var createDebug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
21293
+
21294
+ const logger = (namespace) => createDebug(`strapi-sdk-typescript:${namespace}`);
21295
+
21296
+ const log = logger('request');
20081
21297
  class Strapi {
20082
21298
  constructor(url, token) {
20083
21299
  this.url = url;
@@ -20207,14 +21423,19 @@ class Strapi {
20207
21423
  }));
20208
21424
  }
20209
21425
  async baseFetch(endpoint, params = {}) {
20210
- const response = await fetch(`${this.url}/api/${endpoint}`, _.merge({
21426
+ const mergedParams = _.merge({
20211
21427
  ...(this.token ? {
20212
21428
  headers: {
20213
21429
  Authorization: `Bearer ${this.token}`,
20214
21430
  }
20215
21431
  } : {}),
20216
- }, params));
20217
- return (await response.json());
21432
+ }, params);
21433
+ const response = await fetch(`${this.url}/api/${endpoint}`, mergedParams);
21434
+ const data = await response.json();
21435
+ log(mergedParams);
21436
+ log(response);
21437
+ log(data);
21438
+ return data;
20218
21439
  }
20219
21440
  }
20220
21441
 
@@ -20812,7 +22033,7 @@ function requireMain () {
20812
22033
  hasRequiredMain = 1;
20813
22034
  const fs = fs__default;
20814
22035
  const path = path__default;
20815
- const os = require$$2;
22036
+ const os = require$$0$1;
20816
22037
  const crypto = require$$3;
20817
22038
  const packageJson = require$$4;
20818
22039