@frogbotai/plugin-api-keys 0.19.0 → 0.20.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/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -119
- package/dist/index.js.map +1 -1
- package/dist/strategy.d.ts.map +1 -1
- package/dist/strategy.js +4 -0
- package/dist/strategy.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type CollectionConfig, type FrogbotRequest, type Plugin } from 'frogbot';
|
|
2
|
-
export type { PolicyDocument } from './policy.js';
|
|
3
2
|
export type { MintApiKeyOptions, RevokeApiKeyOptions, RotateApiKeyOptions, } from './server/services.js';
|
|
4
3
|
export { ApiKeyServiceError, mintApiKey, revokeApiKey, rotateApiKey } from './server/services.js';
|
|
5
4
|
export type { ApiKeyHeaderOptions, ApiKeyTokenOptions } from './server/token.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,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,CA+ExE"}
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,16 @@
|
|
|
1
|
-
import { calculateCostUSD, calculateModelCostUSD } from '@frogbotai/gateway';
|
|
2
|
-
import { BudgetExceededError, ModelNotAllowedError } from '@frogbotai/gateway/errors';
|
|
3
|
-
import { getConfiguredModelIds, } from 'frogbot';
|
|
4
1
|
import { createApiKeysCollection } from './collection.js';
|
|
5
|
-
import { createPolicyFields } from './fields.js';
|
|
6
|
-
import { SerialQueue } from './policy.js';
|
|
7
2
|
import { createApiKeyStrategy } from './strategy.js';
|
|
8
3
|
export { ApiKeyServiceError, mintApiKey, revokeApiKey, rotateApiKey } from './server/services.js';
|
|
9
4
|
export { createApiKeyToken, extractApiKeyToken, getApiKeyPrefix, hashApiKeyToken, } from './server/token.js';
|
|
10
5
|
export { isApiKeyStrategy } from './strategy.js';
|
|
11
|
-
function isPricedCustomProvider(entry) {
|
|
12
|
-
return (typeof entry === 'object' &&
|
|
13
|
-
entry !== null &&
|
|
14
|
-
'type' in entry &&
|
|
15
|
-
entry.type === 'openai-compatible' &&
|
|
16
|
-
'models' in entry &&
|
|
17
|
-
Array.isArray(entry.models));
|
|
18
|
-
}
|
|
19
6
|
export function apiKeysPlugin(options = {}) {
|
|
20
|
-
const queue = new SerialQueue();
|
|
21
7
|
return (config) => {
|
|
22
8
|
const authCollection = options.authCollection ?? 'users';
|
|
23
9
|
const collectionSlug = options.collectionSlug ?? 'api-keys';
|
|
24
|
-
const configuredCosts = new Map();
|
|
25
|
-
for (const [provider, entry] of Object.entries(config.ai?.providers ?? {})) {
|
|
26
|
-
if (!isPricedCustomProvider(entry))
|
|
27
|
-
continue;
|
|
28
|
-
for (const model of entry.models) {
|
|
29
|
-
if (!model.cost)
|
|
30
|
-
continue;
|
|
31
|
-
configuredCosts.set(`${provider}/${model.id}`, {
|
|
32
|
-
input: model.cost.input ?? 0,
|
|
33
|
-
output: model.cost.output ?? 0,
|
|
34
|
-
...(model.cost.cache_read !== undefined && { cache_read: model.cost.cache_read }),
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
10
|
const auth = config.collections.find((collection) => collection.slug === authCollection);
|
|
39
11
|
if (!auth || auth.auth === undefined || auth.auth === false) {
|
|
40
12
|
throw new Error(`[plugin-api-keys] Auth collection '${authCollection}' must exist and have auth enabled.`);
|
|
41
13
|
}
|
|
42
|
-
const reservedPolicyFields = new Set(['monthlyBudget', 'models', 'spendThisPeriodUSD']);
|
|
43
|
-
const collision = auth.fields.find((field) => 'name' in field && reservedPolicyFields.has(field.name));
|
|
44
|
-
if (collision && 'name' in collision) {
|
|
45
|
-
throw new Error(`[plugin-api-keys] Auth field '${collision.name}' is reserved.`);
|
|
46
|
-
}
|
|
47
14
|
const existing = config.collections.find((collection) => collection.slug === collectionSlug);
|
|
48
15
|
const usageLog = config.ai
|
|
49
16
|
? (config.collections.find((item) => item.usageLog === true) ?? {
|
|
@@ -81,7 +48,6 @@ export function apiKeysPlugin(options = {}) {
|
|
|
81
48
|
const authConfig = typeof next.auth === 'object' ? next.auth : {};
|
|
82
49
|
next = {
|
|
83
50
|
...next,
|
|
84
|
-
fields: [...next.fields, ...createPolicyFields(getConfiguredModelIds(config.ai))],
|
|
85
51
|
auth: { ...authConfig, strategies: [...(authConfig.strategies ?? []), strategy] },
|
|
86
52
|
};
|
|
87
53
|
}
|
|
@@ -89,24 +55,8 @@ export function apiKeysPlugin(options = {}) {
|
|
|
89
55
|
next = { ...next, fields: [...next.fields, usageField] };
|
|
90
56
|
return next;
|
|
91
57
|
});
|
|
92
|
-
const resetTask = {
|
|
93
|
-
slug: 'frogbot-reset-ai-budgets',
|
|
94
|
-
schedule: [{ cron: '0 0 1 * *', queue: 'frogbot-reset-ai-budgets' }],
|
|
95
|
-
handler: async ({ req }) => {
|
|
96
|
-
await req.payload.update({
|
|
97
|
-
collection: authCollection,
|
|
98
|
-
where: { id: { exists: true } },
|
|
99
|
-
data: { spendThisPeriodUSD: 0 },
|
|
100
|
-
overrideAccess: true,
|
|
101
|
-
req,
|
|
102
|
-
});
|
|
103
|
-
return { output: {} };
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
const jobs = { ...config.jobs, tasks: [...(config.jobs?.tasks ?? []), resetTask] };
|
|
107
58
|
return {
|
|
108
59
|
...config,
|
|
109
|
-
jobs: config.ai ? jobs : config.jobs,
|
|
110
60
|
collections: [
|
|
111
61
|
...collections,
|
|
112
62
|
...(existing ? [] : [collection]),
|
|
@@ -114,76 +64,22 @@ export function apiKeysPlugin(options = {}) {
|
|
|
114
64
|
? [{ ...usageLog, fields: [usageField] }]
|
|
115
65
|
: []),
|
|
116
66
|
],
|
|
117
|
-
...(config.ai
|
|
118
|
-
|
|
119
|
-
ai
|
|
120
|
-
|
|
121
|
-
hooks
|
|
122
|
-
|
|
123
|
-
beforeOperation
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
(policy.spendThisPeriodUSD ?? 0) >= policy.monthlyBudget) {
|
|
131
|
-
throw new BudgetExceededError();
|
|
132
|
-
}
|
|
133
|
-
Object.assign(args.context, {
|
|
134
|
-
policy,
|
|
135
|
-
...('apiKeyId' in policy && typeof policy.apiKeyId === 'string'
|
|
136
|
-
? { usageFields: { apiKey: policy.apiKeyId } }
|
|
137
|
-
: {}),
|
|
138
|
-
});
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
beforeUpstream: [
|
|
142
|
-
...(config.ai.hooks?.beforeUpstream ?? []),
|
|
143
|
-
(args) => {
|
|
144
|
-
const models = args.context.policy?.models;
|
|
145
|
-
if (models?.length && !models.includes(args.model)) {
|
|
146
|
-
throw new ModelNotAllowedError(args.model);
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
],
|
|
150
|
-
afterOperation: [
|
|
151
|
-
...(config.ai.hooks?.afterOperation ?? []),
|
|
152
|
-
async (args) => {
|
|
153
|
-
const req = args.req;
|
|
154
|
-
if (!req?.user || args.error)
|
|
155
|
-
return;
|
|
156
|
-
const userId = req.user.id;
|
|
157
|
-
const configuredCost = configuredCosts.get(args.model);
|
|
158
|
-
const cost = args.usage
|
|
159
|
-
? configuredCost
|
|
160
|
-
? calculateCostUSD(args.usage, configuredCost)
|
|
161
|
-
: calculateModelCostUSD(args.model, args.usage)
|
|
162
|
-
: 0;
|
|
163
|
-
if (cost <= 0)
|
|
164
|
-
return;
|
|
165
|
-
await queue.run(String(userId), async () => {
|
|
166
|
-
const user = (await req.frogbot.findByID({
|
|
167
|
-
collection: authCollection,
|
|
168
|
-
id: userId,
|
|
169
|
-
depth: 0,
|
|
170
|
-
overrideAccess: true,
|
|
171
|
-
req,
|
|
172
|
-
}));
|
|
173
|
-
await req.frogbot.update({
|
|
174
|
-
collection: authCollection,
|
|
175
|
-
id: userId,
|
|
176
|
-
data: { spendThisPeriodUSD: (user.spendThisPeriodUSD ?? 0) + cost },
|
|
177
|
-
overrideAccess: true,
|
|
178
|
-
req,
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
},
|
|
182
|
-
],
|
|
183
|
-
},
|
|
67
|
+
...(config.ai && {
|
|
68
|
+
ai: {
|
|
69
|
+
...config.ai,
|
|
70
|
+
hooks: {
|
|
71
|
+
...config.ai.hooks,
|
|
72
|
+
beforeOperation: [
|
|
73
|
+
...(config.ai.hooks?.beforeOperation ?? []),
|
|
74
|
+
({ req, context }) => {
|
|
75
|
+
if (req?.user && 'apiKeyId' in req.user && typeof req.user.apiKeyId === 'string') {
|
|
76
|
+
context.usageFields = { apiKey: req.user.apiKeyId };
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
],
|
|
184
80
|
},
|
|
185
|
-
}
|
|
186
|
-
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
187
83
|
};
|
|
188
84
|
};
|
|
189
85
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAOrD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAElG,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAWjD,MAAM,UAAU,aAAa,CAAC,UAAgC,EAAE;IAC9D,OAAO,CAAC,MAAM,EAAE,EAAE;QAChB,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC;QACzD,MAAM,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,UAAU,CAAC;QAC5D,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,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,CAAC,EAAE,CAAC,KAAK;wBAClB,eAAe,EAAE;4BACf,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,IAAI,EAAE,CAAC;4BAC3C,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE;gCACnB,IAAI,GAAG,EAAE,IAAI,IAAI,UAAU,IAAI,GAAG,CAAC,IAAI,IAAI,OAAO,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;oCACjF,OAAO,CAAC,WAAW,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;gCACtD,CAAC;4BACH,CAAC;yBACF;qBACF;iBACF;aACF,CAAC;SACH,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/strategy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI1C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAI3E,KAAK,eAAe,GAAG;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"strategy.d.ts","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI1C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAI3E,KAAK,eAAe,GAAG;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,CAiE7E;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAElE"}
|
package/dist/strategy.js
CHANGED
|
@@ -42,6 +42,10 @@ export function createApiKeyStrategy(options) {
|
|
|
42
42
|
collection: authCollection,
|
|
43
43
|
_strategy: 'api-key',
|
|
44
44
|
apiKeyId: key.id,
|
|
45
|
+
...(key.capture !== undefined ? { capture: key.capture } : {}),
|
|
46
|
+
...(typeof key.captureSampleRate === 'number'
|
|
47
|
+
? { captureSampleRate: key.captureSampleRate }
|
|
48
|
+
: {}),
|
|
45
49
|
},
|
|
46
50
|
};
|
|
47
51
|
},
|
package/dist/strategy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strategy.js","sourceRoot":"","sources":["../src/strategy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAIxE,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAkB,CAAC;AASvD,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC7E,MAAM,QAAQ,GAAmB;QAC/B,IAAI,EAAE,SAAS;QACf,YAAY,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE;YAC3C,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;YAC3D,IACE,CAAC,KAAK;gBACN,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AE,cAAc;oBAC1B,SAAS,EAAE,SAAS;oBACpB,QAAQ,EAAE,GAAG,CAAC,EAAE;oBAChB,GAAG,CAAC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC9D,GAAG,CAAC,OAAO,GAAG,CAAC,iBAAiB,KAAK,QAAQ;wBAC3C,CAAC,CAAC,EAAE,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,EAAE;wBAC9C,CAAC,CAAC,EAAE,CAAC;iBACR;aACF,CAAC;QACJ,CAAC;KACF,CAAC;IACF,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAwB;IACvD,OAAO,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frogbotai/plugin-api-keys",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Multiple named API keys for FrogBot.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Colby Gilbert",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@payloadcms/ui": "3.85.1",
|
|
39
39
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
40
40
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
41
|
-
"@frogbotai/gateway": "0.
|
|
42
|
-
"frogbot": "0.
|
|
41
|
+
"@frogbotai/gateway": "0.20.0",
|
|
42
|
+
"frogbot": "0.20.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@payloadcms/ui": "3.85.1",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"react": "19.2.6",
|
|
49
49
|
"react-dom": "19.2.6",
|
|
50
50
|
"typescript": "5.6.2",
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"@frogbotai/plugin-roles": "0.
|
|
51
|
+
"@frogbotai/gateway": "0.20.0",
|
|
52
|
+
"frogbot": "0.20.0",
|
|
53
|
+
"@frogbotai/plugin-roles": "0.20.0"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|
|
56
56
|
"access": "public"
|