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: add scaffolding logic for copliot plugin template #11855

Merged
merged 1 commit into from
Jun 19, 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 @@ -281,10 +281,6 @@ export const inputsToTemplateName: Map<{ [key: string]: any }, TemplateNames> =
{ [QuestionNames.Capabilities]: CapabilityOptions.aiAssistantBot().id },
TemplateNames.AIAssistantBot,
],
[
{ [QuestionNames.Capabilities]: CapabilityOptions.copilotPluginNewApi().id },
TemplateNames.ApiPluginFromScratch,
],
[
{
[QuestionNames.Capabilities]: CapabilityOptions.m365SearchMe().id,
Expand Down Expand Up @@ -355,4 +351,26 @@ export const inputsToTemplateName: Map<{ [key: string]: any }, TemplateNames> =
},
TemplateNames.CustomCopilotAssistantAssistantsApi,
],
// Copilot Plugin
[
{
[QuestionNames.Capabilities]: CapabilityOptions.copilotPluginNewApi().id,
[QuestionNames.ApiAuth]: ApiAuthOptions.none().id,
},
TemplateNames.ApiPluginFromScratch,
],
[
{
[QuestionNames.Capabilities]: CapabilityOptions.copilotPluginNewApi().id,
[QuestionNames.ApiAuth]: ApiAuthOptions.apiKey().id,
},
TemplateNames.ApiPluginFromScratchBearer,
],
[
{
[QuestionNames.Capabilities]: CapabilityOptions.copilotPluginNewApi().id,
[QuestionNames.ApiAuth]: ApiAuthOptions.oauth().id,
},
TemplateNames.ApiPluginFromScratchOAuth,
],
]);
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,42 @@ const V3Version = MetadataV3.projectVersion;
const res = await coordinator.create(v3ctx, inputs);
assert.isTrue(res.isOk());
});

it("create API Plugin with api-key auth (feature flag enabled)", async () => {
const v3ctx = createContext();
v3ctx.userInteraction = new MockedUserInteraction();

const inputs: Inputs = {
platform: Platform.VSCode,
folder: ".",
[QuestionNames.ProjectType]: ProjectTypeOptions.copilotPlugin().id,
[QuestionNames.Capabilities]: CapabilityOptions.copilotPluginNewApi().id,
[QuestionNames.ApiAuth]: ApiAuthOptions.apiKey().id,
[QuestionNames.ProgrammingLanguage]: "javascript",
[QuestionNames.AppName]: randomAppName(),
[QuestionNames.Scratch]: ScratchOptions.yes().id,
};
const res = await coordinator.create(v3ctx, inputs);
assert.isTrue(res.isOk());
});

it("create API Plugin with OAuth (feature flag enabled)", async () => {
const v3ctx = createContext();
v3ctx.userInteraction = new MockedUserInteraction();

const inputs: Inputs = {
platform: Platform.VSCode,
folder: ".",
[QuestionNames.ProjectType]: ProjectTypeOptions.copilotPlugin().id,
[QuestionNames.Capabilities]: CapabilityOptions.copilotPluginNewApi().id,
[QuestionNames.ApiAuth]: ApiAuthOptions.oauth().id,
[QuestionNames.ProgrammingLanguage]: "javascript",
[QuestionNames.AppName]: randomAppName(),
[QuestionNames.Scratch]: ScratchOptions.yes().id,
};
const res = await coordinator.create(v3ctx, inputs);
assert.isTrue(res.isOk());
});
});
});

Expand Down
Loading