Skip to content
Merged
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
8 changes: 4 additions & 4 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"cliVersion": "5.5.1",
"cliVersion": "5.10.2",
"generatorName": "fernapi/fern-typescript-sdk",
"generatorVersion": "3.66.1",
"generatorVersion": "3.69.0",
"generatorConfig": {
"namespaceExport": "Junction",
"noSerdeLayer": false,
Expand All @@ -13,10 +13,10 @@
"packageManager": "pnpm",
"testFramework": "vitest"
},
"originGitCommit": "05d79dd6ce370cbd029417f59eb71c056d94aa61",
"originGitCommit": "5f82089cf81f14dcaa4eabeffe1c781fb1679c6e",
"originGitCommitIsDirty": true,
"invokedBy": "ci",
"requestedVersion": "AUTO",
"ciProvider": "unknown",
"sdkVersion": "0.0.1"
"sdkVersion": "1.0.0"
}
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,19 @@ The SDK is instrumented with automatic retries with exponential backoff. A reque
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
retry limit (default: 2).

A request is deemed retryable when any of the following HTTP status codes is returned:
Which status codes are retried depends on the `retryStatusCodes` generator configuration:

**`legacy`** (current default): retries on
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500)

**`recommended`**: retries on
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway)
- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable)
- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout)

Use the `maxRetries` request option to configure this behavior.

Expand Down
3 changes: 1 addition & 2 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
## 0.0.1 - 2026-05-01
## 1.0.0 - 2026-05-06
* Initial SDK generation
* 🌿 Generated with Fern

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@junction-api/sdk",
"version": "0.0.1",
"version": "1.0.0",
"private": false,
"repository": {
"type": "git",
Expand Down
72 changes: 36 additions & 36 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 27 additions & 2 deletions src/BaseClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import { mergeHeaders } from "./core/headers.js";
import * as core from "./core/index.js";
import type * as environments from "./environments.js";

export type AuthOption =
| false
| core.AuthProvider["getAuthRequest"]
| core.AuthProvider
| HeaderAuthProvider.AuthOptions;

export type BaseClientOptions = {
environment?: core.Supplier<environments.JunctionEnvironment | string>;
/** Specify a custom URL to connect the client to. */
Expand All @@ -19,6 +25,8 @@ export type BaseClientOptions = {
fetch?: typeof fetch;
/** Configure logging for the client. */
logging?: core.logging.LogConfig | core.logging.Logger;
/** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */
auth?: AuthOption;
} & HeaderAuthProvider.AuthOptions;

export interface BaseRequestOptions {
Expand Down Expand Up @@ -51,8 +59,8 @@ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientO
{
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@junction-api/sdk",
"X-Fern-SDK-Version": "0.0.1",
"User-Agent": "@junction-api/sdk/0.0.1",
"X-Fern-SDK-Version": "1.0.0",
"User-Agent": "@junction-api/sdk/1.0.0",
"X-Fern-Runtime": core.RUNTIME.type,
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
Expand All @@ -70,6 +78,23 @@ export function normalizeClientOptionsWithAuth<T extends BaseClientOptions = Bas
options: T,
): NormalizedClientOptionsWithAuth<T> {
const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth<T>;

if (options.auth === false) {
normalized.authProvider = new core.NoOpAuthProvider();
return normalized;
}
if (options.auth != null) {
if (typeof options.auth === "function") {
normalized.authProvider = { getAuthRequest: options.auth };
return normalized;
}
if (core.isAuthProvider(options.auth)) {
normalized.authProvider = options.auth;
return normalized;
}
Object.assign(normalized, options.auth);
}

const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
normalized.authProvider ??= new HeaderAuthProvider(normalizedWithNoOpAuthProvider);
return normalized;
Expand Down
4 changes: 4 additions & 0 deletions src/api/types/LabReportResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export interface LabReportResult {
testName: string;
value: string;
/** ℹ️ This enum is non-exhaustive. */
sampleType?: Junction.LabReportResultSampleType;
/** ℹ️ This enum is non-exhaustive. */
measurementKind?: Junction.LabReportResultMeasurementKind;
/** ℹ️ This enum is non-exhaustive. */
type?: Junction.LabReportResultType | null;
units?: string | null;
maxReferenceRange?: number | null;
Expand Down
11 changes: 11 additions & 0 deletions src/api/types/LabReportResultMeasurementKind.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This file was auto-generated by Fern from our API Definition.

/** ℹ️ This enum is non-exhaustive. */
export const LabReportResultMeasurementKind = {
Direct: "direct",
Calculated: "calculated",
Ratio: "ratio",
Unknown: "unknown",
} as const;
export type LabReportResultMeasurementKind =
(typeof LabReportResultMeasurementKind)[keyof typeof LabReportResultMeasurementKind];
13 changes: 13 additions & 0 deletions src/api/types/LabReportResultSampleType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file was auto-generated by Fern from our API Definition.

/** ℹ️ This enum is non-exhaustive. */
export const LabReportResultSampleType = {
Urine: "urine",
SerumPlasmaBlood: "serum_plasma_blood",
CapillaryBlood: "capillary_blood",
Stool: "stool",
Saliva: "saliva",
Other: "other",
Unknown: "unknown",
} as const;
export type LabReportResultSampleType = (typeof LabReportResultSampleType)[keyof typeof LabReportResultSampleType];
2 changes: 2 additions & 0 deletions src/api/types/MealInDbBaseClientFacingSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface MealInDbBaseClientFacingSource {
/** This value is identical to `id`. */
providerId: string;
timestamp: Date;
/** Date of the meal in the YYYY-mm-dd format. For providers that only expose a date, this is the calendar date as recorded by the user. */
calendarDate: string;
name: string;
energy?: Junction.Energy | null;
macros?: Junction.Macros | null;
Expand Down
Loading
Loading