Skip to content

Commit

Permalink
fix: a few issues in the API ME and API plugin templates (#12511)
Browse files Browse the repository at this point in the history
  • Loading branch information
huimiu authored Oct 12, 2024
1 parent e107e78 commit 8897537
Show file tree
Hide file tree
Showing 24 changed files with 265 additions and 303 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@ paths:
content:
application/json:
schema:
type: array
items:
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
type: object
properties:
results:
type: array
items:
type: object
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ paths:
description: Returns a list of repairs with their details and images
security:
{{#MicrosoftEntra}}
- aadAuthCode: []
- aadAuthCode:
- api://${{OPENAPI_SERVER_DOMAIN}}/${{AAD_APP_CLIENT_ID}}/repairs_read
{{/MicrosoftEntra}}
{{^MicrosoftEntra}}
- oAuth2AuthCode: []
- oAuth2AuthCode:
- api://${{AAD_APP_CLIENT_ID}}/repairs_read
{{/MicrosoftEntra}}
parameters:
- name: assignedTo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
param resourceBaseName string
param functionAppSKU string
param aadAppClientId string
{{^MicrosoftEntra}}
@secure()
param aadAppClientSecret string
{{/MicrosoftEntra}}
param aadAppTenantId string
param aadAppOauthAuthorityHost string
param location string = resourceGroup().location
Expand Down Expand Up @@ -39,33 +35,15 @@ resource functionApp 'Microsoft.Web/sites@2021-02-01' = {
}
{
name: 'FUNCTIONS_WORKER_RUNTIME'
value: 'node' // Set runtime to NodeJS
value: 'dotnet-isolated' // Use .NET isolated process
}
{
name: 'WEBSITE_RUN_FROM_PACKAGE'
value: '1' // Run Azure Functions from a package file
}
{
name: 'WEBSITE_NODE_DEFAULT_VERSION'
value: '~18' // Set NodeJS version to 18.x
}
{
name: 'M365_CLIENT_ID'
value: aadAppClientId
}
{{^MicrosoftEntra}}
{
name: 'M365_CLIENT_SECRET'
value: aadAppClientSecret
}
{{/MicrosoftEntra}}
{
name: 'M365_TENANT_ID'
value: aadAppTenantId
}
{
name: 'M365_AUTHORITY_HOST'
value: aadAppOauthAuthorityHost
name: 'SCM_ZIPDEPLOY_DONOT_PRESERVE_FILETIME'
value: '1' // Zipdeploy files will always be updated. Detail: https://aka.ms/teamsfx-zipdeploy-donot-preserve-filetime
}
]
ftpsState: 'FtpsOnly'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
"aadAppClientId": {
"value": "${{AAD_APP_CLIENT_ID}}"
},
{{^MicrosoftEntra}}
"aadAppClientSecret": {
"value": "${{SECRET_AAD_APP_CLIENT_SECRET}}"
},
{{/MicrosoftEntra}}
"aadAppTenantId": {
"value": "${{AAD_APP_TENANT_ID}}"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,30 @@ paths:
content:
application/json:
schema:
type: array
items:
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
type: object
properties:
results:
type: array
items:
type: object
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@ paths:
content:
application/json:
schema:
type: array
items:
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
type: object
properties:
results:
type: array
items:
type: object
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,30 @@ paths:
content:
application/json:
schema:
type: array
items:
properties:
id:
type: integer
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
type: object
properties:
results:
type: array
items:
type: object
properties:
id:
type: string
description: The unique identifier of the repair
title:
type: string
description: The short summary of the repair
description:
type: string
description: The detailed description of the repair
assignedTo:
type: string
description: The user who is responsible for the repair
date:
type: string
format: date-time
description: The date and time when the repair is scheduled or completed
image:
type: string
format: uri
description: The URL of the image of the item to be repaired or the repair process
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function repair(req, context) {
// Get the assignedTo query parameter.
const assignedTo = req.query.get("assignedTo");

// If the assignedTo query parameter is not provided, return all repair records.
// If the assignedTo query parameter is not provided, return an empty array.
if (!assignedTo) {
return res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ paths:
description: Returns a list of repairs with their details and images
security:
{{#MicrosoftEntra}}
- aadAuthCode: []
- aadAuthCode:
- api://${{OPENAPI_SERVER_DOMAIN}}/${{AAD_APP_CLIENT_ID}}/repairs_read
{{/MicrosoftEntra}}
{{^MicrosoftEntra}}
- oAuth2AuthCode: []
- oAuth2AuthCode:
- api://${{AAD_APP_CLIENT_ID}}/repairs_read
{{/MicrosoftEntra}}
parameters:
- name: assignedTo
Expand Down
22 changes: 0 additions & 22 deletions templates/js/api-plugin-from-scratch-oauth/infra/azure.bicep.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
param resourceBaseName string
param functionAppSKU string
param aadAppClientId string
{{^MicrosoftEntra}}
@secure()
param aadAppClientSecret string
{{/MicrosoftEntra}}
param aadAppTenantId string
param aadAppOauthAuthorityHost string
param location string = resourceGroup().location
Expand Down Expand Up @@ -49,24 +45,6 @@ resource functionApp 'Microsoft.Web/sites@2021-02-01' = {
name: 'WEBSITE_NODE_DEFAULT_VERSION'
value: '~18' // Set NodeJS version to 18.x
}
{
name: 'M365_CLIENT_ID'
value: aadAppClientId
}
{{^MicrosoftEntra}}
{
name: 'M365_CLIENT_SECRET'
value: aadAppClientSecret
}
{{/MicrosoftEntra}}
{
name: 'M365_TENANT_ID'
value: aadAppTenantId
}
{
name: 'M365_AUTHORITY_HOST'
value: aadAppOauthAuthorityHost
}
]
ftpsState: 'FtpsOnly'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
"aadAppClientId": {
"value": "${{AAD_APP_CLIENT_ID}}"
},
{{^MicrosoftEntra}}
"aadAppClientSecret": {
"value": "${{SECRET_AAD_APP_CLIENT_SECRET}}"
},
{{/MicrosoftEntra}}
"aadAppTenantId": {
"value": "${{AAD_APP_TENANT_ID}}"
},
Expand Down
Loading

0 comments on commit 8897537

Please sign in to comment.