@mx-space/api-client 1.8.0-beta.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/controllers/activity.ts +1 -1
- package/dist/adaptors/axios.global.js +64 -64
- package/dist/adaptors/umi-request.global.js +227 -113
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.global.js +1 -1
- package/dist/index.js +1 -1
- package/index.ts +1 -0
- package/models/activity.ts +3 -2
- package/package.json +4 -5
- package/dist/adaptors/ky.cjs +0 -98
- package/dist/adaptors/ky.d.cts +0 -26
- package/dist/adaptors/ky.d.ts +0 -26
- package/dist/adaptors/ky.global.js +0 -590
- package/dist/adaptors/ky.js +0 -62
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -196,11 +196,12 @@ interface TagModel {
|
|
|
196
196
|
|
|
197
197
|
interface ActivityPresence {
|
|
198
198
|
operationTime: number;
|
|
199
|
-
updatedAt: number;
|
|
200
|
-
connectedAt: number;
|
|
201
199
|
identity: string;
|
|
202
200
|
roomName: string;
|
|
203
201
|
position: number;
|
|
202
|
+
joinedAt: number;
|
|
203
|
+
connectedAt: number;
|
|
204
|
+
updatedAt: number;
|
|
204
205
|
displayName?: string;
|
|
205
206
|
}
|
|
206
207
|
interface RoomOmittedNote {
|
|
@@ -1607,4 +1608,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1607
1608
|
*/
|
|
1608
1609
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1609
1610
|
|
|
1610
|
-
export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
1611
|
+
export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, IRequestAdapter, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.d.ts
CHANGED
|
@@ -196,11 +196,12 @@ interface TagModel {
|
|
|
196
196
|
|
|
197
197
|
interface ActivityPresence {
|
|
198
198
|
operationTime: number;
|
|
199
|
-
updatedAt: number;
|
|
200
|
-
connectedAt: number;
|
|
201
199
|
identity: string;
|
|
202
200
|
roomName: string;
|
|
203
201
|
position: number;
|
|
202
|
+
joinedAt: number;
|
|
203
|
+
connectedAt: number;
|
|
204
|
+
updatedAt: number;
|
|
204
205
|
displayName?: string;
|
|
205
206
|
}
|
|
206
207
|
interface RoomOmittedNote {
|
|
@@ -1607,4 +1608,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1607
1608
|
*/
|
|
1608
1609
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1609
1610
|
|
|
1610
|
-
export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
|
1611
|
+
export { AckController, ActivityController, type ActivityPresence, AdminExtraModel, AggregateController, type AggregateRoot, type AggregateRootWithTheme, type AggregateStat, type AggregateTop, type AggregateTopNote, type AggregateTopPost, AlgoliaSearchOptionsModel, BackupOptionsModel, BaiduSearchOptionsModel, type BaseCommentIndexModel, type BaseModel, CategoryController, type CategoryEntries, type CategoryModel, CategoryType, type CategoryWithChildrenModel, CollectionRefTypes, CommentController, type CommentDto, type CommentModel, CommentOptionsModel, type CommentRef, CommentState, type Coordinate, type Count, EnumPageType, HTTPClient, type IConfig, type IConfigKeys, IRequestAdapter, type Image, LinkController, type LinkModel, LinkState, LinkType, MailOptionsModel, type ModelWithLiked, NoteController, type NoteModel, type NoteMusicRecord, type NoteWrappedPayload, type NoteWrappedWithLikedPayload, PageController, type PageModel, type Pager, type PaginateResult, PostController, type PostModel, ProjectController, type ProjectModel, RecentlyAttitudeEnum, RecentlyAttitudeResultEnum, RecentlyController, type RecentlyModel, type RecentlyRefType, RecentlyRefTypes, RequestError, type RoomOmittedNote, type RoomOmittedPage, type RoomOmittedPost, type RoomsData, SayController, type SayModel, SearchController, SeoOptionModel, ServerlessController, SnippetController, type SnippetModel, SnippetType, SubscribeAllBit, SubscribeController, SubscribeNoteCreateBit, SubscribePostCreateBit, SubscribeRecentCreateBit, SubscribeSayCreateBit, type SubscribeType, SubscribeTypeToBitMap, type TLogin, type TagModel, type TextBaseModel, type TimelineData, TimelineType, TopicController, type TopicModel, type Url, UrlOptionModel, UserController, type UserModel, allControllerNames, allControllers, createClient, createClient as default, camelcaseKeys as simpleCamelcaseKeys };
|
package/dist/index.global.js
CHANGED
package/dist/index.js
CHANGED
package/index.ts
CHANGED
package/models/activity.ts
CHANGED
|
@@ -2,11 +2,12 @@ import type { CategoryModel } from './category'
|
|
|
2
2
|
|
|
3
3
|
export interface ActivityPresence {
|
|
4
4
|
operationTime: number
|
|
5
|
-
updatedAt: number
|
|
6
|
-
connectedAt: number
|
|
7
5
|
identity: string
|
|
8
6
|
roomName: string
|
|
9
7
|
position: number
|
|
8
|
+
joinedAt: number
|
|
9
|
+
connectedAt: number
|
|
10
|
+
updatedAt: number
|
|
10
11
|
|
|
11
12
|
displayName?: string
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.8.0
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A api client for mx-space server@next",
|
|
6
6
|
"author": "Innei",
|
|
@@ -46,18 +46,17 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/cors": "2.8.17",
|
|
48
48
|
"@types/express": "4.17.21",
|
|
49
|
-
"@types/lodash": "4.
|
|
49
|
+
"@types/lodash": "4.17.0",
|
|
50
50
|
"abort-controller": "3.0.0",
|
|
51
51
|
"axios": "^1.6.7",
|
|
52
52
|
"camelcase-keys": "^9.1.3",
|
|
53
53
|
"cors": "2.8.5",
|
|
54
|
-
"express": "4.
|
|
54
|
+
"express": "4.19.1",
|
|
55
55
|
"form-data": "4.0.0",
|
|
56
|
-
"ky": "1.2.0",
|
|
57
56
|
"lodash": "4.17.21",
|
|
58
57
|
"tsup": "8.0.2",
|
|
59
58
|
"umi-request": "1.4.0",
|
|
60
|
-
"vite": "^5.
|
|
59
|
+
"vite": "^5.1.3",
|
|
61
60
|
"vitest": "^1.0.4"
|
|
62
61
|
}
|
|
63
62
|
}
|
package/dist/adaptors/ky.cjs
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// adaptors/ky.ts
|
|
31
|
-
var ky_exports = {};
|
|
32
|
-
__export(ky_exports, {
|
|
33
|
-
createKyAdaptor: () => createKyAdaptor,
|
|
34
|
-
default: () => ky_default,
|
|
35
|
-
defaultKyAdaptor: () => defaultKyAdaptor
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(ky_exports);
|
|
38
|
-
var import_ky = __toESM(require("ky"), 1);
|
|
39
|
-
var $http = /* @__PURE__ */ import_ky.default.create({});
|
|
40
|
-
var getDataFromKyResponse = async (response) => {
|
|
41
|
-
const res = await response;
|
|
42
|
-
const isJsonType = res.headers.get("content-type")?.includes("application/json");
|
|
43
|
-
const json = isJsonType ? await res.clone().json() : null;
|
|
44
|
-
const result = {
|
|
45
|
-
...res,
|
|
46
|
-
data: json ?? await res.clone().text()
|
|
47
|
-
};
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
var createKyAdaptor = (ky2) => {
|
|
51
|
-
const adaptor = Object.preventExtensions({
|
|
52
|
-
get default() {
|
|
53
|
-
return ky2;
|
|
54
|
-
},
|
|
55
|
-
responseWrapper: {},
|
|
56
|
-
get(url, options) {
|
|
57
|
-
return getDataFromKyResponse(ky2.get(url, options));
|
|
58
|
-
},
|
|
59
|
-
async post(url, options) {
|
|
60
|
-
const data = options.data;
|
|
61
|
-
delete options.data;
|
|
62
|
-
const kyOptions = {
|
|
63
|
-
...options,
|
|
64
|
-
json: data
|
|
65
|
-
};
|
|
66
|
-
return getDataFromKyResponse(ky2.post(url, kyOptions));
|
|
67
|
-
},
|
|
68
|
-
put(url, options) {
|
|
69
|
-
const data = options.data;
|
|
70
|
-
delete options.data;
|
|
71
|
-
const kyOptions = {
|
|
72
|
-
...options,
|
|
73
|
-
json: data
|
|
74
|
-
};
|
|
75
|
-
return getDataFromKyResponse(ky2.put(url, kyOptions));
|
|
76
|
-
},
|
|
77
|
-
patch(url, options) {
|
|
78
|
-
const data = options.data;
|
|
79
|
-
delete options.data;
|
|
80
|
-
const kyOptions = {
|
|
81
|
-
...options,
|
|
82
|
-
json: data
|
|
83
|
-
};
|
|
84
|
-
return getDataFromKyResponse(ky2.patch(url, kyOptions));
|
|
85
|
-
},
|
|
86
|
-
delete(url, options) {
|
|
87
|
-
return getDataFromKyResponse(ky2.delete(url, options));
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
return adaptor;
|
|
91
|
-
};
|
|
92
|
-
var defaultKyAdaptor = createKyAdaptor($http);
|
|
93
|
-
var ky_default = defaultKyAdaptor;
|
|
94
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
-
0 && (module.exports = {
|
|
96
|
-
createKyAdaptor,
|
|
97
|
-
defaultKyAdaptor
|
|
98
|
-
});
|
package/dist/adaptors/ky.d.cts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { R as RequestOptions, a as IAdaptorRequestResponseType } from '../adapter-29diOMCR.cjs';
|
|
2
|
-
import { ResponsePromise } from 'ky';
|
|
3
|
-
import { KyInstance } from 'ky/distribution/types/ky';
|
|
4
|
-
|
|
5
|
-
declare const createKyAdaptor: (ky: KyInstance) => Readonly<{
|
|
6
|
-
responseWrapper: ResponsePromise;
|
|
7
|
-
} & {
|
|
8
|
-
default: KyInstance;
|
|
9
|
-
get<P = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P>;
|
|
10
|
-
post<P_1 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_1>;
|
|
11
|
-
patch<P_2 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_2>;
|
|
12
|
-
delete<P_3 = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P_3>;
|
|
13
|
-
put<P_4 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_4>;
|
|
14
|
-
}>;
|
|
15
|
-
declare const defaultKyAdaptor: Readonly<{
|
|
16
|
-
responseWrapper: ResponsePromise;
|
|
17
|
-
} & {
|
|
18
|
-
default: KyInstance;
|
|
19
|
-
get<P = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P>;
|
|
20
|
-
post<P_1 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_1>;
|
|
21
|
-
patch<P_2 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_2>;
|
|
22
|
-
delete<P_3 = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P_3>;
|
|
23
|
-
put<P_4 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_4>;
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
export { createKyAdaptor, defaultKyAdaptor as default, defaultKyAdaptor };
|
package/dist/adaptors/ky.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { R as RequestOptions, a as IAdaptorRequestResponseType } from '../adapter-29diOMCR.js';
|
|
2
|
-
import { ResponsePromise } from 'ky';
|
|
3
|
-
import { KyInstance } from 'ky/distribution/types/ky';
|
|
4
|
-
|
|
5
|
-
declare const createKyAdaptor: (ky: KyInstance) => Readonly<{
|
|
6
|
-
responseWrapper: ResponsePromise;
|
|
7
|
-
} & {
|
|
8
|
-
default: KyInstance;
|
|
9
|
-
get<P = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P>;
|
|
10
|
-
post<P_1 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_1>;
|
|
11
|
-
patch<P_2 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_2>;
|
|
12
|
-
delete<P_3 = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P_3>;
|
|
13
|
-
put<P_4 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_4>;
|
|
14
|
-
}>;
|
|
15
|
-
declare const defaultKyAdaptor: Readonly<{
|
|
16
|
-
responseWrapper: ResponsePromise;
|
|
17
|
-
} & {
|
|
18
|
-
default: KyInstance;
|
|
19
|
-
get<P = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P>;
|
|
20
|
-
post<P_1 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_1>;
|
|
21
|
-
patch<P_2 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_2>;
|
|
22
|
-
delete<P_3 = unknown>(url: string, options?: Omit<RequestOptions, "data"> | undefined): IAdaptorRequestResponseType<P_3>;
|
|
23
|
-
put<P_4 = unknown>(url: string, options: Partial<RequestOptions>): IAdaptorRequestResponseType<P_4>;
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
export { createKyAdaptor, defaultKyAdaptor as default, defaultKyAdaptor };
|