@metorial-services/ares-client 1.0.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/README.md +21 -0
- package/dist/clients/typescript/src/index.d.ts +413 -0
- package/dist/clients/typescript/src/index.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +534 -0
- package/dist/index.module.js +2 -0
- package/dist/index.module.js.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +43 -0
- package/src/index.ts +6 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Metorial Ares Client
|
|
2
|
+
|
|
3
|
+
A client library for interacting with the Metorial Ares platform using TypeScript.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createAresClient } from '@lowerdeck/forge-client';
|
|
9
|
+
|
|
10
|
+
let forge = createAresClient({
|
|
11
|
+
endpoint: '...'
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
This project is licensed under the Apache License 2.0.
|
|
18
|
+
|
|
19
|
+
<div align="center">
|
|
20
|
+
<sub>Built with ❤️ by <a href="https://metorial.com">Metorial</a></sub>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import { createClient } from '@lowerdeck/rpc-client';
|
|
2
|
+
type ClientOpts = Parameters<typeof createClient>[0];
|
|
3
|
+
export declare let createAresInternalClient: (o: ClientOpts) => import("@lowerdeck/rpc-server").InferClient<{
|
|
4
|
+
app: {
|
|
5
|
+
list: import("@lowerdeck/rpc-server").Handler<object & {
|
|
6
|
+
limit?: number;
|
|
7
|
+
after?: string;
|
|
8
|
+
before?: string;
|
|
9
|
+
cursor?: string;
|
|
10
|
+
order?: "asc" | "desc";
|
|
11
|
+
}, {
|
|
12
|
+
__typename: string;
|
|
13
|
+
items: {
|
|
14
|
+
object: "ares#app";
|
|
15
|
+
id: string;
|
|
16
|
+
clientId: string;
|
|
17
|
+
slug: string | null;
|
|
18
|
+
hasTerms: boolean;
|
|
19
|
+
defaultRedirectUrl: string;
|
|
20
|
+
redirectDomains: string[];
|
|
21
|
+
defaultTenant: {
|
|
22
|
+
id: string;
|
|
23
|
+
clientId: string;
|
|
24
|
+
} | null;
|
|
25
|
+
counts: {
|
|
26
|
+
users: number;
|
|
27
|
+
tenants: number;
|
|
28
|
+
};
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
31
|
+
}[];
|
|
32
|
+
pagination: {
|
|
33
|
+
has_more_after: boolean;
|
|
34
|
+
has_more_before: boolean;
|
|
35
|
+
};
|
|
36
|
+
}, {
|
|
37
|
+
context: {
|
|
38
|
+
ip: string;
|
|
39
|
+
ua: string | null;
|
|
40
|
+
};
|
|
41
|
+
}>;
|
|
42
|
+
get: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
43
|
+
id: string;
|
|
44
|
+
}>, {
|
|
45
|
+
object: "ares#app";
|
|
46
|
+
id: string;
|
|
47
|
+
clientId: string;
|
|
48
|
+
slug: string | null;
|
|
49
|
+
hasTerms: boolean;
|
|
50
|
+
defaultRedirectUrl: string;
|
|
51
|
+
redirectDomains: string[];
|
|
52
|
+
defaultTenant: {
|
|
53
|
+
id: string;
|
|
54
|
+
clientId: string;
|
|
55
|
+
} | null;
|
|
56
|
+
counts: {
|
|
57
|
+
users: number;
|
|
58
|
+
tenants: number;
|
|
59
|
+
};
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
}, {
|
|
63
|
+
context: {
|
|
64
|
+
ip: string;
|
|
65
|
+
ua: string | null;
|
|
66
|
+
};
|
|
67
|
+
}>;
|
|
68
|
+
create: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
69
|
+
defaultRedirectUrl: string;
|
|
70
|
+
slug: string | undefined;
|
|
71
|
+
redirectDomains: string[] | undefined;
|
|
72
|
+
}>, {
|
|
73
|
+
object: "ares#app";
|
|
74
|
+
id: string;
|
|
75
|
+
clientId: string;
|
|
76
|
+
slug: string | null;
|
|
77
|
+
hasTerms: boolean;
|
|
78
|
+
defaultRedirectUrl: string;
|
|
79
|
+
redirectDomains: string[];
|
|
80
|
+
defaultTenant: {
|
|
81
|
+
id: string;
|
|
82
|
+
clientId: string;
|
|
83
|
+
} | null;
|
|
84
|
+
counts: {
|
|
85
|
+
users: number;
|
|
86
|
+
tenants: number;
|
|
87
|
+
};
|
|
88
|
+
createdAt: Date;
|
|
89
|
+
updatedAt: Date;
|
|
90
|
+
}, {
|
|
91
|
+
context: {
|
|
92
|
+
ip: string;
|
|
93
|
+
ua: string | null;
|
|
94
|
+
};
|
|
95
|
+
}>;
|
|
96
|
+
update: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
97
|
+
id: string;
|
|
98
|
+
slug: string | undefined;
|
|
99
|
+
redirectDomains: string[] | undefined;
|
|
100
|
+
}>, {
|
|
101
|
+
object: "ares#app";
|
|
102
|
+
id: string;
|
|
103
|
+
clientId: string;
|
|
104
|
+
slug: string | null;
|
|
105
|
+
hasTerms: boolean;
|
|
106
|
+
defaultRedirectUrl: string;
|
|
107
|
+
redirectDomains: string[];
|
|
108
|
+
defaultTenant: {
|
|
109
|
+
id: string;
|
|
110
|
+
clientId: string;
|
|
111
|
+
} | null;
|
|
112
|
+
counts: {
|
|
113
|
+
users: number;
|
|
114
|
+
tenants: number;
|
|
115
|
+
};
|
|
116
|
+
createdAt: Date;
|
|
117
|
+
updatedAt: Date;
|
|
118
|
+
}, {
|
|
119
|
+
context: {
|
|
120
|
+
ip: string;
|
|
121
|
+
ua: string | null;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
|
124
|
+
};
|
|
125
|
+
tenant: {
|
|
126
|
+
list: import("@lowerdeck/rpc-server").Handler<Partial<Pick<{
|
|
127
|
+
appId: string;
|
|
128
|
+
}, never>> & {
|
|
129
|
+
appId: string;
|
|
130
|
+
} & {
|
|
131
|
+
limit?: number;
|
|
132
|
+
after?: string;
|
|
133
|
+
before?: string;
|
|
134
|
+
cursor?: string;
|
|
135
|
+
order?: "asc" | "desc";
|
|
136
|
+
}, {
|
|
137
|
+
__typename: string;
|
|
138
|
+
items: {
|
|
139
|
+
object: "ares#tenant";
|
|
140
|
+
id: string;
|
|
141
|
+
clientId: string;
|
|
142
|
+
appId: string | undefined;
|
|
143
|
+
counts: {
|
|
144
|
+
users: number;
|
|
145
|
+
};
|
|
146
|
+
createdAt: Date;
|
|
147
|
+
updatedAt: Date;
|
|
148
|
+
}[];
|
|
149
|
+
pagination: {
|
|
150
|
+
has_more_after: boolean;
|
|
151
|
+
has_more_before: boolean;
|
|
152
|
+
};
|
|
153
|
+
}, {
|
|
154
|
+
context: {
|
|
155
|
+
ip: string;
|
|
156
|
+
ua: string | null;
|
|
157
|
+
};
|
|
158
|
+
}>;
|
|
159
|
+
get: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
160
|
+
id: string;
|
|
161
|
+
}>, {
|
|
162
|
+
object: "ares#tenant";
|
|
163
|
+
id: string;
|
|
164
|
+
clientId: string;
|
|
165
|
+
appId: string | undefined;
|
|
166
|
+
counts: {
|
|
167
|
+
users: number;
|
|
168
|
+
};
|
|
169
|
+
createdAt: Date;
|
|
170
|
+
updatedAt: Date;
|
|
171
|
+
}, {
|
|
172
|
+
context: {
|
|
173
|
+
ip: string;
|
|
174
|
+
ua: string | null;
|
|
175
|
+
};
|
|
176
|
+
}>;
|
|
177
|
+
};
|
|
178
|
+
user: {
|
|
179
|
+
list: import("@lowerdeck/rpc-server").Handler<Partial<Pick<{
|
|
180
|
+
appId: string;
|
|
181
|
+
search: string | undefined;
|
|
182
|
+
}, "search">> & {
|
|
183
|
+
appId: string;
|
|
184
|
+
} & {
|
|
185
|
+
limit?: number;
|
|
186
|
+
after?: string;
|
|
187
|
+
before?: string;
|
|
188
|
+
cursor?: string;
|
|
189
|
+
order?: "asc" | "desc";
|
|
190
|
+
}, {
|
|
191
|
+
__typename: string;
|
|
192
|
+
items: {
|
|
193
|
+
object: string;
|
|
194
|
+
status: string;
|
|
195
|
+
id: string;
|
|
196
|
+
email: string;
|
|
197
|
+
name: string;
|
|
198
|
+
firstName: string;
|
|
199
|
+
lastName: string;
|
|
200
|
+
lastLoginAt: Date | null;
|
|
201
|
+
lastActiveAt: Date | null;
|
|
202
|
+
createdAt: Date;
|
|
203
|
+
updatedAt: Date;
|
|
204
|
+
imageUrl: string;
|
|
205
|
+
}[];
|
|
206
|
+
pagination: {
|
|
207
|
+
has_more_after: boolean;
|
|
208
|
+
has_more_before: boolean;
|
|
209
|
+
};
|
|
210
|
+
}, {
|
|
211
|
+
context: {
|
|
212
|
+
ip: string;
|
|
213
|
+
ua: string | null;
|
|
214
|
+
};
|
|
215
|
+
}>;
|
|
216
|
+
get: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
217
|
+
id: string;
|
|
218
|
+
}>, {
|
|
219
|
+
object: string;
|
|
220
|
+
status: string;
|
|
221
|
+
id: string;
|
|
222
|
+
email: string;
|
|
223
|
+
name: string;
|
|
224
|
+
firstName: string;
|
|
225
|
+
lastName: string;
|
|
226
|
+
lastLoginAt: Date | null;
|
|
227
|
+
lastActiveAt: Date | null;
|
|
228
|
+
createdAt: Date;
|
|
229
|
+
updatedAt: Date;
|
|
230
|
+
imageUrl: string;
|
|
231
|
+
}, {
|
|
232
|
+
context: {
|
|
233
|
+
ip: string;
|
|
234
|
+
ua: string | null;
|
|
235
|
+
};
|
|
236
|
+
}>;
|
|
237
|
+
};
|
|
238
|
+
sso: {
|
|
239
|
+
listTenants: import("@lowerdeck/rpc-server").Handler<Partial<Pick<{
|
|
240
|
+
appId: string;
|
|
241
|
+
}, never>> & {
|
|
242
|
+
appId: string;
|
|
243
|
+
} & {
|
|
244
|
+
limit?: number;
|
|
245
|
+
after?: string;
|
|
246
|
+
before?: string;
|
|
247
|
+
cursor?: string;
|
|
248
|
+
order?: "asc" | "desc";
|
|
249
|
+
}, {
|
|
250
|
+
__typename: string;
|
|
251
|
+
items: {
|
|
252
|
+
object: "ares#ssoTenant";
|
|
253
|
+
id: string;
|
|
254
|
+
name: string;
|
|
255
|
+
status: import("../../../service/prisma/generated/enums").SsoTenantStatus;
|
|
256
|
+
clientId: string;
|
|
257
|
+
externalId: string | null;
|
|
258
|
+
isGlobal: boolean;
|
|
259
|
+
counts: {
|
|
260
|
+
connections: number;
|
|
261
|
+
};
|
|
262
|
+
createdAt: Date;
|
|
263
|
+
updatedAt: Date;
|
|
264
|
+
}[];
|
|
265
|
+
pagination: {
|
|
266
|
+
has_more_after: boolean;
|
|
267
|
+
has_more_before: boolean;
|
|
268
|
+
};
|
|
269
|
+
}, {
|
|
270
|
+
context: {
|
|
271
|
+
ip: string;
|
|
272
|
+
ua: string | null;
|
|
273
|
+
};
|
|
274
|
+
}>;
|
|
275
|
+
getTenant: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
276
|
+
id: string;
|
|
277
|
+
}>, {
|
|
278
|
+
object: "ares#ssoTenant";
|
|
279
|
+
id: string;
|
|
280
|
+
name: string;
|
|
281
|
+
status: import("../../../service/prisma/generated/enums").SsoTenantStatus;
|
|
282
|
+
clientId: string;
|
|
283
|
+
externalId: string | null;
|
|
284
|
+
isGlobal: boolean;
|
|
285
|
+
counts: {
|
|
286
|
+
connections: number;
|
|
287
|
+
};
|
|
288
|
+
createdAt: Date;
|
|
289
|
+
updatedAt: Date;
|
|
290
|
+
}, {
|
|
291
|
+
context: {
|
|
292
|
+
ip: string;
|
|
293
|
+
ua: string | null;
|
|
294
|
+
};
|
|
295
|
+
}>;
|
|
296
|
+
createTenant: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
297
|
+
appId: string;
|
|
298
|
+
name: string;
|
|
299
|
+
}>, {
|
|
300
|
+
object: "ares#ssoTenant";
|
|
301
|
+
id: string;
|
|
302
|
+
name: string;
|
|
303
|
+
status: import("../../../service/prisma/generated/enums").SsoTenantStatus;
|
|
304
|
+
clientId: string;
|
|
305
|
+
externalId: string | null;
|
|
306
|
+
isGlobal: boolean;
|
|
307
|
+
counts: {
|
|
308
|
+
connections: number;
|
|
309
|
+
};
|
|
310
|
+
createdAt: Date;
|
|
311
|
+
updatedAt: Date;
|
|
312
|
+
}, {
|
|
313
|
+
context: {
|
|
314
|
+
ip: string;
|
|
315
|
+
ua: string | null;
|
|
316
|
+
};
|
|
317
|
+
}>;
|
|
318
|
+
createSetup: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
319
|
+
tenantId: string;
|
|
320
|
+
redirectUri: string;
|
|
321
|
+
}>, {
|
|
322
|
+
setupUrl: string;
|
|
323
|
+
}, {
|
|
324
|
+
context: {
|
|
325
|
+
ip: string;
|
|
326
|
+
ua: string | null;
|
|
327
|
+
};
|
|
328
|
+
}>;
|
|
329
|
+
listConnections: import("@lowerdeck/rpc-server").Handler<Partial<Pick<{
|
|
330
|
+
tenantId: string;
|
|
331
|
+
}, never>> & {
|
|
332
|
+
tenantId: string;
|
|
333
|
+
} & {
|
|
334
|
+
limit?: number;
|
|
335
|
+
after?: string;
|
|
336
|
+
before?: string;
|
|
337
|
+
cursor?: string;
|
|
338
|
+
order?: "asc" | "desc";
|
|
339
|
+
}, {
|
|
340
|
+
__typename: string;
|
|
341
|
+
items: {
|
|
342
|
+
object: "ares#ssoConnection";
|
|
343
|
+
id: string;
|
|
344
|
+
name: string;
|
|
345
|
+
providerType: import("../../../service/prisma/generated/enums").SsoConnectionProviderType;
|
|
346
|
+
providerName: string | null;
|
|
347
|
+
createdAt: Date;
|
|
348
|
+
}[];
|
|
349
|
+
pagination: {
|
|
350
|
+
has_more_after: boolean;
|
|
351
|
+
has_more_before: boolean;
|
|
352
|
+
};
|
|
353
|
+
}, {
|
|
354
|
+
context: {
|
|
355
|
+
ip: string;
|
|
356
|
+
ua: string | null;
|
|
357
|
+
};
|
|
358
|
+
}>;
|
|
359
|
+
};
|
|
360
|
+
oauth: {
|
|
361
|
+
exchange: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
362
|
+
clientId: string;
|
|
363
|
+
authorizationCode: string;
|
|
364
|
+
}>, {
|
|
365
|
+
user: {
|
|
366
|
+
id: string;
|
|
367
|
+
email: string;
|
|
368
|
+
name: string;
|
|
369
|
+
firstName: string;
|
|
370
|
+
lastName: string;
|
|
371
|
+
createdAt: Date;
|
|
372
|
+
updatedAt: Date;
|
|
373
|
+
};
|
|
374
|
+
session: {
|
|
375
|
+
id: string;
|
|
376
|
+
expiresAt: Date;
|
|
377
|
+
};
|
|
378
|
+
}, {
|
|
379
|
+
context: {
|
|
380
|
+
ip: string;
|
|
381
|
+
ua: string | null;
|
|
382
|
+
};
|
|
383
|
+
}>;
|
|
384
|
+
};
|
|
385
|
+
session: {
|
|
386
|
+
get: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
387
|
+
sessionId: string;
|
|
388
|
+
}>, {
|
|
389
|
+
id: string;
|
|
390
|
+
userId: string;
|
|
391
|
+
deviceId: string;
|
|
392
|
+
impersonationOid: bigint | null;
|
|
393
|
+
loggedOutAt: Date | null;
|
|
394
|
+
expiresAt: Date;
|
|
395
|
+
createdAt: Date;
|
|
396
|
+
}, {
|
|
397
|
+
context: {
|
|
398
|
+
ip: string;
|
|
399
|
+
ua: string | null;
|
|
400
|
+
};
|
|
401
|
+
}>;
|
|
402
|
+
logout: import("@lowerdeck/rpc-server").Handler<import("@lowerdeck/validation/dist/validators").UndefinedIsOptional<{
|
|
403
|
+
sessionId: string;
|
|
404
|
+
}>, {}, {
|
|
405
|
+
context: {
|
|
406
|
+
ip: string;
|
|
407
|
+
ua: string | null;
|
|
408
|
+
};
|
|
409
|
+
}>;
|
|
410
|
+
};
|
|
411
|
+
}>;
|
|
412
|
+
export {};
|
|
413
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAErD,eAAO,IAAI,wBAAwB,GAAI,GAAG,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAoC,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import { createClient } from '@lowerdeck/rpc-client';\nimport type { InternalClient } from '../../../service/src/apis/internal';\n\ntype ClientOpts = Parameters<typeof createClient>[0];\n\nexport let createAresInternalClient = (o: ClientOpts) => createClient<InternalClient>(o);\n"],"names":["o","createClient"],"mappings":"wEAKsC,SAACA,GAAa,OAAKC,EAAAA,aAA6BD,EAAE"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v9.5.1
|
|
2
|
+
|
|
3
|
+
import * as Cookie from 'cookie';
|
|
4
|
+
|
|
5
|
+
export interface ClientOpts {
|
|
6
|
+
endpoint: string;
|
|
7
|
+
headers?: Record<string, string | undefined>;
|
|
8
|
+
getHeaders?: () => Promise<Record<string, string>> | Record<string, string>;
|
|
9
|
+
onRequest?: (d: {
|
|
10
|
+
endpoint: string;
|
|
11
|
+
name: string;
|
|
12
|
+
payload: any;
|
|
13
|
+
headers: Record<string, string | undefined>;
|
|
14
|
+
query?: Record<string, string | undefined>;
|
|
15
|
+
}) => any;
|
|
16
|
+
}
|
|
17
|
+
declare let createClient: <T extends object>(clientOpts: ClientOpts) => T;
|
|
18
|
+
export interface ValidationError {
|
|
19
|
+
code: string;
|
|
20
|
+
message: string;
|
|
21
|
+
expected?: any;
|
|
22
|
+
received?: any;
|
|
23
|
+
path?: string[];
|
|
24
|
+
min?: number;
|
|
25
|
+
max?: number;
|
|
26
|
+
positive?: boolean;
|
|
27
|
+
negative?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export type ValidationResult<T> = {
|
|
30
|
+
success: true;
|
|
31
|
+
value: T;
|
|
32
|
+
} | {
|
|
33
|
+
success: false;
|
|
34
|
+
errors: ValidationError[];
|
|
35
|
+
};
|
|
36
|
+
export type ValidationType<T> = {
|
|
37
|
+
validate: (value: any) => ValidationResult<T>;
|
|
38
|
+
examples?: T[];
|
|
39
|
+
items?: ValidationType<any> | ValidationType<any>[];
|
|
40
|
+
properties?: {
|
|
41
|
+
[key: string]: ValidationType<any>;
|
|
42
|
+
};
|
|
43
|
+
type: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
optional?: boolean;
|
|
47
|
+
nullable?: boolean;
|
|
48
|
+
hidden?: boolean;
|
|
49
|
+
};
|
|
50
|
+
export type KeysWhichExtend<T, SelectedType> = {
|
|
51
|
+
[key in keyof T]: SelectedType extends T[key] ? key : never;
|
|
52
|
+
}[keyof T];
|
|
53
|
+
export type Optional<T> = Partial<Pick<T, KeysWhichExtend<T, undefined>>>;
|
|
54
|
+
type Required$1<T> = Omit<T, KeysWhichExtend<T, undefined>>;
|
|
55
|
+
export type UndefinedIsOptional<T> = Optional<T> & Required$1<T>;
|
|
56
|
+
export interface ServiceRequest {
|
|
57
|
+
query: URLSearchParams;
|
|
58
|
+
headers: Headers;
|
|
59
|
+
url: string;
|
|
60
|
+
ip?: string;
|
|
61
|
+
body: any;
|
|
62
|
+
rawBody: any;
|
|
63
|
+
requestId: string;
|
|
64
|
+
getCookies: () => Record<string, string | undefined>;
|
|
65
|
+
getCookie: (name: string) => string | undefined;
|
|
66
|
+
setCookie: (name: string, value: string, opts?: Cookie.SerializeOptions) => void;
|
|
67
|
+
sharedMiddlewareMemo: Map<string, Promise<any>>;
|
|
68
|
+
beforeSend: (handler: () => Promise<any>) => void;
|
|
69
|
+
appendHeaders: (headers: Record<string, string | string[]>) => void;
|
|
70
|
+
}
|
|
71
|
+
export type Simplify<T> = {
|
|
72
|
+
[KeyType in keyof T]: T[KeyType];
|
|
73
|
+
} & {};
|
|
74
|
+
export type ExtendContext<C extends object, E> = E extends object ? Simplify<C & E> : C;
|
|
75
|
+
export type Controller<HandlersAndSubControllers extends {
|
|
76
|
+
[key: string]: Handler<any, any, any> | Controller<any>;
|
|
77
|
+
}> = HandlersAndSubControllers;
|
|
78
|
+
export type InferClient<HandlersAndSubControllers extends {
|
|
79
|
+
[key: string]: Handler<any, any, any> | Controller<any>;
|
|
80
|
+
}> = {
|
|
81
|
+
[K in keyof HandlersAndSubControllers]: HandlersAndSubControllers[K] extends Handler<infer I, infer O, infer C> ? ((input: I, opts?: {
|
|
82
|
+
headers?: Record<string, string>;
|
|
83
|
+
query?: Record<string, string>;
|
|
84
|
+
}) => Promise<O>) & {
|
|
85
|
+
getFull: (input: I, opts?: {
|
|
86
|
+
headers?: Record<string, string>;
|
|
87
|
+
query?: Record<string, string>;
|
|
88
|
+
}) => Promise<{
|
|
89
|
+
data: O;
|
|
90
|
+
status: number;
|
|
91
|
+
headers: Record<string, string>;
|
|
92
|
+
}>;
|
|
93
|
+
} : HandlersAndSubControllers[K] extends Controller<infer U> ? InferClient<U> : never;
|
|
94
|
+
};
|
|
95
|
+
declare class Handler<Input, Output, Context extends {
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
} = {}> {
|
|
98
|
+
private _middleware;
|
|
99
|
+
private _handler;
|
|
100
|
+
private _validation;
|
|
101
|
+
constructor(_middleware?: Array<(ctx: Context & ServiceRequest) => Promise<any>>);
|
|
102
|
+
do<HandlerOutput>(handler: (ctx: Context & Omit<ServiceRequest, "body"> & {
|
|
103
|
+
input: Input;
|
|
104
|
+
}) => Promise<HandlerOutput>): Handler<Input, HandlerOutput, Context>;
|
|
105
|
+
use<T extends {
|
|
106
|
+
[key: string]: any;
|
|
107
|
+
} = {}>(handler: (ctx: Context & ServiceRequest) => Promise<T | undefined | void>): Handler<Input, Output, ExtendContext<Context, T>>;
|
|
108
|
+
input<HandlerInput>(validation: ValidationType<HandlerInput>): Handler<HandlerInput, Output, Context>;
|
|
109
|
+
run(req: ServiceRequest, initialContext: any): Promise<{
|
|
110
|
+
response: Output;
|
|
111
|
+
}>;
|
|
112
|
+
}
|
|
113
|
+
declare const SsoTenantStatus: {
|
|
114
|
+
readonly pending: "pending";
|
|
115
|
+
readonly completed: "completed";
|
|
116
|
+
};
|
|
117
|
+
export type SsoTenantStatus = (typeof SsoTenantStatus)[keyof typeof SsoTenantStatus];
|
|
118
|
+
declare const SsoConnectionProviderType: {
|
|
119
|
+
readonly saml: "saml";
|
|
120
|
+
readonly oidc: "oidc";
|
|
121
|
+
};
|
|
122
|
+
export type SsoConnectionProviderType = (typeof SsoConnectionProviderType)[keyof typeof SsoConnectionProviderType];
|
|
123
|
+
type ClientOpts$1 = Parameters<typeof createClient>[0];
|
|
124
|
+
export declare let createAresInternalClient: (o: ClientOpts$1) => InferClient<{
|
|
125
|
+
app: {
|
|
126
|
+
list: Handler<object & {
|
|
127
|
+
limit?: number;
|
|
128
|
+
after?: string;
|
|
129
|
+
before?: string;
|
|
130
|
+
cursor?: string;
|
|
131
|
+
order?: "asc" | "desc";
|
|
132
|
+
}, {
|
|
133
|
+
__typename: string;
|
|
134
|
+
items: {
|
|
135
|
+
object: "ares#app";
|
|
136
|
+
id: string;
|
|
137
|
+
clientId: string;
|
|
138
|
+
slug: string | null;
|
|
139
|
+
hasTerms: boolean;
|
|
140
|
+
defaultRedirectUrl: string;
|
|
141
|
+
redirectDomains: string[];
|
|
142
|
+
defaultTenant: {
|
|
143
|
+
id: string;
|
|
144
|
+
clientId: string;
|
|
145
|
+
} | null;
|
|
146
|
+
counts: {
|
|
147
|
+
users: number;
|
|
148
|
+
tenants: number;
|
|
149
|
+
};
|
|
150
|
+
createdAt: Date;
|
|
151
|
+
updatedAt: Date;
|
|
152
|
+
}[];
|
|
153
|
+
pagination: {
|
|
154
|
+
has_more_after: boolean;
|
|
155
|
+
has_more_before: boolean;
|
|
156
|
+
};
|
|
157
|
+
}, {
|
|
158
|
+
context: {
|
|
159
|
+
ip: string;
|
|
160
|
+
ua: string | null;
|
|
161
|
+
};
|
|
162
|
+
}>;
|
|
163
|
+
get: Handler<UndefinedIsOptional<{
|
|
164
|
+
id: string;
|
|
165
|
+
}>, {
|
|
166
|
+
object: "ares#app";
|
|
167
|
+
id: string;
|
|
168
|
+
clientId: string;
|
|
169
|
+
slug: string | null;
|
|
170
|
+
hasTerms: boolean;
|
|
171
|
+
defaultRedirectUrl: string;
|
|
172
|
+
redirectDomains: string[];
|
|
173
|
+
defaultTenant: {
|
|
174
|
+
id: string;
|
|
175
|
+
clientId: string;
|
|
176
|
+
} | null;
|
|
177
|
+
counts: {
|
|
178
|
+
users: number;
|
|
179
|
+
tenants: number;
|
|
180
|
+
};
|
|
181
|
+
createdAt: Date;
|
|
182
|
+
updatedAt: Date;
|
|
183
|
+
}, {
|
|
184
|
+
context: {
|
|
185
|
+
ip: string;
|
|
186
|
+
ua: string | null;
|
|
187
|
+
};
|
|
188
|
+
}>;
|
|
189
|
+
create: Handler<UndefinedIsOptional<{
|
|
190
|
+
defaultRedirectUrl: string;
|
|
191
|
+
slug: string | undefined;
|
|
192
|
+
redirectDomains: string[] | undefined;
|
|
193
|
+
}>, {
|
|
194
|
+
object: "ares#app";
|
|
195
|
+
id: string;
|
|
196
|
+
clientId: string;
|
|
197
|
+
slug: string | null;
|
|
198
|
+
hasTerms: boolean;
|
|
199
|
+
defaultRedirectUrl: string;
|
|
200
|
+
redirectDomains: string[];
|
|
201
|
+
defaultTenant: {
|
|
202
|
+
id: string;
|
|
203
|
+
clientId: string;
|
|
204
|
+
} | null;
|
|
205
|
+
counts: {
|
|
206
|
+
users: number;
|
|
207
|
+
tenants: number;
|
|
208
|
+
};
|
|
209
|
+
createdAt: Date;
|
|
210
|
+
updatedAt: Date;
|
|
211
|
+
}, {
|
|
212
|
+
context: {
|
|
213
|
+
ip: string;
|
|
214
|
+
ua: string | null;
|
|
215
|
+
};
|
|
216
|
+
}>;
|
|
217
|
+
update: Handler<UndefinedIsOptional<{
|
|
218
|
+
id: string;
|
|
219
|
+
slug: string | undefined;
|
|
220
|
+
redirectDomains: string[] | undefined;
|
|
221
|
+
}>, {
|
|
222
|
+
object: "ares#app";
|
|
223
|
+
id: string;
|
|
224
|
+
clientId: string;
|
|
225
|
+
slug: string | null;
|
|
226
|
+
hasTerms: boolean;
|
|
227
|
+
defaultRedirectUrl: string;
|
|
228
|
+
redirectDomains: string[];
|
|
229
|
+
defaultTenant: {
|
|
230
|
+
id: string;
|
|
231
|
+
clientId: string;
|
|
232
|
+
} | null;
|
|
233
|
+
counts: {
|
|
234
|
+
users: number;
|
|
235
|
+
tenants: number;
|
|
236
|
+
};
|
|
237
|
+
createdAt: Date;
|
|
238
|
+
updatedAt: Date;
|
|
239
|
+
}, {
|
|
240
|
+
context: {
|
|
241
|
+
ip: string;
|
|
242
|
+
ua: string | null;
|
|
243
|
+
};
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
246
|
+
tenant: {
|
|
247
|
+
list: Handler<Partial<Pick<{
|
|
248
|
+
appId: string;
|
|
249
|
+
}, never>> & {
|
|
250
|
+
appId: string;
|
|
251
|
+
} & {
|
|
252
|
+
limit?: number;
|
|
253
|
+
after?: string;
|
|
254
|
+
before?: string;
|
|
255
|
+
cursor?: string;
|
|
256
|
+
order?: "asc" | "desc";
|
|
257
|
+
}, {
|
|
258
|
+
__typename: string;
|
|
259
|
+
items: {
|
|
260
|
+
object: "ares#tenant";
|
|
261
|
+
id: string;
|
|
262
|
+
clientId: string;
|
|
263
|
+
appId: string | undefined;
|
|
264
|
+
counts: {
|
|
265
|
+
users: number;
|
|
266
|
+
};
|
|
267
|
+
createdAt: Date;
|
|
268
|
+
updatedAt: Date;
|
|
269
|
+
}[];
|
|
270
|
+
pagination: {
|
|
271
|
+
has_more_after: boolean;
|
|
272
|
+
has_more_before: boolean;
|
|
273
|
+
};
|
|
274
|
+
}, {
|
|
275
|
+
context: {
|
|
276
|
+
ip: string;
|
|
277
|
+
ua: string | null;
|
|
278
|
+
};
|
|
279
|
+
}>;
|
|
280
|
+
get: Handler<UndefinedIsOptional<{
|
|
281
|
+
id: string;
|
|
282
|
+
}>, {
|
|
283
|
+
object: "ares#tenant";
|
|
284
|
+
id: string;
|
|
285
|
+
clientId: string;
|
|
286
|
+
appId: string | undefined;
|
|
287
|
+
counts: {
|
|
288
|
+
users: number;
|
|
289
|
+
};
|
|
290
|
+
createdAt: Date;
|
|
291
|
+
updatedAt: Date;
|
|
292
|
+
}, {
|
|
293
|
+
context: {
|
|
294
|
+
ip: string;
|
|
295
|
+
ua: string | null;
|
|
296
|
+
};
|
|
297
|
+
}>;
|
|
298
|
+
};
|
|
299
|
+
user: {
|
|
300
|
+
list: Handler<Partial<Pick<{
|
|
301
|
+
appId: string;
|
|
302
|
+
search: string | undefined;
|
|
303
|
+
}, "search">> & {
|
|
304
|
+
appId: string;
|
|
305
|
+
} & {
|
|
306
|
+
limit?: number;
|
|
307
|
+
after?: string;
|
|
308
|
+
before?: string;
|
|
309
|
+
cursor?: string;
|
|
310
|
+
order?: "asc" | "desc";
|
|
311
|
+
}, {
|
|
312
|
+
__typename: string;
|
|
313
|
+
items: {
|
|
314
|
+
object: string;
|
|
315
|
+
status: string;
|
|
316
|
+
id: string;
|
|
317
|
+
email: string;
|
|
318
|
+
name: string;
|
|
319
|
+
firstName: string;
|
|
320
|
+
lastName: string;
|
|
321
|
+
lastLoginAt: Date | null;
|
|
322
|
+
lastActiveAt: Date | null;
|
|
323
|
+
createdAt: Date;
|
|
324
|
+
updatedAt: Date;
|
|
325
|
+
imageUrl: string;
|
|
326
|
+
}[];
|
|
327
|
+
pagination: {
|
|
328
|
+
has_more_after: boolean;
|
|
329
|
+
has_more_before: boolean;
|
|
330
|
+
};
|
|
331
|
+
}, {
|
|
332
|
+
context: {
|
|
333
|
+
ip: string;
|
|
334
|
+
ua: string | null;
|
|
335
|
+
};
|
|
336
|
+
}>;
|
|
337
|
+
get: Handler<UndefinedIsOptional<{
|
|
338
|
+
id: string;
|
|
339
|
+
}>, {
|
|
340
|
+
object: string;
|
|
341
|
+
status: string;
|
|
342
|
+
id: string;
|
|
343
|
+
email: string;
|
|
344
|
+
name: string;
|
|
345
|
+
firstName: string;
|
|
346
|
+
lastName: string;
|
|
347
|
+
lastLoginAt: Date | null;
|
|
348
|
+
lastActiveAt: Date | null;
|
|
349
|
+
createdAt: Date;
|
|
350
|
+
updatedAt: Date;
|
|
351
|
+
imageUrl: string;
|
|
352
|
+
}, {
|
|
353
|
+
context: {
|
|
354
|
+
ip: string;
|
|
355
|
+
ua: string | null;
|
|
356
|
+
};
|
|
357
|
+
}>;
|
|
358
|
+
};
|
|
359
|
+
sso: {
|
|
360
|
+
listTenants: Handler<Partial<Pick<{
|
|
361
|
+
appId: string;
|
|
362
|
+
}, never>> & {
|
|
363
|
+
appId: string;
|
|
364
|
+
} & {
|
|
365
|
+
limit?: number;
|
|
366
|
+
after?: string;
|
|
367
|
+
before?: string;
|
|
368
|
+
cursor?: string;
|
|
369
|
+
order?: "asc" | "desc";
|
|
370
|
+
}, {
|
|
371
|
+
__typename: string;
|
|
372
|
+
items: {
|
|
373
|
+
object: "ares#ssoTenant";
|
|
374
|
+
id: string;
|
|
375
|
+
name: string;
|
|
376
|
+
status: SsoTenantStatus;
|
|
377
|
+
clientId: string;
|
|
378
|
+
externalId: string | null;
|
|
379
|
+
isGlobal: boolean;
|
|
380
|
+
counts: {
|
|
381
|
+
connections: number;
|
|
382
|
+
};
|
|
383
|
+
createdAt: Date;
|
|
384
|
+
updatedAt: Date;
|
|
385
|
+
}[];
|
|
386
|
+
pagination: {
|
|
387
|
+
has_more_after: boolean;
|
|
388
|
+
has_more_before: boolean;
|
|
389
|
+
};
|
|
390
|
+
}, {
|
|
391
|
+
context: {
|
|
392
|
+
ip: string;
|
|
393
|
+
ua: string | null;
|
|
394
|
+
};
|
|
395
|
+
}>;
|
|
396
|
+
getTenant: Handler<UndefinedIsOptional<{
|
|
397
|
+
id: string;
|
|
398
|
+
}>, {
|
|
399
|
+
object: "ares#ssoTenant";
|
|
400
|
+
id: string;
|
|
401
|
+
name: string;
|
|
402
|
+
status: SsoTenantStatus;
|
|
403
|
+
clientId: string;
|
|
404
|
+
externalId: string | null;
|
|
405
|
+
isGlobal: boolean;
|
|
406
|
+
counts: {
|
|
407
|
+
connections: number;
|
|
408
|
+
};
|
|
409
|
+
createdAt: Date;
|
|
410
|
+
updatedAt: Date;
|
|
411
|
+
}, {
|
|
412
|
+
context: {
|
|
413
|
+
ip: string;
|
|
414
|
+
ua: string | null;
|
|
415
|
+
};
|
|
416
|
+
}>;
|
|
417
|
+
createTenant: Handler<UndefinedIsOptional<{
|
|
418
|
+
appId: string;
|
|
419
|
+
name: string;
|
|
420
|
+
}>, {
|
|
421
|
+
object: "ares#ssoTenant";
|
|
422
|
+
id: string;
|
|
423
|
+
name: string;
|
|
424
|
+
status: SsoTenantStatus;
|
|
425
|
+
clientId: string;
|
|
426
|
+
externalId: string | null;
|
|
427
|
+
isGlobal: boolean;
|
|
428
|
+
counts: {
|
|
429
|
+
connections: number;
|
|
430
|
+
};
|
|
431
|
+
createdAt: Date;
|
|
432
|
+
updatedAt: Date;
|
|
433
|
+
}, {
|
|
434
|
+
context: {
|
|
435
|
+
ip: string;
|
|
436
|
+
ua: string | null;
|
|
437
|
+
};
|
|
438
|
+
}>;
|
|
439
|
+
createSetup: Handler<UndefinedIsOptional<{
|
|
440
|
+
tenantId: string;
|
|
441
|
+
redirectUri: string;
|
|
442
|
+
}>, {
|
|
443
|
+
setupUrl: string;
|
|
444
|
+
}, {
|
|
445
|
+
context: {
|
|
446
|
+
ip: string;
|
|
447
|
+
ua: string | null;
|
|
448
|
+
};
|
|
449
|
+
}>;
|
|
450
|
+
listConnections: Handler<Partial<Pick<{
|
|
451
|
+
tenantId: string;
|
|
452
|
+
}, never>> & {
|
|
453
|
+
tenantId: string;
|
|
454
|
+
} & {
|
|
455
|
+
limit?: number;
|
|
456
|
+
after?: string;
|
|
457
|
+
before?: string;
|
|
458
|
+
cursor?: string;
|
|
459
|
+
order?: "asc" | "desc";
|
|
460
|
+
}, {
|
|
461
|
+
__typename: string;
|
|
462
|
+
items: {
|
|
463
|
+
object: "ares#ssoConnection";
|
|
464
|
+
id: string;
|
|
465
|
+
name: string;
|
|
466
|
+
providerType: SsoConnectionProviderType;
|
|
467
|
+
providerName: string | null;
|
|
468
|
+
createdAt: Date;
|
|
469
|
+
}[];
|
|
470
|
+
pagination: {
|
|
471
|
+
has_more_after: boolean;
|
|
472
|
+
has_more_before: boolean;
|
|
473
|
+
};
|
|
474
|
+
}, {
|
|
475
|
+
context: {
|
|
476
|
+
ip: string;
|
|
477
|
+
ua: string | null;
|
|
478
|
+
};
|
|
479
|
+
}>;
|
|
480
|
+
};
|
|
481
|
+
oauth: {
|
|
482
|
+
exchange: Handler<UndefinedIsOptional<{
|
|
483
|
+
clientId: string;
|
|
484
|
+
authorizationCode: string;
|
|
485
|
+
}>, {
|
|
486
|
+
user: {
|
|
487
|
+
id: string;
|
|
488
|
+
email: string;
|
|
489
|
+
name: string;
|
|
490
|
+
firstName: string;
|
|
491
|
+
lastName: string;
|
|
492
|
+
createdAt: Date;
|
|
493
|
+
updatedAt: Date;
|
|
494
|
+
};
|
|
495
|
+
session: {
|
|
496
|
+
id: string;
|
|
497
|
+
expiresAt: Date;
|
|
498
|
+
};
|
|
499
|
+
}, {
|
|
500
|
+
context: {
|
|
501
|
+
ip: string;
|
|
502
|
+
ua: string | null;
|
|
503
|
+
};
|
|
504
|
+
}>;
|
|
505
|
+
};
|
|
506
|
+
session: {
|
|
507
|
+
get: Handler<UndefinedIsOptional<{
|
|
508
|
+
sessionId: string;
|
|
509
|
+
}>, {
|
|
510
|
+
id: string;
|
|
511
|
+
userId: string;
|
|
512
|
+
deviceId: string;
|
|
513
|
+
impersonationOid: bigint | null;
|
|
514
|
+
loggedOutAt: Date | null;
|
|
515
|
+
expiresAt: Date;
|
|
516
|
+
createdAt: Date;
|
|
517
|
+
}, {
|
|
518
|
+
context: {
|
|
519
|
+
ip: string;
|
|
520
|
+
ua: string | null;
|
|
521
|
+
};
|
|
522
|
+
}>;
|
|
523
|
+
logout: Handler<UndefinedIsOptional<{
|
|
524
|
+
sessionId: string;
|
|
525
|
+
}>, {}, {
|
|
526
|
+
context: {
|
|
527
|
+
ip: string;
|
|
528
|
+
ua: string | null;
|
|
529
|
+
};
|
|
530
|
+
}>;
|
|
531
|
+
};
|
|
532
|
+
}>;
|
|
533
|
+
|
|
534
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.module.js","sources":["../src/index.ts"],"sourcesContent":["import { createClient } from '@lowerdeck/rpc-client';\nimport type { InternalClient } from '../../../service/src/apis/internal';\n\ntype ClientOpts = Parameters<typeof createClient>[0];\n\nexport let createAresInternalClient = (o: ClientOpts) => createClient<InternalClient>(o);\n"],"names":["createAresInternalClient","o","createClient"],"mappings":"qDAKW,IAAAA,EAA2B,SAACC,GAAa,OAAKC,EAA6BD,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@lowerdeck/rpc-client")):"function"==typeof define&&define.amd?define(["exports","@lowerdeck/rpc-client"],n):n((e||self).aresClient={},e.rpcClient)}(this,function(e,n){e.createAresInternalClient=function(e){return n.createClient(e)}});
|
|
2
|
+
//# sourceMappingURL=index.umd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { createClient } from '@lowerdeck/rpc-client';\nimport type { InternalClient } from '../../../service/src/apis/internal';\n\ntype ClientOpts = Parameters<typeof createClient>[0];\n\nexport let createAresInternalClient = (o: ClientOpts) => createClient<InternalClient>(o);\n"],"names":["o","createClient"],"mappings":"sUAKsC,SAACA,GAAa,OAAKC,EAAAA,aAA6BD,EAAE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@metorial-services/ares-client",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/**",
|
|
9
|
+
"dist/**",
|
|
10
|
+
"README.md",
|
|
11
|
+
"package.json"
|
|
12
|
+
],
|
|
13
|
+
"author": "Tobias Herber",
|
|
14
|
+
"license": "Apache 2",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"source": "src/index.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"require": "./dist/index.cjs",
|
|
20
|
+
"import": "./dist/index.module.js",
|
|
21
|
+
"default": "./dist/index.module.js"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.cjs",
|
|
24
|
+
"module": "./dist/index.module.js",
|
|
25
|
+
"types": "dist/index.d.ts",
|
|
26
|
+
"unpkg": "./dist/index.umd.js",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"test": "vitest run --passWithNoTests",
|
|
29
|
+
"lint": "prettier src/**/*.ts --check",
|
|
30
|
+
"build": "rm -rf ./dist && microbundle && dts-bundle-generator --config dts-bundle-generator.config.json",
|
|
31
|
+
"prepublish": "bun run build"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@lowerdeck/rpc-client": "^1.0.4"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@types/node": "^25.0.3",
|
|
38
|
+
"dts-bundle-generator": "^9.5.1",
|
|
39
|
+
"microbundle": "^0.15.1",
|
|
40
|
+
"typescript": "^5.8.3",
|
|
41
|
+
"vitest": "^3.1.2"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createClient } from '@lowerdeck/rpc-client';
|
|
2
|
+
import type { InternalClient } from '../../../service/src/apis/internal';
|
|
3
|
+
|
|
4
|
+
type ClientOpts = Parameters<typeof createClient>[0];
|
|
5
|
+
|
|
6
|
+
export let createAresInternalClient = (o: ClientOpts) => createClient<InternalClient>(o);
|