From d28862034209abbdbcc40ae0104e9f5f20c9e6c6 Mon Sep 17 00:00:00 2001 From: Thomas Park Date: Mon, 12 Oct 2026 21:19:42 +0000 Subject: [PATCH 1/2] Support all chat integration origins in generated API types --- openapi/public-api-v1.yaml | 94 ++++++++++++++++++++++++++++-- src/generated/openapi-types.ts | 28 ++++----- tests/resources/chats/list.test.ts | 5 +- 3 files changed, 106 insertions(+), 21 deletions(-) diff --git a/openapi/public-api-v1.yaml b/openapi/public-api-v1.yaml index a3d442f..7cd81ec 100644 --- a/openapi/public-api-v1.yaml +++ b/openapi/public-api-v1.yaml @@ -2807,7 +2807,8 @@ components: - form - import - app - description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox)." + - integration + description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in)." capturedAt: type: string format: date-time @@ -3665,6 +3666,44 @@ components: - "null" enum: - slack + - teams + - telegram + - whatsapp + - discord + - gchat + - github + - linear + - notion + - gmail + - twilio + - messenger + - instagram + - x + - xchat + - web + - agentphone + - dial + - kapso + - lark + - linq + - liveblocks + - matrix + - novu + - photon + - resend + - sendblue + - velt + - zernio + - webex + - line + - baileys + - blooio + - zalo + - mattermost + - weixin + - qq + - wecom + - zaileys - null description: The chat app the conversation started in; null for the Brew web app. updatedAt: @@ -12578,7 +12617,8 @@ components: - form - import - app - description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox)." + - integration + description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in)." capturedAt: type: string format: date-time @@ -12880,7 +12920,8 @@ components: - form - import - app - description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox)." + - integration + description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in)." capturedAt: type: string format: date-time @@ -13041,7 +13082,8 @@ components: - form - import - app - description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox)." + - integration + description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in)." capturedAt: type: string format: date-time @@ -13165,7 +13207,8 @@ components: - form - import - app - description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox)." + - integration + description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in)." capturedAt: type: string format: date-time @@ -13311,7 +13354,8 @@ components: - form - import - app - description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox)." + - integration + description: "Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in)." capturedAt: type: string format: date-time @@ -17552,6 +17596,44 @@ components: - "null" enum: - slack + - teams + - telegram + - whatsapp + - discord + - gchat + - github + - linear + - notion + - gmail + - twilio + - messenger + - instagram + - x + - xchat + - web + - agentphone + - dial + - kapso + - lark + - linq + - liveblocks + - matrix + - novu + - photon + - resend + - sendblue + - velt + - zernio + - webex + - line + - baileys + - blooio + - zalo + - mattermost + - weixin + - qq + - wecom + - zaileys - null description: The chat app the conversation started in; null for the Brew web app. updatedAt: diff --git a/src/generated/openapi-types.ts b/src/generated/openapi-types.ts index ee187ad..f567aca 100644 --- a/src/generated/openapi-types.ts +++ b/src/generated/openapi-types.ts @@ -3554,10 +3554,10 @@ export interface components { subscribed?: boolean; consent?: { /** - * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox). + * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in). * @enum {string} */ - source: "api" | "form" | "import" | "app"; + source: "api" | "form" | "import" | "app" | "integration"; /** * Format: date-time * @description When it was captured. @@ -3853,7 +3853,7 @@ export interface components { * @description The chat app the conversation started in; null for the Brew web app. * @enum {string|null} */ - origin: "slack" | null; + origin: "slack" | "teams" | "telegram" | "whatsapp" | "discord" | "gchat" | "github" | "linear" | "notion" | "gmail" | "twilio" | "messenger" | "instagram" | "x" | "xchat" | "web" | "agentphone" | "dial" | "kapso" | "lark" | "linq" | "liveblocks" | "matrix" | "novu" | "photon" | "resend" | "sendblue" | "velt" | "zernio" | "webex" | "line" | "baileys" | "blooio" | "zalo" | "mattermost" | "weixin" | "qq" | "wecom" | "zaileys" | null; /** Format: date-time */ updatedAt: string; /** @description Opens the chat in the Brew app. */ @@ -6939,10 +6939,10 @@ export interface components { subscribed?: boolean; consent?: { /** - * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox). + * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in). * @enum {string} */ - source: "api" | "form" | "import" | "app"; + source: "api" | "form" | "import" | "app" | "integration"; /** * Format: date-time * @description When it was captured. @@ -7083,10 +7083,10 @@ export interface components { subscribed?: boolean; consent?: { /** - * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox). + * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in). * @enum {string} */ - source: "api" | "form" | "import" | "app"; + source: "api" | "form" | "import" | "app" | "integration"; /** * Format: date-time * @description When it was captured. @@ -7164,10 +7164,10 @@ export interface components { subscribed?: boolean; consent?: { /** - * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox). + * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in). * @enum {string} */ - source: "api" | "form" | "import" | "app"; + source: "api" | "form" | "import" | "app" | "integration"; /** * Format: date-time * @description When it was captured. @@ -7224,10 +7224,10 @@ export interface components { subscribed?: boolean; consent?: { /** - * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox). + * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in). * @enum {string} */ - source: "api" | "form" | "import" | "app"; + source: "api" | "form" | "import" | "app" | "integration"; /** * Format: date-time * @description When it was captured. @@ -7290,10 +7290,10 @@ export interface components { subscribed?: boolean; consent?: { /** - * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox). + * @description Who captured it: `api` (an API caller asserted it), `form` (a signup form), `import` (a bulk import), `app` (the in-app CSV wizard checkbox), `integration` (an integration sync such as Stripe created the contact; provenance only, not an opt-in). * @enum {string} */ - source: "api" | "form" | "import" | "app"; + source: "api" | "form" | "import" | "app" | "integration"; /** * Format: date-time * @description When it was captured. @@ -8659,7 +8659,7 @@ export interface components { * @description The chat app the conversation started in; null for the Brew web app. * @enum {string|null} */ - origin: "slack" | null; + origin: "slack" | "teams" | "telegram" | "whatsapp" | "discord" | "gchat" | "github" | "linear" | "notion" | "gmail" | "twilio" | "messenger" | "instagram" | "x" | "xchat" | "web" | "agentphone" | "dial" | "kapso" | "lark" | "linq" | "liveblocks" | "matrix" | "novu" | "photon" | "resend" | "sendblue" | "velt" | "zernio" | "webex" | "line" | "baileys" | "blooio" | "zalo" | "mattermost" | "weixin" | "qq" | "wecom" | "zaileys" | null; /** Format: date-time */ updatedAt: string; /** @description Opens the chat in the Brew app. */ diff --git a/tests/resources/chats/list.test.ts b/tests/resources/chats/list.test.ts index dfd8747..c2951bc 100644 --- a/tests/resources/chats/list.test.ts +++ b/tests/resources/chats/list.test.ts @@ -119,7 +119,10 @@ describe('chats.list', () => { }) it('types the rows', () => { - expectTypeOf().toEqualTypeOf<'slack' | null>() + expectTypeOf<'slack' | 'teams' | 'telegram' | 'whatsapp'>().toExtend< + ChatSummary['origin'] + >() + expectTypeOf().toExtend() expectTypeOf<{ limit: 10; cursor: 'c' }>().toExtend() }) }) From dd37015875e8bd2ca8be209b66f008851b126f8c Mon Sep 17 00:00:00 2001 From: Thomas Park Date: Tue, 13 Oct 2026 08:33:34 +0000 Subject: [PATCH 2/2] test: pin complete chat origin contract --- tests/resources/chats/list.test.ts | 47 +++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/tests/resources/chats/list.test.ts b/tests/resources/chats/list.test.ts index c2951bc..d311c49 100644 --- a/tests/resources/chats/list.test.ts +++ b/tests/resources/chats/list.test.ts @@ -119,10 +119,49 @@ describe('chats.list', () => { }) it('types the rows', () => { - expectTypeOf<'slack' | 'teams' | 'telegram' | 'whatsapp'>().toExtend< - ChatSummary['origin'] - >() - expectTypeOf().toExtend() + // Pin the published contract so removals and widening to string fail typecheck. + type ExpectedOrigin = + | 'slack' + | 'teams' + | 'telegram' + | 'whatsapp' + | 'discord' + | 'gchat' + | 'github' + | 'linear' + | 'notion' + | 'gmail' + | 'twilio' + | 'messenger' + | 'instagram' + | 'x' + | 'xchat' + | 'web' + | 'agentphone' + | 'dial' + | 'kapso' + | 'lark' + | 'linq' + | 'liveblocks' + | 'matrix' + | 'novu' + | 'photon' + | 'resend' + | 'sendblue' + | 'velt' + | 'zernio' + | 'webex' + | 'line' + | 'baileys' + | 'blooio' + | 'zalo' + | 'mattermost' + | 'weixin' + | 'qq' + | 'wecom' + | 'zaileys' + | null + expectTypeOf().toEqualTypeOf() expectTypeOf<{ limit: 10; cursor: 'c' }>().toExtend() }) })