Skip to content

Commit

Permalink
docs: add comments & update action
Browse files Browse the repository at this point in the history
  • Loading branch information
santese committed Nov 7, 2023
1 parent 902dc09 commit d47b03b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -18,7 +20,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: Install dependencies
run: yarn
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion src/lib/microsoft-partnercenter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe('Microsoft Partner Center', () => {
})
})

it(' should create an application consent', async () => {
it('should create an application consent', async () => {
const consent: ApplicationConsent = {
applicationId: '1',
applicationGrants: [
Expand Down
13 changes: 13 additions & 0 deletions src/lib/microsoft-partnercenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ export class MicrosoftPartnerCenter {
return data.items
}

/**
* Creates an application consent
* https://learn.microsoft.com/en-us/partner-center/developer/control-panel-vendor-apis#acquire-consent
* @param customerId
* @param applicationConsent
* @returns
*/
async createApplicationConsent(
customerId: string,
applicationConsent: ApplicationConsent,
Expand All @@ -163,6 +170,12 @@ export class MicrosoftPartnerCenter {
return data
}

/**
* Removes an application consent
* https://learn.microsoft.com/en-us/partner-center/developer/control-panel-vendor-apis#remove-consent
* @param customerId
* @param applicationConsentId
*/
async removeApplicationConsent(customerId: string, applicationConsentId: string) {
const url = `/customers/${customerId}/applicationconsents/${applicationConsentId}`
await this.httpAgent.delete(url)
Expand Down

0 comments on commit d47b03b

Please sign in to comment.