Skip to content

Commit 1cbfe41

Browse files
gjtorikianclaude
andcommitted
feat(oagen[2/2]): update existing SDK modules with generated types, docs, and serializers
Generated by running: npm run sdk:generate:node --target ../backend/workos-node - JSDoc on all existing service methods (pulled from OpenAPI spec) - Serialize functions and Response interfaces alongside existing deserialize functions - Six new user-management sub-services (session tokens, CORS origins, JWT templates, redirect URIs, authorized applications, data providers) wired into workos.ts - New dependency interfaces, serializers, and enum types required by the above - Manual fix: removed `export * from './mfa/interfaces'` to avoid duplicate Factor export Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2b5ca3c commit 1cbfe41

281 files changed

Lines changed: 7191 additions & 10 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/api-keys/api-keys.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
13
import { WorkOS } from '../workos';
24
import {
35
SerializedValidateApiKeyResponse,
@@ -9,6 +11,15 @@ import { deserializeValidateApiKeyResponse } from './serializers/validate-api-ke
911
export class ApiKeys {
1012
constructor(private readonly workos: WorkOS) {}
1113

14+
/**
15+
* Validate API key
16+
*
17+
* Validate an API key value and return the API key object if valid.
18+
* @param payload - Object containing value.
19+
* @returns {ApiKeyValidationResponse}
20+
* @throws {UnauthorizedException} 401
21+
* @throws {UnprocessableEntityException} 422
22+
*/
1223
async validateApiKey(
1324
payload: ValidateApiKeyOptions,
1425
): Promise<ValidateApiKeyResponse> {
@@ -20,6 +31,15 @@ export class ApiKeys {
2031
return deserializeValidateApiKeyResponse(data);
2132
}
2233

34+
/**
35+
* Delete an API key
36+
*
37+
* Permanently deletes an API key. This action cannot be undone. Once deleted, any requests using this API key will fail authentication.
38+
* @param id - The unique ID of the API key.
39+
* @example "api_key_01EHZNVPK3SFK441A1RGBFSHRT"
40+
* @returns {void}
41+
* @throws {NotFoundException} 404
42+
*/
2343
async deleteApiKey(id: string): Promise<void> {
2444
await this.workos.delete(`/api_keys/${id}`);
2545
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
3+
import type {
4+
ApiKeyWithValueOwner,
5+
ApiKeyWithValueOwnerResponse,
6+
} from '../../organizations/interfaces/api-key-with-value-owner.interface';
7+
8+
export type ApiKeyOwner = ApiKeyWithValueOwner;
9+
export type ApiKeyOwnerResponse = ApiKeyWithValueOwnerResponse;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
3+
import type { ApiKey, ApiKeyResponse } from './api-key.interface';
4+
5+
export interface ApiKeyValidationResponse {
6+
apiKey: ApiKey | null;
7+
}
8+
9+
export interface ApiKeyValidationResponseWire {
10+
api_key: ApiKeyResponse | null;
11+
}

src/api-keys/interfaces/api-key.interface.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
3+
import type { ApiKeyOwnerResponse } from './api-key-owner.interface';
4+
/** The API Key object if the value is valid, or `null` if invalid. */
15
export interface ApiKey {
6+
/** Distinguishes the API Key object. */
27
object: 'api_key';
8+
/** Unique identifier of the API Key. */
39
id: string;
10+
/** The entity that owns the API Key. */
411
owner: {
512
type: 'organization';
613
id: string;
714
};
15+
/** A descriptive name for the API Key. */
816
name: string;
17+
/** An obfuscated representation of the API Key value. */
918
obfuscatedValue: string;
19+
/** Timestamp of when the API Key was last used. */
1020
lastUsedAt: string | null;
21+
/** The permission slugs assigned to the API Key. */
1122
permissions: string[];
23+
/** An ISO 8601 timestamp. */
1224
createdAt: string;
25+
/** An ISO 8601 timestamp. */
1326
updatedAt: string;
1427
}
1528

@@ -27,3 +40,15 @@ export interface SerializedApiKey {
2740
created_at: string;
2841
updated_at: string;
2942
}
43+
44+
export interface ApiKeyResponse {
45+
object: 'api_key';
46+
id: string;
47+
owner: ApiKeyOwnerResponse;
48+
name: string;
49+
obfuscated_value: string;
50+
last_used_at: string | null;
51+
permissions: string[];
52+
created_at: string;
53+
updated_at: string;
54+
}

src/api-keys/interfaces/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
13
export * from './api-key.interface';
24
export * from './create-organization-api-key-options.interface';
35
export * from './created-api-key.interface';
46
export * from './list-organization-api-keys-options.interface';
57
export * from './validate-api-key.interface';
8+
9+
export * from './api-key-owner.interface';
10+
11+
export * from './api-key-validation-response.interface';

src/api-keys/interfaces/validate-api-key.interface.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
13
import { ApiKey, SerializedApiKey } from './api-key.interface';
24

35
export interface ValidateApiKeyOptions {
@@ -6,8 +8,14 @@ export interface ValidateApiKeyOptions {
68

79
export interface ValidateApiKeyResponse {
810
apiKey: ApiKey | null;
11+
value?: string;
912
}
1013

1114
export interface SerializedValidateApiKeyResponse {
1215
api_key: SerializedApiKey | null;
1316
}
17+
18+
export interface ValidateApiKey {
19+
/** The value for an API key. */
20+
value?: string;
21+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
3+
export {
4+
deserializeApiKeyWithValueOwner as deserializeApiKeyOwner,
5+
serializeApiKeyWithValueOwner as serializeApiKeyOwner,
6+
} from '../../organizations/serializers/api-key-with-value-owner.serializer';
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
3+
import type {
4+
ApiKeyValidationResponse,
5+
ApiKeyValidationResponseWire,
6+
} from '../interfaces/api-key-validation-response.interface';
7+
import { deserializeApiKey, serializeApiKey } from './api-key.serializer';
8+
9+
export const deserializeApiKeyValidationResponse = (
10+
response: ApiKeyValidationResponseWire,
11+
): ApiKeyValidationResponse => ({
12+
apiKey: response.api_key != null ? deserializeApiKey(response.api_key) : null,
13+
});
14+
15+
export const serializeApiKeyValidationResponse = (
16+
model: ApiKeyValidationResponse,
17+
): ApiKeyValidationResponseWire => ({
18+
api_key: model.apiKey != null ? serializeApiKey(model.apiKey) : null,
19+
});

src/api-keys/serializers/api-key.serializer.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
13
import { ApiKey, SerializedApiKey } from '../interfaces/api-key.interface';
4+
import type { ApiKeyResponse } from '../interfaces/api-key.interface';
5+
import { serializeApiKeyOwner } from './api-key-owner.serializer';
26

37
export function deserializeApiKey(apiKey: SerializedApiKey): ApiKey {
48
return {
@@ -13,3 +17,15 @@ export function deserializeApiKey(apiKey: SerializedApiKey): ApiKey {
1317
updatedAt: apiKey.updated_at,
1418
};
1519
}
20+
21+
export const serializeApiKey = (model: ApiKey): ApiKeyResponse => ({
22+
object: model.object,
23+
id: model.id,
24+
owner: serializeApiKeyOwner(model.owner),
25+
name: model.name,
26+
obfuscated_value: model.obfuscatedValue,
27+
last_used_at: model.lastUsedAt,
28+
permissions: model.permissions,
29+
created_at: model.createdAt,
30+
updated_at: model.updatedAt,
31+
});

src/api-keys/serializers/validate-api-key.serializer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
// This file is auto-generated by oagen. Do not edit.
2+
13
import {
24
SerializedValidateApiKeyResponse,
35
ValidateApiKeyResponse,
46
} from '../interfaces/validate-api-key.interface';
57
import { deserializeApiKey } from './api-key.serializer';
8+
import type { ValidateApiKey } from '../interfaces/validate-api-key.interface';
69

710
export function deserializeValidateApiKeyResponse(
811
response: SerializedValidateApiKeyResponse,
@@ -11,3 +14,9 @@ export function deserializeValidateApiKeyResponse(
1114
apiKey: response.api_key ? deserializeApiKey(response.api_key) : null,
1215
};
1316
}
17+
18+
export const deserializeValidateApiKey = (
19+
response: ValidateApiKeyResponse,
20+
): ValidateApiKey => ({
21+
value: response.value,
22+
});

0 commit comments

Comments
 (0)