apigee-x-module
Advanced tools
Comparing version 0.5.10 to 0.5.11
@@ -47,28 +47,30 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
url: `https://apigee.googleapis.com/v1/organizations/${client.projectId}/apiproducts`, | ||
method: "post", | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
data: apiProduct | ||
}).then((response) => { | ||
let apigeeApiProduct = response.data; | ||
let apiProduct = apigeeApiProduct; | ||
if (apigeeApiProduct.attributes) | ||
for (const attr of apigeeApiProduct.attributes) { | ||
if (attr.name === "image") | ||
apiProduct.imageUrl = attr.value; | ||
if (attr.name === "spec") | ||
apiProduct.specUrl = attr.value; | ||
if (attr.name === "access") | ||
apiProduct.access = attr.value; | ||
} | ||
resolve(apiProduct); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
url: `https://apigee.googleapis.com/v1/organizations/${projectId}/apiproducts`, | ||
method: "post", | ||
headers: { | ||
"Content-Type": "application/json" | ||
}, | ||
data: apiProduct | ||
}).then((response) => { | ||
let apigeeApiProduct = response.data; | ||
let apiProduct = apigeeApiProduct; | ||
if (apigeeApiProduct.attributes) | ||
for (const attr of apigeeApiProduct.attributes) { | ||
if (attr.name === "image") | ||
apiProduct.imageUrl = attr.value; | ||
if (attr.name === "spec") | ||
apiProduct.specUrl = attr.value; | ||
if (attr.name === "access") | ||
apiProduct.access = attr.value; | ||
} | ||
resolve(apiProduct); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -80,16 +82,18 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/apiproducts/${apiProductName}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApiProduct = response.data; | ||
let apiProduct = apigeeApiProduct; | ||
resolve(apiProduct); | ||
}).catch((error) => { | ||
console.error(error); | ||
resolve(error.response.data); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/apiproducts/${apiProductName}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApiProduct = response.data; | ||
let apiProduct = apigeeApiProduct; | ||
resolve(apiProduct); | ||
}).catch((error) => { | ||
console.error(error); | ||
resolve(error.response.data); | ||
}); | ||
}); | ||
@@ -101,20 +105,22 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers?expand=true`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeDevelopers = response.data; | ||
let developers = { | ||
developers: [] | ||
}; | ||
if (apigeeDevelopers && apigeeDevelopers.developer) { | ||
apigeeDevelopers.developer.forEach(apigeeDeveloper => { | ||
developers.developers.push(apigeeDeveloper); | ||
}); | ||
} | ||
resolve(developers); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers?expand=true`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeDevelopers = response.data; | ||
let developers = { | ||
developers: [] | ||
}; | ||
if (apigeeDevelopers && apigeeDevelopers.developer) { | ||
apigeeDevelopers.developer.forEach(apigeeDeveloper => { | ||
developers.developers.push(apigeeDeveloper); | ||
}); | ||
} | ||
resolve(developers); | ||
}); | ||
}); | ||
@@ -126,19 +132,21 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
//console.error(error); | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
//console.error(error); | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -150,20 +158,22 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers`, | ||
"method": "post", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": developerData | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
//console.error(error); | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers`, | ||
"method": "post", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": developerData | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
//console.error(error); | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -175,17 +185,19 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${developerData.email}`, | ||
"method": "put", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": developerData | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
console.error(error); | ||
resolve(error.response.data); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${developerData.email}`, | ||
"method": "put", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": developerData | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
console.error(error); | ||
resolve(error.response.data); | ||
}); | ||
}); | ||
@@ -197,16 +209,18 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
console.error(error); | ||
resolve(error.response.data); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeDeveloper = response.data; | ||
let developer = apigeeDeveloper; | ||
resolve(developer); | ||
}).catch((error) => { | ||
console.error(error); | ||
resolve(error.response.data); | ||
}); | ||
}); | ||
@@ -218,26 +232,28 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps?expand=true`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApps = response.data; | ||
let apps = { | ||
apps: [] | ||
}; | ||
if (apigeeApps.app && apigeeApps.app.length > 0) { | ||
apigeeApps.app.forEach(apigeeApp => { | ||
let app = apigeeApp; | ||
apps.apps.push(app); | ||
}); | ||
} | ||
resolve(apps); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps?expand=true`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApps = response.data; | ||
let apps = { | ||
apps: [] | ||
}; | ||
if (apigeeApps.app && apigeeApps.app.length > 0) { | ||
apigeeApps.app.forEach(apigeeApp => { | ||
let app = apigeeApp; | ||
apps.apps.push(app); | ||
}); | ||
} | ||
resolve(apps); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -249,22 +265,24 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps`, | ||
"method": "post", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": { | ||
name: appName, | ||
apiProducts: apiProducts | ||
} | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps`, | ||
"method": "post", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": { | ||
name: appName, | ||
apiProducts: apiProducts | ||
} | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -276,18 +294,20 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps/${appName}`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -299,19 +319,21 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}`, | ||
"method": "put", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": app | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps/${appName}`, | ||
"method": "put", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": app | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -323,18 +345,20 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}/keys/${keyName}`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps/${appName}/keys/${keyName}`, | ||
"method": "get", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -366,19 +390,21 @@ }); | ||
key.apiProducts = newProductsArray; | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}/keys/${key.consumerKey}`, | ||
"method": "put", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": key | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps/${appName}/keys/${key.consumerKey}`, | ||
"method": "put", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": key | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -395,21 +421,23 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}/keys/${keyName}`, | ||
"method": "post", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": { | ||
apiProducts: apiProducts | ||
} | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps/${appName}/keys/${keyName}`, | ||
"method": "post", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
}, | ||
"data": { | ||
apiProducts: apiProducts | ||
} | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -421,18 +449,20 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}/keys/${keyName}/apiproducts/${apiProduct}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${projectId}/developers/${email}/apps/${appName}/keys/${keyName}/apiproducts/${apiProduct}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeAppCredential = response.data; | ||
let appCredential = apigeeAppCredential; | ||
resolve(appCredential); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -444,18 +474,20 @@ }); | ||
return new Promise((resolve, reject) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
auth.getProjectId().then((projectId) => { | ||
auth.getClient().then((client) => { | ||
client.request({ | ||
"url": `https://apigee.googleapis.com/v1/organizations/${client.projectId}/developers/${email}/apps/${appName}`, | ||
"method": "delete", | ||
"headers": { | ||
"Content-Type": "application/json" | ||
} | ||
}).then((response) => { | ||
let apigeeApp = response.data; | ||
let app = apigeeApp; | ||
resolve(app); | ||
}).catch((error) => { | ||
if (error.response && error.response.data) | ||
resolve(error.response.data); | ||
else | ||
reject(error); | ||
}); | ||
}); | ||
@@ -462,0 +494,0 @@ }); |
{ | ||
"name": "apigee-x-module", | ||
"version": "0.5.10", | ||
"version": "0.5.11", | ||
"description": "Module for integrating with the Apigee X platform for TS/JS developer portal integrations.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/tyayers/apigee-x-module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42721
676