Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
13 changes: 10 additions & 3 deletions components/azure_devops/azure_devops.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export default {
_baseUrl() {
return "https://dev.azure.com";
},
_headers() {
const basicAuth = Buffer.from(`${this._oauthUid()}:${this._oauthAccessToken()}`).toString("base64");
_headers(useOAuth) {
const basicAuth = Buffer.from(`${this._oauthUid()}:${useOAuth
? this._oauthAccessToken()
: this._personalAccessToken()}`).toString("base64");
return {
Authorization: `Basic ${basicAuth}`,
};
Expand All @@ -40,16 +42,20 @@ export default {
_oauthUid() {
return this.$auth.oauth_uid;
},
_personalAccessToken() {
return this.$auth.personal_access_token;
},
_makeRequest(args = {}) {
const {
$ = this,
url,
path,
useOAuth = false,
...otherArgs
} = args;
const config = {
url: url || `${this._baseUrl()}${path}`,
headers: this._headers(),
headers: this._headers(useOAuth),
...otherArgs,
};
config.url += config.url.includes("?")
Expand All @@ -61,6 +67,7 @@ export default {
async listAccounts(args = {}) {
const { value } = await this._makeRequest({
url: `https://app.vssps.visualstudio.com/_apis/accounts?memberId=${this._oauthUid()}`,
useOAuth: true,
...args,
});
return value;
Expand Down
4 changes: 2 additions & 2 deletions components/azure_devops/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/azure_devops",
"version": "0.0.4",
"version": "0.1.0",
"description": "Pipedream Azure DevOps Components",
"main": "azure_devops.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.2.1"
"@pipedream/platform": "^3.1.0"
}
}
11 changes: 7 additions & 4 deletions components/azure_devops/sources/new-event/new-event.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import azureDevops from "../../azure_devops.app.mjs";

export default {
name: "New Event (Instant)",
version: "0.0.2",
version: "0.0.3",
key: "azure_devops-new-event",
description: "Emit new event for the specified event type.",
type: "source",
Expand Down Expand Up @@ -40,9 +40,12 @@ export default {
},
eventType: this.eventType,
};
const { id } = await this.azureDevops.createSubscription(this.organization, {
data,
});
const { id } = await this.azureDevops.createSubscription(
this.organization,
{
data,
},
);
this._setHookId(id);
},
async deactivate() {
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading