Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

[TypeScript][Skill] Implement changes in Skill to 1.0 release #3585

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -72,7 +72,7 @@ export class SkillDialogBase extends ComponentDialog {

if (providerTokenResponse !== undefined) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const state: any = await this.stateAccessor.get(sc.context);
const state: SkillState = await this.stateAccessor.get(sc.context, new SkillState());
state.token = providerTokenResponse.tokenResponse.token;
}

Expand Down Expand Up @@ -125,7 +125,7 @@ export class SkillDialogBase extends ComponentDialog {

// clear state
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const state: any = await this.stateAccessor.get(sc.context);
const state: SkillState = await this.stateAccessor.get(sc.context, new SkillState());
state.clear();
}
}
Expand Up @@ -83,7 +83,7 @@ const cosmosDbStorageOptions: CosmosDbPartitionedStorageOptions = {
const storage: CosmosDbPartitionedStorage = new CosmosDbPartitionedStorage(cosmosDbStorageOptions);
const userState: UserState = new UserState(storage);
const conversationState: ConversationState = new ConversationState(storage);
const stateAccessor: StatePropertyAccessor<SkillState> = userState.createProperty(SkillState.name);
const stateAccessor: StatePropertyAccessor<SkillState> = conversationState.createProperty(SkillState.name);

// Configure localized responses
const localizedTemplates: Map<string, string> = new Map<string, string>();
Expand Down
Expand Up @@ -72,7 +72,7 @@ export class SkillDialogBase extends ComponentDialog {

if (providerTokenResponse !== undefined) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const state: any = await this.stateAccessor.get(sc.context);
const state: SkillState = await this.stateAccessor.get(sc.context, new SkillState());
state.token = providerTokenResponse.tokenResponse.token;
}

Expand Down Expand Up @@ -125,7 +125,7 @@ export class SkillDialogBase extends ComponentDialog {

// clear state
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const state: any = await this.stateAccessor.get(sc.context);
const state: SkillState = await this.stateAccessor.get(sc.context, new SkillState());
state.clear();
}
}
2 changes: 1 addition & 1 deletion templates/typescript/samples/sample-skill/src/index.ts
Expand Up @@ -83,7 +83,7 @@ const cosmosDbStorageOptions: CosmosDbPartitionedStorageOptions = {
const storage: CosmosDbPartitionedStorage = new CosmosDbPartitionedStorage(cosmosDbStorageOptions);
const userState: UserState = new UserState(storage);
const conversationState: ConversationState = new ConversationState(storage);
const stateAccessor: StatePropertyAccessor<SkillState> = userState.createProperty(SkillState.name);
const stateAccessor: StatePropertyAccessor<SkillState> = conversationState.createProperty(SkillState.name);

// Configure localized responses
const localizedTemplates: Map<string, string> = new Map<string, string>();
Expand Down