Skip to content

Commit

Permalink
Update TypeScript projects to use new client creator methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjoh committed Feb 2, 2024
1 parent 31eabca commit 05cc66f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion get-started/azure-auth/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules/
makesdk-dev.bat
*.js
out/
4 changes: 2 additions & 2 deletions get-started/azure-auth/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { DeviceCodeCredential } from '@azure/identity';
import { AzureIdentityAuthenticationProvider } from '@microsoft/kiota-authentication-azure';
import { FetchRequestAdapter } from '@microsoft/kiota-http-fetchlibrary';
import { GetUserApiClient } from './client/getUserApiClient';
import { createGetUserApiClient } from './client/getUserApiClient';

const clientId = 'YOUR_CLIENT_ID';

Expand All @@ -25,7 +25,7 @@ const authProvider =
new AzureIdentityAuthenticationProvider(credential, graphScopes, undefined, allowedHosts);
const adapter = new FetchRequestAdapter(authProvider);

const client = new GetUserApiClient(adapter);
const client = createGetUserApiClient(adapter);

async function GetUser(): Promise<void> {
try {
Expand Down
2 changes: 1 addition & 1 deletion get-started/azure-auth/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
"outDir": "./out", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
Expand Down
4 changes: 2 additions & 2 deletions get-started/quickstart/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// <ProgramSnippet>
import { AnonymousAuthenticationProvider } from '@microsoft/kiota-abstractions';
import { FetchRequestAdapter } from '@microsoft/kiota-http-fetchlibrary';
import { PostsClient } from './client/postsClient';
import { createPostsClient } from './client/postsClient';
import { Post } from './client/models';

// API requires no authentication, so use the anonymous
Expand All @@ -13,7 +13,7 @@ const authProvider = new AnonymousAuthenticationProvider();
// Create request adapter using the fetch-based implementation
const adapter = new FetchRequestAdapter(authProvider);
// Create the API client
const client = new PostsClient(adapter);
const client =createPostsClient(adapter);

async function main(): Promise<void> {
try {
Expand Down

0 comments on commit 05cc66f

Please sign in to comment.