diff --git a/src/api-keys/api-keys.spec.ts b/src/api-keys/api-keys.spec.ts index f7229a194..c9a531664 100644 --- a/src/api-keys/api-keys.spec.ts +++ b/src/api-keys/api-keys.spec.ts @@ -64,6 +64,7 @@ describe('ApiKeys', () => { type: 'user', id: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS', organizationId: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS', + organization_id: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS', }, name: 'Test User Api Key', obfuscatedValue: 'sk_…PRYS', diff --git a/src/api-keys/interfaces/api-key.interface.ts b/src/api-keys/interfaces/api-key.interface.ts index 15444eb1d..64283f29d 100644 --- a/src/api-keys/interfaces/api-key.interface.ts +++ b/src/api-keys/interfaces/api-key.interface.ts @@ -14,6 +14,11 @@ export interface ApiKey { type: 'user'; id: string; organizationId: string; + /** + * @deprecated Use `organizationId`. Retained for compatibility with + * releases before 10.8.0, which returned the raw API field name. + */ + organization_id?: string; }; /** A descriptive name for the API Key. */ name: string; diff --git a/src/api-keys/serializers/api-key.serializer.ts b/src/api-keys/serializers/api-key.serializer.ts index 3b924bbb9..0ccbbca3a 100644 --- a/src/api-keys/serializers/api-key.serializer.ts +++ b/src/api-keys/serializers/api-key.serializer.ts @@ -10,6 +10,7 @@ export function deserializeApiKey(apiKey: SerializedApiKey): ApiKey { type: 'user', id: apiKey.owner.id, organizationId: apiKey.owner.organization_id, + organization_id: apiKey.owner.organization_id, } : apiKey.owner, name: apiKey.name,