Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat, in progress): ir supports user agent headers #4232

Merged
merged 5 commits into from
Aug 8, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export async function generateIrForFernWorkspace({
smartCasing,
disableExamples,
audiences,
readme
readme,
version: undefined,
packageName: undefined
});
}
4 changes: 3 additions & 1 deletion packages/cli/cli/src/commands/mock/mockServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export async function mockServer({
keywords: undefined,
smartCasing: false,
disableExamples: false,
readme: undefined
readme: undefined,
version: undefined,
packageName: undefined
});

const mockServer = new MockServer({
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/cli/src/commands/test/testOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export async function testOutput({
keywords: undefined,
smartCasing: false,
disableExamples: false,
readme: undefined
readme: undefined,
version: undefined,
packageName: undefined
});

const mockServer = new MockServer({
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/docs-resolver/src/DocsDefinitionResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ export class DocsDefinitionResolver {
keywords: undefined,
smartCasing: false,
disableExamples: false,
readme: undefined
readme: undefined,
version: undefined,
packageName: undefined
});
const apiDefinitionId = await this.registerApi({ ir, snippetsConfig });
const api = convertIrToApiDefinition(ir, apiDefinitionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ it("converts to api reference node", async () => {
keywords: undefined,
smartCasing: false,
disableExamples: false,
readme: undefined
readme: undefined,
version: undefined,
packageName: undefined
});

const apiDefinition = convertIrToApiDefinition(ir, apiDefinitionId);
Expand Down
4 changes: 3 additions & 1 deletion packages/cli/docs-resolver/src/__test__/stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ it("converts to api reference node", async () => {
keywords: undefined,
smartCasing: false,
disableExamples: false,
readme: undefined
readme: undefined,
version: undefined,
packageName: undefined
});

const apiDefinition = convertIrToApiDefinition(ir, apiDefinitionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,10 +850,11 @@ exports[`dependencies correctly incorporates dependencies 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
`;

exports[`dependencies file dependencies 1`] = `3033661`;
exports[`dependencies file dependencies 1`] = `3033692`;
42 changes: 28 additions & 14 deletions packages/cli/ete-tests/src/tests/ir/__snapshots__/ir.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ exports[`ir {"name":"auth-header-prefix"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -1336,7 +1337,8 @@ exports[`ir {"name":"extended-examples"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -1868,7 +1870,8 @@ exports[`ir {"name":"file-upload"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -8639,7 +8642,8 @@ exports[`ir {"name":"multiple-environment-urls"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -8938,7 +8942,8 @@ exports[`ir {"name":"navigation-points-to"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -11058,7 +11063,8 @@ exports[`ir {"name":"nested-example-reference"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -12249,7 +12255,8 @@ exports[`ir {"name":"packages"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -13773,7 +13780,8 @@ exports[`ir {"name":"response-property"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -15451,7 +15459,8 @@ exports[`ir {"name":"simple","audiences":["internal"]} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -19494,7 +19503,8 @@ exports[`ir {"name":"simple","audiences":["test"]} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -34582,7 +34592,8 @@ exports[`ir {"name":"simple"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -35220,7 +35231,8 @@ exports[`ir {"name":"streaming"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -36416,7 +36428,8 @@ exports[`ir {"name":"variables"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down Expand Up @@ -36721,7 +36734,8 @@ exports[`ir {"name":"webhooks"} 1`] = `
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ export async function generateAndSnapshotIR({
keywords: undefined,
smartCasing: true,
disableExamples: false,
readme: undefined
readme: undefined,
version: undefined,
packageName: undefined
});

const intermediateRepresentationJson = await IrSerialization.IntermediateRepresentation.jsonOrThrow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4664,7 +4664,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1264378,7 +1264378,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3545,7 +3545,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3810,7 +3810,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@
"platformHeaders": {
"language": "X-Fern-Language",
"sdkName": "X-Fern-SDK-Name",
"sdkVersion": "X-Fern-SDK-Version"
"sdkVersion": "X-Fern-SDK-Version",
"userAgent": null
}
}
}
Loading
Loading