@mx-space/api-client 1.7.1 → 1.8.0-alpha.1
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/controllers/activity.ts +40 -2
- package/dist/adaptors/axios.global.js +175 -128
- package/dist/adaptors/ky.global.js +17 -17
- package/dist/index.cjs +46 -0
- package/dist/index.d.cts +38 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.global.js +44 -0
- package/dist/index.js +45 -0
- package/models/activity.ts +8 -0
- package/models/comment.ts +2 -1
- package/package.json +6 -6
package/controllers/activity.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { IRequestAdapter } from '~/interfaces/adapter'
|
|
2
2
|
import type { IController } from '~/interfaces/controller'
|
|
3
3
|
import type { IRequestHandler } from '~/interfaces/request'
|
|
4
|
+
import type { ActivityPresence } from '~/models/activity'
|
|
5
|
+
import type { HTTPClient } from '../core'
|
|
4
6
|
|
|
5
7
|
import { autoBind } from '~/utils/auto-bind'
|
|
6
8
|
|
|
7
|
-
import { HTTPClient } from '../core'
|
|
8
|
-
|
|
9
9
|
declare module '../core/client' {
|
|
10
10
|
interface HTTPClient<
|
|
11
11
|
T extends IRequestAdapter = IRequestAdapter,
|
|
@@ -38,4 +38,42 @@ export class ActivityController<ResponseWrapper> implements IController {
|
|
|
38
38
|
},
|
|
39
39
|
})
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @support core >= 5.0.0
|
|
45
|
+
*/
|
|
46
|
+
getPresence(roomName: string) {
|
|
47
|
+
return this.proxy.presence.get<Record<string, ActivityPresence>>({
|
|
48
|
+
params: {
|
|
49
|
+
room_name: roomName,
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @support core >= 5.0.0
|
|
57
|
+
*/
|
|
58
|
+
updatePresence({
|
|
59
|
+
identity,
|
|
60
|
+
position,
|
|
61
|
+
roomName,
|
|
62
|
+
sid,
|
|
63
|
+
}: {
|
|
64
|
+
roomName: string
|
|
65
|
+
position: number
|
|
66
|
+
identity: string
|
|
67
|
+
sid: string
|
|
68
|
+
}) {
|
|
69
|
+
return this.proxy.presence.update.post({
|
|
70
|
+
data: {
|
|
71
|
+
identity,
|
|
72
|
+
position,
|
|
73
|
+
ts: Date.now(),
|
|
74
|
+
roomName,
|
|
75
|
+
sid,
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
}
|
|
41
79
|
}
|
|
@@ -10296,9 +10296,9 @@
|
|
|
10296
10296
|
}
|
|
10297
10297
|
});
|
|
10298
10298
|
|
|
10299
|
-
// ../../node_modules/.pnpm/follow-redirects@1.15.
|
|
10299
|
+
// ../../node_modules/.pnpm/follow-redirects@1.15.5_debug@4.3.4/node_modules/follow-redirects/debug.js
|
|
10300
10300
|
var require_debug = __commonJS({
|
|
10301
|
-
"../../node_modules/.pnpm/follow-redirects@1.15.
|
|
10301
|
+
"../../node_modules/.pnpm/follow-redirects@1.15.5_debug@4.3.4/node_modules/follow-redirects/debug.js"(exports, module) {
|
|
10302
10302
|
"use strict";
|
|
10303
10303
|
var debug;
|
|
10304
10304
|
module.exports = function() {
|
|
@@ -10317,9 +10317,9 @@
|
|
|
10317
10317
|
}
|
|
10318
10318
|
});
|
|
10319
10319
|
|
|
10320
|
-
// ../../node_modules/.pnpm/follow-redirects@1.15.
|
|
10320
|
+
// ../../node_modules/.pnpm/follow-redirects@1.15.5_debug@4.3.4/node_modules/follow-redirects/index.js
|
|
10321
10321
|
var require_follow_redirects = __commonJS({
|
|
10322
|
-
"../../node_modules/.pnpm/follow-redirects@1.15.
|
|
10322
|
+
"../../node_modules/.pnpm/follow-redirects@1.15.5_debug@4.3.4/node_modules/follow-redirects/index.js"(exports, module) {
|
|
10323
10323
|
"use strict";
|
|
10324
10324
|
var url2 = __require("url");
|
|
10325
10325
|
var URL2 = url2.URL;
|
|
@@ -10328,6 +10328,25 @@
|
|
|
10328
10328
|
var Writable = __require("stream").Writable;
|
|
10329
10329
|
var assert = __require("assert");
|
|
10330
10330
|
var debug = require_debug();
|
|
10331
|
+
var useNativeURL = false;
|
|
10332
|
+
try {
|
|
10333
|
+
assert(new URL2());
|
|
10334
|
+
} catch (error) {
|
|
10335
|
+
useNativeURL = error.code === "ERR_INVALID_URL";
|
|
10336
|
+
}
|
|
10337
|
+
var preservedUrlFields = [
|
|
10338
|
+
"auth",
|
|
10339
|
+
"host",
|
|
10340
|
+
"hostname",
|
|
10341
|
+
"href",
|
|
10342
|
+
"path",
|
|
10343
|
+
"pathname",
|
|
10344
|
+
"port",
|
|
10345
|
+
"protocol",
|
|
10346
|
+
"query",
|
|
10347
|
+
"search",
|
|
10348
|
+
"hash"
|
|
10349
|
+
];
|
|
10331
10350
|
var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
|
|
10332
10351
|
var eventHandlers = /* @__PURE__ */ Object.create(null);
|
|
10333
10352
|
events.forEach(function(event) {
|
|
@@ -10346,7 +10365,8 @@
|
|
|
10346
10365
|
);
|
|
10347
10366
|
var TooManyRedirectsError = createErrorType(
|
|
10348
10367
|
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
10349
|
-
"Maximum number of redirects exceeded"
|
|
10368
|
+
"Maximum number of redirects exceeded",
|
|
10369
|
+
RedirectionError
|
|
10350
10370
|
);
|
|
10351
10371
|
var MaxBodyLengthExceededError = createErrorType(
|
|
10352
10372
|
"ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
|
|
@@ -10372,7 +10392,11 @@
|
|
|
10372
10392
|
}
|
|
10373
10393
|
var self2 = this;
|
|
10374
10394
|
this._onNativeResponse = function(response) {
|
|
10375
|
-
|
|
10395
|
+
try {
|
|
10396
|
+
self2._processResponse(response);
|
|
10397
|
+
} catch (cause) {
|
|
10398
|
+
self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
|
|
10399
|
+
}
|
|
10376
10400
|
};
|
|
10377
10401
|
this._performRequest();
|
|
10378
10402
|
}
|
|
@@ -10531,8 +10555,7 @@
|
|
|
10531
10555
|
var protocol = this._options.protocol;
|
|
10532
10556
|
var nativeProtocol = this._options.nativeProtocols[protocol];
|
|
10533
10557
|
if (!nativeProtocol) {
|
|
10534
|
-
|
|
10535
|
-
return;
|
|
10558
|
+
throw new TypeError("Unsupported protocol " + protocol);
|
|
10536
10559
|
}
|
|
10537
10560
|
if (this._options.agents) {
|
|
10538
10561
|
var scheme = protocol.slice(0, -1);
|
|
@@ -10588,8 +10611,7 @@
|
|
|
10588
10611
|
destroyRequest(this._currentRequest);
|
|
10589
10612
|
response.destroy();
|
|
10590
10613
|
if (++this._redirectCount > this._options.maxRedirects) {
|
|
10591
|
-
|
|
10592
|
-
return;
|
|
10614
|
+
throw new TooManyRedirectsError();
|
|
10593
10615
|
}
|
|
10594
10616
|
var requestHeaders;
|
|
10595
10617
|
var beforeRedirect = this._options.beforeRedirect;
|
|
@@ -10610,21 +10632,14 @@
|
|
|
10610
10632
|
removeMatchingHeaders(/^content-/i, this._options.headers);
|
|
10611
10633
|
}
|
|
10612
10634
|
var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
|
|
10613
|
-
var currentUrlParts =
|
|
10635
|
+
var currentUrlParts = parseUrl(this._currentUrl);
|
|
10614
10636
|
var currentHost = currentHostHeader || currentUrlParts.host;
|
|
10615
10637
|
var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
|
|
10616
|
-
var redirectUrl;
|
|
10617
|
-
|
|
10618
|
-
redirectUrl = url2.resolve(currentUrl, location);
|
|
10619
|
-
} catch (cause) {
|
|
10620
|
-
this.emit("error", new RedirectionError({ cause }));
|
|
10621
|
-
return;
|
|
10622
|
-
}
|
|
10623
|
-
debug("redirecting to", redirectUrl);
|
|
10638
|
+
var redirectUrl = resolveUrl(location, currentUrl);
|
|
10639
|
+
debug("redirecting to", redirectUrl.href);
|
|
10624
10640
|
this._isRedirect = true;
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) {
|
|
10641
|
+
spreadUrlObject(redirectUrl, this._options);
|
|
10642
|
+
if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
|
|
10628
10643
|
removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
|
|
10629
10644
|
}
|
|
10630
10645
|
if (isFunction2(beforeRedirect)) {
|
|
@@ -10637,19 +10652,10 @@
|
|
|
10637
10652
|
method,
|
|
10638
10653
|
headers: requestHeaders
|
|
10639
10654
|
};
|
|
10640
|
-
|
|
10641
|
-
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
10642
|
-
} catch (err) {
|
|
10643
|
-
this.emit("error", err);
|
|
10644
|
-
return;
|
|
10645
|
-
}
|
|
10655
|
+
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
10646
10656
|
this._sanitizeOptions(this._options);
|
|
10647
10657
|
}
|
|
10648
|
-
|
|
10649
|
-
this._performRequest();
|
|
10650
|
-
} catch (cause) {
|
|
10651
|
-
this.emit("error", new RedirectionError({ cause }));
|
|
10652
|
-
}
|
|
10658
|
+
this._performRequest();
|
|
10653
10659
|
};
|
|
10654
10660
|
function wrap(protocols) {
|
|
10655
10661
|
var exports2 = {
|
|
@@ -10662,22 +10668,13 @@
|
|
|
10662
10668
|
var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
|
|
10663
10669
|
var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
|
|
10664
10670
|
function request(input, options, callback) {
|
|
10665
|
-
if (
|
|
10666
|
-
|
|
10667
|
-
|
|
10668
|
-
|
|
10669
|
-
} catch (err) {
|
|
10670
|
-
parsed = url2.parse(input);
|
|
10671
|
-
}
|
|
10672
|
-
if (!isString2(parsed.protocol)) {
|
|
10673
|
-
throw new InvalidUrlError({ input });
|
|
10674
|
-
}
|
|
10675
|
-
input = parsed;
|
|
10676
|
-
} else if (URL2 && input instanceof URL2) {
|
|
10677
|
-
input = urlToOptions(input);
|
|
10671
|
+
if (isURL(input)) {
|
|
10672
|
+
input = spreadUrlObject(input);
|
|
10673
|
+
} else if (isString2(input)) {
|
|
10674
|
+
input = spreadUrlObject(parseUrl(input));
|
|
10678
10675
|
} else {
|
|
10679
10676
|
callback = options;
|
|
10680
|
-
options = input;
|
|
10677
|
+
options = validateUrl(input);
|
|
10681
10678
|
input = { protocol };
|
|
10682
10679
|
}
|
|
10683
10680
|
if (isFunction2(options)) {
|
|
@@ -10710,23 +10707,43 @@
|
|
|
10710
10707
|
}
|
|
10711
10708
|
function noop2() {
|
|
10712
10709
|
}
|
|
10713
|
-
function
|
|
10714
|
-
var
|
|
10715
|
-
|
|
10716
|
-
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
)
|
|
10720
|
-
|
|
10721
|
-
|
|
10722
|
-
pathname: urlObject.pathname,
|
|
10723
|
-
path: urlObject.pathname + urlObject.search,
|
|
10724
|
-
href: urlObject.href
|
|
10725
|
-
};
|
|
10726
|
-
if (urlObject.port !== "") {
|
|
10727
|
-
options.port = Number(urlObject.port);
|
|
10710
|
+
function parseUrl(input) {
|
|
10711
|
+
var parsed;
|
|
10712
|
+
if (useNativeURL) {
|
|
10713
|
+
parsed = new URL2(input);
|
|
10714
|
+
} else {
|
|
10715
|
+
parsed = validateUrl(url2.parse(input));
|
|
10716
|
+
if (!isString2(parsed.protocol)) {
|
|
10717
|
+
throw new InvalidUrlError({ input });
|
|
10718
|
+
}
|
|
10728
10719
|
}
|
|
10729
|
-
return
|
|
10720
|
+
return parsed;
|
|
10721
|
+
}
|
|
10722
|
+
function resolveUrl(relative, base) {
|
|
10723
|
+
return useNativeURL ? new URL2(relative, base) : parseUrl(url2.resolve(base, relative));
|
|
10724
|
+
}
|
|
10725
|
+
function validateUrl(input) {
|
|
10726
|
+
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
10727
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
10728
|
+
}
|
|
10729
|
+
if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
|
|
10730
|
+
throw new InvalidUrlError({ input: input.href || input });
|
|
10731
|
+
}
|
|
10732
|
+
return input;
|
|
10733
|
+
}
|
|
10734
|
+
function spreadUrlObject(urlObject, target) {
|
|
10735
|
+
var spread3 = target || {};
|
|
10736
|
+
for (var key of preservedUrlFields) {
|
|
10737
|
+
spread3[key] = urlObject[key];
|
|
10738
|
+
}
|
|
10739
|
+
if (spread3.hostname.startsWith("[")) {
|
|
10740
|
+
spread3.hostname = spread3.hostname.slice(1, -1);
|
|
10741
|
+
}
|
|
10742
|
+
if (spread3.port !== "") {
|
|
10743
|
+
spread3.port = Number(spread3.port);
|
|
10744
|
+
}
|
|
10745
|
+
spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname;
|
|
10746
|
+
return spread3;
|
|
10730
10747
|
}
|
|
10731
10748
|
function removeMatchingHeaders(regex, headers) {
|
|
10732
10749
|
var lastValue;
|
|
@@ -10746,8 +10763,16 @@
|
|
|
10746
10763
|
this.message = this.cause ? message + ": " + this.cause.message : message;
|
|
10747
10764
|
}
|
|
10748
10765
|
CustomError.prototype = new (baseClass || Error)();
|
|
10749
|
-
CustomError.prototype
|
|
10750
|
-
|
|
10766
|
+
Object.defineProperties(CustomError.prototype, {
|
|
10767
|
+
constructor: {
|
|
10768
|
+
value: CustomError,
|
|
10769
|
+
enumerable: false
|
|
10770
|
+
},
|
|
10771
|
+
name: {
|
|
10772
|
+
value: "Error [" + code + "]",
|
|
10773
|
+
enumerable: false
|
|
10774
|
+
}
|
|
10775
|
+
});
|
|
10751
10776
|
return CustomError;
|
|
10752
10777
|
}
|
|
10753
10778
|
function destroyRequest(request, error) {
|
|
@@ -10771,19 +10796,22 @@
|
|
|
10771
10796
|
function isBuffer2(value) {
|
|
10772
10797
|
return typeof value === "object" && "length" in value;
|
|
10773
10798
|
}
|
|
10799
|
+
function isURL(value) {
|
|
10800
|
+
return URL2 && value instanceof URL2;
|
|
10801
|
+
}
|
|
10774
10802
|
module.exports = wrap({ http: http2, https: https2 });
|
|
10775
10803
|
module.exports.wrap = wrap;
|
|
10776
10804
|
}
|
|
10777
10805
|
});
|
|
10778
10806
|
|
|
10779
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
10807
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/bind.js
|
|
10780
10808
|
function bind(fn, thisArg) {
|
|
10781
10809
|
return function wrap() {
|
|
10782
10810
|
return fn.apply(thisArg, arguments);
|
|
10783
10811
|
};
|
|
10784
10812
|
}
|
|
10785
10813
|
|
|
10786
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
10814
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/utils.js
|
|
10787
10815
|
var { toString } = Object.prototype;
|
|
10788
10816
|
var { getPrototypeOf } = Object;
|
|
10789
10817
|
var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
|
|
@@ -11142,7 +11170,7 @@
|
|
|
11142
11170
|
isThenable
|
|
11143
11171
|
};
|
|
11144
11172
|
|
|
11145
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11173
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/AxiosError.js
|
|
11146
11174
|
function AxiosError(message, code, config, request, response) {
|
|
11147
11175
|
Error.call(this);
|
|
11148
11176
|
if (Error.captureStackTrace) {
|
|
@@ -11214,11 +11242,11 @@
|
|
|
11214
11242
|
};
|
|
11215
11243
|
var AxiosError_default = AxiosError;
|
|
11216
11244
|
|
|
11217
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11245
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/classes/FormData.js
|
|
11218
11246
|
var import_form_data = __toESM(require_form_data(), 1);
|
|
11219
11247
|
var FormData_default = import_form_data.default;
|
|
11220
11248
|
|
|
11221
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11249
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/toFormData.js
|
|
11222
11250
|
function isVisitable(thing) {
|
|
11223
11251
|
return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
|
|
11224
11252
|
}
|
|
@@ -11333,7 +11361,7 @@
|
|
|
11333
11361
|
}
|
|
11334
11362
|
var toFormData_default = toFormData;
|
|
11335
11363
|
|
|
11336
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11364
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
|
|
11337
11365
|
function encode(str) {
|
|
11338
11366
|
const charMap = {
|
|
11339
11367
|
"!": "%21",
|
|
@@ -11366,7 +11394,7 @@
|
|
|
11366
11394
|
};
|
|
11367
11395
|
var AxiosURLSearchParams_default = AxiosURLSearchParams;
|
|
11368
11396
|
|
|
11369
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11397
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/buildURL.js
|
|
11370
11398
|
function encode2(val) {
|
|
11371
11399
|
return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
11372
11400
|
}
|
|
@@ -11392,7 +11420,7 @@
|
|
|
11392
11420
|
return url2;
|
|
11393
11421
|
}
|
|
11394
11422
|
|
|
11395
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11423
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/InterceptorManager.js
|
|
11396
11424
|
var InterceptorManager = class {
|
|
11397
11425
|
constructor() {
|
|
11398
11426
|
this.handlers = [];
|
|
@@ -11456,18 +11484,18 @@
|
|
|
11456
11484
|
};
|
|
11457
11485
|
var InterceptorManager_default = InterceptorManager;
|
|
11458
11486
|
|
|
11459
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11487
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/defaults/transitional.js
|
|
11460
11488
|
var transitional_default = {
|
|
11461
11489
|
silentJSONParsing: true,
|
|
11462
11490
|
forcedJSONParsing: true,
|
|
11463
11491
|
clarifyTimeoutError: false
|
|
11464
11492
|
};
|
|
11465
11493
|
|
|
11466
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11494
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
11467
11495
|
var import_url = __toESM(__require("url"), 1);
|
|
11468
11496
|
var URLSearchParams_default = import_url.default.URLSearchParams;
|
|
11469
11497
|
|
|
11470
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11498
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/node/index.js
|
|
11471
11499
|
var node_default = {
|
|
11472
11500
|
isNode: true,
|
|
11473
11501
|
classes: {
|
|
@@ -11478,7 +11506,7 @@
|
|
|
11478
11506
|
protocols: ["http", "https", "file", "data"]
|
|
11479
11507
|
};
|
|
11480
11508
|
|
|
11481
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11509
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/common/utils.js
|
|
11482
11510
|
var utils_exports = {};
|
|
11483
11511
|
__export(utils_exports, {
|
|
11484
11512
|
hasBrowserEnv: () => hasBrowserEnv,
|
|
@@ -11494,13 +11522,13 @@
|
|
|
11494
11522
|
self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
|
|
11495
11523
|
})();
|
|
11496
11524
|
|
|
11497
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11525
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/platform/index.js
|
|
11498
11526
|
var platform_default = {
|
|
11499
11527
|
...utils_exports,
|
|
11500
11528
|
...node_default
|
|
11501
11529
|
};
|
|
11502
11530
|
|
|
11503
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11531
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
11504
11532
|
function toURLEncodedForm(data, options) {
|
|
11505
11533
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({
|
|
11506
11534
|
visitor: function(value, key, path, helpers) {
|
|
@@ -11513,7 +11541,7 @@
|
|
|
11513
11541
|
}, options));
|
|
11514
11542
|
}
|
|
11515
11543
|
|
|
11516
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11544
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToJSON.js
|
|
11517
11545
|
function parsePropPath(name) {
|
|
11518
11546
|
return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
|
|
11519
11547
|
return match[0] === "[]" ? "" : match[1] || match[0];
|
|
@@ -11534,6 +11562,8 @@
|
|
|
11534
11562
|
function formDataToJSON(formData) {
|
|
11535
11563
|
function buildPath(path, value, target, index) {
|
|
11536
11564
|
let name = path[index++];
|
|
11565
|
+
if (name === "__proto__")
|
|
11566
|
+
return true;
|
|
11537
11567
|
const isNumericKey = Number.isFinite(+name);
|
|
11538
11568
|
const isLast = index >= path.length;
|
|
11539
11569
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
@@ -11565,7 +11595,7 @@
|
|
|
11565
11595
|
}
|
|
11566
11596
|
var formDataToJSON_default = formDataToJSON;
|
|
11567
11597
|
|
|
11568
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11598
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/defaults/index.js
|
|
11569
11599
|
function stringifySafely(rawValue, parser, encoder) {
|
|
11570
11600
|
if (utils_default.isString(rawValue)) {
|
|
11571
11601
|
try {
|
|
@@ -11591,9 +11621,6 @@
|
|
|
11591
11621
|
}
|
|
11592
11622
|
const isFormData2 = utils_default.isFormData(data);
|
|
11593
11623
|
if (isFormData2) {
|
|
11594
|
-
if (!hasJSONContentType) {
|
|
11595
|
-
return data;
|
|
11596
|
-
}
|
|
11597
11624
|
return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
|
|
11598
11625
|
}
|
|
11599
11626
|
if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
|
|
@@ -11674,7 +11701,7 @@
|
|
|
11674
11701
|
});
|
|
11675
11702
|
var defaults_default = defaults;
|
|
11676
11703
|
|
|
11677
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11704
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/parseHeaders.js
|
|
11678
11705
|
var ignoreDuplicateOf = utils_default.toObjectSet([
|
|
11679
11706
|
"age",
|
|
11680
11707
|
"authorization",
|
|
@@ -11719,7 +11746,7 @@
|
|
|
11719
11746
|
return parsed;
|
|
11720
11747
|
};
|
|
11721
11748
|
|
|
11722
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11749
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/AxiosHeaders.js
|
|
11723
11750
|
var $internals = Symbol("internals");
|
|
11724
11751
|
function normalizeHeader(header) {
|
|
11725
11752
|
return header && String(header).trim().toLowerCase();
|
|
@@ -11937,7 +11964,7 @@
|
|
|
11937
11964
|
utils_default.freezeMethods(AxiosHeaders);
|
|
11938
11965
|
var AxiosHeaders_default = AxiosHeaders;
|
|
11939
11966
|
|
|
11940
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11967
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/transformData.js
|
|
11941
11968
|
function transformData(fns, response) {
|
|
11942
11969
|
const config = this || defaults_default;
|
|
11943
11970
|
const context = response || config;
|
|
@@ -11950,12 +11977,12 @@
|
|
|
11950
11977
|
return data;
|
|
11951
11978
|
}
|
|
11952
11979
|
|
|
11953
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11980
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/isCancel.js
|
|
11954
11981
|
function isCancel(value) {
|
|
11955
11982
|
return !!(value && value.__CANCEL__);
|
|
11956
11983
|
}
|
|
11957
11984
|
|
|
11958
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11985
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/CanceledError.js
|
|
11959
11986
|
function CanceledError(message, config, request) {
|
|
11960
11987
|
AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
|
|
11961
11988
|
this.name = "CanceledError";
|
|
@@ -11965,7 +11992,7 @@
|
|
|
11965
11992
|
});
|
|
11966
11993
|
var CanceledError_default = CanceledError;
|
|
11967
11994
|
|
|
11968
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
11995
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/settle.js
|
|
11969
11996
|
function settle(resolve, reject, response) {
|
|
11970
11997
|
const validateStatus2 = response.config.validateStatus;
|
|
11971
11998
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
@@ -11981,17 +12008,17 @@
|
|
|
11981
12008
|
}
|
|
11982
12009
|
}
|
|
11983
12010
|
|
|
11984
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12011
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isAbsoluteURL.js
|
|
11985
12012
|
function isAbsoluteURL(url2) {
|
|
11986
12013
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
|
|
11987
12014
|
}
|
|
11988
12015
|
|
|
11989
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12016
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/combineURLs.js
|
|
11990
12017
|
function combineURLs(baseURL, relativeURL) {
|
|
11991
|
-
return relativeURL ? baseURL.replace(
|
|
12018
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
11992
12019
|
}
|
|
11993
12020
|
|
|
11994
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12021
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/buildFullPath.js
|
|
11995
12022
|
function buildFullPath(baseURL, requestedURL) {
|
|
11996
12023
|
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
|
11997
12024
|
return combineURLs(baseURL, requestedURL);
|
|
@@ -11999,7 +12026,7 @@
|
|
|
11999
12026
|
return requestedURL;
|
|
12000
12027
|
}
|
|
12001
12028
|
|
|
12002
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12029
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
12003
12030
|
var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
|
|
12004
12031
|
var import_http = __toESM(__require("http"), 1);
|
|
12005
12032
|
var import_https = __toESM(__require("https"), 1);
|
|
@@ -12007,16 +12034,16 @@
|
|
|
12007
12034
|
var import_follow_redirects = __toESM(require_follow_redirects(), 1);
|
|
12008
12035
|
var import_zlib = __toESM(__require("zlib"), 1);
|
|
12009
12036
|
|
|
12010
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12011
|
-
var VERSION = "1.6.
|
|
12037
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/env/data.js
|
|
12038
|
+
var VERSION = "1.6.7";
|
|
12012
12039
|
|
|
12013
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12040
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/parseProtocol.js
|
|
12014
12041
|
function parseProtocol(url2) {
|
|
12015
12042
|
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
|
|
12016
12043
|
return match && match[1] || "";
|
|
12017
12044
|
}
|
|
12018
12045
|
|
|
12019
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12046
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/fromDataURI.js
|
|
12020
12047
|
var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
|
|
12021
12048
|
function fromDataURI(uri, asBlob, options) {
|
|
12022
12049
|
const _Blob = options && options.Blob || platform_default.classes.Blob;
|
|
@@ -12045,13 +12072,13 @@
|
|
|
12045
12072
|
throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
|
|
12046
12073
|
}
|
|
12047
12074
|
|
|
12048
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12075
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
12049
12076
|
var import_stream4 = __toESM(__require("stream"), 1);
|
|
12050
12077
|
|
|
12051
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12078
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
12052
12079
|
var import_stream = __toESM(__require("stream"), 1);
|
|
12053
12080
|
|
|
12054
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12081
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/throttle.js
|
|
12055
12082
|
function throttle(fn, freq) {
|
|
12056
12083
|
let timestamp = 0;
|
|
12057
12084
|
const threshold = 1e3 / freq;
|
|
@@ -12077,7 +12104,7 @@
|
|
|
12077
12104
|
}
|
|
12078
12105
|
var throttle_default = throttle;
|
|
12079
12106
|
|
|
12080
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12107
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/speedometer.js
|
|
12081
12108
|
function speedometer(samplesCount, min) {
|
|
12082
12109
|
samplesCount = samplesCount || 10;
|
|
12083
12110
|
const bytes = new Array(samplesCount);
|
|
@@ -12113,7 +12140,7 @@
|
|
|
12113
12140
|
}
|
|
12114
12141
|
var speedometer_default = speedometer;
|
|
12115
12142
|
|
|
12116
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12143
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
|
|
12117
12144
|
var kInternals = Symbol("internals");
|
|
12118
12145
|
var AxiosTransformStream = class extends import_stream.default.Transform {
|
|
12119
12146
|
constructor(options) {
|
|
@@ -12263,14 +12290,14 @@
|
|
|
12263
12290
|
};
|
|
12264
12291
|
var AxiosTransformStream_default = AxiosTransformStream;
|
|
12265
12292
|
|
|
12266
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12293
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
12267
12294
|
var import_events = __toESM(__require("events"), 1);
|
|
12268
12295
|
|
|
12269
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12296
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToStream.js
|
|
12270
12297
|
var import_util = __require("util");
|
|
12271
12298
|
var import_stream2 = __require("stream");
|
|
12272
12299
|
|
|
12273
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12300
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/readBlob.js
|
|
12274
12301
|
var { asyncIterator } = Symbol;
|
|
12275
12302
|
var readBlob = async function* (blob) {
|
|
12276
12303
|
if (blob.stream) {
|
|
@@ -12285,7 +12312,7 @@
|
|
|
12285
12312
|
};
|
|
12286
12313
|
var readBlob_default = readBlob;
|
|
12287
12314
|
|
|
12288
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12315
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/formDataToStream.js
|
|
12289
12316
|
var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
|
|
12290
12317
|
var textEncoder = new import_util.TextEncoder();
|
|
12291
12318
|
var CRLF = "\r\n";
|
|
@@ -12364,7 +12391,7 @@
|
|
|
12364
12391
|
};
|
|
12365
12392
|
var formDataToStream_default = formDataToStream;
|
|
12366
12393
|
|
|
12367
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12394
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
|
|
12368
12395
|
var import_stream3 = __toESM(__require("stream"), 1);
|
|
12369
12396
|
var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
|
|
12370
12397
|
__transform(chunk, encoding, callback) {
|
|
@@ -12386,7 +12413,7 @@
|
|
|
12386
12413
|
};
|
|
12387
12414
|
var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
|
|
12388
12415
|
|
|
12389
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12416
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/callbackify.js
|
|
12390
12417
|
var callbackify = (fn, reducer) => {
|
|
12391
12418
|
return utils_default.isAsyncFn(fn) ? function(...args) {
|
|
12392
12419
|
const cb = args.pop();
|
|
@@ -12401,7 +12428,7 @@
|
|
|
12401
12428
|
};
|
|
12402
12429
|
var callbackify_default = callbackify;
|
|
12403
12430
|
|
|
12404
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12431
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/http.js
|
|
12405
12432
|
var zlibOptions = {
|
|
12406
12433
|
flush: import_zlib.default.constants.Z_SYNC_FLUSH,
|
|
12407
12434
|
finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
|
|
@@ -12416,12 +12443,12 @@
|
|
|
12416
12443
|
var supportedProtocols = platform_default.protocols.map((protocol) => {
|
|
12417
12444
|
return protocol + ":";
|
|
12418
12445
|
});
|
|
12419
|
-
function dispatchBeforeRedirect(options) {
|
|
12446
|
+
function dispatchBeforeRedirect(options, responseDetails) {
|
|
12420
12447
|
if (options.beforeRedirects.proxy) {
|
|
12421
12448
|
options.beforeRedirects.proxy(options);
|
|
12422
12449
|
}
|
|
12423
12450
|
if (options.beforeRedirects.config) {
|
|
12424
|
-
options.beforeRedirects.config(options);
|
|
12451
|
+
options.beforeRedirects.config(options, responseDetails);
|
|
12425
12452
|
}
|
|
12426
12453
|
}
|
|
12427
12454
|
function setProxy(options, configProxy, location) {
|
|
@@ -12501,6 +12528,9 @@
|
|
|
12501
12528
|
const _lookup = callbackify_default(lookup, (value) => utils_default.isArray(value) ? value : [value]);
|
|
12502
12529
|
lookup = (hostname, opt, cb) => {
|
|
12503
12530
|
_lookup(hostname, opt, (err, arg0, arg1) => {
|
|
12531
|
+
if (err) {
|
|
12532
|
+
return cb(err);
|
|
12533
|
+
}
|
|
12504
12534
|
const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
|
|
12505
12535
|
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
|
|
12506
12536
|
});
|
|
@@ -12897,7 +12927,7 @@
|
|
|
12897
12927
|
});
|
|
12898
12928
|
};
|
|
12899
12929
|
|
|
12900
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12930
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/cookies.js
|
|
12901
12931
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
12902
12932
|
// Standard browser envs support document.cookie
|
|
12903
12933
|
{
|
|
@@ -12930,7 +12960,7 @@
|
|
|
12930
12960
|
}
|
|
12931
12961
|
);
|
|
12932
12962
|
|
|
12933
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
12963
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isURLSameOrigin.js
|
|
12934
12964
|
var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
|
|
12935
12965
|
// Standard browser envs have full support of the APIs needed to test
|
|
12936
12966
|
// whether the request URL is of the same origin as current location.
|
|
@@ -12971,7 +13001,7 @@
|
|
|
12971
13001
|
}()
|
|
12972
13002
|
);
|
|
12973
13003
|
|
|
12974
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13004
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/xhr.js
|
|
12975
13005
|
function progressEventReducer(listener, isDownloadStream) {
|
|
12976
13006
|
let bytesNotified = 0;
|
|
12977
13007
|
const _speedometer = speedometer_default(50, 250);
|
|
@@ -13141,7 +13171,7 @@
|
|
|
13141
13171
|
});
|
|
13142
13172
|
};
|
|
13143
13173
|
|
|
13144
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13174
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/adapters/adapters.js
|
|
13145
13175
|
var knownAdapters = {
|
|
13146
13176
|
http: http_default,
|
|
13147
13177
|
xhr: xhr_default
|
|
@@ -13194,7 +13224,7 @@
|
|
|
13194
13224
|
adapters: knownAdapters
|
|
13195
13225
|
};
|
|
13196
13226
|
|
|
13197
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13227
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/dispatchRequest.js
|
|
13198
13228
|
function throwIfCancellationRequested(config) {
|
|
13199
13229
|
if (config.cancelToken) {
|
|
13200
13230
|
config.cancelToken.throwIfRequested();
|
|
@@ -13239,7 +13269,7 @@
|
|
|
13239
13269
|
});
|
|
13240
13270
|
}
|
|
13241
13271
|
|
|
13242
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13272
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/mergeConfig.js
|
|
13243
13273
|
var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
|
|
13244
13274
|
function mergeConfig(config1, config2) {
|
|
13245
13275
|
config2 = config2 || {};
|
|
@@ -13319,7 +13349,7 @@
|
|
|
13319
13349
|
return config;
|
|
13320
13350
|
}
|
|
13321
13351
|
|
|
13322
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13352
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/validator.js
|
|
13323
13353
|
var validators = {};
|
|
13324
13354
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
|
|
13325
13355
|
validators[type] = function validator(thing) {
|
|
@@ -13377,7 +13407,7 @@
|
|
|
13377
13407
|
validators
|
|
13378
13408
|
};
|
|
13379
13409
|
|
|
13380
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13410
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/core/Axios.js
|
|
13381
13411
|
var validators2 = validator_default.validators;
|
|
13382
13412
|
var Axios = class {
|
|
13383
13413
|
constructor(instanceConfig) {
|
|
@@ -13395,7 +13425,24 @@
|
|
|
13395
13425
|
*
|
|
13396
13426
|
* @returns {Promise} The Promise to be fulfilled
|
|
13397
13427
|
*/
|
|
13398
|
-
request(configOrUrl, config) {
|
|
13428
|
+
async request(configOrUrl, config) {
|
|
13429
|
+
try {
|
|
13430
|
+
return await this._request(configOrUrl, config);
|
|
13431
|
+
} catch (err) {
|
|
13432
|
+
if (err instanceof Error) {
|
|
13433
|
+
let dummy;
|
|
13434
|
+
Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
|
|
13435
|
+
const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
|
|
13436
|
+
if (!err.stack) {
|
|
13437
|
+
err.stack = stack;
|
|
13438
|
+
} else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
|
|
13439
|
+
err.stack += "\n" + stack;
|
|
13440
|
+
}
|
|
13441
|
+
}
|
|
13442
|
+
throw err;
|
|
13443
|
+
}
|
|
13444
|
+
}
|
|
13445
|
+
_request(configOrUrl, config) {
|
|
13399
13446
|
if (typeof configOrUrl === "string") {
|
|
13400
13447
|
config = config || {};
|
|
13401
13448
|
config.url = configOrUrl;
|
|
@@ -13520,7 +13567,7 @@
|
|
|
13520
13567
|
});
|
|
13521
13568
|
var Axios_default = Axios;
|
|
13522
13569
|
|
|
13523
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13570
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/cancel/CancelToken.js
|
|
13524
13571
|
var CancelToken = class _CancelToken {
|
|
13525
13572
|
constructor(executor) {
|
|
13526
13573
|
if (typeof executor !== "function") {
|
|
@@ -13610,19 +13657,19 @@
|
|
|
13610
13657
|
};
|
|
13611
13658
|
var CancelToken_default = CancelToken;
|
|
13612
13659
|
|
|
13613
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13660
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/spread.js
|
|
13614
13661
|
function spread(callback) {
|
|
13615
13662
|
return function wrap(arr) {
|
|
13616
13663
|
return callback.apply(null, arr);
|
|
13617
13664
|
};
|
|
13618
13665
|
}
|
|
13619
13666
|
|
|
13620
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13667
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/isAxiosError.js
|
|
13621
13668
|
function isAxiosError(payload) {
|
|
13622
13669
|
return utils_default.isObject(payload) && payload.isAxiosError === true;
|
|
13623
13670
|
}
|
|
13624
13671
|
|
|
13625
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13672
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/helpers/HttpStatusCode.js
|
|
13626
13673
|
var HttpStatusCode = {
|
|
13627
13674
|
Continue: 100,
|
|
13628
13675
|
SwitchingProtocols: 101,
|
|
@@ -13693,7 +13740,7 @@
|
|
|
13693
13740
|
});
|
|
13694
13741
|
var HttpStatusCode_default = HttpStatusCode;
|
|
13695
13742
|
|
|
13696
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13743
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/lib/axios.js
|
|
13697
13744
|
function createInstance(defaultConfig) {
|
|
13698
13745
|
const context = new Axios_default(defaultConfig);
|
|
13699
13746
|
const instance = bind(Axios_default.prototype.request, context);
|
|
@@ -13726,7 +13773,7 @@
|
|
|
13726
13773
|
axios.default = axios;
|
|
13727
13774
|
var axios_default = axios;
|
|
13728
13775
|
|
|
13729
|
-
// ../../node_modules/.pnpm/axios@1.6.
|
|
13776
|
+
// ../../node_modules/.pnpm/axios@1.6.7/node_modules/axios/index.js
|
|
13730
13777
|
var {
|
|
13731
13778
|
Axios: Axios2,
|
|
13732
13779
|
AxiosError: AxiosError2,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
3
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/errors/HTTPError.js
|
|
4
4
|
var HTTPError = class extends Error {
|
|
5
5
|
constructor(response, request, options) {
|
|
6
6
|
const code = response.status || response.status === 0 ? response.status : "";
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
36
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/errors/TimeoutError.js
|
|
37
37
|
var TimeoutError = class extends Error {
|
|
38
38
|
constructor(request) {
|
|
39
39
|
super("Request timed out");
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
51
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/utils/is.js
|
|
52
52
|
var isObject = (value) => value !== null && typeof value === "object";
|
|
53
53
|
|
|
54
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
54
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/utils/merge.js
|
|
55
55
|
var validateAndMerge = (...sources) => {
|
|
56
56
|
for (const source of sources) {
|
|
57
57
|
if ((!isObject(source) || Array.isArray(source)) && source !== void 0) {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
return returnValue;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
101
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/core/constants.js
|
|
102
102
|
var supportsRequestStreams = (() => {
|
|
103
103
|
let duplexAccessed = false;
|
|
104
104
|
let hasContentType = false;
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
duplex: true
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
165
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/utils/normalize.js
|
|
166
166
|
var normalizeRequestMethod = (input) => requestMethods.includes(input) ? input.toUpperCase() : input;
|
|
167
167
|
var retryMethods = ["get", "put", "head", "delete", "options", "trace"];
|
|
168
168
|
var retryStatusCodes = [408, 413, 429, 500, 502, 503, 504];
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
199
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/utils/timeout.js
|
|
200
200
|
async function timeout(request, init, abortController, options) {
|
|
201
201
|
return new Promise((resolve, reject) => {
|
|
202
202
|
const timeoutId = setTimeout(() => {
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
214
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/utils/delay.js
|
|
215
215
|
async function delay(ms, { signal }) {
|
|
216
216
|
return new Promise((resolve, reject) => {
|
|
217
217
|
if (signal) {
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
232
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/utils/options.js
|
|
233
233
|
var findUnknownOptions = (request, options) => {
|
|
234
234
|
const unknownOptions = {};
|
|
235
235
|
for (const key in options) {
|
|
@@ -240,11 +240,11 @@
|
|
|
240
240
|
return unknownOptions;
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
243
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/core/Ky.js
|
|
244
244
|
var Ky = class _Ky {
|
|
245
245
|
static create(input, options) {
|
|
246
246
|
const ky2 = new _Ky(input, options);
|
|
247
|
-
const
|
|
247
|
+
const function_ = async () => {
|
|
248
248
|
if (typeof ky2._options.timeout === "number" && ky2._options.timeout > maxSafeTimeout) {
|
|
249
249
|
throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`);
|
|
250
250
|
}
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
return response;
|
|
277
277
|
};
|
|
278
278
|
const isRetriableMethod = ky2._options.retry.methods.includes(ky2.request.method.toLowerCase());
|
|
279
|
-
const result = isRetriableMethod ? ky2._retry(
|
|
279
|
+
const result = isRetriableMethod ? ky2._retry(function_) : function_();
|
|
280
280
|
for (const [type, mimeType] of Object.entries(responseTypes)) {
|
|
281
281
|
result[type] = async () => {
|
|
282
282
|
ky2.request.headers.set("accept", ky2.request.headers.get("accept") || mimeType);
|
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
}
|
|
396
396
|
_calculateRetryDelay(error) {
|
|
397
397
|
this._retryCount++;
|
|
398
|
-
if (this._retryCount
|
|
398
|
+
if (this._retryCount <= this._options.retry.limit && !(error instanceof TimeoutError)) {
|
|
399
399
|
if (error instanceof HTTPError) {
|
|
400
400
|
if (!this._options.retry.statusCodes.includes(error.response.status)) {
|
|
401
401
|
return 0;
|
|
@@ -428,9 +428,9 @@
|
|
|
428
428
|
}
|
|
429
429
|
return response;
|
|
430
430
|
}
|
|
431
|
-
async _retry(
|
|
431
|
+
async _retry(function_) {
|
|
432
432
|
try {
|
|
433
|
-
return await
|
|
433
|
+
return await function_();
|
|
434
434
|
} catch (error) {
|
|
435
435
|
const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);
|
|
436
436
|
if (ms !== 0 && this._retryCount > 0) {
|
|
@@ -446,7 +446,7 @@
|
|
|
446
446
|
return;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
return this._retry(
|
|
449
|
+
return this._retry(function_);
|
|
450
450
|
}
|
|
451
451
|
throw error;
|
|
452
452
|
}
|
|
@@ -512,7 +512,7 @@
|
|
|
512
512
|
}
|
|
513
513
|
};
|
|
514
514
|
|
|
515
|
-
// ../../node_modules/.pnpm/ky@1.
|
|
515
|
+
// ../../node_modules/.pnpm/ky@1.2.0/node_modules/ky/distribution/index.js
|
|
516
516
|
var createInstance = (defaults) => {
|
|
517
517
|
const ky2 = (input, options) => Ky.create(input, validateAndMerge(defaults, options));
|
|
518
518
|
for (const method of requestMethods) {
|
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(api_client_exports, {
|
|
|
25
25
|
AggregateController: () => AggregateController,
|
|
26
26
|
CategoryController: () => CategoryController,
|
|
27
27
|
CategoryType: () => CategoryType,
|
|
28
|
+
CollectionRefTypes: () => CollectionRefTypes,
|
|
28
29
|
CommentController: () => CommentController,
|
|
29
30
|
CommentState: () => CommentState,
|
|
30
31
|
EnumPageType: () => EnumPageType,
|
|
@@ -206,6 +207,37 @@ var ActivityController = class {
|
|
|
206
207
|
}
|
|
207
208
|
});
|
|
208
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
*
|
|
212
|
+
* @support core >= 5.0.0
|
|
213
|
+
*/
|
|
214
|
+
getPresence(roomName) {
|
|
215
|
+
return this.proxy.presence.get({
|
|
216
|
+
params: {
|
|
217
|
+
room_name: roomName
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
* @support core >= 5.0.0
|
|
224
|
+
*/
|
|
225
|
+
updatePresence({
|
|
226
|
+
identity,
|
|
227
|
+
position,
|
|
228
|
+
roomName,
|
|
229
|
+
sid
|
|
230
|
+
}) {
|
|
231
|
+
return this.proxy.presence.update.post({
|
|
232
|
+
data: {
|
|
233
|
+
identity,
|
|
234
|
+
position,
|
|
235
|
+
ts: Date.now(),
|
|
236
|
+
roomName,
|
|
237
|
+
sid
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}
|
|
209
241
|
};
|
|
210
242
|
|
|
211
243
|
// controllers/aggregate.ts
|
|
@@ -1079,6 +1111,19 @@ var TimelineType = /* @__PURE__ */ ((TimelineType2) => {
|
|
|
1079
1111
|
return TimelineType2;
|
|
1080
1112
|
})(TimelineType || {});
|
|
1081
1113
|
|
|
1114
|
+
// ../../apps/core/src/constants/db.constant.ts
|
|
1115
|
+
var POST_COLLECTION_NAME = "posts";
|
|
1116
|
+
var NOTE_COLLECTION_NAME = "notes";
|
|
1117
|
+
var PAGE_COLLECTION_NAME = "pages";
|
|
1118
|
+
var RECENTLY_COLLECTION_NAME = "recentlies";
|
|
1119
|
+
var CollectionRefTypes = /* @__PURE__ */ ((CollectionRefTypes2) => {
|
|
1120
|
+
CollectionRefTypes2[CollectionRefTypes2["Post"] = POST_COLLECTION_NAME] = "Post";
|
|
1121
|
+
CollectionRefTypes2[CollectionRefTypes2["Note"] = NOTE_COLLECTION_NAME] = "Note";
|
|
1122
|
+
CollectionRefTypes2[CollectionRefTypes2["Page"] = PAGE_COLLECTION_NAME] = "Page";
|
|
1123
|
+
CollectionRefTypes2[CollectionRefTypes2["Recently"] = RECENTLY_COLLECTION_NAME] = "Recently";
|
|
1124
|
+
return CollectionRefTypes2;
|
|
1125
|
+
})(CollectionRefTypes || {});
|
|
1126
|
+
|
|
1082
1127
|
// models/comment.ts
|
|
1083
1128
|
var CommentState = /* @__PURE__ */ ((CommentState2) => {
|
|
1084
1129
|
CommentState2[CommentState2["Unread"] = 0] = "Unread";
|
|
@@ -1150,6 +1195,7 @@ var api_client_default = createClient;
|
|
|
1150
1195
|
AggregateController,
|
|
1151
1196
|
CategoryController,
|
|
1152
1197
|
CategoryType,
|
|
1198
|
+
CollectionRefTypes,
|
|
1153
1199
|
CommentController,
|
|
1154
1200
|
CommentState,
|
|
1155
1201
|
EnumPageType,
|
package/dist/index.d.cts
CHANGED
|
@@ -116,6 +116,15 @@ declare class AckController<ResponseWrapper> implements IController {
|
|
|
116
116
|
}>;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
interface ActivityPresence {
|
|
120
|
+
operationTime: number;
|
|
121
|
+
updatedAt: number;
|
|
122
|
+
connectedAt: number;
|
|
123
|
+
identity: string;
|
|
124
|
+
roomName: string;
|
|
125
|
+
position: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
119
128
|
declare module '../core/client' {
|
|
120
129
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
121
130
|
activity: ActivityController<ResponseWrapper>;
|
|
@@ -138,6 +147,35 @@ declare class ActivityController<ResponseWrapper> implements IController {
|
|
|
138
147
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
139
148
|
data: never;
|
|
140
149
|
}>;
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @support core >= 5.0.0
|
|
153
|
+
*/
|
|
154
|
+
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
155
|
+
[key: string]: any;
|
|
156
|
+
data: Record<string, ActivityPresence>;
|
|
157
|
+
} : ResponseWrapper extends {
|
|
158
|
+
data: Record<string, ActivityPresence>;
|
|
159
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
160
|
+
data: Record<string, ActivityPresence>;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @support core >= 5.0.0
|
|
165
|
+
*/
|
|
166
|
+
updatePresence({ identity, position, roomName, sid, }: {
|
|
167
|
+
roomName: string;
|
|
168
|
+
position: number;
|
|
169
|
+
identity: string;
|
|
170
|
+
sid: string;
|
|
171
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
172
|
+
[key: string]: any;
|
|
173
|
+
data: unknown;
|
|
174
|
+
} : ResponseWrapper extends {
|
|
175
|
+
data: unknown;
|
|
176
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
177
|
+
data: unknown;
|
|
178
|
+
}>;
|
|
141
179
|
}
|
|
142
180
|
|
|
143
181
|
type SortOrder = 'asc' | 'desc';
|
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,15 @@ declare class AckController<ResponseWrapper> implements IController {
|
|
|
116
116
|
}>;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
interface ActivityPresence {
|
|
120
|
+
operationTime: number;
|
|
121
|
+
updatedAt: number;
|
|
122
|
+
connectedAt: number;
|
|
123
|
+
identity: string;
|
|
124
|
+
roomName: string;
|
|
125
|
+
position: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
119
128
|
declare module '@mx-space/api-client' {
|
|
120
129
|
interface HTTPClient<T extends IRequestAdapter = IRequestAdapter, ResponseWrapper = unknown> {
|
|
121
130
|
activity: ActivityController<ResponseWrapper>;
|
|
@@ -138,6 +147,35 @@ declare class ActivityController<ResponseWrapper> implements IController {
|
|
|
138
147
|
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
139
148
|
data: never;
|
|
140
149
|
}>;
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @support core >= 5.0.0
|
|
153
|
+
*/
|
|
154
|
+
getPresence(roomName: string): RequestProxyResult<Record<string, ActivityPresence>, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
155
|
+
[key: string]: any;
|
|
156
|
+
data: Record<string, ActivityPresence>;
|
|
157
|
+
} : ResponseWrapper extends {
|
|
158
|
+
data: Record<string, ActivityPresence>;
|
|
159
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
160
|
+
data: Record<string, ActivityPresence>;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
* @support core >= 5.0.0
|
|
165
|
+
*/
|
|
166
|
+
updatePresence({ identity, position, roomName, sid, }: {
|
|
167
|
+
roomName: string;
|
|
168
|
+
position: number;
|
|
169
|
+
identity: string;
|
|
170
|
+
sid: string;
|
|
171
|
+
}): RequestProxyResult<unknown, ResponseWrapper, ResponseWrapper extends unknown ? {
|
|
172
|
+
[key: string]: any;
|
|
173
|
+
data: unknown;
|
|
174
|
+
} : ResponseWrapper extends {
|
|
175
|
+
data: unknown;
|
|
176
|
+
} ? ResponseWrapper : Omit<ResponseWrapper, "data"> & {
|
|
177
|
+
data: unknown;
|
|
178
|
+
}>;
|
|
141
179
|
}
|
|
142
180
|
|
|
143
181
|
type SortOrder = 'asc' | 'desc';
|
package/dist/index.global.js
CHANGED
|
@@ -143,6 +143,37 @@
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
*
|
|
148
|
+
* @support core >= 5.0.0
|
|
149
|
+
*/
|
|
150
|
+
getPresence(roomName) {
|
|
151
|
+
return this.proxy.presence.get({
|
|
152
|
+
params: {
|
|
153
|
+
room_name: roomName
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
*
|
|
159
|
+
* @support core >= 5.0.0
|
|
160
|
+
*/
|
|
161
|
+
updatePresence({
|
|
162
|
+
identity,
|
|
163
|
+
position,
|
|
164
|
+
roomName,
|
|
165
|
+
sid
|
|
166
|
+
}) {
|
|
167
|
+
return this.proxy.presence.update.post({
|
|
168
|
+
data: {
|
|
169
|
+
identity,
|
|
170
|
+
position,
|
|
171
|
+
ts: Date.now(),
|
|
172
|
+
roomName,
|
|
173
|
+
sid
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
146
177
|
};
|
|
147
178
|
|
|
148
179
|
// controllers/aggregate.ts
|
|
@@ -1016,6 +1047,19 @@
|
|
|
1016
1047
|
return TimelineType2;
|
|
1017
1048
|
})(TimelineType || {});
|
|
1018
1049
|
|
|
1050
|
+
// ../../apps/core/src/constants/db.constant.ts
|
|
1051
|
+
var POST_COLLECTION_NAME = "posts";
|
|
1052
|
+
var NOTE_COLLECTION_NAME = "notes";
|
|
1053
|
+
var PAGE_COLLECTION_NAME = "pages";
|
|
1054
|
+
var RECENTLY_COLLECTION_NAME = "recentlies";
|
|
1055
|
+
var CollectionRefTypes = /* @__PURE__ */ ((CollectionRefTypes2) => {
|
|
1056
|
+
CollectionRefTypes2[CollectionRefTypes2["Post"] = POST_COLLECTION_NAME] = "Post";
|
|
1057
|
+
CollectionRefTypes2[CollectionRefTypes2["Note"] = NOTE_COLLECTION_NAME] = "Note";
|
|
1058
|
+
CollectionRefTypes2[CollectionRefTypes2["Page"] = PAGE_COLLECTION_NAME] = "Page";
|
|
1059
|
+
CollectionRefTypes2[CollectionRefTypes2["Recently"] = RECENTLY_COLLECTION_NAME] = "Recently";
|
|
1060
|
+
return CollectionRefTypes2;
|
|
1061
|
+
})(CollectionRefTypes || {});
|
|
1062
|
+
|
|
1019
1063
|
// models/comment.ts
|
|
1020
1064
|
var CommentState = /* @__PURE__ */ ((CommentState2) => {
|
|
1021
1065
|
CommentState2[CommentState2["Unread"] = 0] = "Unread";
|
package/dist/index.js
CHANGED
|
@@ -141,6 +141,37 @@ var ActivityController = class {
|
|
|
141
141
|
}
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
*
|
|
146
|
+
* @support core >= 5.0.0
|
|
147
|
+
*/
|
|
148
|
+
getPresence(roomName) {
|
|
149
|
+
return this.proxy.presence.get({
|
|
150
|
+
params: {
|
|
151
|
+
room_name: roomName
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
*
|
|
157
|
+
* @support core >= 5.0.0
|
|
158
|
+
*/
|
|
159
|
+
updatePresence({
|
|
160
|
+
identity,
|
|
161
|
+
position,
|
|
162
|
+
roomName,
|
|
163
|
+
sid
|
|
164
|
+
}) {
|
|
165
|
+
return this.proxy.presence.update.post({
|
|
166
|
+
data: {
|
|
167
|
+
identity,
|
|
168
|
+
position,
|
|
169
|
+
ts: Date.now(),
|
|
170
|
+
roomName,
|
|
171
|
+
sid
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
144
175
|
};
|
|
145
176
|
|
|
146
177
|
// controllers/aggregate.ts
|
|
@@ -1014,6 +1045,19 @@ var TimelineType = /* @__PURE__ */ ((TimelineType2) => {
|
|
|
1014
1045
|
return TimelineType2;
|
|
1015
1046
|
})(TimelineType || {});
|
|
1016
1047
|
|
|
1048
|
+
// ../../apps/core/src/constants/db.constant.ts
|
|
1049
|
+
var POST_COLLECTION_NAME = "posts";
|
|
1050
|
+
var NOTE_COLLECTION_NAME = "notes";
|
|
1051
|
+
var PAGE_COLLECTION_NAME = "pages";
|
|
1052
|
+
var RECENTLY_COLLECTION_NAME = "recentlies";
|
|
1053
|
+
var CollectionRefTypes = /* @__PURE__ */ ((CollectionRefTypes2) => {
|
|
1054
|
+
CollectionRefTypes2[CollectionRefTypes2["Post"] = POST_COLLECTION_NAME] = "Post";
|
|
1055
|
+
CollectionRefTypes2[CollectionRefTypes2["Note"] = NOTE_COLLECTION_NAME] = "Note";
|
|
1056
|
+
CollectionRefTypes2[CollectionRefTypes2["Page"] = PAGE_COLLECTION_NAME] = "Page";
|
|
1057
|
+
CollectionRefTypes2[CollectionRefTypes2["Recently"] = RECENTLY_COLLECTION_NAME] = "Recently";
|
|
1058
|
+
return CollectionRefTypes2;
|
|
1059
|
+
})(CollectionRefTypes || {});
|
|
1060
|
+
|
|
1017
1061
|
// models/comment.ts
|
|
1018
1062
|
var CommentState = /* @__PURE__ */ ((CommentState2) => {
|
|
1019
1063
|
CommentState2[CommentState2["Unread"] = 0] = "Unread";
|
|
@@ -1084,6 +1128,7 @@ export {
|
|
|
1084
1128
|
AggregateController,
|
|
1085
1129
|
CategoryController,
|
|
1086
1130
|
CategoryType,
|
|
1131
|
+
CollectionRefTypes,
|
|
1087
1132
|
CommentController,
|
|
1088
1133
|
CommentState,
|
|
1089
1134
|
EnumPageType,
|
package/models/comment.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { CollectionRefTypes } from '@core/constants/db.constant'
|
|
2
1
|
import type { BaseModel } from './base'
|
|
3
2
|
import type { CategoryModel } from './category'
|
|
4
3
|
|
|
4
|
+
import { CollectionRefTypes } from '@core/constants/db.constant'
|
|
5
|
+
|
|
5
6
|
export { CollectionRefTypes }
|
|
6
7
|
export interface CommentModel extends BaseModel {
|
|
7
8
|
refType: CollectionRefTypes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-alpha.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A api client for mx-space server@next",
|
|
6
6
|
"author": "Innei",
|
|
@@ -48,16 +48,16 @@
|
|
|
48
48
|
"@types/express": "4.17.21",
|
|
49
49
|
"@types/lodash": "4.14.202",
|
|
50
50
|
"abort-controller": "3.0.0",
|
|
51
|
-
"axios": "^1.6.
|
|
52
|
-
"camelcase-keys": "^9.1.
|
|
51
|
+
"axios": "^1.6.7",
|
|
52
|
+
"camelcase-keys": "^9.1.3",
|
|
53
53
|
"cors": "2.8.5",
|
|
54
54
|
"express": "4.18.2",
|
|
55
55
|
"form-data": "4.0.0",
|
|
56
|
-
"ky": "1.
|
|
56
|
+
"ky": "1.2.0",
|
|
57
57
|
"lodash": "4.17.21",
|
|
58
58
|
"tsup": "8.0.1",
|
|
59
59
|
"umi-request": "1.4.0",
|
|
60
|
-
"vite": "^5.0.
|
|
60
|
+
"vite": "^5.0.12",
|
|
61
61
|
"vitest": "^1.0.4"
|
|
62
62
|
}
|
|
63
|
-
}
|
|
63
|
+
}
|