Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cliVersion": "5.50.4",
"cliVersion": "5.54.0",
"generatorName": "fernapi/fern-typescript-node-sdk",
"generatorVersion": "3.54.0",
"generatorConfig": {
Expand Down Expand Up @@ -34,6 +34,6 @@
}
}
},
"originGitCommit": "5389bda9455377b317c3f90580c1b5f30d79d974",
"originGitCommit": "4bdf5e028823430e99a8114ebde725caa17b0a78",
"sdkVersion": "0.0.0-dev"
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export class SectionsClient {
public list(
request: Corti.documents.GuidedSectionsListRequest = {},
requestOptions?: SectionsClient.RequestOptions,
): core.HttpResponsePromise<Corti.GuidedSection[]> {
): core.HttpResponsePromise<Corti.GuidedSectionListItem[]> {
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
}

private async __list(
request: Corti.documents.GuidedSectionsListRequest = {},
requestOptions?: SectionsClient.RequestOptions,
): Promise<core.WithRawResponse<Corti.GuidedSection[]>> {
): Promise<core.WithRawResponse<Corti.GuidedSectionListItem[]>> {
const { lang, region, specialty, label, published, source } = request;
const _queryParams: Record<string, unknown> = {
lang,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ export class TemplatesClient {
public list(
request: Corti.documents.GuidedTemplatesListRequest = {},
requestOptions?: TemplatesClient.RequestOptions,
): core.HttpResponsePromise<Corti.GuidedTemplate[]> {
): core.HttpResponsePromise<Corti.GuidedTemplateListItem[]> {
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
}

private async __list(
request: Corti.documents.GuidedTemplatesListRequest = {},
requestOptions?: TemplatesClient.RequestOptions,
): Promise<core.WithRawResponse<Corti.GuidedTemplate[]>> {
): Promise<core.WithRawResponse<Corti.GuidedTemplateListItem[]>> {
const { lang, region, specialty, label, published, source } = request;
const _queryParams: Record<string, unknown> = {
lang,
Expand Down
2 changes: 2 additions & 0 deletions src/api/types/GuidedArrayNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 2 additions & 0 deletions src/api/types/GuidedObjectNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown> | null;
/** Define what fields are possible to return in the object. */
fields?: Corti.GuidedFieldDefinition[];
}
35 changes: 6 additions & 29 deletions src/api/types/GuidedSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
39 changes: 39 additions & 0 deletions src/api/types/GuidedSectionListItem.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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];
35 changes: 6 additions & 29 deletions src/api/types/GuidedTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
39 changes: 39 additions & 0 deletions src/api/types/GuidedTemplateListItem.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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];
6 changes: 4 additions & 2 deletions src/api/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
}
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
}
2 changes: 2 additions & 0 deletions src/serialization/types/GuidedArrayNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const GuidedArrayNode: core.serialization.ObjectSchema<serializers.Guided
itemFormat: core.serialization.string().optional(),
minItems: core.serialization.number().optionalNullable(),
maxItems: core.serialization.number().optionalNullable(),
default: core.serialization.list(core.serialization.unknown()).optionalNullable(),
});

export declare namespace GuidedArrayNode {
Expand All @@ -22,5 +23,6 @@ export declare namespace GuidedArrayNode {
itemFormat?: string | null;
minItems?: (number | null | undefined) | null;
maxItems?: (number | null | undefined) | null;
default?: (unknown[] | null | undefined) | null;
}
}
2 changes: 2 additions & 0 deletions src/serialization/types/GuidedObjectNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const GuidedObjectNode: core.serialization.ObjectSchema<
type: core.serialization.stringLiteral("object"),
description: core.serialization.string().optional(),
fieldFormat: core.serialization.string().optional(),
default: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optionalNullable(),
fields: core.serialization.list(core.serialization.lazyObject(() => serializers.GuidedFieldDefinition)).optional(),
});

Expand All @@ -19,6 +20,7 @@ export declare namespace GuidedObjectNode {
type: "object";
description?: string | null;
fieldFormat?: string | null;
default?: (Record<string, unknown> | null | undefined) | null;
fields?: serializers.GuidedFieldDefinition.Raw[] | null;
}
}
41 changes: 7 additions & 34 deletions src/serialization/types/GuidedSection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<serializers.GuidedSection.Raw, Corti.GuidedSection> =
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;
}
}
Loading
Loading