From 4091fad0b01fdefd63286f6e3f81c88b9eb7414e Mon Sep 17 00:00:00 2001 From: Aaron de Mello Date: Fri, 12 Jun 2026 14:26:16 -0400 Subject: [PATCH 1/2] Support callback URIs in application updates --- CHANGELOG.md | 1 + src/models/applicationDetails.ts | 35 +++++++++++++++++++++++++--- src/resources/applications.ts | 3 +-- tests/resources/applications.spec.ts | 14 +++++++++++ 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 070cc058..8ba1556e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Correct `Rules` list (`GET /v3/rules`) to normalize its nested `{ data: { items, nextCursor } }` envelope back to the flat `{ data, nextCursor }` shape the list machinery expects - Correct `Applications` `ApplicationDetails` field `redirectUris` → `callbackUris` (V3 wire contract), widen `region`/`environment` to `string`, add hosted-auth/IdP public fields, and add `applications.update()` (PATCH) - Correct `Applications` `applications.update()` to accept write-only `additionalSettings` (forwarded in the request body, stripped from the response) +- Correct `Applications` `applications.update()` to accept `callbackUris` with callback URI IDs for preserving existing callback URIs - Correct `RedirectUris` `update()` to use PATCH (was PUT), fix `destroy()` return type, make `platform` optional with a typed `RedirectUriPlatform` enum, and surface `deletedAt` on `RedirectUri` ## [8.2.0] - 2026-06-11 diff --git a/src/models/applicationDetails.ts b/src/models/applicationDetails.ts index bdc9b5fb..1807230c 100644 --- a/src/models/applicationDetails.ts +++ b/src/models/applicationDetails.ts @@ -1,4 +1,8 @@ -import { RedirectUri } from './redirectUri.js'; +import { + RedirectUri, + RedirectUriPlatform, + RedirectUriSettings, +} from './redirectUri.js'; /** * Interface for a Nylas application details object @@ -181,12 +185,33 @@ export interface AdditionalSettings { */ export type UpdateBranding = Partial; +/** + * Callback URI shape accepted by application updates. + */ +export interface UpdateApplicationRedirectUriRequest { + /** + * Existing callback URI ID. Include this when preserving or updating an existing URI. + */ + id?: string; + /** + * Redirect URL. + */ + url: string; + /** + * Platform identifier. One of `web`, `js`, `ios`, `android`, `desktop`. + * Defaults to `web` when omitted. + */ + platform?: RedirectUriPlatform; + /** + * Optional settings for the redirect URI. + */ + settings?: RedirectUriSettings; +} + /** * Interface representing a request to update application details. * * All fields are optional; each supplied nested object is a full replace, not a deep merge. - * Note: `callbackUris`/`redirectUris` are ignored by this endpoint — manage callback URIs - * via the dedicated redirect-uris endpoints. */ export interface UpdateApplicationRequest { /** @@ -201,6 +226,10 @@ export interface UpdateApplicationRequest { * Identity provider (IdP) settings for the application. */ idpSettings?: IdpSettings; + /** + * List of callback URIs for the application. + */ + callbackUris?: UpdateApplicationRedirectUriRequest[]; /** * White-label domain for the application. */ diff --git a/src/resources/applications.ts b/src/resources/applications.ts index 74b074ad..b0e78990 100644 --- a/src/resources/applications.ts +++ b/src/resources/applications.ts @@ -51,8 +51,7 @@ export class Applications extends Resource { /** * Update application details. * - * Each supplied nested object is a full replace, not a deep merge. Callback URIs cannot - * be updated here — manage them via {@link redirectUris}. + * Each supplied nested object is a full replace, not a deep merge. * @returns The updated application details */ public update({ diff --git a/tests/resources/applications.spec.ts b/tests/resources/applications.spec.ts index 9561c9e1..40edff39 100644 --- a/tests/resources/applications.spec.ts +++ b/tests/resources/applications.spec.ts @@ -66,6 +66,13 @@ describe('Applications', () => { origins: 'https://example.com', issuers: 'https://issuer.example.com', }, + callbackUris: [ + { + id: '0556d035-6cb6-4262-a035-6b77e11cf8fc', + url: 'https://example.com/callback', + platform: 'web', + }, + ], domain: 'auth.example.com', }, overrides: { @@ -91,6 +98,13 @@ describe('Applications', () => { origins: 'https://example.com', issuers: 'https://issuer.example.com', }, + callbackUris: [ + { + id: '0556d035-6cb6-4262-a035-6b77e11cf8fc', + url: 'https://example.com/callback', + platform: 'web', + }, + ], domain: 'auth.example.com', }, overrides: { From 1c709553173fac436149a6a7d89014dc14067db3 Mon Sep 17 00:00:00 2001 From: Aaron de Mello Date: Fri, 12 Jun 2026 14:32:07 -0400 Subject: [PATCH 2/2] Document workspace auto-group invalid filter --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ba1556e..aa6c04bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- Add Workspaces API support via `nylas.workspaces` — list, find, create, update (PATCH), destroy, plus `autoGroup()` and `manualAssign()` for grouping grants by domain, `default`, `policyId`, and `ruleIds` +- Add Workspaces API support via `nylas.workspaces` — list, find, create, update (PATCH), destroy, plus `autoGroup()` and `manualAssign()` for grouping grants by domain, `invalidAlso`, `default`, `policyId`, and `ruleIds` - Add Agent Account Lists API support via `nylas.lists` — create lists with `name`, optional `description`, and immutable `type`, plus list, find, update, destroy, `listItems()`, `addItems()`, and `removeItems()` for managing `/v3/lists` - Add Manage Domains API support via `nylas.domains` — list, find, create, update, destroy, plus `info()` and `verify()` for domain verification (`/v3/admin/domains`). Includes `ServiceAccountSigner` support for Nylas Service Account request signing, bearer-auth suppression, and canonical signed wire bodies.