diff --git a/.changeset/fast-panthers-sin.md b/.changeset/fast-panthers-sin.md new file mode 100644 index 000000000..7b07c28ec --- /dev/null +++ b/.changeset/fast-panthers-sin.md @@ -0,0 +1,10 @@ +--- +"@osdk/foundry-sdk-generator": patch +"@osdk/cli.cmd.typescript": patch +"@osdk/legacy-client": patch +"@osdk/shared.test": patch +"@osdk/generator": patch +"@osdk/client": patch +--- + +Modify name passed to TS user agent diff --git a/examples-extra/basic/sdk/src/generatedNoCheck/OntologyMetadata.ts b/examples-extra/basic/sdk/src/generatedNoCheck/OntologyMetadata.ts index 94228cb96..d6a803ccc 100644 --- a/examples-extra/basic/sdk/src/generatedNoCheck/OntologyMetadata.ts +++ b/examples-extra/basic/sdk/src/generatedNoCheck/OntologyMetadata.ts @@ -1,7 +1,7 @@ import { OntologyMetadata as OM } from '@osdk/api'; export type $ExpectedClientVersion = '0.16.0'; -export const $osdkMetadata = { extraUserAgent: 'typescript-sdk/dev osdk-cli/dev' }; +export const $osdkMetadata = { extraUserAgent: 'typescript-osdk/dev osdk-cli/dev' }; export interface OntologyMetadata extends OM<$ExpectedClientVersion> {} @@ -9,5 +9,5 @@ export const OntologyMetadata: OntologyMetadata = { expectsClientVersion: '0.16.0', ontologyRid: 'ri.ontology.main.ontology.a35bb7f9-2c57-4199-a1cd-af461d88bd6e', ontologyApiName: 'default', - userAgent: 'typescript-sdk/dev osdk-cli/dev', + userAgent: 'typescript-osdk/dev osdk-cli/dev', }; diff --git a/examples-extra/docs_example/src/generatedNoCheck/OntologyMetadata.ts b/examples-extra/docs_example/src/generatedNoCheck/OntologyMetadata.ts index 37ba5eec3..1c0ad06f1 100644 --- a/examples-extra/docs_example/src/generatedNoCheck/OntologyMetadata.ts +++ b/examples-extra/docs_example/src/generatedNoCheck/OntologyMetadata.ts @@ -1,7 +1,7 @@ import { OntologyMetadata as OM } from '@osdk/api'; export type $ExpectedClientVersion = '0.16.0'; -export const $osdkMetadata = { extraUserAgent: 'typescript-sdk/dev osdk-cli/dev' }; +export const $osdkMetadata = { extraUserAgent: 'typescript-osdk/dev osdk-cli/dev' }; export interface OntologyMetadata extends OM<$ExpectedClientVersion> {} @@ -9,5 +9,5 @@ export const OntologyMetadata: OntologyMetadata = { expectsClientVersion: '0.16.0', ontologyRid: 'ri.ontology.main.ontology.a35bb7f9-2c57-4199-a1cd-af461d88bd6e', ontologyApiName: 'ontology-d097f725-ab77-46cf-83c0-e3cb9186bff1', - userAgent: 'typescript-sdk/dev osdk-cli/dev', + userAgent: 'typescript-osdk/dev osdk-cli/dev', }; diff --git a/examples-extra/one_dot_one/src/generatedNoCheck/Ontology.ts b/examples-extra/one_dot_one/src/generatedNoCheck/Ontology.ts index 6099a8515..a782956e3 100644 --- a/examples-extra/one_dot_one/src/generatedNoCheck/Ontology.ts +++ b/examples-extra/one_dot_one/src/generatedNoCheck/Ontology.ts @@ -17,7 +17,7 @@ export const Ontology: { metadata: { ontologyRid: 'ridHere'; ontologyApiName: 'OntologyApiName'; - userAgent: 'typescript-sdk/dev osdk-cli/dev'; + userAgent: 'typescript-osdk/dev osdk-cli/dev'; }; objects: { Todo: typeof Todo; @@ -36,7 +36,7 @@ export const Ontology: { metadata: { ontologyRid: 'ridHere' as const, ontologyApiName: 'OntologyApiName' as const, - userAgent: 'typescript-sdk/dev osdk-cli/dev' as const, + userAgent: 'typescript-osdk/dev osdk-cli/dev' as const, }, objects: { Todo, diff --git a/examples-extra/todoapp/src/generatedNoCheck2/OntologyMetadata.ts b/examples-extra/todoapp/src/generatedNoCheck2/OntologyMetadata.ts index 37ba5eec3..1c0ad06f1 100644 --- a/examples-extra/todoapp/src/generatedNoCheck2/OntologyMetadata.ts +++ b/examples-extra/todoapp/src/generatedNoCheck2/OntologyMetadata.ts @@ -1,7 +1,7 @@ import { OntologyMetadata as OM } from '@osdk/api'; export type $ExpectedClientVersion = '0.16.0'; -export const $osdkMetadata = { extraUserAgent: 'typescript-sdk/dev osdk-cli/dev' }; +export const $osdkMetadata = { extraUserAgent: 'typescript-osdk/dev osdk-cli/dev' }; export interface OntologyMetadata extends OM<$ExpectedClientVersion> {} @@ -9,5 +9,5 @@ export const OntologyMetadata: OntologyMetadata = { expectsClientVersion: '0.16.0', ontologyRid: 'ri.ontology.main.ontology.a35bb7f9-2c57-4199-a1cd-af461d88bd6e', ontologyApiName: 'ontology-d097f725-ab77-46cf-83c0-e3cb9186bff1', - userAgent: 'typescript-sdk/dev osdk-cli/dev', + userAgent: 'typescript-osdk/dev osdk-cli/dev', }; diff --git a/packages/cli.cmd.typescript/src/generate/handleGenerate.mts b/packages/cli.cmd.typescript/src/generate/handleGenerate.mts index 7cf3bfbe2..2001b570b 100644 --- a/packages/cli.cmd.typescript/src/generate/handleGenerate.mts +++ b/packages/cli.cmd.typescript/src/generate/handleGenerate.mts @@ -222,9 +222,9 @@ async function generateSourceFiles( // This makes it so that releases don't force us to have to regenerate the code when the version strings change. function getUserAgent(version: string) { if (version === "dev") { - return "typescript-sdk/dev osdk-cli/dev"; + return "typescript-osdk/dev osdk-cli/dev"; } else { - return `typescript-sdk/${version} ${USER_AGENT}`; + return `typescript-osdk/${version} ${USER_AGENT}`; } } diff --git a/packages/client/generateMockOntology.js b/packages/client/generateMockOntology.js index ea93bdb93..a0e291326 100644 --- a/packages/client/generateMockOntology.js +++ b/packages/client/generateMockOntology.js @@ -45,7 +45,7 @@ delete ontologyWithoutUnsupportedAction.actionTypes["unsupported-action"]; await generateClientSdkVersionTwoPointZero( ontologyWithoutUnsupportedAction, - "typescript-sdk/dev osdk-cli/dev", + "typescript-osdk/dev osdk-cli/dev", { writeFile: (path, contents) => { return writeFile(path, contents, "utf-8"); diff --git a/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts b/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts index 325cf4c4c..11c72c733 100644 --- a/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts +++ b/packages/foundry-sdk-generator/src/generate/betaClient/generatePackage.ts @@ -51,7 +51,7 @@ export async function generatePackage( const inMemoryFileSystem: { [fileName: string]: string } = {}; await generateClientSdkVersionOneDotOne( ontology, - `typescript-sdk/${options.packageVersion} ${USER_AGENT}`, + `typescript-osdk/${options.packageVersion} ${USER_AGENT}`, { writeFile: async (path, contents) => { inMemoryFileSystem[normalize(path)] = contents; diff --git a/packages/foundry-sdk-generator/src/utils/UserAgent.ts b/packages/foundry-sdk-generator/src/utils/UserAgent.ts index cd230714a..7d528a708 100644 --- a/packages/foundry-sdk-generator/src/utils/UserAgent.ts +++ b/packages/foundry-sdk-generator/src/utils/UserAgent.ts @@ -15,4 +15,4 @@ */ export const USER_AGENT = - `typescript-sdk-generator/${process.env.PACKAGE_VERSION}`; + `typescript-osdk-generator/${process.env.PACKAGE_VERSION}`; diff --git a/packages/generator/src/generateClientSdkPackage.ts b/packages/generator/src/generateClientSdkPackage.ts index c30673c1e..48fe8f753 100644 --- a/packages/generator/src/generateClientSdkPackage.ts +++ b/packages/generator/src/generateClientSdkPackage.ts @@ -42,7 +42,7 @@ export async function generateClientSdkPackage( ? generateClientSdkVersionTwoPointZero : undefined!)( ontology, - `typescript-sdk/${packageVersion} osdk-cli/${cliVersion}`, + `typescript-osdk/${packageVersion} osdk-cli/${cliVersion}`, minimalFs, outDir, packageType, diff --git a/packages/generator/src/v1.1/generateClientSdkVersionOneDotOne.test.ts b/packages/generator/src/v1.1/generateClientSdkVersionOneDotOne.test.ts index 39f7d3881..c0ed3d168 100644 --- a/packages/generator/src/v1.1/generateClientSdkVersionOneDotOne.test.ts +++ b/packages/generator/src/v1.1/generateClientSdkVersionOneDotOne.test.ts @@ -28,7 +28,7 @@ describe("generator", () => { await generateClientSdkVersionOneDotOne( TodoWireOntology, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", helper.minimalFiles, BASE_PATH, ); @@ -67,7 +67,7 @@ describe("generator", () => { expect(async () => { await expect(generateClientSdkVersionOneDotOne( TodoWireOntology, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", helper.minimalFiles, BASE_PATH, )).rejects.toThrow(); @@ -85,7 +85,7 @@ describe("generator", () => { await generateClientSdkVersionOneDotOne( TodoWireOntology, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", helper.minimalFiles, BASE_PATH, ); @@ -101,7 +101,7 @@ describe("generator", () => { await mkdir(`${__dirname}/generated`, { recursive: true }); await generateClientSdkVersionOneDotOne( TodoWireOntology, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", { writeFile: async (path, contents) => { await writeFile(path, contents, { flag: "w" }); diff --git a/packages/generator/src/v1.1/generateMetadataFile.test.ts b/packages/generator/src/v1.1/generateMetadataFile.test.ts index 09aecc988..094e20bf8 100644 --- a/packages/generator/src/v1.1/generateMetadataFile.test.ts +++ b/packages/generator/src/v1.1/generateMetadataFile.test.ts @@ -26,7 +26,7 @@ describe(generateMetadataFile, () => { await generateMetadataFile( TodoWireOntology, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", helper.minimalFiles, BASE_PATH, ); @@ -53,7 +53,7 @@ describe(generateMetadataFile, () => { metadata: { ontologyRid: 'ridHere'; ontologyApiName: 'OntologyApiName'; - userAgent: 'typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0'; + userAgent: 'typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0'; }; objects: { Todo: typeof Todo; @@ -70,7 +70,7 @@ describe(generateMetadataFile, () => { metadata: { ontologyRid: 'ridHere' as const, ontologyApiName: 'OntologyApiName' as const, - userAgent: 'typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0' as const, + userAgent: 'typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0' as const, }, objects: { Todo, @@ -163,7 +163,7 @@ describe(generateMetadataFile, () => { interfaceTypes: {}, sharedPropertyTypes: {}, }, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", helper.minimalFiles, BASE_PATH, ); @@ -190,7 +190,7 @@ describe(generateMetadataFile, () => { metadata: { ontologyRid: 'rid'; ontologyApiName: 'apiName'; - userAgent: 'typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0'; + userAgent: 'typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0'; }; objects: { foo: typeof foo; @@ -207,7 +207,7 @@ describe(generateMetadataFile, () => { metadata: { ontologyRid: 'rid' as const, ontologyApiName: 'apiName' as const, - userAgent: 'typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0' as const, + userAgent: 'typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0' as const, }, objects: { foo, @@ -252,7 +252,7 @@ describe(generateMetadataFile, () => { interfaceTypes: {}, sharedPropertyTypes: {}, }, - "typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0", + "typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0", helper.minimalFiles, BASE_PATH, ); @@ -274,7 +274,7 @@ describe(generateMetadataFile, () => { metadata: { ontologyRid: 'rid'; ontologyApiName: 'apiName'; - userAgent: 'typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0'; + userAgent: 'typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0'; }; objects: {}; actions: {}; @@ -283,7 +283,7 @@ describe(generateMetadataFile, () => { metadata: { ontologyRid: 'rid' as const, ontologyApiName: 'apiName' as const, - userAgent: 'typescript-sdk/0.0.0 typescript-sdk-generator/0.0.0' as const, + userAgent: 'typescript-osdk/0.0.0 typescript-osdk-generator/0.0.0' as const, }, objects: {}, actions: {}, diff --git a/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts b/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts index 4263aa6e1..c6e854013 100644 --- a/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts +++ b/packages/generator/src/v2.0/generateClientSdkVersionTwoPointZero.test.ts @@ -28,7 +28,7 @@ describe("generator", () => { await generateClientSdkVersionTwoPointZero( TodoWireOntology, - "typescript-sdk/0.0.0 osdk-cli/0.0.0", + "typescript-osdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH, ); @@ -64,7 +64,7 @@ describe("generator", () => { expect(async () => { await expect(generateClientSdkVersionTwoPointZero( TodoWireOntology, - "typescript-sdk/0.0.0 osdk-cli/0.0.0", + "typescript-osdk/0.0.0 osdk-cli/0.0.0", helper.minimalFiles, BASE_PATH, )).rejects.toThrow(); @@ -94,7 +94,7 @@ describe("generator", () => { await mkdir(`${__dirname}/generated`, { recursive: true }); await generateClientSdkVersionTwoPointZero( TodoWireOntology, - "typescript-sdk/0.0.0 osdk-cli/0.0.0", + "typescript-osdk/0.0.0 osdk-cli/0.0.0", { writeFile: async (path, contents) => { await writeFile(path, contents, { flag: "w" }); diff --git a/packages/legacy-client/generateMockOntology.mjs b/packages/legacy-client/generateMockOntology.mjs index 0833078f9..309234acd 100644 --- a/packages/legacy-client/generateMockOntology.mjs +++ b/packages/legacy-client/generateMockOntology.mjs @@ -45,7 +45,7 @@ delete ontologyWithoutUnsupportedAction.actionTypes["unsupported-action"]; await generateClientSdkVersionOneDotOne( ontologyWithoutUnsupportedAction, - "typescript-sdk/dev osdk-cli/dev", + "typescript-osdk/dev osdk-cli/dev", { writeFile: (path, contents) => { return writeFile(path, contents, "utf-8"); diff --git a/packages/shared.test/src/mock-ontology/mockOntology.ts b/packages/shared.test/src/mock-ontology/mockOntology.ts index cfdbff7fd..142a434ac 100644 --- a/packages/shared.test/src/mock-ontology/mockOntology.ts +++ b/packages/shared.test/src/mock-ontology/mockOntology.ts @@ -25,7 +25,7 @@ import { ObjectTypeWithAllPropertyTypes } from "./ObjectTypeWithAllPropertyTypes import { ObjectTypeWithReservedNames } from "./ObjectTypeWithReservedNames"; const osdkMetadata = { - extraUserAgent: "typescript-sdk/0.0.0 osdk-cli/0.0.0", + extraUserAgent: "typescript-osdk/0.0.0 osdk-cli/0.0.0", }; const Task: TaskDef = { @@ -166,7 +166,7 @@ export const MockOntology = { metadata: { ontologyRid: "", ontologyApiName: "Ontology", - userAgent: "typescript-sdk/0.0.0 osdk-cli/0.0.0", + userAgent: "typescript-osdk/0.0.0 osdk-cli/0.0.0", }, objects: { Task,