lemon-core 3.0.0 → 3.1.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/README.md +13 -21
- package/dist/common/test-helper.js +19 -11
- package/dist/common/test-helper.js.map +1 -1
- package/dist/controllers/dummy-controller.d.ts +1 -1
- package/dist/controllers/dummy-controller.js +2 -2
- package/dist/controllers/dummy-controller.js.map +1 -1
- package/dist/controllers/general-api-controller.d.ts +1 -1
- package/dist/controllers/general-api-controller.js +5 -5
- package/dist/controllers/general-api-controller.js.map +1 -1
- package/dist/controllers/general-controller.js +2 -1
- package/dist/controllers/general-controller.js.map +1 -1
- package/dist/controllers/index.js +6 -2
- package/dist/controllers/index.js.map +1 -1
- package/dist/cores/api/api-service.d.ts +239 -0
- package/dist/cores/api/api-service.js +674 -0
- package/dist/cores/api/api-service.js.map +1 -0
- package/dist/cores/api/index.d.ts +10 -0
- package/dist/cores/api/index.js +27 -0
- package/dist/cores/api/index.js.map +1 -0
- package/dist/cores/api-service.js +19 -18
- package/dist/cores/api-service.js.map +1 -1
- package/dist/cores/aws/aws-kms-service.d.ts +53 -2
- package/dist/cores/aws/aws-kms-service.js +112 -29
- package/dist/cores/aws/aws-kms-service.js.map +1 -1
- package/dist/cores/aws/aws-s3-service.js +19 -18
- package/dist/cores/aws/aws-s3-service.js.map +1 -1
- package/dist/cores/aws/aws-sns-service.js +10 -10
- package/dist/cores/aws/aws-sns-service.js.map +1 -1
- package/dist/cores/aws/aws-sqs-service.js +12 -12
- package/dist/cores/aws/aws-sqs-service.js.map +1 -1
- package/dist/cores/aws/index.js +1 -1
- package/dist/cores/cache/cache-service.d.ts +440 -0
- package/dist/cores/cache/cache-service.js +967 -0
- package/dist/cores/cache/cache-service.js.map +1 -0
- package/dist/cores/cache/index.d.ts +10 -0
- package/dist/cores/cache/index.js +27 -0
- package/dist/cores/cache/index.js.map +1 -0
- package/dist/cores/cache-service.d.ts +54 -18
- package/dist/cores/cache-service.js +56 -45
- package/dist/cores/cache-service.js.map +1 -1
- package/dist/cores/config/config-service.js +11 -10
- package/dist/cores/config/config-service.js.map +1 -1
- package/dist/cores/core-services.js +6 -2
- package/dist/cores/core-services.js.map +1 -1
- package/dist/cores/core-types.d.ts +42 -12
- package/dist/cores/dynamo/dynamo-query-service.d.ts +52 -0
- package/dist/cores/dynamo/dynamo-query-service.js +127 -0
- package/dist/cores/dynamo/dynamo-query-service.js.map +1 -0
- package/dist/cores/dynamo/dynamo-scan-service.d.ts +70 -0
- package/dist/cores/dynamo/dynamo-scan-service.js +164 -0
- package/dist/cores/dynamo/dynamo-scan-service.js.map +1 -0
- package/dist/cores/dynamo/dynamo-service.d.ts +192 -0
- package/dist/cores/dynamo/dynamo-service.js +525 -0
- package/dist/cores/dynamo/dynamo-service.js.map +1 -0
- package/dist/cores/dynamo/index.d.ts +12 -0
- package/dist/cores/dynamo/index.js +29 -0
- package/dist/cores/dynamo/index.js.map +1 -0
- package/dist/cores/dynamo-query-service.js +7 -7
- package/dist/cores/dynamo-query-service.js.map +1 -1
- package/dist/cores/dynamo-scan-service.js +8 -8
- package/dist/cores/dynamo-scan-service.js.map +1 -1
- package/dist/cores/dynamo-service.js +19 -19
- package/dist/cores/dynamo-service.js.map +1 -1
- package/dist/cores/elastic/elastic6-query-service.d.ts +104 -0
- package/dist/cores/elastic/elastic6-query-service.js +510 -0
- package/dist/cores/elastic/elastic6-query-service.js.map +1 -0
- package/dist/cores/elastic/elastic6-service.d.ts +273 -0
- package/dist/cores/elastic/elastic6-service.js +903 -0
- package/dist/cores/elastic/elastic6-service.js.map +1 -0
- package/dist/cores/elastic/hangul-service.d.ts +102 -0
- package/dist/cores/elastic/hangul-service.js +205 -0
- package/dist/cores/elastic/hangul-service.js.map +1 -0
- package/dist/cores/elastic/index.d.ts +12 -0
- package/dist/cores/elastic/index.js +29 -0
- package/dist/cores/elastic/index.js.map +1 -0
- package/dist/cores/elastic6-query-service.js +7 -7
- package/dist/cores/elastic6-query-service.js.map +1 -1
- package/dist/cores/elastic6-service.js +57 -65
- package/dist/cores/elastic6-service.js.map +1 -1
- package/dist/cores/hangul-service.d.ts +17 -3
- package/dist/cores/hangul-service.js +17 -8
- package/dist/cores/hangul-service.js.map +1 -1
- package/dist/cores/http-storage-service.js +1 -1
- package/dist/cores/http-storage-service.js.map +1 -1
- package/dist/cores/index.d.ts +9 -15
- package/dist/cores/index.js +14 -15
- package/dist/cores/index.js.map +1 -1
- package/dist/cores/lambda/index.js +8 -4
- package/dist/cores/lambda/index.js.map +1 -1
- package/dist/cores/lambda/lambda-cognito-handler.js +2 -2
- package/dist/cores/lambda/lambda-cognito-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-cron-handler.js +2 -2
- package/dist/cores/lambda/lambda-cron-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-dynamo-stream-handler.d.ts +2 -2
- package/dist/cores/lambda/lambda-dynamo-stream-handler.js +20 -20
- package/dist/cores/lambda/lambda-dynamo-stream-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-handler.js +12 -11
- package/dist/cores/lambda/lambda-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-notification-handler.js +10 -10
- package/dist/cores/lambda/lambda-notification-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-sns-handler.js +13 -13
- package/dist/cores/lambda/lambda-sns-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-sqs-handler.js +13 -13
- package/dist/cores/lambda/lambda-sqs-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-web-handler.d.ts +158 -8
- package/dist/cores/lambda/lambda-web-handler.js +330 -119
- package/dist/cores/lambda/lambda-web-handler.js.map +1 -1
- package/dist/cores/lambda/lambda-wss-handler.js +16 -12
- package/dist/cores/lambda/lambda-wss-handler.js.map +1 -1
- package/dist/cores/model-manager.js +11 -11
- package/dist/cores/model-manager.js.map +1 -1
- package/dist/cores/protocol/protocol-service.d.ts +4 -0
- package/dist/cores/protocol/protocol-service.js +46 -40
- package/dist/cores/protocol/protocol-service.js.map +1 -1
- package/dist/cores/proxy-storage-service.js +7 -10
- package/dist/cores/proxy-storage-service.js.map +1 -1
- package/dist/cores/redis-storage-service.js +13 -13
- package/dist/cores/redis-storage-service.js.map +1 -1
- package/dist/cores/storage/http-storage-service.d.ts +22 -0
- package/dist/cores/storage/http-storage-service.js +129 -0
- package/dist/cores/storage/http-storage-service.js.map +1 -0
- package/dist/cores/storage/index.d.ts +14 -0
- package/dist/cores/storage/index.js +31 -0
- package/dist/cores/storage/index.js.map +1 -0
- package/dist/cores/storage/model-manager.d.ts +93 -0
- package/dist/cores/storage/model-manager.js +192 -0
- package/dist/cores/storage/model-manager.js.map +1 -0
- package/dist/cores/storage/proxy-storage-service.d.ts +573 -0
- package/dist/cores/storage/proxy-storage-service.js +913 -0
- package/dist/cores/storage/proxy-storage-service.js.map +1 -0
- package/dist/cores/storage/redis-storage-service.d.ts +183 -0
- package/dist/cores/storage/redis-storage-service.js +391 -0
- package/dist/cores/storage/redis-storage-service.js.map +1 -0
- package/dist/cores/storage/storage-service.d.ts +169 -0
- package/dist/cores/storage/storage-service.js +374 -0
- package/dist/cores/storage/storage-service.js.map +1 -0
- package/dist/cores/storage-service.d.ts +1 -1
- package/dist/cores/storage-service.js +10 -8
- package/dist/cores/storage-service.js.map +1 -1
- package/dist/engine/builder.js +27 -20
- package/dist/engine/builder.js.map +1 -1
- package/dist/engine/engine.js +53 -44
- package/dist/engine/engine.js.map +1 -1
- package/dist/engine/index.js +8 -4
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/utilities.d.ts +4 -3
- package/dist/engine/utilities.js +32 -37
- package/dist/engine/utilities.js.map +1 -1
- package/dist/environ.d.ts +2 -2
- package/dist/environ.js +20 -10
- package/dist/environ.js.map +1 -1
- package/dist/exec-cli.js +26 -26
- package/dist/exec-cli.js.map +1 -1
- package/dist/extended/abstract-service.d.ts +533 -0
- package/dist/extended/abstract-service.js +915 -0
- package/dist/extended/abstract-service.js.map +1 -0
- package/dist/extended/index.d.ts +10 -0
- package/dist/extended/index.js +27 -0
- package/dist/extended/index.js.map +1 -0
- package/dist/helpers/helpers.d.ts +273 -0
- package/dist/helpers/helpers.js +613 -0
- package/dist/helpers/helpers.js.map +1 -0
- package/dist/helpers/index.d.ts +10 -0
- package/dist/helpers/index.js +27 -0
- package/dist/helpers/index.js.map +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/dynamo/expressions.js +35 -27
- package/dist/lib/dynamo/expressions.js.map +1 -1
- package/dist/lib/dynamo/query.js +24 -20
- package/dist/lib/dynamo/query.js.map +1 -1
- package/dist/lib/dynamo/scan.js +17 -13
- package/dist/lib/dynamo/scan.js.map +1 -1
- package/dist/lib/dynamo/serializer.js +11 -7
- package/dist/lib/dynamo/serializer.js.map +1 -1
- package/dist/lib/dynamo/utils.js +19 -14
- package/dist/lib/dynamo/utils.js.map +1 -1
- package/dist/lib/dynamodb-value.js +3 -3
- package/dist/lib/dynamodb-value.js.map +1 -1
- package/dist/lib/index.js +6 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/tools/express.js +21 -15
- package/dist/tools/express.js.map +1 -1
- package/dist/tools/index.js +6 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/shared.js +12 -6
- package/dist/tools/shared.js.map +1 -1
- package/package.json +16 -15
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API headers.
|
|
3
|
+
*/
|
|
4
|
+
export interface APIHeaders {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* class: `APIServiceClient`
|
|
9
|
+
* - General API Request Client w/ url like `GET <endpoint>/<id>?/<cmd>?`
|
|
10
|
+
*/
|
|
11
|
+
export interface APIServiceClient {
|
|
12
|
+
hello(): string;
|
|
13
|
+
doGet<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
14
|
+
doPut<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
15
|
+
doPost<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
16
|
+
doPatch<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
17
|
+
doDelete<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* possible method.
|
|
21
|
+
*/
|
|
22
|
+
export declare type APIHttpMethod = 'GET' | 'PUT' | 'POST' | 'PATCH' | 'DELETE';
|
|
23
|
+
/**
|
|
24
|
+
* class: `ApiHttpProxy`
|
|
25
|
+
* - http proxy service.
|
|
26
|
+
*/
|
|
27
|
+
export interface ApiHttpProxy {
|
|
28
|
+
/**
|
|
29
|
+
* say this service name.
|
|
30
|
+
*/
|
|
31
|
+
hello(): string;
|
|
32
|
+
/**
|
|
33
|
+
* call http request via proxy server.
|
|
34
|
+
*
|
|
35
|
+
* url := `<host>/<path?>?<param>`
|
|
36
|
+
*
|
|
37
|
+
* @param method http method
|
|
38
|
+
* @param host host name (or https://~)
|
|
39
|
+
* @param path object id
|
|
40
|
+
* @param param query paramters
|
|
41
|
+
* @param body body
|
|
42
|
+
* @param ctx context
|
|
43
|
+
* @param hash (optional) hash value (valid only for client-side).
|
|
44
|
+
*/
|
|
45
|
+
doProxy<T = any>(method: APIHttpMethod, host: string, path?: string, param?: any, body?: any, ctx?: any, hash?: string): Promise<T>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* class: `APIProxyClient`
|
|
49
|
+
* - proxed APIServiceClient
|
|
50
|
+
*/
|
|
51
|
+
export declare class APIProxyClient implements APIServiceClient {
|
|
52
|
+
protected service: APIServiceClient;
|
|
53
|
+
constructor(service: APIServiceClient);
|
|
54
|
+
hello: () => string;
|
|
55
|
+
doGet<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
56
|
+
doPut<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
57
|
+
doPost<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
58
|
+
doPatch<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
59
|
+
doDelete<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* class: `APIService`
|
|
63
|
+
* - use internal http-proxy service due to restriction internet-face in VPC lambda.
|
|
64
|
+
*/
|
|
65
|
+
export declare class APIService implements APIServiceClient {
|
|
66
|
+
protected type: string;
|
|
67
|
+
protected endpoint: string;
|
|
68
|
+
protected headers: APIHeaders;
|
|
69
|
+
protected client: APIServiceClient;
|
|
70
|
+
/**
|
|
71
|
+
* create API service.
|
|
72
|
+
*
|
|
73
|
+
* ```js
|
|
74
|
+
* // basic
|
|
75
|
+
* const api = new API('web', 'http://localhost:8081', {});
|
|
76
|
+
* api.doGet('');
|
|
77
|
+
*
|
|
78
|
+
* // via python
|
|
79
|
+
* const api = new API('residents', 'http://localhost:8113', {});
|
|
80
|
+
* api.doGet('123'); // http GET :8113/residents/123
|
|
81
|
+
*
|
|
82
|
+
* // proxy server
|
|
83
|
+
* const api = new API('web', 'http://localhost:8081', {}, null, proxy);
|
|
84
|
+
* api.doGet('');
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* @param type type in endpoint
|
|
88
|
+
* @param endpoint base endpoint (support ONLY http, https)
|
|
89
|
+
* @param headers common headers.
|
|
90
|
+
* @param client real api-client to use (or use proxy, or create default)
|
|
91
|
+
* @param proxy proxy-service to use if there is no client (or use backbone server)
|
|
92
|
+
*/
|
|
93
|
+
constructor(type: string, endpoint: string, headers?: APIHeaders, client?: APIServiceClient, proxy?: ApiHttpProxy);
|
|
94
|
+
hello: () => string;
|
|
95
|
+
/**
|
|
96
|
+
* helper to make http client
|
|
97
|
+
*
|
|
98
|
+
* @param backbone backbone address like 'http://localhost:8081'
|
|
99
|
+
*/
|
|
100
|
+
static buildClient(type: string, endpoint: string, headers?: APIHeaders, backbone?: string, proxy?: ApiHttpProxy): APIServiceClient;
|
|
101
|
+
/**
|
|
102
|
+
* make a client for sub-typed endpoint.
|
|
103
|
+
* @param type sub-type path.
|
|
104
|
+
*/
|
|
105
|
+
buildSubTypeClient(type: string, useRecord?: boolean, folder?: string): APIServiceClient;
|
|
106
|
+
/**
|
|
107
|
+
* make api recorder of this service.
|
|
108
|
+
* @param folder base folder (default `./logs`)
|
|
109
|
+
*/
|
|
110
|
+
buildRecorder(folder?: string): APIServiceClient;
|
|
111
|
+
/**
|
|
112
|
+
* class: `TypedEndpoint`
|
|
113
|
+
* - by using common proxy, extends endpoint by type.
|
|
114
|
+
* - endpoint := base+'/'+type.
|
|
115
|
+
*/
|
|
116
|
+
private static ProxyServiceClient;
|
|
117
|
+
/**
|
|
118
|
+
* use sub-typed endpoint.
|
|
119
|
+
* - extends as endpoint := parent.endpoint + '/' + type
|
|
120
|
+
*/
|
|
121
|
+
static SubTypeClient: {
|
|
122
|
+
new (parent: APIServiceClient, type: string): {
|
|
123
|
+
readonly parent: APIServiceClient;
|
|
124
|
+
readonly type: string;
|
|
125
|
+
hello: () => string;
|
|
126
|
+
asCmd: (id: string, cmd?: string) => string;
|
|
127
|
+
doGet(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
128
|
+
doPut(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
129
|
+
doPost(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
130
|
+
doPatch(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
131
|
+
doDelete(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* recorder of api-http-proxy client.
|
|
136
|
+
*/
|
|
137
|
+
static ApiHttpProxyRecorder: {
|
|
138
|
+
new (target: ApiHttpProxy, folder?: string): {
|
|
139
|
+
readonly target: ApiHttpProxy;
|
|
140
|
+
readonly folder: string;
|
|
141
|
+
hello: () => string;
|
|
142
|
+
doProxy<T = any>(method: APIHttpMethod, host: string, path?: string, param?: any, body?: any, context?: any, hash?: string): Promise<T>;
|
|
143
|
+
};
|
|
144
|
+
next: number;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* recorder of api-service client.
|
|
148
|
+
*/
|
|
149
|
+
static APIServiceClientRecorder: {
|
|
150
|
+
new (target: APIServiceClient, endpoint: string, folder?: string): {
|
|
151
|
+
readonly target: APIServiceClient;
|
|
152
|
+
readonly endpoint: string;
|
|
153
|
+
readonly folder: string;
|
|
154
|
+
hello: () => string;
|
|
155
|
+
doRecord(method: APIHttpMethod, id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
156
|
+
doGet(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
157
|
+
doPut(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
158
|
+
doPost(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
159
|
+
doPatch(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
160
|
+
doDelete(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<any>;
|
|
161
|
+
};
|
|
162
|
+
next: number;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* GET HOST/PATH?$param
|
|
166
|
+
*/
|
|
167
|
+
doGet: (id: string, cmd?: string, $param?: any, $body?: any, hash?: string) => Promise<any>;
|
|
168
|
+
/**
|
|
169
|
+
* PUT HOST/PATH?$param
|
|
170
|
+
*/
|
|
171
|
+
doPut: (id: string, cmd?: string, $param?: any, $body?: any, hash?: string) => Promise<any>;
|
|
172
|
+
/**
|
|
173
|
+
* POST HOST/PATH?$param
|
|
174
|
+
*/
|
|
175
|
+
doPost: (id: string, cmd?: string, $param?: any, $body?: any, hash?: string) => Promise<any>;
|
|
176
|
+
/**
|
|
177
|
+
* PATCH HOST/PATH?$param
|
|
178
|
+
*/
|
|
179
|
+
doPatch: (id: string, cmd?: string, $param?: any, $body?: any, hash?: string) => Promise<any>;
|
|
180
|
+
/**
|
|
181
|
+
* DELETE HOST/PATH?$param
|
|
182
|
+
*/
|
|
183
|
+
doDelete: (id: string, cmd?: string, $param?: any, $body?: any, hash?: string) => Promise<any>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* create http-web-proxy agent which using endpoint as proxy server.
|
|
187
|
+
*
|
|
188
|
+
* # as cases.
|
|
189
|
+
* as proxy agent: GET <endpoint>/<host?>/<path?>
|
|
190
|
+
* as direct agent: GET <endpoint>/<id?>/<cmd?>
|
|
191
|
+
*
|
|
192
|
+
* @param name client-name
|
|
193
|
+
* @param endpoint service url (or backbone proxy-url)
|
|
194
|
+
* @param headers headers
|
|
195
|
+
* @param encoder path encoder (default encodeURIComponent)
|
|
196
|
+
* @param relayHeaderKey relay-key in headers for proxy.
|
|
197
|
+
* @param resultKey resultKey in response
|
|
198
|
+
*/
|
|
199
|
+
export declare const createHttpWebProxy: (name: string, endpoint: string, headers?: APIHeaders, encoder?: (name: string, path: string) => string, relayHeaderKey?: string, resultKey?: string) => ApiHttpProxy;
|
|
200
|
+
/** ********************************************************************************************************************
|
|
201
|
+
* MOCKS API-SERVICE
|
|
202
|
+
** ********************************************************************************************************************/
|
|
203
|
+
/**
|
|
204
|
+
* class: `MocksAPIService`
|
|
205
|
+
* - use <mock>.json file in `./data/mocks/` instead of real http request.
|
|
206
|
+
* - it redirect to url like `endpoint/type/id/cmd`
|
|
207
|
+
*
|
|
208
|
+
* ```ts
|
|
209
|
+
* // json format
|
|
210
|
+
* {
|
|
211
|
+
* param: { // input format
|
|
212
|
+
* method: string;
|
|
213
|
+
* endpoint: string;
|
|
214
|
+
* id?: string;
|
|
215
|
+
* cmd?: string;
|
|
216
|
+
* },
|
|
217
|
+
* data: { // response data
|
|
218
|
+
* ...
|
|
219
|
+
* },
|
|
220
|
+
* error?: string; // in case of error.
|
|
221
|
+
* }
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
export declare class MocksAPIService implements ApiHttpProxy, APIServiceClient {
|
|
225
|
+
private $map;
|
|
226
|
+
private type;
|
|
227
|
+
private endpoint;
|
|
228
|
+
constructor(type: string, endpoint: string);
|
|
229
|
+
protected loadSync(): void;
|
|
230
|
+
protected asPath: (id?: string, cmd?: string) => string;
|
|
231
|
+
doProxy<T = any>(method: APIHttpMethod, type: string, path: string, param?: any, body?: any, ctx?: any, hash?: string): Promise<T>;
|
|
232
|
+
protected na: (a: any, x: string, y: string) => string;
|
|
233
|
+
hello: () => string;
|
|
234
|
+
doGet<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
235
|
+
doPut<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
236
|
+
doPost<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
237
|
+
doPatch<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
238
|
+
doDelete<T = any>(id: string, cmd?: string, param?: any, body?: any, hash?: string): Promise<T>;
|
|
239
|
+
}
|