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

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