8000 Apigee (new) by vtalas · Pull Request #579 · clientIO/appmixer-connectors · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Apigee (new) #579

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

Draft
wants to merge 19 commits into
base: dev
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"content-type": "^1.0.4",
"csv-parse": "^5.6.0",
"csv-reader": "^1.0.12",
"dotenv": "^16.5.0",
"dtl-js": "^5.4.1",
"eslint": "^8.43.0",
"form-data": "4.0.0",
Expand Down
8 changes: 4 additions & 4 deletions src/appmixer/apify/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ module.exports = {
accountNameFromProfileInfo: 'data.email',

requestProfileInfo: {
'method': 'GET',
'uri': 'https://api.apify.com/v2/users/{{apiUserId}}?token={{apiToken}}'
method: 'GET',
url: 'https://api.apify.com/v2/users/{{apiUserId}}?token={{apiToken}}'
},

validate: {
'method': 'GET',
'uri': 'https://api.apify.com/v2/users/{{apiUserId}}?token={{apiToken}}'
method: 'GET',
url: 'https://api.apify.com/v2/users/{{apiUserId}}?token={{apiToken}}'
}
}
};
14 changes: 14 additions & 0 deletions src/appmixer/apify/crawlers/FetchDatasets/FetchDatasets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const lib = require('../../lib.generated');
module.exports = {
async receive(context) {
const { desc } = context.messages.in.content;

// https://docs.apify.com/api/v2#/reference/datasets/dataset-collection/get-list-of-datasets
const { data } = await lib.callEndpoint(context, {
method: 'GET',
action: 'datasets'
});

return context.sendJson(data, 'out');
}
};
106 changes: 106 additions & 0 deletions src/appmixer/apify/crawlers/FetchDatasets/component.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"name": "appmixer.apify.core.FetchDatasets",
"author": "Appmixer <info@appmixer.com>",
"description": "Retrieve datasets from the Apify platform, which store structured data extracted by actors.",
"version": "1.0.0",
"private": false,
"auth": {
"service": "appmixer:apify"
},
"quota": {
"manager": "appmixer:apify",
"resources": "requests"
},
"inPorts": [
{
"name": "in"
}
],
Comment on lines +14 to +18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Input port lacks a schema definition.
All components should declare a JSON schema for each input port (even if empty) to guarantee consistent UI and validation.

 "inPorts": [
-    {
-        "name": "in"
-    }
+    {
+        "name": "in",
+        "schema": {
+            "type": "object",
+            "properties": {}
+        },
+        "inspector": {
+            "inputs": {}
+        }
+    }
 ]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"inPorts": [
{
"name": "in"
}
],
"inPorts": [
{
"name": "in",
"schema": {
"type": "object",
"properties": {}
},
"inspector": {
"inputs": {}
}
}
],
🤖 Prompt for AI Agents
In src/appmixer/apify/crawlers/FetchDatasets/component.json around lines 14 to
18, the input port named "in" is missing a schema definition. Add a JSON schema
property to this input port, even if it is an empty object, to ensure consistent
UI rendering and input validation across components.

"outPorts": [
{
"name": "out",
"options": [
{
"label": "Total",
"value": "total",
"schema": {
"type": "number"
}
},
{
"label": "Count",
"value": "count",
"schema": {
"type": "number"
}
},
{
"label": "Offset",
"value": "offset",
"schema": {
"type": "number"
}
},
{
"label": "Limit",
"value": "limit",
"schema": {
"type": "number"
}
},
{
"label": "Desc",
"value": "desc",
"schema": {
"type": "boolean"
}
},
{
"label": "Items",
"value": "items",
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"title": "Items.Id"
},
"name": {
"type": "string",
"title": "Items.Name"
},
"userId": {
"type": "string",
"title": "Items.User Id"
},
"createdAt": {
"type": "string",
"title": "Items.Created At"
},
"modifiedAt": {
"type": "string",
"title": "Items.Modified At"
},
"accessedAt": {
"type": "string",
"title": "Items.Accessed At"
},
"itemCount": {
"type": "number",
"title": "Items.Item Count"
},
"cleanItemCount": {
"type": "number",
"title": "Items.Clean Item Count"
}
}
}
}
}
]
}
],
"icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAuMzc1IDM5OC40MzIiPjxkZWZzPjxzdHlsZT4uYXtmaWxsOiNmZmY7b3BhY2l0eTowO30uYntmaWxsOiMwMGE3Y2U7fS5je2ZpbGw6I2ZmOTAxMjt9LmR7ZmlsbDojNmNjMDRhO308L3N0eWxlPjwvZGVmcz48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMjA5NzEuNjI1IDk4LjE0NSkiPjxyZWN0IGNsYXNzPSJhIiB3aWR0aD0iNDAwIiBoZWlnaHQ9IjM5OCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjA5NzIgLTk4KSIvPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDc4MSkiPjxwYXRoIGNsYXNzPSJiIiBkPSJNNDQzLjAyNSwyOTAuNjYxbC0xMTYuNTYxLTI2MGMyMy4yMjctNC4yLDQwLjAzOS03LjI1NSw0Mi44NzQtNy43NzhhNzAuNTksNzAuNTksMCwwLDEsMTIuMjUtLjkzOSw4My45MTMsODMuOTEzLDAsMCwxLDE3LjQ4NCwxLjc4MSw2MC40OCw2MC40OCwwLDAsMSwxOC44LDcuMjNBNDYuMDQzLDQ2LjA0MywwLDAsMSw0MzMuNSw0Ni40NTgsNTEuODg5LDUxLjg4OSwwLDAsMSw0MzguNzI0LDU4LjJhNjkuNDg1LDY5LjQ4NSwwLDAsM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wvc3ZnPg=="
}
18 changes: 18 additions & 0 deletions src/appmixer/apigee/README.md
7B34
Original file line number Diff line numberDiff line change
@@ -0,0 +1,18 @@
TEST_SERVER_URL=http://localhost:2200 appmixer test auth login src/appmixer/apigee/auth.js -c 1038500334679-25o83vj5269qkj67frpgtgs0ndbaq2la.apps.googleusercontent.com -s CJrM6NIQ87qfIrhbYK3tq.............. -o "https://www.googleapis.com/auth/cloud-platform"

appmixer test auth refresh src/appmixer/apigee/auth.js

appmixer test component src/appmixer/apigee/core/ListOrganizations

appmixer test component src/appmixer/apigee/core/ListEnvironments -p '{"org":"new-edge-team"}'

appmixer test component src/appmixer/apigee/core/ListKeyValueMaps -p '{"org":"new-edge-team", "env":"intermediate-dev-env"}'

appmixer test component src/appmixer/apigee/core/ListEntries -p '{"org":"new-edge-team", "env":"intermediate-dev-env"}' -i '{"in":{"mapName":"appmixer-blocked-ips"}}'

appmixer test component src/appmixer/apigee/core/ListEntries -p '{"org":"new-edge-team", "env":"intermediate-dev-env"}' -i '{"in":{"mapName":"salt-acl-policy"}}'

appmixer test component src/appmixer/apigee/core/AddEntry -p '{"org":"new-edge-team", "env":"intermediate-dev-env"}' -i '{"in":{"mapName":"appmixer-blocked-ips", "ips": "1.1.1.1", "ttl": 3600, "comment": "test"}}'

appmixer test component src/appmixer/apigee/core/AddEntry -p '{"org":"new-edge-team", "env":"intermediate-dev-env"}' -i '{"in":{"mapName":"appmixer-blocked-ips", "ips": "2001:0db8:85a3:0000:0000:8a2e:0370:7334", "ttl": 3600, "comment": "test"}}'

Loading
Loading
0