@mx-space/api-client 1.8.0-beta.1 → 1.8.1-alpha.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 +4 -3
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.global.js +4 -3
- package/dist/index.js +4 -3
- package/index.ts +1 -0
- package/interfaces/client.ts +5 -0
- 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
|
@@ -202,7 +202,7 @@ var ActivityController = class {
|
|
|
202
202
|
likeIt(type, id) {
|
|
203
203
|
return this.proxy.like.post({
|
|
204
204
|
data: {
|
|
205
|
-
type,
|
|
205
|
+
type: type.toLowerCase(),
|
|
206
206
|
id
|
|
207
207
|
}
|
|
208
208
|
});
|
|
@@ -940,7 +940,8 @@ var HTTPClient = class {
|
|
|
940
940
|
this.options = options;
|
|
941
941
|
this._endpoint = _endpoint.replace(/\/*$/, "").replace("localhost", "127.0.0.1");
|
|
942
942
|
this._proxy = this.buildRoute(this)();
|
|
943
|
-
options.transformResponse
|
|
943
|
+
options.transformResponse || (options.transformResponse = (data) => camelcaseKeys(data));
|
|
944
|
+
options.getDataFromResponse || (options.getDataFromResponse = (res) => res.data);
|
|
944
945
|
this.initGetClient();
|
|
945
946
|
attachRequestMethod(this);
|
|
946
947
|
}
|
|
@@ -1047,7 +1048,7 @@ var HTTPClient = class {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
throw that.options.customThrowResponseError ? that.options.customThrowResponseError(e) : new RequestError(message, code, url, e);
|
|
1049
1050
|
}
|
|
1050
|
-
const data = res
|
|
1051
|
+
const data = that.options.getDataFromResponse(res);
|
|
1051
1052
|
if (!data) {
|
|
1052
1053
|
return null;
|
|
1053
1054
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -16,6 +16,11 @@ interface IClientOptions {
|
|
|
16
16
|
};
|
|
17
17
|
customThrowResponseError: <T extends Error = Error>(err: any) => T;
|
|
18
18
|
transformResponse: <T = any>(data: any) => T;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @default (res) => res.data
|
|
22
|
+
*/
|
|
23
|
+
getDataFromResponse: <T = any>(response: unknown) => T;
|
|
19
24
|
}
|
|
20
25
|
type ClientOptions = Partial<IClientOptions>;
|
|
21
26
|
|
|
@@ -1608,4 +1613,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1608
1613
|
*/
|
|
1609
1614
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1610
1615
|
|
|
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, 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 };
|
|
1616
|
+
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
|
@@ -16,6 +16,11 @@ interface IClientOptions {
|
|
|
16
16
|
};
|
|
17
17
|
customThrowResponseError: <T extends Error = Error>(err: any) => T;
|
|
18
18
|
transformResponse: <T = any>(data: any) => T;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @default (res) => res.data
|
|
22
|
+
*/
|
|
23
|
+
getDataFromResponse: <T = any>(response: unknown) => T;
|
|
19
24
|
}
|
|
20
25
|
type ClientOptions = Partial<IClientOptions>;
|
|
21
26
|
|
|
@@ -1608,4 +1613,4 @@ interface SnippetModel<T = unknown> extends BaseModel {
|
|
|
1608
1613
|
*/
|
|
1609
1614
|
declare const camelcaseKeys: <T = any>(obj: any) => T;
|
|
1610
1615
|
|
|
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, 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 };
|
|
1616
|
+
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
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
likeIt(type, id) {
|
|
139
139
|
return this.proxy.like.post({
|
|
140
140
|
data: {
|
|
141
|
-
type,
|
|
141
|
+
type: type.toLowerCase(),
|
|
142
142
|
id
|
|
143
143
|
}
|
|
144
144
|
});
|
|
@@ -876,7 +876,8 @@
|
|
|
876
876
|
this.options = options;
|
|
877
877
|
this._endpoint = _endpoint.replace(/\/*$/, "").replace("localhost", "127.0.0.1");
|
|
878
878
|
this._proxy = this.buildRoute(this)();
|
|
879
|
-
options.transformResponse
|
|
879
|
+
options.transformResponse || (options.transformResponse = (data) => camelcaseKeys(data));
|
|
880
|
+
options.getDataFromResponse || (options.getDataFromResponse = (res) => res.data);
|
|
880
881
|
this.initGetClient();
|
|
881
882
|
attachRequestMethod(this);
|
|
882
883
|
}
|
|
@@ -983,7 +984,7 @@
|
|
|
983
984
|
}
|
|
984
985
|
throw that.options.customThrowResponseError ? that.options.customThrowResponseError(e) : new RequestError(message, code, url, e);
|
|
985
986
|
}
|
|
986
|
-
const data = res
|
|
987
|
+
const data = that.options.getDataFromResponse(res);
|
|
987
988
|
if (!data) {
|
|
988
989
|
return null;
|
|
989
990
|
}
|
package/dist/index.js
CHANGED
|
@@ -136,7 +136,7 @@ var ActivityController = class {
|
|
|
136
136
|
likeIt(type, id) {
|
|
137
137
|
return this.proxy.like.post({
|
|
138
138
|
data: {
|
|
139
|
-
type,
|
|
139
|
+
type: type.toLowerCase(),
|
|
140
140
|
id
|
|
141
141
|
}
|
|
142
142
|
});
|
|
@@ -874,7 +874,8 @@ var HTTPClient = class {
|
|
|
874
874
|
this.options = options;
|
|
875
875
|
this._endpoint = _endpoint.replace(/\/*$/, "").replace("localhost", "127.0.0.1");
|
|
876
876
|
this._proxy = this.buildRoute(this)();
|
|
877
|
-
options.transformResponse
|
|
877
|
+
options.transformResponse || (options.transformResponse = (data) => camelcaseKeys(data));
|
|
878
|
+
options.getDataFromResponse || (options.getDataFromResponse = (res) => res.data);
|
|
878
879
|
this.initGetClient();
|
|
879
880
|
attachRequestMethod(this);
|
|
880
881
|
}
|
|
@@ -981,7 +982,7 @@ var HTTPClient = class {
|
|
|
981
982
|
}
|
|
982
983
|
throw that.options.customThrowResponseError ? that.options.customThrowResponseError(e) : new RequestError(message, code, url, e);
|
|
983
984
|
}
|
|
984
|
-
const data = res
|
|
985
|
+
const data = that.options.getDataFromResponse(res);
|
|
985
986
|
if (!data) {
|
|
986
987
|
return null;
|
|
987
988
|
}
|
package/index.ts
CHANGED
package/interfaces/client.ts
CHANGED
|
@@ -11,5 +11,10 @@ interface IClientOptions {
|
|
|
11
11
|
}
|
|
12
12
|
customThrowResponseError: <T extends Error = Error>(err: any) => T
|
|
13
13
|
transformResponse: <T = any>(data: any) => T
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @default (res) => res.data
|
|
17
|
+
*/
|
|
18
|
+
getDataFromResponse: <T = any>(response: unknown) => T
|
|
14
19
|
}
|
|
15
20
|
export type ClientOptions = Partial<IClientOptions>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-space/api-client",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1-alpha.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 };
|