@frogbotai/plugin-api-keys 0.29.0 → 0.31.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/dist/client/ApiKeysManager.d.ts.map +1 -1
- package/dist/client/ApiKeysManager.js +184 -21
- package/dist/client/ApiKeysManager.js.map +1 -1
- package/dist/client.d.ts +0 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/collection.d.ts +1 -1
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +214 -110
- package/dist/collection.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -39
- package/dist/index.js.map +1 -1
- package/dist/server/services.d.ts.map +1 -1
- package/dist/server/services.js +63 -28
- package/dist/server/services.js.map +1 -1
- package/dist/server/token.js +11 -3
- package/dist/server/token.js.map +1 -1
- package/dist/strategy.d.ts.map +1 -1
- package/dist/strategy.js +51 -29
- package/dist/strategy.js.map +1 -1
- package/package.json +7 -7
- package/dist/client/CostUSD.d.ts +0 -11
- package/dist/client/CostUSD.d.ts.map +0 -1
- package/dist/client/CostUSD.js +0 -19
- package/dist/client/CostUSD.js.map +0 -1
package/dist/collection.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
+
import { moneyField } from 'frogbot';
|
|
1
2
|
import { ApiKeyServiceError, mintApiKey, revokeApiKey, rotateApiKey } from './server/services.js';
|
|
2
3
|
const MANAGER_COMPONENT = '@frogbotai/plugin-api-keys/client#ApiKeysManager';
|
|
3
|
-
const ownKeys = ({ req })
|
|
4
|
+
const ownKeys = ({ req })=>req.user ? {
|
|
5
|
+
owner: {
|
|
6
|
+
equals: req.user.id
|
|
7
|
+
}
|
|
8
|
+
} : false;
|
|
4
9
|
function mergeFields(...groups) {
|
|
5
10
|
const fields = new Map();
|
|
6
|
-
for (const group of groups)
|
|
7
|
-
for (const field of group ?? [])
|
|
11
|
+
for (const group of groups){
|
|
12
|
+
for (const field of group ?? []){
|
|
8
13
|
const key = 'name' in field && field.name ? field.name : JSON.stringify(field);
|
|
9
14
|
fields.set(key, field);
|
|
10
15
|
}
|
|
11
16
|
}
|
|
12
|
-
return [
|
|
17
|
+
return [
|
|
18
|
+
...fields.values()
|
|
19
|
+
];
|
|
13
20
|
}
|
|
14
|
-
function createViews({ usageCollection, views
|
|
21
|
+
function createViews({ usageCollection, views }) {
|
|
15
22
|
if (!views?.length) {
|
|
16
23
|
return [
|
|
17
24
|
{
|
|
@@ -19,123 +26,195 @@ function createViews({ usageCollection, views, }) {
|
|
|
19
26
|
defaultFields: [
|
|
20
27
|
'name',
|
|
21
28
|
'prefix',
|
|
22
|
-
...
|
|
29
|
+
...usageCollection ? [
|
|
30
|
+
'totalCostUSD'
|
|
31
|
+
] : [],
|
|
23
32
|
'lastUsedAt',
|
|
24
33
|
'revokedAt',
|
|
25
|
-
'actions'
|
|
34
|
+
'actions'
|
|
26
35
|
],
|
|
27
|
-
components: {
|
|
28
|
-
|
|
36
|
+
components: {
|
|
37
|
+
beforeTable: [
|
|
38
|
+
MANAGER_COMPONENT
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
29
42
|
];
|
|
30
43
|
}
|
|
31
|
-
const index = views.findIndex((view)
|
|
32
|
-
return views.map((view, position)
|
|
33
|
-
? {
|
|
44
|
+
const index = views.findIndex((view)=>view.type === 'list');
|
|
45
|
+
return views.map((view, position)=>position === index && view.type === 'list' ? {
|
|
34
46
|
...view,
|
|
35
47
|
components: {
|
|
36
48
|
...view.components,
|
|
37
|
-
beforeTable: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
beforeTable: [
|
|
50
|
+
MANAGER_COMPONENT,
|
|
51
|
+
...view.components?.beforeTable ?? []
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
} : view);
|
|
41
55
|
}
|
|
42
|
-
function createEndpoints({ collectionSlug, tokenPrefix, canRevokeAnyKey
|
|
56
|
+
function createEndpoints({ collectionSlug, tokenPrefix, canRevokeAnyKey }) {
|
|
43
57
|
return [
|
|
44
58
|
{
|
|
45
59
|
method: 'post',
|
|
46
60
|
path: '/mint',
|
|
47
|
-
handler: async (req)
|
|
48
|
-
if (!req.user)
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
handler: async (req)=>{
|
|
62
|
+
if (!req.user) return Response.json({
|
|
63
|
+
error: 'Authentication required'
|
|
64
|
+
}, {
|
|
65
|
+
status: 401
|
|
66
|
+
});
|
|
67
|
+
const body = await req.json?.().catch(()=>null) ?? null;
|
|
51
68
|
const name = typeof body?.name === 'string' ? body.name.trim() : '';
|
|
52
|
-
if (!name)
|
|
53
|
-
|
|
69
|
+
if (!name) return Response.json({
|
|
70
|
+
error: 'Name is required'
|
|
71
|
+
}, {
|
|
72
|
+
status: 400
|
|
73
|
+
});
|
|
54
74
|
try {
|
|
55
|
-
return Response.json(await mintApiKey({
|
|
56
|
-
|
|
75
|
+
return Response.json(await mintApiKey({
|
|
76
|
+
req,
|
|
77
|
+
collectionSlug,
|
|
78
|
+
tokenPrefix,
|
|
79
|
+
name
|
|
80
|
+
}), {
|
|
81
|
+
status: 201
|
|
57
82
|
});
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
83
|
+
} catch (error) {
|
|
60
84
|
if (error instanceof ApiKeyServiceError && error.code === 'authentication_required') {
|
|
61
|
-
return Response.json({
|
|
85
|
+
return Response.json({
|
|
86
|
+
error: 'Authentication required'
|
|
87
|
+
}, {
|
|
88
|
+
status: 401
|
|
89
|
+
});
|
|
62
90
|
}
|
|
63
91
|
throw error;
|
|
64
92
|
}
|
|
65
|
-
}
|
|
93
|
+
}
|
|
66
94
|
},
|
|
67
95
|
{
|
|
68
96
|
method: 'post',
|
|
69
97
|
path: '/:id/revoke',
|
|
70
|
-
handler: async (req)
|
|
71
|
-
if (!req.user)
|
|
72
|
-
|
|
98
|
+
handler: async (req)=>{
|
|
99
|
+
if (!req.user) return Response.json({
|
|
100
|
+
error: 'Authentication required'
|
|
101
|
+
}, {
|
|
102
|
+
status: 401
|
|
103
|
+
});
|
|
73
104
|
const id = req.routeParams?.id;
|
|
74
105
|
if (typeof id !== 'string' || !id) {
|
|
75
|
-
return Response.json({
|
|
106
|
+
return Response.json({
|
|
107
|
+
error: 'API key not found'
|
|
108
|
+
}, {
|
|
109
|
+
status: 404
|
|
110
|
+
});
|
|
76
111
|
}
|
|
77
112
|
try {
|
|
78
|
-
const anyOwner =
|
|
79
|
-
const { name: _name, owner: _owner, ...result } = await revokeApiKey({
|
|
113
|
+
const anyOwner = await canRevokeAnyKey?.(req) === true;
|
|
114
|
+
const { name: _name, owner: _owner, ...result } = await revokeApiKey({
|
|
115
|
+
req,
|
|
116
|
+
collectionSlug,
|
|
117
|
+
id,
|
|
118
|
+
anyOwner
|
|
119
|
+
});
|
|
80
120
|
return Response.json(result);
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
121
|
+
} catch (error) {
|
|
83
122
|
if (error instanceof ApiKeyServiceError && error.code === 'authentication_required') {
|
|
84
|
-
return Response.json({
|
|
123
|
+
return Response.json({
|
|
124
|
+
error: 'Authentication required'
|
|
125
|
+
}, {
|
|
126
|
+
status: 401
|
|
127
|
+
});
|
|
85
128
|
}
|
|
86
129
|
if (error instanceof ApiKeyServiceError && error.code === 'not_found') {
|
|
87
|
-
return Response.json({
|
|
130
|
+
return Response.json({
|
|
131
|
+
error: 'API key not found'
|
|
132
|
+
}, {
|
|
133
|
+
status: 404
|
|
134
|
+
});
|
|
88
135
|
}
|
|
89
136
|
throw error;
|
|
90
137
|
}
|
|
91
|
-
}
|
|
138
|
+
}
|
|
92
139
|
},
|
|
93
140
|
{
|
|
94
141
|
method: 'post',
|
|
95
142
|
path: '/:id/rotate',
|
|
96
|
-
handler: async (req)
|
|
97
|
-
if (!req.user)
|
|
98
|
-
|
|
143
|
+
handler: async (req)=>{
|
|
144
|
+
if (!req.user) return Response.json({
|
|
145
|
+
error: 'Authentication required'
|
|
146
|
+
}, {
|
|
147
|
+
status: 401
|
|
148
|
+
});
|
|
99
149
|
const id = req.routeParams?.id;
|
|
100
150
|
if (typeof id !== 'string' || !id) {
|
|
101
|
-
return Response.json({
|
|
151
|
+
return Response.json({
|
|
152
|
+
error: 'API key not found'
|
|
153
|
+
}, {
|
|
154
|
+
status: 404
|
|
155
|
+
});
|
|
102
156
|
}
|
|
103
157
|
try {
|
|
104
|
-
const anyOwner =
|
|
105
|
-
return Response.json(await rotateApiKey({
|
|
106
|
-
|
|
107
|
-
|
|
158
|
+
const anyOwner = await canRevokeAnyKey?.(req) === true;
|
|
159
|
+
return Response.json(await rotateApiKey({
|
|
160
|
+
req,
|
|
161
|
+
collectionSlug,
|
|
162
|
+
id,
|
|
163
|
+
tokenPrefix,
|
|
164
|
+
anyOwner
|
|
165
|
+
}), {
|
|
166
|
+
status: 201
|
|
167
|
+
});
|
|
168
|
+
} catch (error) {
|
|
108
169
|
if (error instanceof ApiKeyServiceError && error.code === 'authentication_required') {
|
|
109
|
-
return Response.json({
|
|
170
|
+
return Response.json({
|
|
171
|
+
error: 'Authentication required'
|
|
172
|
+
}, {
|
|
173
|
+
status: 401
|
|
174
|
+
});
|
|
110
175
|
}
|
|
111
176
|
if (error instanceof ApiKeyServiceError && error.code === 'not_found') {
|
|
112
|
-
return Response.json({
|
|
177
|
+
return Response.json({
|
|
178
|
+
error: 'API key not found'
|
|
179
|
+
}, {
|
|
180
|
+
status: 404
|
|
181
|
+
});
|
|
113
182
|
}
|
|
114
183
|
throw error;
|
|
115
184
|
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
118
187
|
];
|
|
119
188
|
}
|
|
120
189
|
export function createApiKeysCollection(options) {
|
|
121
190
|
const { authCollection, collectionSlug, collection, existing, usageCollection } = options;
|
|
122
191
|
const fields = [
|
|
123
|
-
{
|
|
192
|
+
{
|
|
193
|
+
name: 'name',
|
|
194
|
+
type: 'text',
|
|
195
|
+
required: true
|
|
196
|
+
},
|
|
124
197
|
{
|
|
125
198
|
name: 'owner',
|
|
126
199
|
type: 'relationship',
|
|
127
200
|
relationTo: authCollection,
|
|
128
201
|
required: true,
|
|
129
202
|
index: true,
|
|
130
|
-
access: {
|
|
203
|
+
access: {
|
|
204
|
+
update: ()=>false
|
|
205
|
+
}
|
|
131
206
|
},
|
|
132
207
|
{
|
|
133
208
|
name: 'prefix',
|
|
134
209
|
type: 'text',
|
|
135
210
|
required: true,
|
|
136
211
|
index: true,
|
|
137
|
-
access: {
|
|
138
|
-
|
|
212
|
+
access: {
|
|
213
|
+
update: ()=>false
|
|
214
|
+
},
|
|
215
|
+
admin: {
|
|
216
|
+
readOnly: true
|
|
217
|
+
}
|
|
139
218
|
},
|
|
140
219
|
{
|
|
141
220
|
name: 'tokenHash',
|
|
@@ -143,97 +222,122 @@ export function createApiKeysCollection(options) {
|
|
|
143
222
|
required: true,
|
|
144
223
|
unique: true,
|
|
145
224
|
index: true,
|
|
146
|
-
access: {
|
|
147
|
-
|
|
225
|
+
access: {
|
|
226
|
+
read: ()=>false,
|
|
227
|
+
update: ()=>false
|
|
228
|
+
},
|
|
229
|
+
admin: {
|
|
230
|
+
hidden: true
|
|
231
|
+
}
|
|
148
232
|
},
|
|
149
233
|
{
|
|
150
234
|
name: 'lastUsedAt',
|
|
151
235
|
type: 'date',
|
|
152
|
-
access: {
|
|
153
|
-
|
|
236
|
+
access: {
|
|
237
|
+
update: ()=>false
|
|
238
|
+
},
|
|
239
|
+
admin: {
|
|
240
|
+
readOnly: true
|
|
241
|
+
}
|
|
154
242
|
},
|
|
155
243
|
{
|
|
156
244
|
name: 'revokedAt',
|
|
157
245
|
type: 'date',
|
|
158
246
|
index: true,
|
|
159
|
-
access: {
|
|
160
|
-
|
|
247
|
+
access: {
|
|
248
|
+
update: ()=>false
|
|
249
|
+
},
|
|
250
|
+
admin: {
|
|
251
|
+
readOnly: true,
|
|
252
|
+
condition: (_, siblingData)=>Boolean(siblingData.revokedAt)
|
|
253
|
+
}
|
|
161
254
|
},
|
|
162
|
-
...
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
admin: {
|
|
170
|
-
readOnly: true,
|
|
171
|
-
components: {
|
|
172
|
-
Cell: '@frogbotai/plugin-api-keys/client#CostUSDCell',
|
|
173
|
-
Field: '@frogbotai/plugin-api-keys/client#CostUSDField',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
hooks: {
|
|
177
|
-
afterRead: [
|
|
178
|
-
async ({ data, req }) => {
|
|
179
|
-
if (data?.id === undefined)
|
|
180
|
-
return 0;
|
|
181
|
-
const result = await req.frogbot.find({
|
|
182
|
-
collection: usageCollection,
|
|
183
|
-
depth: 0,
|
|
184
|
-
overrideAccess: true,
|
|
185
|
-
pagination: false,
|
|
186
|
-
req,
|
|
187
|
-
where: { apiKey: { equals: data.id } },
|
|
188
|
-
});
|
|
189
|
-
return result.docs.reduce((total, doc) => {
|
|
190
|
-
const cost = doc.costUSD;
|
|
191
|
-
return total + (typeof cost === 'number' ? cost : 0);
|
|
192
|
-
}, 0);
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
},
|
|
255
|
+
...usageCollection ? [
|
|
256
|
+
moneyField({
|
|
257
|
+
name: 'totalCostUSD',
|
|
258
|
+
label: 'Total Cost (USD)',
|
|
259
|
+
virtual: true,
|
|
260
|
+
admin: {
|
|
261
|
+
readOnly: true
|
|
196
262
|
},
|
|
197
|
-
|
|
198
|
-
|
|
263
|
+
hooks: {
|
|
264
|
+
afterRead: [
|
|
265
|
+
async ({ data, req })=>{
|
|
266
|
+
if (data?.id === undefined) return 0;
|
|
267
|
+
const result = await req.frogbot.find({
|
|
268
|
+
collection: usageCollection,
|
|
269
|
+
depth: 0,
|
|
270
|
+
overrideAccess: true,
|
|
271
|
+
pagination: false,
|
|
272
|
+
req,
|
|
273
|
+
where: {
|
|
274
|
+
apiKey: {
|
|
275
|
+
equals: data.id
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
return result.docs.reduce((total, doc)=>{
|
|
280
|
+
const cost = doc.costUSD;
|
|
281
|
+
return total + (typeof cost === 'number' ? cost : 0);
|
|
282
|
+
}, 0);
|
|
283
|
+
}
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
] : [],
|
|
199
288
|
{
|
|
200
289
|
name: 'actions',
|
|
201
290
|
type: 'ui',
|
|
202
|
-
admin: {
|
|
203
|
-
|
|
291
|
+
admin: {
|
|
292
|
+
components: {
|
|
293
|
+
Cell: '@frogbotai/plugin-api-keys/client#RevokeApiKey'
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
204
297
|
];
|
|
205
298
|
const endpoints = createEndpoints(options);
|
|
206
299
|
return {
|
|
207
300
|
slug: collectionSlug,
|
|
208
|
-
labels: {
|
|
301
|
+
labels: {
|
|
302
|
+
singular: 'API Key',
|
|
303
|
+
plural: 'API Keys'
|
|
304
|
+
},
|
|
209
305
|
timestamps: true,
|
|
210
306
|
...existing,
|
|
211
307
|
...collection,
|
|
212
308
|
access: {
|
|
213
|
-
create: ()
|
|
214
|
-
delete: ()
|
|
309
|
+
create: ()=>false,
|
|
310
|
+
delete: ()=>false,
|
|
215
311
|
read: ownKeys,
|
|
216
312
|
update: ownKeys,
|
|
217
313
|
...existing?.access,
|
|
218
|
-
...collection?.access
|
|
314
|
+
...collection?.access
|
|
219
315
|
},
|
|
220
316
|
admin: {
|
|
221
317
|
icon: 'key-round',
|
|
222
318
|
useAsTitle: 'name',
|
|
223
319
|
...existing?.admin,
|
|
224
320
|
...collection?.admin,
|
|
225
|
-
components: {
|
|
321
|
+
components: {
|
|
322
|
+
...existing?.admin?.components,
|
|
323
|
+
...collection?.admin?.components
|
|
324
|
+
},
|
|
226
325
|
views: createViews({
|
|
227
326
|
usageCollection,
|
|
228
|
-
views: collection?.admin?.views ?? existing?.admin?.views
|
|
229
|
-
})
|
|
327
|
+
views: collection?.admin?.views ?? existing?.admin?.views
|
|
328
|
+
})
|
|
230
329
|
},
|
|
231
|
-
endpoints: [
|
|
330
|
+
endpoints: [
|
|
331
|
+
...endpoints,
|
|
332
|
+
...existing?.endpoints ?? [],
|
|
333
|
+
...collection?.endpoints ?? []
|
|
334
|
+
],
|
|
232
335
|
fields: mergeFields(fields, existing?.fields, collection?.fields),
|
|
233
336
|
hooks: {
|
|
234
337
|
...existing?.hooks,
|
|
235
|
-
...collection?.hooks
|
|
236
|
-
}
|
|
338
|
+
...collection?.hooks
|
|
339
|
+
}
|
|
237
340
|
};
|
|
238
341
|
}
|
|
342
|
+
|
|
239
343
|
//# sourceMappingURL=collection.js.map
|
package/dist/collection.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../src/collection.ts"],"names":["moneyField","ApiKeyServiceError","mintApiKey","revokeApiKey","rotateApiKey","MANAGER_COMPONENT","ownKeys","req","user","owner","equals","id","mergeFields","groups","fields","Map","group","field","key","name","JSON","stringify","set","values","createViews","usageCollection","views","length","type","defaultFields","components","beforeTable","index","findIndex","view","map","position","createEndpoints","collectionSlug","tokenPrefix","canRevokeAnyKey","method","path","handler","Response","json","error","status","body","catch","trim","code","routeParams","anyOwner","_name","_owner","result","createApiKeysCollection","options","authCollection","collection","existing","required","relationTo","access","update","admin","readOnly","unique","read","hidden","condition","_","siblingData","Boolean","revokedAt","label","virtual","hooks","afterRead","data","undefined","frogbot","find","depth","overrideAccess","pagination","where","apiKey","docs","reduce","total","doc","cost","costUSD","Cell","endpoints","slug","labels","singular","plural","timestamps","create","delete","icon","useAsTitle"],"mappings":"AAAA,SAOEA,UAAU,QACL,UAAU;AAEjB,SAASC,kBAAkB,EAAEC,UAAU,EAAEC,YAAY,EAAEC,YAAY,QAAQ,uBAAuB;AAElG,MAAMC,oBAAoB;AAY1B,MAAMC,UAAkB,CAA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Q+C,UAAU/C,QAAQ8C,YAAY9C;QAC1DgE,OAAO;YACL,GAAGjB,UAAUiB,KAAK;YAClB,GAAGlB,YAAYkB,KAAK;QACtB;IACF;AACF","file":"collection.js"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC;AAKlF,YAAY,EACV,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,MAAM,MAAM,oBAAoB,GAAG;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACvC,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvE,CAAC;AAEF,wBAAgB,aAAa,CAAC,OAAO,GAAE,oBAAyB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBA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