eigent/package/@stackframe/react/dist/esm/lib/stack-app/api-keys/index.js
2025-08-12 01:16:39 +02:00

22 lines
No EOL
830 B
JavaScript

// src/lib/stack-app/api-keys/index.ts
import { filterUndefined } from "@stackframe/stack-shared/dist/utils/objects";
async function apiKeyCreationOptionsToCrud(type, userIdOrTeamId, options) {
return {
description: options.description,
expires_at_millis: options.expiresAt == null ? options.expiresAt : options.expiresAt.getTime(),
is_public: options.isPublic,
...type === "user" ? { user_id: userIdOrTeamId } : { team_id: userIdOrTeamId }
};
}
async function apiKeyUpdateOptionsToCrud(type, options) {
return filterUndefined({
description: options.description,
expires_at_millis: options.expiresAt == null ? options.expiresAt : options.expiresAt.getTime(),
revoked: options.revoked
});
}
export {
apiKeyCreationOptionsToCrud,
apiKeyUpdateOptionsToCrud
};
//# sourceMappingURL=index.js.map