From b4125b734b1b6012e82438e0d4ca29084434f5f4 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 3 Jul 2026 09:07:40 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 4 +- .../resources/sections/client/Client.ts | 4 +- .../resources/templates/client/Client.ts | 4 +- src/api/types/GuidedArrayNode.ts | 2 + src/api/types/GuidedObjectNode.ts | 2 + src/api/types/GuidedSection.ts | 35 +---- src/api/types/GuidedSectionListItem.ts | 39 +++++ ...urce.ts => GuidedSectionListItemSource.ts} | 5 +- src/api/types/GuidedTemplate.ts | 35 +---- src/api/types/GuidedTemplateListItem.ts | 39 +++++ ...rce.ts => GuidedTemplateListItemSource.ts} | 5 +- src/api/types/index.ts | 6 +- .../resources/sections/client/list.ts | 8 +- .../resources/templates/client/list.ts | 8 +- src/serialization/types/GuidedArrayNode.ts | 2 + src/serialization/types/GuidedObjectNode.ts | 2 + src/serialization/types/GuidedSection.ts | 41 +---- .../types/GuidedSectionListItem.ts | 46 ++++++ ...urce.ts => GuidedSectionListItemSource.ts} | 8 +- src/serialization/types/GuidedTemplate.ts | 41 +---- .../types/GuidedTemplateListItem.ts | 46 ++++++ ...rce.ts => GuidedTemplateListItemSource.ts} | 8 +- src/serialization/types/index.ts | 6 +- tests/wire/documents/sections.test.ts | 72 +++------ tests/wire/documents/templates.test.ts | 141 +++++------------- 25 files changed, 300 insertions(+), 309 deletions(-) create mode 100644 src/api/types/GuidedSectionListItem.ts rename src/api/types/{GuidedSectionSource.ts => GuidedSectionListItemSource.ts} (59%) create mode 100644 src/api/types/GuidedTemplateListItem.ts rename src/api/types/{GuidedTemplateSource.ts => GuidedTemplateListItemSource.ts} (59%) create mode 100644 src/serialization/types/GuidedSectionListItem.ts rename src/serialization/types/{GuidedSectionSource.ts => GuidedSectionListItemSource.ts} (60%) create mode 100644 src/serialization/types/GuidedTemplateListItem.ts rename src/serialization/types/{GuidedTemplateSource.ts => GuidedTemplateListItemSource.ts} (60%) diff --git a/.fern/metadata.json b/.fern/metadata.json index 0b21dc8f..a38dcc68 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,5 +1,5 @@ { - "cliVersion": "5.50.4", + "cliVersion": "5.54.0", "generatorName": "fernapi/fern-typescript-node-sdk", "generatorVersion": "3.54.0", "generatorConfig": { @@ -34,6 +34,6 @@ } } }, - "originGitCommit": "5389bda9455377b317c3f90580c1b5f30d79d974", + "originGitCommit": "4bdf5e028823430e99a8114ebde725caa17b0a78", "sdkVersion": "0.0.0-dev" } diff --git a/src/api/resources/documents/resources/sections/client/Client.ts b/src/api/resources/documents/resources/sections/client/Client.ts index 2d9c83bd..953dcc06 100644 --- a/src/api/resources/documents/resources/sections/client/Client.ts +++ b/src/api/resources/documents/resources/sections/client/Client.ts @@ -41,14 +41,14 @@ export class SectionsClient { public list( request: Corti.documents.GuidedSectionsListRequest = {}, requestOptions?: SectionsClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( request: Corti.documents.GuidedSectionsListRequest = {}, requestOptions?: SectionsClient.RequestOptions, - ): Promise> { + ): Promise> { const { lang, region, specialty, label, published, source } = request; const _queryParams: Record = { lang, diff --git a/src/api/resources/documents/resources/templates/client/Client.ts b/src/api/resources/documents/resources/templates/client/Client.ts index 038b4287..c9cf59d8 100644 --- a/src/api/resources/documents/resources/templates/client/Client.ts +++ b/src/api/resources/documents/resources/templates/client/Client.ts @@ -41,14 +41,14 @@ export class TemplatesClient { public list( request: Corti.documents.GuidedTemplatesListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( request: Corti.documents.GuidedTemplatesListRequest = {}, requestOptions?: TemplatesClient.RequestOptions, - ): Promise> { + ): Promise> { const { lang, region, specialty, label, published, source } = request; const _queryParams: Record = { lang, diff --git a/src/api/types/GuidedArrayNode.ts b/src/api/types/GuidedArrayNode.ts index 2282e31b..5466d9fa 100644 --- a/src/api/types/GuidedArrayNode.ts +++ b/src/api/types/GuidedArrayNode.ts @@ -14,4 +14,6 @@ export interface GuidedArrayNode { minItems?: number | null; /** Maximum number of array items to generate. */ maxItems?: number | null; + /** If nothing is outputted, this default is used. */ + default?: unknown[] | null; } diff --git a/src/api/types/GuidedObjectNode.ts b/src/api/types/GuidedObjectNode.ts index 19b9f256..dc805b51 100644 --- a/src/api/types/GuidedObjectNode.ts +++ b/src/api/types/GuidedObjectNode.ts @@ -16,6 +16,8 @@ export interface GuidedObjectNode { * Validation rules: format must not be empty; if either `{key}` or `{value}` appears, both must be present; in subheading mode no extra placeholders are allowed; in object mode every placeholder must match a defined field key. */ fieldFormat?: string; + /** If nothing is outputted, this default is used. */ + default?: Record | null; /** Define what fields are possible to return in the object. */ fields?: Corti.GuidedFieldDefinition[]; } diff --git a/src/api/types/GuidedSection.ts b/src/api/types/GuidedSection.ts index c04bd7aa..e64e98fb 100644 --- a/src/api/types/GuidedSection.ts +++ b/src/api/types/GuidedSection.ts @@ -2,35 +2,12 @@ import type * as Corti from "../index.js"; -export interface GuidedSection { - /** The UUID of the section. */ - id: string; - /** Reference to the section to inherit generation configuration from. Inherits from published version by default. */ - inheritedFromId?: string | null; - /** True if the section was auto-generated as part of an inline section-composed POST /documents request. */ - autoGenerated?: boolean; - /** Whether this section was created by the user, a project-related API Client or is a Corti standard resource. */ - source?: Corti.GuidedSectionSource; - /** The name of the section. */ - name: string; - /** BCP 47 languages this section has been tweaked for. Empty means no language-specific tweaks. */ - languages: string[]; - /** ISO 3166-1 alpha-3 country codes this section has been tweaked for. Empty means no region-specific tweaks. */ - regions: string[]; - /** Clinical specialties this section has been tweaked for. Empty means no specialty-specific tweaks. */ - specialties: string[]; - /** The description for the section. */ - description?: string; - /** The labels available to use as query param filter in the LIST /sections endpoint. */ - labels: Corti.GuidedLabel[]; +/** + * Section as returned by single-resource endpoints (GET, POST, PATCH on + * `/documents/sections/{sectionID}`) and when embedded inside a resolved template + * version. Extends `GuidedSectionListItem` with the resolved `publishedVersion`. + */ +export interface GuidedSection extends Corti.GuidedSectionListItem { /** The currently published version with section inheritance fully resolved. Present when a version has been published. */ publishedVersion?: Corti.GuidedSectionVersion; - /** The UUID of the creator of this section. */ - createdBy?: string; - /** The original timestamp when the section was created. */ - createdAt: Date; - /** The original timestamp when the section was last updated. */ - updatedAt: Date; - /** Present when the section has been deleted. GET by ID still returns the full resource with this field populated. */ - deletedAt?: Date | null; } diff --git a/src/api/types/GuidedSectionListItem.ts b/src/api/types/GuidedSectionListItem.ts new file mode 100644 index 00000000..7b43d3b2 --- /dev/null +++ b/src/api/types/GuidedSectionListItem.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Section metadata as returned by the LIST /documents/sections endpoint. Does not + * include the resolved `publishedVersion` — use GET /documents/sections/{sectionID} + * to fetch a single section with its published version resolved. + */ +export interface GuidedSectionListItem { + /** The UUID of the section. */ + id: string; + /** Reference to the section to inherit generation configuration from. Inherits from published version by default. */ + inheritedFromId?: string | null; + /** True if the section was auto-generated as part of an inline section-composed POST /documents request. */ + autoGenerated?: boolean; + /** Whether this section was created by the user, a project-related API Client or is a Corti standard resource. */ + source?: Corti.GuidedSectionListItemSource; + /** The name of the section. */ + name: string; + /** BCP 47 languages this section has been tweaked for. Empty means no language-specific tweaks. */ + languages: string[]; + /** ISO 3166-1 alpha-3 country codes this section has been tweaked for. Empty means no region-specific tweaks. */ + regions: string[]; + /** Clinical specialties this section has been tweaked for. Empty means no specialty-specific tweaks. */ + specialties: string[]; + /** The description for the section. */ + description?: string; + /** The labels available to use as query param filter in the LIST /sections endpoint. */ + labels: Corti.GuidedLabel[]; + /** The UUID of the creator of this section. */ + createdBy?: string; + /** The original timestamp when the section was created. */ + createdAt: Date; + /** The original timestamp when the section was last updated. */ + updatedAt: Date; + /** Present when the section has been deleted. GET by ID still returns the full resource with this field populated. */ + deletedAt?: Date | null; +} diff --git a/src/api/types/GuidedSectionSource.ts b/src/api/types/GuidedSectionListItemSource.ts similarity index 59% rename from src/api/types/GuidedSectionSource.ts rename to src/api/types/GuidedSectionListItemSource.ts index 2d598fcf..aa633270 100644 --- a/src/api/types/GuidedSectionSource.ts +++ b/src/api/types/GuidedSectionListItemSource.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. /** Whether this section was created by the user, a project-related API Client or is a Corti standard resource. */ -export const GuidedSectionSource = { +export const GuidedSectionListItemSource = { User: "user", Corti: "corti", Project: "project", } as const; -export type GuidedSectionSource = (typeof GuidedSectionSource)[keyof typeof GuidedSectionSource]; +export type GuidedSectionListItemSource = + (typeof GuidedSectionListItemSource)[keyof typeof GuidedSectionListItemSource]; diff --git a/src/api/types/GuidedTemplate.ts b/src/api/types/GuidedTemplate.ts index d22f32ae..7d4730e9 100644 --- a/src/api/types/GuidedTemplate.ts +++ b/src/api/types/GuidedTemplate.ts @@ -2,35 +2,12 @@ import type * as Corti from "../index.js"; -export interface GuidedTemplate { - /** The UUID of the template. */ - id: string; - /** Reference to the template to inherit template instructions and sections from. Inherits from published version by default. */ - inheritedFromId?: string | null; - /** True if the template was auto-generated based on the section-composed POST /documents request. */ - autoGenerated?: boolean; - /** Whether this template was created by the user, a project-related API Client or is a Corti standard resource. */ - source?: Corti.GuidedTemplateSource; - /** The name of this template. Not passed to the LLM. */ - name: string; - /** A description for this template. Not passed to the LLM. */ - description?: string; - /** BCP 47 language tags this template has been tweaked for (e.g. `["fr", "de", "en-GB"]`). Empty means no language-specific tweaks. */ - languages: string[]; - /** ISO 3166-1 alpha-3 country codes this template has been tweaked for (e.g. `["BEL"]`). Empty means no region-specific tweaks. */ - regions: string[]; - /** Clinical specialties this template has been tweaked for. Empty means no specialty-specific tweaks. */ - specialties: string[]; - /** The available labels to use as query param filter in the LIST /templates endpoint. */ - labels: Corti.GuidedLabel[]; +/** + * Template as returned by single-resource endpoints (GET, POST, PATCH on + * `/documents/templates/{templateID}`). Extends `GuidedTemplateListItem` with the resolved + * `publishedVersion`. + */ +export interface GuidedTemplate extends Corti.GuidedTemplateListItem { /** The currently published version with inheritance fully resolved. Present when a version has been published. */ publishedVersion?: Corti.GuidedTemplateVersion; - /** The UUID of the creator of this template. */ - createdBy?: string; - /** The original timestamp when the template was created. */ - createdAt: Date; - /** The original timestamp when the template was last updated. */ - updatedAt: Date; - /** Present when the template has been deleted. GET by ID still returns the full resource with this field populated. */ - deletedAt?: Date | null; } diff --git a/src/api/types/GuidedTemplateListItem.ts b/src/api/types/GuidedTemplateListItem.ts new file mode 100644 index 00000000..c49f14cf --- /dev/null +++ b/src/api/types/GuidedTemplateListItem.ts @@ -0,0 +1,39 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../index.js"; + +/** + * Template metadata as returned by the LIST /documents/templates endpoint. Does not + * include the resolved `publishedVersion` — use GET /documents/templates/{templateID} + * to fetch a single template with its published version resolved. + */ +export interface GuidedTemplateListItem { + /** The UUID of the template. */ + id: string; + /** Reference to the template to inherit template instructions and sections from. Inherits from published version by default. */ + inheritedFromId?: string | null; + /** True if the template was auto-generated based on the section-composed POST /documents request. */ + autoGenerated?: boolean; + /** Whether this template was created by the user, a project-related API Client or is a Corti standard resource. */ + source?: Corti.GuidedTemplateListItemSource; + /** The name of this template. Not passed to the LLM. */ + name: string; + /** A description for this template. Not passed to the LLM. */ + description?: string; + /** BCP 47 language tags this template has been tweaked for (e.g. `["fr", "de", "en-GB"]`). Empty means no language-specific tweaks. */ + languages: string[]; + /** ISO 3166-1 alpha-3 country codes this template has been tweaked for (e.g. `["BEL"]`). Empty means no region-specific tweaks. */ + regions: string[]; + /** Clinical specialties this template has been tweaked for. Empty means no specialty-specific tweaks. */ + specialties: string[]; + /** The available labels to use as query param filter in the LIST /templates endpoint. */ + labels: Corti.GuidedLabel[]; + /** The UUID of the creator of this template. */ + createdBy?: string; + /** The original timestamp when the template was created. */ + createdAt: Date; + /** The original timestamp when the template was last updated. */ + updatedAt: Date; + /** Present when the template has been deleted. GET by ID still returns the full resource with this field populated. */ + deletedAt?: Date | null; +} diff --git a/src/api/types/GuidedTemplateSource.ts b/src/api/types/GuidedTemplateListItemSource.ts similarity index 59% rename from src/api/types/GuidedTemplateSource.ts rename to src/api/types/GuidedTemplateListItemSource.ts index dd255c4d..dbb3352d 100644 --- a/src/api/types/GuidedTemplateSource.ts +++ b/src/api/types/GuidedTemplateListItemSource.ts @@ -1,9 +1,10 @@ // This file was auto-generated by Fern from our API Definition. /** Whether this template was created by the user, a project-related API Client or is a Corti standard resource. */ -export const GuidedTemplateSource = { +export const GuidedTemplateListItemSource = { User: "user", Corti: "corti", Project: "project", } as const; -export type GuidedTemplateSource = (typeof GuidedTemplateSource)[keyof typeof GuidedTemplateSource]; +export type GuidedTemplateListItemSource = + (typeof GuidedTemplateListItemSource)[keyof typeof GuidedTemplateListItemSource]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 55671f76..7ce73b9e 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -141,9 +141,10 @@ export * from "./GuidedSectionGenerationPartial.js"; export * from "./GuidedSectionInstructions.js"; export * from "./GuidedSectionInstructionsOverride.js"; export * from "./GuidedSectionInstructionsPartial.js"; +export * from "./GuidedSectionListItem.js"; +export * from "./GuidedSectionListItemSource.js"; export * from "./GuidedSectionOverride.js"; export * from "./GuidedSectionOverrides.js"; -export * from "./GuidedSectionSource.js"; export * from "./GuidedSectionsCreateBase.js"; export * from "./GuidedSectionsCreateFromInheritanceRequest.js"; export * from "./GuidedSectionsCreateFromScratchRequest.js"; @@ -157,9 +158,10 @@ export * from "./GuidedTemplate.js"; export * from "./GuidedTemplateGeneration.js"; export * from "./GuidedTemplateInstructions.js"; export * from "./GuidedTemplateInstructionsPartial.js"; +export * from "./GuidedTemplateListItem.js"; +export * from "./GuidedTemplateListItemSource.js"; export * from "./GuidedTemplateOverrides.js"; export * from "./GuidedTemplateRef.js"; -export * from "./GuidedTemplateSource.js"; export * from "./GuidedTemplatesCreateBase.js"; export * from "./GuidedTemplatesCreateFromInheritanceRequest.js"; export * from "./GuidedTemplatesCreateFromInheritanceRequestGeneration.js"; diff --git a/src/serialization/resources/documents/resources/sections/client/list.ts b/src/serialization/resources/documents/resources/sections/client/list.ts index a6c41457..d0afdfb3 100644 --- a/src/serialization/resources/documents/resources/sections/client/list.ts +++ b/src/serialization/resources/documents/resources/sections/client/list.ts @@ -3,13 +3,13 @@ import type * as Corti from "../../../../../../api/index.js"; import * as core from "../../../../../../core/index.js"; import type * as serializers from "../../../../../index.js"; -import { GuidedSection } from "../../../../../types/GuidedSection.js"; +import { GuidedSectionListItem } from "../../../../../types/GuidedSectionListItem.js"; export const Response: core.serialization.Schema< serializers.documents.sections.list.Response.Raw, - Corti.GuidedSection[] -> = core.serialization.list(GuidedSection); + Corti.GuidedSectionListItem[] +> = core.serialization.list(GuidedSectionListItem); export declare namespace Response { - export type Raw = GuidedSection.Raw[]; + export type Raw = GuidedSectionListItem.Raw[]; } diff --git a/src/serialization/resources/documents/resources/templates/client/list.ts b/src/serialization/resources/documents/resources/templates/client/list.ts index 6709277f..df29d0cb 100644 --- a/src/serialization/resources/documents/resources/templates/client/list.ts +++ b/src/serialization/resources/documents/resources/templates/client/list.ts @@ -3,13 +3,13 @@ import type * as Corti from "../../../../../../api/index.js"; import * as core from "../../../../../../core/index.js"; import type * as serializers from "../../../../../index.js"; -import { GuidedTemplate } from "../../../../../types/GuidedTemplate.js"; +import { GuidedTemplateListItem } from "../../../../../types/GuidedTemplateListItem.js"; export const Response: core.serialization.Schema< serializers.documents.templates.list.Response.Raw, - Corti.GuidedTemplate[] -> = core.serialization.list(GuidedTemplate); + Corti.GuidedTemplateListItem[] +> = core.serialization.list(GuidedTemplateListItem); export declare namespace Response { - export type Raw = GuidedTemplate.Raw[]; + export type Raw = GuidedTemplateListItem.Raw[]; } diff --git a/src/serialization/types/GuidedArrayNode.ts b/src/serialization/types/GuidedArrayNode.ts index 5292558d..255b7035 100644 --- a/src/serialization/types/GuidedArrayNode.ts +++ b/src/serialization/types/GuidedArrayNode.ts @@ -12,6 +12,7 @@ export const GuidedArrayNode: core.serialization.ObjectSchema serializers.GuidedFieldDefinition)).optional(), }); @@ -19,6 +20,7 @@ export declare namespace GuidedObjectNode { type: "object"; description?: string | null; fieldFormat?: string | null; + default?: (Record | null | undefined) | null; fields?: serializers.GuidedFieldDefinition.Raw[] | null; } } diff --git a/src/serialization/types/GuidedSection.ts b/src/serialization/types/GuidedSection.ts index d8d37c52..7878ee8f 100644 --- a/src/serialization/types/GuidedSection.ts +++ b/src/serialization/types/GuidedSection.ts @@ -3,45 +3,18 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -import { GuidedLabel } from "./GuidedLabel.js"; -import { GuidedSectionSource } from "./GuidedSectionSource.js"; +import { GuidedSectionListItem } from "./GuidedSectionListItem.js"; import { GuidedSectionVersion } from "./GuidedSectionVersion.js"; export const GuidedSection: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string(), - inheritedFromId: core.serialization.string().optionalNullable(), - autoGenerated: core.serialization.boolean().optional(), - source: GuidedSectionSource.optional(), - name: core.serialization.string(), - languages: core.serialization.list(core.serialization.string()), - regions: core.serialization.list(core.serialization.string()), - specialties: core.serialization.list(core.serialization.string()), - description: core.serialization.string().optional(), - labels: core.serialization.list(GuidedLabel), - publishedVersion: GuidedSectionVersion.optional(), - createdBy: core.serialization.string().optional(), - createdAt: core.serialization.date(), - updatedAt: core.serialization.date(), - deletedAt: core.serialization.date().optionalNullable(), - }); + core.serialization + .object({ + publishedVersion: GuidedSectionVersion.optional(), + }) + .extend(GuidedSectionListItem); export declare namespace GuidedSection { - export interface Raw { - id: string; - inheritedFromId?: (string | null | undefined) | null; - autoGenerated?: boolean | null; - source?: GuidedSectionSource.Raw | null; - name: string; - languages: string[]; - regions: string[]; - specialties: string[]; - description?: string | null; - labels: GuidedLabel.Raw[]; + export interface Raw extends GuidedSectionListItem.Raw { publishedVersion?: GuidedSectionVersion.Raw | null; - createdBy?: string | null; - createdAt: string; - updatedAt: string; - deletedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GuidedSectionListItem.ts b/src/serialization/types/GuidedSectionListItem.ts new file mode 100644 index 00000000..b12d500b --- /dev/null +++ b/src/serialization/types/GuidedSectionListItem.ts @@ -0,0 +1,46 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { GuidedLabel } from "./GuidedLabel.js"; +import { GuidedSectionListItemSource } from "./GuidedSectionListItemSource.js"; + +export const GuidedSectionListItem: core.serialization.ObjectSchema< + serializers.GuidedSectionListItem.Raw, + Corti.GuidedSectionListItem +> = core.serialization.object({ + id: core.serialization.string(), + inheritedFromId: core.serialization.string().optionalNullable(), + autoGenerated: core.serialization.boolean().optional(), + source: GuidedSectionListItemSource.optional(), + name: core.serialization.string(), + languages: core.serialization.list(core.serialization.string()), + regions: core.serialization.list(core.serialization.string()), + specialties: core.serialization.list(core.serialization.string()), + description: core.serialization.string().optional(), + labels: core.serialization.list(GuidedLabel), + createdBy: core.serialization.string().optional(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + deletedAt: core.serialization.date().optionalNullable(), +}); + +export declare namespace GuidedSectionListItem { + export interface Raw { + id: string; + inheritedFromId?: (string | null | undefined) | null; + autoGenerated?: boolean | null; + source?: GuidedSectionListItemSource.Raw | null; + name: string; + languages: string[]; + regions: string[]; + specialties: string[]; + description?: string | null; + labels: GuidedLabel.Raw[]; + createdBy?: string | null; + createdAt: string; + updatedAt: string; + deletedAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/GuidedSectionSource.ts b/src/serialization/types/GuidedSectionListItemSource.ts similarity index 60% rename from src/serialization/types/GuidedSectionSource.ts rename to src/serialization/types/GuidedSectionListItemSource.ts index 36a77c87..7de5886b 100644 --- a/src/serialization/types/GuidedSectionSource.ts +++ b/src/serialization/types/GuidedSectionListItemSource.ts @@ -4,11 +4,11 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -export const GuidedSectionSource: core.serialization.Schema< - serializers.GuidedSectionSource.Raw, - Corti.GuidedSectionSource +export const GuidedSectionListItemSource: core.serialization.Schema< + serializers.GuidedSectionListItemSource.Raw, + Corti.GuidedSectionListItemSource > = core.serialization.enum_(["user", "corti", "project"]); -export declare namespace GuidedSectionSource { +export declare namespace GuidedSectionListItemSource { export type Raw = "user" | "corti" | "project"; } diff --git a/src/serialization/types/GuidedTemplate.ts b/src/serialization/types/GuidedTemplate.ts index d3afc129..4bd2e2a4 100644 --- a/src/serialization/types/GuidedTemplate.ts +++ b/src/serialization/types/GuidedTemplate.ts @@ -3,45 +3,18 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -import { GuidedLabel } from "./GuidedLabel.js"; -import { GuidedTemplateSource } from "./GuidedTemplateSource.js"; +import { GuidedTemplateListItem } from "./GuidedTemplateListItem.js"; import { GuidedTemplateVersion } from "./GuidedTemplateVersion.js"; export const GuidedTemplate: core.serialization.ObjectSchema = - core.serialization.object({ - id: core.serialization.string(), - inheritedFromId: core.serialization.string().optionalNullable(), - autoGenerated: core.serialization.boolean().optional(), - source: GuidedTemplateSource.optional(), - name: core.serialization.string(), - description: core.serialization.string().optional(), - languages: core.serialization.list(core.serialization.string()), - regions: core.serialization.list(core.serialization.string()), - specialties: core.serialization.list(core.serialization.string()), - labels: core.serialization.list(GuidedLabel), - publishedVersion: GuidedTemplateVersion.optional(), - createdBy: core.serialization.string().optional(), - createdAt: core.serialization.date(), - updatedAt: core.serialization.date(), - deletedAt: core.serialization.date().optionalNullable(), - }); + core.serialization + .object({ + publishedVersion: GuidedTemplateVersion.optional(), + }) + .extend(GuidedTemplateListItem); export declare namespace GuidedTemplate { - export interface Raw { - id: string; - inheritedFromId?: (string | null | undefined) | null; - autoGenerated?: boolean | null; - source?: GuidedTemplateSource.Raw | null; - name: string; - description?: string | null; - languages: string[]; - regions: string[]; - specialties: string[]; - labels: GuidedLabel.Raw[]; + export interface Raw extends GuidedTemplateListItem.Raw { publishedVersion?: GuidedTemplateVersion.Raw | null; - createdBy?: string | null; - createdAt: string; - updatedAt: string; - deletedAt?: (string | null | undefined) | null; } } diff --git a/src/serialization/types/GuidedTemplateListItem.ts b/src/serialization/types/GuidedTemplateListItem.ts new file mode 100644 index 00000000..f14bc315 --- /dev/null +++ b/src/serialization/types/GuidedTemplateListItem.ts @@ -0,0 +1,46 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Corti from "../../api/index.js"; +import * as core from "../../core/index.js"; +import type * as serializers from "../index.js"; +import { GuidedLabel } from "./GuidedLabel.js"; +import { GuidedTemplateListItemSource } from "./GuidedTemplateListItemSource.js"; + +export const GuidedTemplateListItem: core.serialization.ObjectSchema< + serializers.GuidedTemplateListItem.Raw, + Corti.GuidedTemplateListItem +> = core.serialization.object({ + id: core.serialization.string(), + inheritedFromId: core.serialization.string().optionalNullable(), + autoGenerated: core.serialization.boolean().optional(), + source: GuidedTemplateListItemSource.optional(), + name: core.serialization.string(), + description: core.serialization.string().optional(), + languages: core.serialization.list(core.serialization.string()), + regions: core.serialization.list(core.serialization.string()), + specialties: core.serialization.list(core.serialization.string()), + labels: core.serialization.list(GuidedLabel), + createdBy: core.serialization.string().optional(), + createdAt: core.serialization.date(), + updatedAt: core.serialization.date(), + deletedAt: core.serialization.date().optionalNullable(), +}); + +export declare namespace GuidedTemplateListItem { + export interface Raw { + id: string; + inheritedFromId?: (string | null | undefined) | null; + autoGenerated?: boolean | null; + source?: GuidedTemplateListItemSource.Raw | null; + name: string; + description?: string | null; + languages: string[]; + regions: string[]; + specialties: string[]; + labels: GuidedLabel.Raw[]; + createdBy?: string | null; + createdAt: string; + updatedAt: string; + deletedAt?: (string | null | undefined) | null; + } +} diff --git a/src/serialization/types/GuidedTemplateSource.ts b/src/serialization/types/GuidedTemplateListItemSource.ts similarity index 60% rename from src/serialization/types/GuidedTemplateSource.ts rename to src/serialization/types/GuidedTemplateListItemSource.ts index a36c4d39..e396e7aa 100644 --- a/src/serialization/types/GuidedTemplateSource.ts +++ b/src/serialization/types/GuidedTemplateListItemSource.ts @@ -4,11 +4,11 @@ import type * as Corti from "../../api/index.js"; import * as core from "../../core/index.js"; import type * as serializers from "../index.js"; -export const GuidedTemplateSource: core.serialization.Schema< - serializers.GuidedTemplateSource.Raw, - Corti.GuidedTemplateSource +export const GuidedTemplateListItemSource: core.serialization.Schema< + serializers.GuidedTemplateListItemSource.Raw, + Corti.GuidedTemplateListItemSource > = core.serialization.enum_(["user", "corti", "project"]); -export declare namespace GuidedTemplateSource { +export declare namespace GuidedTemplateListItemSource { export type Raw = "user" | "corti" | "project"; } diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 55671f76..7ce73b9e 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -141,9 +141,10 @@ export * from "./GuidedSectionGenerationPartial.js"; export * from "./GuidedSectionInstructions.js"; export * from "./GuidedSectionInstructionsOverride.js"; export * from "./GuidedSectionInstructionsPartial.js"; +export * from "./GuidedSectionListItem.js"; +export * from "./GuidedSectionListItemSource.js"; export * from "./GuidedSectionOverride.js"; export * from "./GuidedSectionOverrides.js"; -export * from "./GuidedSectionSource.js"; export * from "./GuidedSectionsCreateBase.js"; export * from "./GuidedSectionsCreateFromInheritanceRequest.js"; export * from "./GuidedSectionsCreateFromScratchRequest.js"; @@ -157,9 +158,10 @@ export * from "./GuidedTemplate.js"; export * from "./GuidedTemplateGeneration.js"; export * from "./GuidedTemplateInstructions.js"; export * from "./GuidedTemplateInstructionsPartial.js"; +export * from "./GuidedTemplateListItem.js"; +export * from "./GuidedTemplateListItemSource.js"; export * from "./GuidedTemplateOverrides.js"; export * from "./GuidedTemplateRef.js"; -export * from "./GuidedTemplateSource.js"; export * from "./GuidedTemplatesCreateBase.js"; export * from "./GuidedTemplatesCreateFromInheritanceRequest.js"; export * from "./GuidedTemplatesCreateFromInheritanceRequestGeneration.js"; diff --git a/tests/wire/documents/sections.test.ts b/tests/wire/documents/sections.test.ts index c8777a78..d8cd59ba 100644 --- a/tests/wire/documents/sections.test.ts +++ b/tests/wire/documents/sections.test.ts @@ -30,16 +30,6 @@ describe("SectionsClient", () => { specialties: ["specialties"], description: "description", labels: [{ key: "key", value: "value" }], - publishedVersion: { - id: "id", - versionNumber: 1, - deletedAt: "2024-01-15T09:30:00Z", - generation: { - heading: "heading", - instructions: { contentPrompt: "contentPrompt" }, - outputSchema: { type: "string" }, - }, - }, createdBy: "createdBy", createdAt: "2024-01-15T09:30:00Z", updatedAt: "2024-01-15T09:30:00Z", @@ -73,20 +63,6 @@ describe("SectionsClient", () => { value: "value", }, ], - publishedVersion: { - id: "id", - versionNumber: 1, - deletedAt: new Date("2024-01-15T09:30:00.000Z"), - generation: { - heading: "heading", - instructions: { - contentPrompt: "contentPrompt", - }, - outputSchema: { - type: "string", - }, - }, - }, createdBy: "createdBy", createdAt: new Date("2024-01-15T09:30:00.000Z"), updatedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -125,6 +101,10 @@ describe("SectionsClient", () => { specialties: ["specialties"], description: "description", labels: [{ key: "key", value: "value" }], + createdBy: "createdBy", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -135,10 +115,6 @@ describe("SectionsClient", () => { outputSchema: { type: "string" }, }, }, - createdBy: "createdBy", - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - deletedAt: "2024-01-15T09:30:00Z", }; server @@ -178,6 +154,10 @@ describe("SectionsClient", () => { value: "value", }, ], + createdBy: "createdBy", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deletedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -192,10 +172,6 @@ describe("SectionsClient", () => { }, }, }, - createdBy: "createdBy", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deletedAt: new Date("2024-01-15T09:30:00.000Z"), }); }); @@ -268,6 +244,10 @@ describe("SectionsClient", () => { specialties: ["specialties"], description: "description", labels: [{ key: "key", value: "value" }], + createdBy: "createdBy", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -278,10 +258,6 @@ describe("SectionsClient", () => { outputSchema: { type: "string" }, }, }, - createdBy: "createdBy", - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - deletedAt: "2024-01-15T09:30:00Z", }; server @@ -309,6 +285,10 @@ describe("SectionsClient", () => { value: "value", }, ], + createdBy: "createdBy", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deletedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -323,10 +303,6 @@ describe("SectionsClient", () => { }, }, }, - createdBy: "createdBy", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deletedAt: new Date("2024-01-15T09:30:00.000Z"), }); }); @@ -452,6 +428,10 @@ describe("SectionsClient", () => { specialties: ["specialties"], description: "description", labels: [{ key: "key", value: "value" }], + createdBy: "createdBy", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -462,10 +442,6 @@ describe("SectionsClient", () => { outputSchema: { type: "string" }, }, }, - createdBy: "createdBy", - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - deletedAt: "2024-01-15T09:30:00Z", }; server @@ -494,6 +470,10 @@ describe("SectionsClient", () => { value: "value", }, ], + createdBy: "createdBy", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deletedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -508,10 +488,6 @@ describe("SectionsClient", () => { }, }, }, - createdBy: "createdBy", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deletedAt: new Date("2024-01-15T09:30:00.000Z"), }); }); diff --git a/tests/wire/documents/templates.test.ts b/tests/wire/documents/templates.test.ts index b6f33c22..e4ed02b1 100644 --- a/tests/wire/documents/templates.test.ts +++ b/tests/wire/documents/templates.test.ts @@ -30,35 +30,6 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], - publishedVersion: { - id: "id", - versionNumber: 1, - deletedAt: "2024-01-15T09:30:00Z", - generation: { - instructions: { prompt: "prompt" }, - sections: [ - { - id: "id", - name: "name", - languages: ["languages"], - regions: ["regions"], - specialties: ["specialties"], - labels: [{ key: "key", value: "value" }], - publishedVersion: { - id: "id", - versionNumber: 1, - generation: { - heading: "heading", - instructions: { contentPrompt: "contentPrompt" }, - outputSchema: { type: "string" }, - }, - }, - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - }, - ], - }, - }, createdBy: "createdBy", createdAt: "2024-01-15T09:30:00Z", updatedAt: "2024-01-15T09:30:00Z", @@ -92,46 +63,6 @@ describe("TemplatesClient", () => { value: "value", }, ], - publishedVersion: { - id: "id", - versionNumber: 1, - deletedAt: new Date("2024-01-15T09:30:00.000Z"), - generation: { - instructions: { - prompt: "prompt", - }, - sections: [ - { - id: "id", - name: "name", - languages: ["languages"], - regions: ["regions"], - specialties: ["specialties"], - labels: [ - { - key: "key", - value: "value", - }, - ], - publishedVersion: { - id: "id", - versionNumber: 1, - generation: { - heading: "heading", - instructions: { - contentPrompt: "contentPrompt", - }, - outputSchema: { - type: "string", - }, - }, - }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - }, - ], - }, - }, createdBy: "createdBy", createdAt: new Date("2024-01-15T09:30:00.000Z"), updatedAt: new Date("2024-01-15T09:30:00.000Z"), @@ -163,6 +94,10 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], + createdBy: "createdBy", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -177,6 +112,8 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -186,16 +123,10 @@ describe("TemplatesClient", () => { outputSchema: { type: "string" }, }, }, - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", }, ], }, }, - createdBy: "createdBy", - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - deletedAt: "2024-01-15T09:30:00Z", }; server @@ -227,6 +158,10 @@ describe("TemplatesClient", () => { value: "value", }, ], + createdBy: "createdBy", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deletedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -248,6 +183,8 @@ describe("TemplatesClient", () => { value: "value", }, ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -261,16 +198,10 @@ describe("TemplatesClient", () => { }, }, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, ], }, }, - createdBy: "createdBy", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deletedAt: new Date("2024-01-15T09:30:00.000Z"), }); }); @@ -328,6 +259,10 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], + createdBy: "createdBy", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -342,6 +277,8 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -351,16 +288,10 @@ describe("TemplatesClient", () => { outputSchema: { type: "string" }, }, }, - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", }, ], }, }, - createdBy: "createdBy", - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - deletedAt: "2024-01-15T09:30:00Z", }; server @@ -388,6 +319,10 @@ describe("TemplatesClient", () => { value: "value", }, ], + createdBy: "createdBy", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deletedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -409,6 +344,8 @@ describe("TemplatesClient", () => { value: "value", }, ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -422,16 +359,10 @@ describe("TemplatesClient", () => { }, }, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, ], }, }, - createdBy: "createdBy", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deletedAt: new Date("2024-01-15T09:30:00.000Z"), }); }); @@ -557,6 +488,10 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], + createdBy: "createdBy", + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", + deletedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -571,6 +506,8 @@ describe("TemplatesClient", () => { regions: ["regions"], specialties: ["specialties"], labels: [{ key: "key", value: "value" }], + createdAt: "2024-01-15T09:30:00Z", + updatedAt: "2024-01-15T09:30:00Z", publishedVersion: { id: "id", versionNumber: 1, @@ -580,16 +517,10 @@ describe("TemplatesClient", () => { outputSchema: { type: "string" }, }, }, - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", }, ], }, }, - createdBy: "createdBy", - createdAt: "2024-01-15T09:30:00Z", - updatedAt: "2024-01-15T09:30:00Z", - deletedAt: "2024-01-15T09:30:00Z", }; server @@ -618,6 +549,10 @@ describe("TemplatesClient", () => { value: "value", }, ], + createdBy: "createdBy", + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), + deletedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -639,6 +574,8 @@ describe("TemplatesClient", () => { value: "value", }, ], + createdAt: new Date("2024-01-15T09:30:00.000Z"), + updatedAt: new Date("2024-01-15T09:30:00.000Z"), publishedVersion: { id: "id", versionNumber: 1, @@ -652,16 +589,10 @@ describe("TemplatesClient", () => { }, }, }, - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), }, ], }, }, - createdBy: "createdBy", - createdAt: new Date("2024-01-15T09:30:00.000Z"), - updatedAt: new Date("2024-01-15T09:30:00.000Z"), - deletedAt: new Date("2024-01-15T09:30:00.000Z"), }); });