diff --git a/.oagen-manifest.json b/.oagen-manifest.json index f4f865519..2888b6c27 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -1,7 +1,6 @@ { "version": 2, "language": "node", - "generatedAt": "2026-06-16T18:02:10.415Z", "files": [ "src/api-keys/interfaces/create-validation-options.interface.ts", "src/api-keys/interfaces/delete-api-key-options.interface.ts", @@ -82,6 +81,31 @@ "src/groups/serializers/index.ts", "src/groups/serializers/update-group.serializer.ts", "src/groups/serializers/user-organization-membership-base-list-data.serializer.ts", + "src/it-contacts/fixtures/create-it-contact.json", + "src/it-contacts/fixtures/invite-it-contact.json", + "src/it-contacts/fixtures/it-contact-list-list-metadata.json", + "src/it-contacts/fixtures/it-contact-list.json", + "src/it-contacts/fixtures/it-contact.json", + "src/it-contacts/interfaces/create-it-contact-options.interface.ts", + "src/it-contacts/interfaces/create-it-contact.interface.ts", + "src/it-contacts/interfaces/delete-it-contact-options.interface.ts", + "src/it-contacts/interfaces/index.ts", + "src/it-contacts/interfaces/invite-it-contact-intents.interface.ts", + "src/it-contacts/interfaces/invite-it-contact-options.interface.ts", + "src/it-contacts/interfaces/invite-it-contact.interface.ts", + "src/it-contacts/interfaces/it-contact-list-list-metadata.interface.ts", + "src/it-contacts/interfaces/it-contact-list.interface.ts", + "src/it-contacts/interfaces/it-contact.interface.ts", + "src/it-contacts/interfaces/list-it-contacts-options.interface.ts", + "src/it-contacts/interfaces/revoke-it-contact-options.interface.ts", + "src/it-contacts/it-contacts.spec.ts", + "src/it-contacts/it-contacts.ts", + "src/it-contacts/serializers/create-it-contact.serializer.ts", + "src/it-contacts/serializers/index.ts", + "src/it-contacts/serializers/invite-it-contact.serializer.ts", + "src/it-contacts/serializers/it-contact-list-list-metadata.serializer.ts", + "src/it-contacts/serializers/it-contact-list.serializer.ts", + "src/it-contacts/serializers/it-contact.serializer.ts", "src/pipes/fixtures/connected-account.json", "src/pipes/fixtures/data-integration-access-token-response-access-token.json", "src/pipes/fixtures/data-integration-access-token-response.json", diff --git a/src/index.ts b/src/index.ts index f00652919..ba3f0ed99 100644 --- a/src/index.ts +++ b/src/index.ts @@ -24,6 +24,7 @@ export * from './events/interfaces'; export * from './feature-flags/interfaces'; export { FeatureFlagsRuntimeClient } from './feature-flags/runtime-client'; export * from './groups/interfaces'; +export * from './it-contacts/interfaces'; export * from './multi-factor-auth/interfaces'; export * from './organizations/interfaces'; export * from './organization-domains/interfaces'; diff --git a/src/it-contacts/fixtures/create-it-contact.json b/src/it-contacts/fixtures/create-it-contact.json new file mode 100644 index 000000000..6de60fb50 --- /dev/null +++ b/src/it-contacts/fixtures/create-it-contact.json @@ -0,0 +1,3 @@ +{ + "email": "it-contact@example.com" +} diff --git a/src/it-contacts/fixtures/invite-it-contact.json b/src/it-contacts/fixtures/invite-it-contact.json new file mode 100644 index 000000000..064cf985f --- /dev/null +++ b/src/it-contacts/fixtures/invite-it-contact.json @@ -0,0 +1,3 @@ +{ + "intents": ["sso", "directory_sync"] +} diff --git a/src/it-contacts/fixtures/it-contact-list-list-metadata.json b/src/it-contacts/fixtures/it-contact-list-list-metadata.json new file mode 100644 index 000000000..598b6c023 --- /dev/null +++ b/src/it-contacts/fixtures/it-contact-list-list-metadata.json @@ -0,0 +1,4 @@ +{ + "before": "it_contact_01HXYZ123456789ABCDEFGHIJ", + "after": "it_contact_01HXYZ987654321KJIHGFEDCBA" +} diff --git a/src/it-contacts/fixtures/it-contact-list.json b/src/it-contacts/fixtures/it-contact-list.json new file mode 100644 index 000000000..732bbe9a9 --- /dev/null +++ b/src/it-contacts/fixtures/it-contact-list.json @@ -0,0 +1,16 @@ +{ + "object": "list", + "data": [ + { + "object": "it_contact", + "id": "it_contact_01HXYZ123456789ABCDEFGHIJ", + "email": "it-contact@example.com", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" + } + ], + "list_metadata": { + "before": "it_contact_01HXYZ123456789ABCDEFGHIJ", + "after": "it_contact_01HXYZ987654321KJIHGFEDCBA" + } +} diff --git a/src/it-contacts/fixtures/it-contact.json b/src/it-contacts/fixtures/it-contact.json new file mode 100644 index 000000000..f57597489 --- /dev/null +++ b/src/it-contacts/fixtures/it-contact.json @@ -0,0 +1,7 @@ +{ + "object": "it_contact", + "id": "it_contact_01HXYZ123456789ABCDEFGHIJ", + "email": "it-contact@example.com", + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z" +} diff --git a/src/it-contacts/interfaces/create-it-contact-options.interface.ts b/src/it-contacts/interfaces/create-it-contact-options.interface.ts new file mode 100644 index 000000000..0d333c3a1 --- /dev/null +++ b/src/it-contacts/interfaces/create-it-contact-options.interface.ts @@ -0,0 +1,8 @@ +// This file is auto-generated by oagen. Do not edit. + +export interface CreateItContactOptions { + /** The ID of the organization. */ + organizationId: string; + /** The email address of the IT contact. */ + email: string; +} diff --git a/src/it-contacts/interfaces/create-it-contact.interface.ts b/src/it-contacts/interfaces/create-it-contact.interface.ts new file mode 100644 index 000000000..fc6382ac8 --- /dev/null +++ b/src/it-contacts/interfaces/create-it-contact.interface.ts @@ -0,0 +1,10 @@ +// This file is auto-generated by oagen. Do not edit. + +export interface CreateItContact { + /** The email address of the IT contact. */ + email: string; +} + +export interface CreateItContactResponse { + email: string; +} diff --git a/src/it-contacts/interfaces/delete-it-contact-options.interface.ts b/src/it-contacts/interfaces/delete-it-contact-options.interface.ts new file mode 100644 index 000000000..a0e7a84bf --- /dev/null +++ b/src/it-contacts/interfaces/delete-it-contact-options.interface.ts @@ -0,0 +1,8 @@ +// This file is auto-generated by oagen. Do not edit. + +export interface DeleteItContactOptions { + /** The ID of the organization. */ + organizationId: string; + /** The ID of the IT contact. */ + contactId: string; +} diff --git a/src/it-contacts/interfaces/index.ts b/src/it-contacts/interfaces/index.ts new file mode 100644 index 000000000..024cabb5c --- /dev/null +++ b/src/it-contacts/interfaces/index.ts @@ -0,0 +1,11 @@ +// This file is auto-generated by oagen. Do not edit. + +export * from './create-it-contact-options.interface'; +export * from './create-it-contact.interface'; +export * from './delete-it-contact-options.interface'; +export * from './invite-it-contact-intents.interface'; +export * from './invite-it-contact-options.interface'; +export * from './invite-it-contact.interface'; +export * from './it-contact.interface'; +export * from './list-it-contacts-options.interface'; +export * from './revoke-it-contact-options.interface'; diff --git a/src/it-contacts/interfaces/invite-it-contact-intents.interface.ts b/src/it-contacts/interfaces/invite-it-contact-intents.interface.ts new file mode 100644 index 000000000..c249af152 --- /dev/null +++ b/src/it-contacts/interfaces/invite-it-contact-intents.interface.ts @@ -0,0 +1,12 @@ +// This file is auto-generated by oagen. Do not edit. + +export const InviteItContactIntents = { + SSO: 'sso', + DirectorySync: 'directory_sync', + LogStreams: 'log_streams', + DomainVerification: 'domain_verification', + BringYourOwnKey: 'bring_your_own_key', +} as const; + +export type InviteItContactIntents = + (typeof InviteItContactIntents)[keyof typeof InviteItContactIntents]; diff --git a/src/it-contacts/interfaces/invite-it-contact-options.interface.ts b/src/it-contacts/interfaces/invite-it-contact-options.interface.ts new file mode 100644 index 000000000..29468b6fa --- /dev/null +++ b/src/it-contacts/interfaces/invite-it-contact-options.interface.ts @@ -0,0 +1,12 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { InviteItContactIntents } from './invite-it-contact-intents.interface'; + +export interface InviteItContactOptions { + /** The ID of the organization. */ + organizationId: string; + /** The ID of the IT contact. */ + contactId: string; + /** The Admin Portal features that the IT contact can configure. */ + intents: InviteItContactIntents[]; +} diff --git a/src/it-contacts/interfaces/invite-it-contact.interface.ts b/src/it-contacts/interfaces/invite-it-contact.interface.ts new file mode 100644 index 000000000..a021d7379 --- /dev/null +++ b/src/it-contacts/interfaces/invite-it-contact.interface.ts @@ -0,0 +1,12 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { InviteItContactIntents } from './invite-it-contact-intents.interface'; + +export interface InviteItContact { + /** The Admin Portal features that the IT contact can configure. */ + intents: InviteItContactIntents[]; +} + +export interface InviteItContactResponse { + intents: InviteItContactIntents[]; +} diff --git a/src/it-contacts/interfaces/it-contact-list-list-metadata.interface.ts b/src/it-contacts/interfaces/it-contact-list-list-metadata.interface.ts new file mode 100644 index 000000000..04d96c623 --- /dev/null +++ b/src/it-contacts/interfaces/it-contact-list-list-metadata.interface.ts @@ -0,0 +1,14 @@ +// This file is auto-generated by oagen. Do not edit. + +/** Pagination cursors for navigating between pages of results. */ +export interface ItContactListListMetadata { + /** An object ID that defines your place in the list. When the ID is not present, you are at the start of the list. */ + before: string | null; + /** An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. */ + after: string | null; +} + +export interface ItContactListListMetadataResponse { + before: string | null; + after: string | null; +} diff --git a/src/it-contacts/interfaces/it-contact-list.interface.ts b/src/it-contacts/interfaces/it-contact-list.interface.ts new file mode 100644 index 000000000..346cee9ed --- /dev/null +++ b/src/it-contacts/interfaces/it-contact-list.interface.ts @@ -0,0 +1,22 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { ItContact, ItContactResponse } from './it-contact.interface'; +import type { + ItContactListListMetadata, + ItContactListListMetadataResponse, +} from './it-contact-list-list-metadata.interface'; + +export interface ItContactList { + /** Indicates this is a list response. */ + object: 'list'; + /** The list of records for the current page. */ + data: ItContact[]; + /** Pagination cursors for navigating between pages of results. */ + listMetadata: ItContactListListMetadata; +} + +export interface ItContactListResponse { + object: 'list'; + data: ItContactResponse[]; + list_metadata: ItContactListListMetadataResponse; +} diff --git a/src/it-contacts/interfaces/it-contact.interface.ts b/src/it-contacts/interfaces/it-contact.interface.ts new file mode 100644 index 000000000..2f69bd382 --- /dev/null +++ b/src/it-contacts/interfaces/it-contact.interface.ts @@ -0,0 +1,22 @@ +// This file is auto-generated by oagen. Do not edit. + +export interface ItContact { + /** The IT Contact object. */ + object: 'it_contact'; + /** The unique ID of the IT Contact. */ + id: string; + /** The email address of the IT Contact. */ + email: string; + /** An ISO 8601 timestamp. */ + createdAt: Date; + /** An ISO 8601 timestamp. */ + updatedAt: Date; +} + +export interface ItContactResponse { + object: 'it_contact'; + id: string; + email: string; + created_at: string; + updated_at: string; +} diff --git a/src/it-contacts/interfaces/list-it-contacts-options.interface.ts b/src/it-contacts/interfaces/list-it-contacts-options.interface.ts new file mode 100644 index 000000000..01ac2757a --- /dev/null +++ b/src/it-contacts/interfaces/list-it-contacts-options.interface.ts @@ -0,0 +1,6 @@ +// This file is auto-generated by oagen. Do not edit. + +export interface ListItContactsOptions { + /** The ID of the organization. */ + organizationId: string; +} diff --git a/src/it-contacts/interfaces/revoke-it-contact-options.interface.ts b/src/it-contacts/interfaces/revoke-it-contact-options.interface.ts new file mode 100644 index 000000000..94e3e34b4 --- /dev/null +++ b/src/it-contacts/interfaces/revoke-it-contact-options.interface.ts @@ -0,0 +1,8 @@ +// This file is auto-generated by oagen. Do not edit. + +export interface RevokeItContactOptions { + /** The ID of the organization. */ + organizationId: string; + /** The ID of the IT contact. */ + contactId: string; +} diff --git a/src/it-contacts/it-contacts.spec.ts b/src/it-contacts/it-contacts.spec.ts new file mode 100644 index 000000000..ac6e48be1 --- /dev/null +++ b/src/it-contacts/it-contacts.spec.ts @@ -0,0 +1,111 @@ +// This file is auto-generated by oagen. Do not edit. + +import fetch from 'jest-fetch-mock'; +import { + fetchOnce, + fetchURL, + fetchMethod, + fetchBody, +} from '../common/utils/test-utils'; +import { WorkOS } from '../workos'; + +import itContactListFixture from './fixtures/it-contact-list.json'; +import itContactFixture from './fixtures/it-contact.json'; + +const workos = new WorkOS('sk_test_Sz3IQjepeSWaI4cMS4ms4sMuU'); + +describe('ItContacts', () => { + beforeEach(() => fetch.resetMocks()); + + describe('listItContacts', () => { + it('returns the expected result', async () => { + fetchOnce(itContactListFixture); + + const result = await workos.itContacts.listItContacts({ + organizationId: 'test_organizationId', + }); + + expect(fetchMethod()).toBe('GET'); + expect(new URL(String(fetchURL())).pathname).toBe( + '/organizations/test_organizationId/it_contacts', + ); + expect(result.object).toBe('list'); + }); + }); + + describe('createItContact', () => { + it('sends the correct request and returns result', async () => { + fetchOnce(itContactFixture); + + const result = await workos.itContacts.createItContact({ + organizationId: 'test_organizationId', + email: 'test@example.com', + }); + + expect(fetchMethod()).toBe('POST'); + expect(new URL(String(fetchURL())).pathname).toBe( + '/organizations/test_organizationId/it_contacts', + ); + expect(fetchBody()).toEqual( + expect.objectContaining({ email: 'test@example.com' }), + ); + expect(result.object).toBe('it_contact'); + expect(result.id).toBe('it_contact_01HXYZ123456789ABCDEFGHIJ'); + expect(result.email).toBe('it-contact@example.com'); + expect(result.createdAt.toISOString()).toBe('2026-01-15T12:00:00.000Z'); + expect(result.updatedAt.toISOString()).toBe('2026-01-15T12:00:00.000Z'); + }); + }); + + describe('deleteItContact', () => { + it('sends a DELETE request', async () => { + fetchOnce({}, { status: 204 }); + + await workos.itContacts.deleteItContact({ + organizationId: 'test_organizationId', + contactId: 'test_contactId', + }); + + expect(fetchMethod()).toBe('DELETE'); + expect(new URL(String(fetchURL())).pathname).toBe( + '/organizations/test_organizationId/it_contacts/test_contactId', + ); + }); + }); + + describe('inviteItContact', () => { + it('sends the request', async () => { + fetchOnce({}); + + await workos.itContacts.inviteItContact({ + organizationId: 'test_organizationId', + contactId: 'test_contactId', + intents: ['sso'], + }); + + expect(fetchMethod()).toBe('POST'); + expect(new URL(String(fetchURL())).pathname).toBe( + '/organizations/test_organizationId/it_contacts/test_contactId/invite', + ); + expect(fetchBody()).toEqual( + expect.objectContaining({ intents: ['sso'] }), + ); + }); + }); + + describe('revokeItContact', () => { + it('sends the request', async () => { + fetchOnce({}); + + await workos.itContacts.revokeItContact({ + organizationId: 'test_organizationId', + contactId: 'test_contactId', + }); + + expect(fetchMethod()).toBe('POST'); + expect(new URL(String(fetchURL())).pathname).toBe( + '/organizations/test_organizationId/it_contacts/test_contactId/revoke', + ); + }); + }); +}); diff --git a/src/it-contacts/it-contacts.ts b/src/it-contacts/it-contacts.ts new file mode 100644 index 000000000..f1866b946 --- /dev/null +++ b/src/it-contacts/it-contacts.ts @@ -0,0 +1,134 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { WorkOS } from '../workos'; +import type { ListItContactsOptions } from './interfaces/list-it-contacts-options.interface'; +import type { CreateItContactOptions } from './interfaces/create-it-contact-options.interface'; +import type { DeleteItContactOptions } from './interfaces/delete-it-contact-options.interface'; +import type { InviteItContactOptions } from './interfaces/invite-it-contact-options.interface'; +import type { RevokeItContactOptions } from './interfaces/revoke-it-contact-options.interface'; +import type { + ItContactList, + ItContactListResponse, +} from './interfaces/it-contact-list.interface'; +import type { + ItContact, + ItContactResponse, +} from './interfaces/it-contact.interface'; +import type { CreateItContactResponse } from './interfaces/create-it-contact.interface'; +import type { InviteItContactResponse } from './interfaces/invite-it-contact.interface'; +import { deserializeItContactList } from './serializers/it-contact-list.serializer'; +import { deserializeItContact } from './serializers/it-contact.serializer'; +import { serializeCreateItContact } from './serializers/create-it-contact.serializer'; +import { serializeInviteItContact } from './serializers/invite-it-contact.serializer'; + +export class ItContacts { + constructor(private readonly workos: WorkOS) {} + + /** + * List IT contacts + * + * Get the IT contacts for an organization. + * @param options - The request options. + * @param options.organizationId - The ID of the organization. + * @example "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + * @returns {Promise} + * @throws {AuthorizationException} 403 + * @throws {NotFoundException} 404 + */ + async listItContacts(options: ListItContactsOptions): Promise { + const { organizationId } = options; + const { data } = await this.workos.get( + `/organizations/${encodeURIComponent(organizationId)}/it_contacts`, + ); + return deserializeItContactList(data); + } + + /** + * Create an IT contact + * + * Add an IT contact to an organization. No Admin Portal invitation is sent, though the contact is notified if the organization has a connection certificate nearing expiry. + * @param options - The request options. + * @param options.organizationId - The ID of the organization. + * @example "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + * @returns {Promise} + * @throws {AuthorizationException} 403 + * @throws {NotFoundException} 404 + * @throws {ConflictException} 409 + * @throws {UnprocessableEntityException} 422 + */ + async createItContact(options: CreateItContactOptions): Promise { + const { organizationId, ...payload } = options; + const { data } = await this.workos.post< + ItContactResponse, + CreateItContactResponse + >( + `/organizations/${encodeURIComponent(organizationId)}/it_contacts`, + serializeCreateItContact(payload), + ); + return deserializeItContact(data); + } + + /** + * Delete an IT contact + * + * Remove an IT contact from an organization and revoke the contact's active setup links. + * @param options - The request options. + * @param options.organizationId - The ID of the organization. + * @example "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + * @param options.contactId - The ID of the IT contact. + * @example "it_contact_01HXYZ123456789ABCDEFGHIJ" + * @returns {Promise} + * @throws {AuthorizationException} 403 + * @throws {NotFoundException} 404 + */ + async deleteItContact(options: DeleteItContactOptions): Promise { + const { organizationId, contactId } = options; + await this.workos.delete( + `/organizations/${encodeURIComponent(organizationId)}/it_contacts/${encodeURIComponent(contactId)}`, + ); + } + + /** + * Invite an IT contact + * + * Create an Admin Portal setup link and email it to the IT contact. An organization can have at most one active invitation. + * @param options - The request options. + * @param options.organizationId - The ID of the organization. + * @example "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + * @param options.contactId - The ID of the IT contact. + * @example "it_contact_01HXYZ123456789ABCDEFGHIJ" + * @returns {Promise} + * @throws {AuthorizationException} 403 + * @throws {NotFoundException} 404 + * @throws {ConflictException} 409 + * @throws {UnprocessableEntityException} 422 + */ + async inviteItContact(options: InviteItContactOptions): Promise { + const { organizationId, contactId, ...payload } = options; + await this.workos.post( + `/organizations/${encodeURIComponent(organizationId)}/it_contacts/${encodeURIComponent(contactId)}/invite`, + serializeInviteItContact(payload), + ); + } + + /** + * Revoke an IT contact's invitation + * + * Revoke the organization's active Admin Portal invitation. + * @param options - The request options. + * @param options.organizationId - The ID of the organization. + * @example "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + * @param options.contactId - The ID of the IT contact. + * @example "it_contact_01HXYZ123456789ABCDEFGHIJ" + * @returns {Promise} + * @throws {AuthorizationException} 403 + * @throws {NotFoundException} 404 + */ + async revokeItContact(options: RevokeItContactOptions): Promise { + const { organizationId, contactId } = options; + await this.workos.post( + `/organizations/${encodeURIComponent(organizationId)}/it_contacts/${encodeURIComponent(contactId)}/revoke`, + {}, + ); + } +} diff --git a/src/it-contacts/serializers/create-it-contact.serializer.ts b/src/it-contacts/serializers/create-it-contact.serializer.ts new file mode 100644 index 000000000..699accfbe --- /dev/null +++ b/src/it-contacts/serializers/create-it-contact.serializer.ts @@ -0,0 +1,12 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { + CreateItContact, + CreateItContactResponse, +} from '../interfaces/create-it-contact.interface'; + +export const serializeCreateItContact = ( + model: CreateItContact, +): CreateItContactResponse => ({ + email: model.email, +}); diff --git a/src/it-contacts/serializers/index.ts b/src/it-contacts/serializers/index.ts new file mode 100644 index 000000000..bb9f0415c --- /dev/null +++ b/src/it-contacts/serializers/index.ts @@ -0,0 +1,7 @@ +// This file is auto-generated by oagen. Do not edit. + +export * from './create-it-contact.serializer'; +export * from './invite-it-contact.serializer'; +export * from './it-contact.serializer'; +export * from './it-contact-list.serializer'; +export * from './it-contact-list-list-metadata.serializer'; diff --git a/src/it-contacts/serializers/invite-it-contact.serializer.ts b/src/it-contacts/serializers/invite-it-contact.serializer.ts new file mode 100644 index 000000000..cfd3e4e61 --- /dev/null +++ b/src/it-contacts/serializers/invite-it-contact.serializer.ts @@ -0,0 +1,12 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { + InviteItContact, + InviteItContactResponse, +} from '../interfaces/invite-it-contact.interface'; + +export const serializeInviteItContact = ( + model: InviteItContact, +): InviteItContactResponse => ({ + intents: model.intents, +}); diff --git a/src/it-contacts/serializers/it-contact-list-list-metadata.serializer.ts b/src/it-contacts/serializers/it-contact-list-list-metadata.serializer.ts new file mode 100644 index 000000000..51acc87f3 --- /dev/null +++ b/src/it-contacts/serializers/it-contact-list-list-metadata.serializer.ts @@ -0,0 +1,13 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { + ItContactListListMetadata, + ItContactListListMetadataResponse, +} from '../interfaces/it-contact-list-list-metadata.interface'; + +export const deserializeItContactListListMetadata = ( + response: ItContactListListMetadataResponse, +): ItContactListListMetadata => ({ + before: response.before ?? null, + after: response.after ?? null, +}); diff --git a/src/it-contacts/serializers/it-contact-list.serializer.ts b/src/it-contacts/serializers/it-contact-list.serializer.ts new file mode 100644 index 000000000..b0972d666 --- /dev/null +++ b/src/it-contacts/serializers/it-contact-list.serializer.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { + ItContactList, + ItContactListResponse, +} from '../interfaces/it-contact-list.interface'; +import { deserializeItContact } from './it-contact.serializer'; +import { deserializeItContactListListMetadata } from './it-contact-list-list-metadata.serializer'; + +export const deserializeItContactList = ( + response: ItContactListResponse, +): ItContactList => ({ + object: response.object, + data: response.data.map(deserializeItContact), + listMetadata: deserializeItContactListListMetadata(response.list_metadata), +}); diff --git a/src/it-contacts/serializers/it-contact.serializer.ts b/src/it-contacts/serializers/it-contact.serializer.ts new file mode 100644 index 000000000..3aa56f3dc --- /dev/null +++ b/src/it-contacts/serializers/it-contact.serializer.ts @@ -0,0 +1,16 @@ +// This file is auto-generated by oagen. Do not edit. + +import type { + ItContact, + ItContactResponse, +} from '../interfaces/it-contact.interface'; + +export const deserializeItContact = ( + response: ItContactResponse, +): ItContact => ({ + object: response.object, + id: response.id, + email: response.email, + createdAt: new Date(response.created_at), + updatedAt: new Date(response.updated_at), +}); diff --git a/src/workos.ts b/src/workos.ts index 6f5c12bb8..36cb4cee0 100644 --- a/src/workos.ts +++ b/src/workos.ts @@ -39,6 +39,7 @@ import { UserManagement } from './user-management/user-management'; import { BadRequestException } from './common/exceptions/bad-request.exception'; import { FeatureFlags } from './feature-flags/feature-flags'; import { Groups } from './groups/groups'; +import { ItContacts } from './it-contacts/it-contacts'; import { HttpClient, HttpClientError } from './common/net/http-client'; import { SubtleCryptoProvider } from './common/crypto/subtle-crypto-provider'; @@ -79,6 +80,7 @@ export class WorkOS { readonly events = new Events(this); readonly featureFlags = new FeatureFlags(this); readonly groups = new Groups(this); + readonly itContacts = new ItContacts(this); readonly multiFactorAuth = new MultiFactorAuth(this); readonly organizations = new Organizations(this); readonly organizationDomains = new OrganizationDomains(this);