diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 79b6e311..9b23ed07 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -26,5 +26,10 @@ jobs: - uses: s4u/maven-settings-action@v3.0.0 with: servers: '[{"id": "ossrh", "username": "${{ secrets.DISTRIBUTION_REPOSITORY_RELEASE_USERNAME }}", "password": "${{ secrets.DISTRIBUTION_REPOSITORY_RELEASE_PASSWORD }}"}]' + + - uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.TAG_SSH_KEY }} + - name: Release to production - run: mvn clean release:clean release:prepare release:perform -B -DaltDeploymentRepository=ossrh::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ \ No newline at end of file + run: mvn clean release:clean release:prepare release:perform -B -DaltDeploymentRepository=ossrh::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ -Darguments="-Ddevelop.api.key=${{ secrets.DEVELOP_SERVER_API_KEY }} -Dprod.na1.api.key=${{ secrets.PROD_EU1_SERVER_API_KEY }} -Dprod.eu1.api.key=${{ secrets.PROD_NA1_SERVER_API_KEY }}" -P release \ No newline at end of file diff --git a/commons/src/main/java/io/polyapi/commons/api/error/http/InternalServerErrorException.java b/commons/src/main/java/io/polyapi/commons/api/error/http/InternalServerErrorException.java index b50b4224..1963b826 100644 --- a/commons/src/main/java/io/polyapi/commons/api/error/http/InternalServerErrorException.java +++ b/commons/src/main/java/io/polyapi/commons/api/error/http/InternalServerErrorException.java @@ -1,6 +1,10 @@ package io.polyapi.commons.api.error.http; import io.polyapi.commons.api.http.Response; +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; /** * Exception thrown when there's an Internal Server Error (status code 500) response from the server. @@ -13,6 +17,14 @@ public class InternalServerErrorException extends HttpResponseException { * @param response The response. */ public InternalServerErrorException(Response response) { - super("An internal error occurred on the server. Please contact an administrator.", response); + super(doIt(response.body()), response); + } + + private static String doIt(InputStream body) { + try { + return IOUtils.toString(body); + } catch (IOException e) { + throw new RuntimeException(e); + } } } diff --git a/polyapi-maven-plugin/pom.xml b/polyapi-maven-plugin/pom.xml index 312887c8..3370a425 100644 --- a/polyapi-maven-plugin/pom.xml +++ b/polyapi-maven-plugin/pom.xml @@ -120,8 +120,125 @@ - + + develop-check + + + develop.api.key + + + + + + org.apache.maven.plugins + maven-invoker-plugin + 3.7.0 + + verify + true + true + + + + develop-run + + install + run + + + + ${project.build.directory}/it/develop + https://develop-k8s.polyapi.io + ${develop.api.key} + 443 + + + + + + + + + + prod-na1-check + + + prod.na1.api.key + + + + + + org.apache.maven.plugins + maven-invoker-plugin + 3.7.0 + + verify + true + true + + + + prod-na1-run + + install + run + + + + ${project.build.directory}/it/prod/na1 + https://na1.polyapi.io + ${prod.na1.api.key} + 443 + + + + + + + + + + prod-eu1-check + + + prod.eu1.api.key + + + + + + org.apache.maven.plugins + maven-invoker-plugin + 3.7.0 + + verify + true + true + + + + prod-eu1-run + + install + run + + + + ${project.build.directory}/it/prod/eu1 + https://eu1.polyapi.io + ${prod.eu1.api.key} + 443 + + + + + + + + + release diff --git a/polyapi-maven-plugin/src/it/deploy-function-it/pom.xml b/polyapi-maven-plugin/src/it/deploy-function-it/pom.xml new file mode 100644 index 00000000..5dc7cc7b --- /dev/null +++ b/polyapi-maven-plugin/src/it/deploy-function-it/pom.xml @@ -0,0 +1,161 @@ + + + 4.0.0 + io.polyapi.it + deploy-function-it + @project.version@ + + https://polyapi.io + Deploy function IT for Poly API + + https://github.com/polyapi/polyapi-java + + + debug + 5.10.0 + ${project.groupId} + + + + The Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-params + ${junit.version} + test + + + junit + junit + 4.13.2 + test + + + io.polyapi + library + @project.version@ + + + + + + + target/generated-resources + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.12.1 + + true + + + + poly-compilation + validate + + compile + + + + + + io.polyapi + polyapi-maven-plugin + @project.version@ + + + clear-function + clean + + delete-function + + + defaultFunction + + + + deploy-and-generate + validate + + deploy-functions + generate-sources + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.2.0 + + + add-source + generate-sources + + add-source + + + + target/generated-sources + + + + + + + + + + + + delayed-function-execution + + + host + https://eu1.polyapi.io + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.8 + + + sleep-for-a-while + test-compile + + + + + + + run + + + + + + + + + diff --git a/polyapi-maven-plugin/src/it/deploy-function-it/src/main/java/io/polyapi/it/DefaultFunction.java b/polyapi-maven-plugin/src/it/deploy-function-it/src/main/java/io/polyapi/it/DefaultFunction.java new file mode 100644 index 00000000..e5e75f30 --- /dev/null +++ b/polyapi-maven-plugin/src/it/deploy-function-it/src/main/java/io/polyapi/it/DefaultFunction.java @@ -0,0 +1,11 @@ +package io.polyapi.it; + +import io.polyapi.commons.api.model.PolyFunction; + +public class DefaultFunction { + + @PolyFunction + public String defaultFunction(String parameter) { + return String.format("%s - %s", parameter, parameter); + } +} diff --git a/polyapi-maven-plugin/src/it/deploy-function-it/src/test/java/io/polyapi/ReleaseTest.java b/polyapi-maven-plugin/src/it/deploy-function-it/src/test/java/io/polyapi/ReleaseTest.java new file mode 100644 index 00000000..3f401d01 --- /dev/null +++ b/polyapi-maven-plugin/src/it/deploy-function-it/src/test/java/io/polyapi/ReleaseTest.java @@ -0,0 +1,14 @@ +package io.polyapi; + +import org.junit.jupiter.api.Test; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.MatcherAssert.assertThat; + +public class ReleaseTest { + + @Test + public void defaultFunctionTest() { + assertThat(Poly.io.polyapi.it.defaultFunction("test"), equalTo("test - test")); + } +} diff --git a/polyapi-maven-plugin/src/it/deploy-function-it/src/test/resources/specs.json b/polyapi-maven-plugin/src/it/deploy-function-it/src/test/resources/specs.json new file mode 100644 index 00000000..f32bb398 --- /dev/null +++ b/polyapi-maven-plugin/src/it/deploy-function-it/src/test/resources/specs.json @@ -0,0 +1,8576 @@ +[ + { + "id": "44c2d69a-aa5e-434a-b3de-5c96fbdcc44b", + "type": "apiFunction", + "context": "hotelApi.hotelData", + "name": "create", + "description": "Create a new hotel entry with details such as name, description, capacity, zones, and owner information. The API call uses POST method and requires a request payload containing hotel details. The response payload provides information about the Pipedream platform and the created hotel entry.", + "function": { + "arguments": [ + { + "name": "PipeDreamHost", + "description": "Host to be used for the requests", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "AUTH_TOKEN", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "hotelDataBody", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Owner": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "alive": { + "type": "boolean" + } + }, + "required": ["alive", "name"], + "title": "Owner" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "capacity": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + }, + "owner": { + "$ref": "#/definitions/Owner" + } + }, + "required": ["capacity", "description", "name", "owner", "zones"], + "title": "Argument" + } + } + }, { + "name": "payload", + "required": true, + "type": { + "kind": "object", + "properties": [ + { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + } + ] + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "PUBLIC" + }, + "apiType": "rest" + }, { + "id": "26c0b009-3487-4145-9494-d16aef45cb74", + "type": "apiFunction", + "context": "shipping", + "name": "twilioSendMessage", + "description": "This API call allows you to send a text message using Twilio's messaging service. The payload contains the to phone number, the from phone number, and the body of the message. The response payload contains information about the message, including the message contents, the status of the message, and any error codes or messages. This call is initiated using the https protocol and requires an account sid and token.", + "function": { + "arguments": [ + { + "name": "AUTH_TOKEN", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "My_Phone_Number", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "message", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "SubresourceUris": { + "type": "object", + "additionalProperties": false, + "properties": { + "media": { + "type": "string" + } + }, + "required": ["media"], + "title": "SubresourceUris" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "body": { + "type": "string" + }, + "num_segments": { + "type": "string", + "format": "integer" + }, + "direction": { + "type": "string" + }, + "from": { + "type": "string" + }, + "date_updated": { + "type": "string" + }, + "price": { + "type": "null" + }, + "error_message": { + "type": "null" + }, + "uri": { + "type": "string" + }, + "account_sid": { + "type": "string" + }, + "num_media": { + "type": "string", + "format": "integer" + }, + "to": { + "type": "string" + }, + "date_created": { + "type": "string" + }, + "status": { + "type": "string" + }, + "sid": { + "type": "string" + }, + "date_sent": { + "type": "null" + }, + "messaging_service_sid": { + "type": "null" + }, + "error_code": { + "type": "null" + }, + "price_unit": { + "type": "string" + }, + "api_version": { + "type": "string", + "format": "date" + }, + "subresource_uris": { + "$ref": "#/definitions/SubresourceUris" + } + }, + "required": [ + "account_sid", "api_version", "body", "date_created", "date_sent", "date_updated", "direction", "error_code", + "error_message", "from", "messaging_service_sid", "num_media", "num_segments", "price", "price_unit", "sid", + "status", "subresource_uris", "to", "uri" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "PUBLIC" + }, + "apiType": "rest" +}, { + "id": "a4108ecd-699c-4ef6-b582-d670b3604afe", + "type": "serverFunction", + "context": "test", + "name": "test", + "description": "This API call is used to test the list items. It takes an item from the list (first, second, third) as an input and returns a string representation of the ordinal form of the input (1st, 2nd, 3rd).", + "requirements": [], + "function": { + "arguments": [ + { + "name": "list", + "description": "An object that is used as input for the function. The list items are 'first', 'second', and 'third'.", + "required": true, + "type": { + "kind": "object", + "schema": { + "enum": ["first", "second", "third"], + "type": "string", + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "any" + }, + "synchronous": true + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nvar List;\n(function (List) {\n List[\"first\"] = \"first\";\n List[\"second\"] = \"second\";\n List[\"third\"] = \"third\";\n})(List || (List = {}));\nasync function test(list) {\n let val = '';\n switch (list) {\n case List.first:\n val = '1st';\n break;\n case List.second:\n val = '2nd';\n break;\n case List.third:\n val = '3rd';\n break;\n }\n console.log(JSON.stringify({\n val\n }));\n}\ntest(List.first);\n", + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "id": "67539fc8-7dba-4e23-93e2-4e9ce4cdd71e", + "type": "customFunction", + "context": "", + "name": "sayHelloSimple2", + "description": "This API call is a simple function to return a greeting message. It takes a name as an input and returns a string that says 'Hello' followed by the provided name. It's a part of the exports.greetings context.", + "requirements": [], + "function": { + "arguments": [ + { + "name": "name", + "description": "The name of the person to whom the greeting is to be made.", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nasync function sayHelloSimple2(name) {\n return `Hello ${name}`;\n}\n", + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "webhookHandle", + "id": "71b36426-ebce-4e59-80c2-3e32cb80a196", + "name": "getToken", + "context": "test", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string" + }, + "itemId": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date" + } + }, + "required": ["date", "itemId", "type"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "webhookHandle", + "id": "aa67f971-7957-41de-ab1d-cc55ab9fafe3", + "name": "itemPurchased2", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "webhookHandle", + "id": "3a656c33-35b7-445c-9265-8dd6083fbc39", + "name": "itemPurchased4", + "context": "test.events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "authFunction", + "id": "ee35849b-e40b-4f8a-bcb3-da4e1134f219", + "context": "auth0", + "name": "getToken", + "description": "This function obtains a token from getToken using the OAuth 2.0 authorization code flow. It will return a login url if the user needs to log in, a token once they are logged in, and an error if the user fails to log in. It allows an optional callback url where the user is going to be redirected after log in. If the refresh token flow is enabled, the refresh token will be stored on the poly server.", + "function": { + "arguments": [ + { + "name": "clientId", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "clientSecret", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "scopes", + "required": true, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + }, { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "name": "AuthFunctionCallback", + "spec": { + "arguments": [ + { + "name": "token", + "required": false, + "nullable": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "url", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "error", + "required": false, + "nullable": true, + "type": { + "kind": "primitive", + "type": "object" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + }, { + "name": "options", + "required": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "callbackUrl", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "timeout", + "required": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "audience", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "autoCloseOnToken", + "required": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, { + "name": "autoCloseOnUrl", + "required": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, { + "name": "userId", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ] + } + } + ], + "returnType": { + "kind": "object", + "properties": [ + { + "name": "close", + "type": { + "kind": "function", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + }, + "required": true + } + ] + }, + "synchronous": true + }, + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "authFunction", + "id": "ee35849b-e40b-4f8a-bcb3-da4e1134f219", + "context": "auth0", + "name": "introspectToken", + "description": "This function should be used to introspect an access token for getToken. It will return a JSON with the claims of the token.", + "function": { + "arguments": [ + { + "name": "token", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object" + } + }, + "subResource": "introspect", + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "authFunction", + "id": "ee35849b-e40b-4f8a-bcb3-da4e1134f219", + "context": "auth0", + "name": "revokeToken", + "description": "This function revokes both an access token and any associated refresh tokens for getToken.", + "function": { + "arguments": [ + { + "name": "token", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "void" + } + }, + "subResource": "revoke", + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "authFunction", + "id": "ee35849b-e40b-4f8a-bcb3-da4e1134f219", + "context": "auth0", + "name": "refreshToken", + "description": "This function can be used to refresh an access token for getToken. In this case an access token, expired or not, can be passed in to refresh it for a new one. The refresh token to be used is stored on the poly server.", + "function": { + "arguments": [ + { + "name": "token", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "subResource": "refresh", + "visibilityMetadata": { + "visibility": "PUBLIC" + } +}, { + "type": "serverVariable", + "id": "b60ca6b2-35bb-40cd-afbc-8939f12b1276", + "name": "ohipEnvironmentVariables", + "context": "hosts", + "description": "This variable is used to store the URL of the server or service endpoint. It is mainly made use of within the application to establish network connections to interact with the designated server, facilitating data exchange and ensuring seamless communication.", + "visibilityMetadata": { + "visibility": "PUBLIC" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": false, + "valueType": { + "kind": "primitive", + "type": "string" + }, + "value": null + } +}, { + "id": "60062c03-dcfd-437d-832c-6cba9543f683", + "type": "apiFunction", + "context": "shipping", + "name": "getGMapsGetXy", + "description": "", + "function": { + "arguments": [ + { + "name": "location", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GAPIKey", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Result": { + "type": "object", + "additionalProperties": false, + "properties": { + "address_components": { + "type": "array", + "items": { + "$ref": "#/definitions/AddressComponent" + } + }, + "formatted_address": { + "type": "string" + }, + "geometry": { + "$ref": "#/definitions/Geometry" + }, + "partial_match": { + "type": "boolean" + }, + "place_id": { + "type": "string" + }, + "plus_code": { + "$ref": "#/definitions/PlusCode" + }, + "types": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "address_components", "formatted_address", "geometry", "partial_match", "place_id", "plus_code", "types" + ], + "title": "Result" + }, + "AddressComponent": { + "type": "object", + "additionalProperties": false, + "properties": { + "long_name": { + "type": "string" + }, + "short_name": { + "type": "string" + }, + "types": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["long_name", "short_name", "types"], + "title": "AddressComponent" + }, + "Geometry": { + "type": "object", + "additionalProperties": false, + "properties": { + "location": { + "$ref": "#/definitions/Location" + }, + "location_type": { + "type": "string" + }, + "viewport": { + "$ref": "#/definitions/Viewport" + } + }, + "required": ["location", "location_type", "viewport"], + "title": "Geometry" + }, + "Location": { + "type": "object", + "additionalProperties": false, + "properties": { + "lat": { + "type": "number" + }, + "lng": { + "type": "number" + } + }, + "required": ["lat", "lng"], + "title": "Location" + }, + "Viewport": { + "type": "object", + "additionalProperties": false, + "properties": { + "northeast": { + "$ref": "#/definitions/Location" + }, + "southwest": { + "$ref": "#/definitions/Location" + } + }, + "required": ["northeast", "southwest"], + "title": "Viewport" + }, + "PlusCode": { + "type": "object", + "additionalProperties": false, + "properties": { + "compound_code": { + "type": "string" + }, + "global_code": { + "type": "string" + } + }, + "required": ["compound_code", "global_code"], + "title": "PlusCode" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Result" + } + }, + "status": { + "type": "string" + } + }, + "required": ["results", "status"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "TENANT" + }, + "apiType": "rest" +}, { + "id": "d692d5dc-b854-490f-b3c5-682221f82b00", + "type": "apiFunction", + "context": "", + "name": "payloadWithComments", + "description": "", + "function": { + "arguments": [ + { + "name": "payloadWithComments", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "ReturnsPortalOrder": { + "type": "object", + "additionalProperties": false, + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/definitions/Order" + } + } + }, + "required": ["orders"], + "title": "ReturnsPortalOrder" + }, + "Order": { + "type": "object", + "additionalProperties": false, + "properties": { + "identifier": { + "type": "string", + "description": "identifier is the order identifier used by the clients internal ecomm systems" + }, + "raw_status": { + "type": "string" + }, + "status": { + "type": "string", + "description": "status can be sent as Created, Shipped, or Cancelled" + }, + "total_amount_cents": { + "type": "integer", + "description": "total_amount_cents is the sum of the header level total_amount_cents and product_amount_cents" + }, + "product_amount_cents": { + "type": "integer", + "description": "product_amount_cents at the header level is the sum of the product_amount_cents for each line" + }, + "tax_amount_cents": { + "type": "integer", + "description": "tax_amount_cents at the header level is the sum of the tax_amount_cents for each line" + }, + "discount_amount_cents": { + "type": "integer" + }, + "shipping_amount_cents": { + "type": "integer" + }, + "shipping_tax_amount_cents": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "tags": { + "type": "array", + "items": {} + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "created_at should be the tiime the order was created in the Order Management System" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Item" + } + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "shipping_address": { + "$ref": "#/definitions/IngAddress" + }, + "billing_address": { + "$ref": "#/definitions/IngAddress" + }, + "transactions": { + "type": "array", + "items": {}, + "description": "The transactions object needs to be sent but only as an empty array like below" + }, + "refunds": { + "type": "array", + "items": {}, + "description": "For the initial creation of the return portal order the refund object should be sent but as an empty array like below" + }, + "discounts": { + "type": "array", + "items": {}, + "description": "discounts object needs to be sent but only as an empty array like below" + } + }, + "required": [ + "billing_address", "created_at", "currency", "customer", "discount_amount_cents", "discounts", + "items", "product_amount_cents", "raw_status", "refunds", "shipping_address", "shipping_amount_cents", + "shipping_tax_amount_cents", "tags", "tax_amount_cents", "total_amount_cents", "transactions", + "updated_at" + ], + "title": "Order" + }, + "IngAddress": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "street1": { + "type": "string" + }, + "city": { + "type": "string" + }, + "state": { + "type": "string" + }, + "zip_code": { + "type": "string", + "format": "integer" + }, + "country_code": { + "type": "string" + }, + "phone": { + "type": "string" + } + }, + "required": ["city", "country_code", "name", "phone", "state", "street1", "zip_code"], + "title": "IngAddress" + }, + "Customer": { + "type": "object", + "additionalProperties": false, + "properties": { + "identifier": { + "type": "string", + "format": "integer", + "description": "If there is no customer identifier it is recommended to send the customers email as the identifier" + }, + "first_name": { + "type": "string" + }, + "last_name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "phone": { + "type": "string" + } + }, + "required": ["email", "first_name", "identifier", "last_name"], + "title": "Customer" + }, + "Item": { + "type": "object", + "additionalProperties": false, + "properties": { + "identifier": { + "type": "string", + "format": "integer", + "description": "identifier is the forward order lines identifier" + }, + "sku": { + "type": "string" + }, + "upc": { + "type": "string", + "format": "integer" + }, + "quantity": { + "type": "integer", + "description": "The quantity is the total quantity on the order-line" + }, + "quantity_shipped": { + "type": "integer", + "description": "The quantity_shipped is the total quantity of shipped units on the order-line. This scenario is a full shipment and refund so the quantity_shipped is equal to the quantity" + }, + "quantity_canceled": { + "type": "integer", + "description": "The quantity_canceled is the total quantity of cancelled units on the order-line. This scenario is a full shipment and refund so the quantity_canceled is 0" + }, + "tracking_number": { + "type": "string" + }, + "shipped_date": { + "type": "string", + "format": "date-time", + "description": "shipped_date can be used to mark the start of the return window" + }, + "product_identifier": { + "type": "string", + "format": "integer", + "description": "product_identifier is the Client Id unique to that product (ex. same SKU from different vendors). Send SKU if no product_identifier exists" + }, + "variant_identifier": { + "type": "string", + "format": "integer", + "description": "variant_identifier is used to find the skus that should be made available to the customer as part of the even exchange" + }, + "title": { + "type": "string" + }, + "tags": { + "type": "array", + "items": {} + }, + "product_amount_cents": { + "type": "integer", + "description": "product_amount_cents is the unit_price_amount_cents multiplied by the quantity_shipped" + }, + "tax_amount_cents": { + "type": "integer", + "description": "tax_amount_cents is the tax, in cents, for all units for the sku in the shipment" + }, + "discount_amount_cents": { + "type": "integer" + }, + "unit_price_amount_cents": { + "type": "integer", + "description": "unit_price_amount_cents is the price, in cents, for a single unit of the sku" + }, + "image_url": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"], + "qt-uri-extensions": [".jpg"] + }, + "weight": { + "type": "number", + "description": "weight is needed for determining ER eligibility if catalog is not provided" + } + }, + "required": [ + "discount_amount_cents", "identifier", "image_url", "product_amount_cents", "product_identifier", + "quantity", "quantity_canceled", "quantity_shipped", "shipped_date", "sku", "tags", + "tax_amount_cents", "title", "tracking_number", "unit_price_amount_cents", "variant_identifier", + "weight" + ], + "title": "Item" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "returns_portal_order": { + "$ref": "#/definitions/ReturnsPortalOrder" + } + }, + "required": ["returns_portal_order"], + "title": "Argument" + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "7892356a-a747-4603-bd43-d14b9df9f6f0", + "type": "apiFunction", + "context": "", + "name": "createSimpleOrder", + "description": "", + "function": { + "arguments": [ + { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "AUTH_TOKEN", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "exchangeUrl", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "orderReceived", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "a7cb2839-dafb-4b47-8ee3-de5d4dbcad36", + "type": "apiFunction", + "context": "", + "name": "addPersonToRoom", + "description": "", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "payload", + "required": true, + "type": { + "kind": "object", + "properties": [ + { + "name": "name", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "age", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "days", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "firstTime", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, { + "name": "alone", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ] + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "f4a8af4d-19b7-411b-bd70-d3e795e96701", + "type": "apiFunction", + "context": "hotelApi.v4.rooms", + "name": "createReservation", + "description": "This API call is used to create a new room reservation in a hotel. It includes details such as the source of sale, room stay details like room rates, guest counts, room type, rate plan code, market code, and reservation guests' information. The response includes details about the Pipedream platform.", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "payload", + "required": true, + "type": { + "kind": "object", + "properties": [ + { + "name": "HotelId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "AmountBeforeTax", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "CurrencyCode", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "DateFrom", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "DateTo", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "Adults", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "Children", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "ChildrenAges", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "RoomTypeCode", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "RatePlanCode", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "NumberOfUnits", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestFirstName", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestLastName", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestAddressStreet", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestAddressCity", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestAddressPostalCode", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestAddressState", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GuestAddressCountry", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ] + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "e6e014fa-0390-4414-b578-c1dc4e64923d", + "type": "apiFunction", + "context": "pipedream.hotelApi.rooms", + "name": "book", + "description": "This API call is used to book a room in a hotel through the Pipedream platform. It requires the guest's name, age, number of days for the stay, and information on whether it's the guest's first time and if they are staying alone. The response includes details about Pipedream and the specific event, ", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "payload", + "required": true, + "type": { + "kind": "object", + "properties": [ + { + "name": "name", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "age", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "days", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "firstTime", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, { + "name": "alone", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ] + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "ddf02193-4aa5-42bb-a1b5-39e422b558a4", + "type": "apiFunction", + "context": "pipedream.arrayValues", + "name": "post", + "description": "This API call is used to send a POST request to the Pipedream platform. It includes an array of values, an object, a string, and a boolean or number. The response includes details about the Pipedream platform, event ID, workflow ID, owner ID, deployment ID, timestamp, and links to inspect and quicks", + "function": { + "arguments": [ + { + "name": "arrayVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "$ref": "#/definitions/ArgumentElement" + }, + "definitions": { + "ArgumentElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "menuitemid": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + }, + "required": ["menuitemid", "quantity"], + "title": "ArgumentElement" + } + } + } + } + }, { + "name": "objectVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "propertyS": { + "type": "string" + }, + "propertyB": { + "type": "boolean" + }, + "propertyN": { + "type": "integer" + } + }, + "required": ["propertyB", "propertyN", "propertyS"], + "title": "Argument" + } + } + }, { + "name": "stringVar", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "numOrNotVar", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "dac76666-6d9c-4be9-8b3f-e203c35ea750", + "type": "apiFunction", + "context": "localhost.tiers", + "name": "update", + "description": "This API call is used to update the name of a specific tier on the localhost server. The tier is identified using its unique ID and the new name is provided in the request payload. The response payload returns the updated tier information including its ID, new name, maximum functions, maximum chat q", + "function": { + "arguments": [], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "maxFunctions": { + "type": "integer" + }, + "maxChatQuestions": { + "type": "integer" + }, + "functionCallsPerDay": { + "type": "integer" + } + }, + "required": ["functionCallsPerDay", "id", "maxChatQuestions", "maxFunctions", "name"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "da9dc555-ba94-4b5f-a7a0-748dfcf744eb", + "type": "apiFunction", + "context": "", + "name": "hotelPersonVerySimpleStuffHere4", + "description": "", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personName", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "d9538755-e9b4-42bf-9750-bd48aeb89059", + "type": "apiFunction", + "context": "", + "name": "setHotelDataArray", + "description": "", + "function": { + "arguments": [ + { + "name": "arrayVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "$ref": "#/definitions/ArgumentElement" + }, + "definitions": { + "ArgumentElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "menuitemid": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + }, + "required": ["menuitemid", "quantity"], + "title": "ArgumentElement" + } + } + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "d6b93e6a-039f-4160-ac9a-e5ba946b894c", + "type": "apiFunction", + "context": "mindbodyonlineAPI.classes", + "name": "getClasses", + "description": "This is a GET API call that uses the Mindbodyonline API. It retrieves information about classes. The call returns an error message of 'Missing API key' with the code 'DeniedAccess' if a valid API key is not provided.", + "function": { + "arguments": [], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Error": { + "type": "object", + "additionalProperties": false, + "properties": { + "Message": { + "type": "string" + }, + "Code": { + "type": "string" + } + }, + "required": ["Code", "Message"], + "title": "Error" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "Error": { + "$ref": "#/definitions/Error" + } + }, + "required": ["Error"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "cc2ef6a1-6553-4ec7-9c54-61afb583442a", + "type": "apiFunction", + "context": "", + "name": "getHotelArray", + "description": "", + "function": { + "arguments": [ + { + "name": "polyApiKey", + "description": "dsadsad", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "arrayVar", + "description": "test", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "object", + "items": { + "$ref": "#/definitions/ArgumentElement" + }, + "definitions": { + "ArgumentElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "menuitemid": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + }, + "required": ["menuitemid"], + "title": "ArgumentElement" + } + }, + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "parent": { + "type": "string" + }, + "resource_subtype": { + "type": "string" + }, + "approval_status": { + "type": "string" + }, + "assignee_status": { + "type": "string" + }, + "due_at": { + "type": "string", + "format": "date-time" + }, + "due_on": { + "type": "null" + }, + "completed": { + "type": "boolean" + }, + "html_notes": { + "type": "string" + }, + "liked": { + "type": "boolean" + }, + "notes": { + "type": "string" + }, + "assignee": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["parent"], + "title": "Argument", + "typess": "object", + "propertiessss": { + "name": { + "type": "string" + }, + "parent": { + "type": "string" + }, + "resource_subtype": { + "type": "string" + }, + "approval_status": { + "type": "string" + }, + "assignee_status": { + "type": "string" + }, + "due_at": { + "type": "string", + "format": "date-time" + }, + "due_on": { + "type": "null" + }, + "completed": { + "type": "boolean" + }, + "html_notes": { + "type": "string" + }, + "liked": { + "type": "boolean" + }, + "notes": { + "type": "string" + }, + "assignee": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, { + "name": "objectVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "propertyS": { + "type": "string" + }, + "propertyB": { + "type": "boolean" + }, + "propertyN": { + "type": "integer" + } + }, + "required": ["propertyB", "propertyN", "propertyS"], + "title": "Argument" + } + } + }, { + "name": "stringVar", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "bdf67e44-1eec-4c4c-9651-12441c79c392", + "type": "apiFunction", + "context": "hotel", + "name": "findReservation", + "description": "", + "function": { + "arguments": [ + { + "name": "BaconHost", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "baconIpsumType", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "customHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "testKey", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "type": "string" + }, + "definitions": {} + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "bc3e5eb6-fb72-4579-90a7-07b6eaf78f2d", + "type": "apiFunction", + "context": "", + "name": "setHotelDataArray2", + "description": "", + "function": { + "arguments": [ + { + "name": "arrayVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "$ref": "#/definitions/ArgumentElement" + }, + "definitions": { + "ArgumentElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "menuitemid": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + }, + "required": ["menuitemid", "quantity"], + "title": "ArgumentElement" + } + } + } + } + }, { + "name": "objectVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "propertyS": { + "type": "string" + }, + "propertyB": { + "type": "boolean" + }, + "propertyN": { + "type": "integer" + } + }, + "required": ["propertyB", "propertyN", "propertyS"], + "title": "Argument" + } + } + }, { + "name": "stringVar", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "numOrNotVar", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": ["about", "owner_id", "timestamp", "workflow_id"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "ba219c82-1b3d-47bb-9b9a-d3f425d16470", + "type": "apiFunction", + "context": "io.mixergy.tanks", + "name": "getTankDetails", + "description": "This API call is used to retrieve information about a specific tank by tank ID. It returns various details about the tank such as the type, firmware version, registered time, last communication time, serial number, and volume. It also provides links to related resources like the schedule, products, and details.", + "function": { + "arguments": [], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Links": { + "type": "object", + "additionalProperties": false, + "properties": { + "self": { + "$ref": "#/definitions/Autoschedule" + }, + "autoschedule": { + "$ref": "#/definitions/Autoschedule" + }, + "schedule": { + "$ref": "#/definitions/Autoschedule" + }, + "tariff": { + "$ref": "#/definitions/Autoschedule" + }, + "settings": { + "$ref": "#/definitions/Autoschedule" + }, + "control": { + "$ref": "#/definitions/Autoschedule" + }, + "cleansing": { + "$ref": "#/definitions/Autoschedule" + }, + "tariff_service_request": { + "$ref": "#/definitions/Autoschedule" + }, + "products": { + "$ref": "#/definitions/Autoschedule" + }, + "care_plan_details": { + "$ref": "#/definitions/Autoschedule" + }, + "measurements": { + "$ref": "#/definitions/Autoschedule" + }, + "earliest_measurement": { + "$ref": "#/definitions/Autoschedule" + }, + "latest_measurement": { + "$ref": "#/definitions/Autoschedule" + }, + "events": { + "$ref": "#/definitions/Autoschedule" + }, + "earliest_event": { + "$ref": "#/definitions/Autoschedule" + }, + "latest_event": { + "$ref": "#/definitions/Autoschedule" + }, + "details": { + "$ref": "#/definitions/Details" + } + }, + "required": [ + "autoschedule", "care_plan_details", "cleansing", "control", "details", "earliest_event", + "earliest_measurement", "events", "latest_event", "latest_measurement", "measurements", "products", + "schedule", "self", "settings", "tariff", "tariff_service_request" + ], + "title": "Links" + }, + "Autoschedule": { + "type": "object", + "additionalProperties": false, + "properties": { + "href": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": ["href"], + "title": "Autoschedule" + }, + "Details": { + "type": "object", + "additionalProperties": false, + "properties": { + "href": { + "type": "string" + }, + "templated": { + "type": "boolean" + } + }, + "required": ["href", "templated"], + "title": "Details" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "firmwareVersion": { + "type": "string" + }, + "registeredAt": { + "type": "integer" + }, + "lastCommunication": { + "type": "integer" + }, + "serialNumber": { + "type": "string" + }, + "description": { + "type": "string" + }, + "tankModelCode": { + "type": "string" + }, + "configuration": { + "type": "string" + }, + "volume": { + "type": "integer" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "_links": { + "$ref": "#/definitions/Links" + } + }, + "required": [ + "_links", "configuration", "description", "firmwareVersion", "id", "lastCommunication", "permissions", + "registeredAt", "serialNumber", "tankModelCode", "type", "volume" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "a5c471ad-a8d6-40d0-a257-704d8cd33556", + "type": "apiFunction", + "context": "api.response", + "name": "baconIpsumPostMeatText", + "description": "This API call is used to generate text based on a given meat type and ID. The request payload contains the key-value pairs for the query, and the response payload returns an array of meat-based text generated based on the selected options.", + "function": { + "arguments": [ + { + "name": "BaconHost", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "baconIpsumType", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "customHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "type": "string" + }, + "definitions": {} + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "a4b865ba-4a26-4102-8ab0-44483ee050ef", + "type": "apiFunction", + "context": "", + "name": "createProduct", + "description": "", + "function": { + "arguments": [ + { + "name": "shop", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "shopToken", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "body", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Product": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "body_html": { + "type": "string" + }, + "vendor": { + "type": "string" + }, + "product_type": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "handle": { + "type": "string" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "published_at": { + "type": "null" + }, + "template_suffix": { + "type": "null" + }, + "status": { + "type": "string" + }, + "published_scope": { + "type": "string" + }, + "tags": { + "type": "string" + }, + "admin_graphql_api_id": { + "type": "string" + }, + "variants": { + "type": "array", + "items": { + "$ref": "#/definitions/Variant" + } + }, + "options": { + "type": "array", + "items": { + "$ref": "#/definitions/Option" + } + }, + "images": { + "type": "array", + "items": {} + }, + "image": { + "type": "null" + } + }, + "required": [ + "admin_graphql_api_id", "body_html", "created_at", "handle", "id", "image", "images", "options", + "product_type", "published_at", "published_scope", "status", "tags", "template_suffix", "title", + "updated_at", "variants", "vendor" + ], + "title": "Product" + }, + "Option": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "product_id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "values": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["id", "name", "position", "product_id", "values"], + "title": "Option" + }, + "Variant": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + }, + "product_id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "price": { + "type": "string" + }, + "sku": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "inventory_policy": { + "type": "string" + }, + "compare_at_price": { + "type": "null" + }, + "fulfillment_service": { + "type": "string" + }, + "inventory_management": { + "type": "null" + }, + "option1": { + "type": "string" + }, + "option2": { + "type": "null" + }, + "option3": { + "type": "null" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "taxable": { + "type": "boolean" + }, + "barcode": { + "type": "null" + }, + "grams": { + "type": "integer" + }, + "image_id": { + "type": "null" + }, + "weight": { + "type": "integer" + }, + "weight_unit": { + "type": "string" + }, + "inventory_item_id": { + "type": "integer" + }, + "inventory_quantity": { + "type": "integer" + }, + "old_inventory_quantity": { + "type": "integer" + }, + "requires_shipping": { + "type": "boolean" + }, + "admin_graphql_api_id": { + "type": "string" + } + }, + "required": [ + "admin_graphql_api_id", "barcode", "compare_at_price", "created_at", "fulfillment_service", "grams", "id", + "image_id", "inventory_item_id", "inventory_management", "inventory_policy", "inventory_quantity", + "old_inventory_quantity", "option1", "option2", "option3", "position", "price", "product_id", + "requires_shipping", "sku", "taxable", "title", "updated_at", "weight", "weight_unit" + ], + "title": "Variant" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "product": { + "$ref": "#/definitions/Product" + } + }, + "required": ["product"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "a3bb78a7-1ecc-4b92-ad99-06c42d164860", + "type": "apiFunction", + "context": "", + "name": "hotelPersonVerySimpleStuffHere1", + "description": "", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personName", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "a15eb48d-bef8-4072-935a-dda1c9d903d0", + "type": "apiFunction", + "context": "hotel", + "name": "addPersonToRoom", + "description": "This API call allows a user to book a hotel room by sending a POST request with a payload containing the customer's name, age, length of stay, and other details. The response payload provides information about the request and the API tool used.", + "function": { + "arguments": [ + { + "name": "payload", + "required": true, + "type": { + "kind": "object", + "properties": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "name", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "age", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "days", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "firstTime", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, { + "name": "alone", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ] + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "887861ff-2d8a-4fc2-b974-1fe217455bb8", + "type": "apiFunction", + "context": "data.jsonplaceholder", + "name": "getPostComments", + "description": "This API call retrieves comments for a specific post in JSON format. It uses a GET request and takes the post ID as an input parameter. The response payload provides information such as the comment ID, name, email, and body. This API is part of the JSONPlaceholder service that provides mock data for testing and prototyping.", + "function": { + "arguments": [ + { + "name": "postId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "854e3ca5-1b89-4631-a3c9-3e2821e6544d", + "type": "apiFunction", + "context": "", + "name": "subscribeToVhsChanges", + "description": "", + "function": { + "arguments": [ + { + "name": "poly.webhookUrl", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "name", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "description", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "apiKey", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "error": { + "type": "string" + } + }, + "required": ["error"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "8009494a-60ae-45b5-a757-57fc5c774a82", + "type": "apiFunction", + "context": "shipping", + "name": "hotelGetLocation", + "description": "", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personName", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "7d2b5f9d-7411-4fcd-b26b-6a12a913bfa6", + "type": "apiFunction", + "context": "", + "name": "setHotelDataArray1", + "description": "", + "function": { + "arguments": [ + { + "name": "arrayVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "$ref": "#/definitions/ArgumentElement" + }, + "definitions": { + "ArgumentElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "menuitemid": { + "type": "integer" + }, + "quantity": { + "type": "integer" + } + }, + "required": ["menuitemid", "quantity"], + "title": "ArgumentElement" + } + } + } + } + }, { + "name": "objectVar", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "propertyS": { + "type": "string" + }, + "propertyB": { + "type": "boolean" + }, + "propertyN": { + "type": "integer" + } + }, + "required": ["propertyB", "propertyN", "propertyS"], + "title": "Argument" + } + } + }, { + "name": "stringVar", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "73c2a904-835d-410b-b095-1d6f342e3587", + "type": "apiFunction", + "context": "hotelApi.hotelData", + "name": "setHotelData2", + "description": "Create a new hotel room with the given name, description, capacity, zones and owner. roomId and testQueryParam are optional query parameters.", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "AUTH_TOKEN", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "hotelDataBody", + "description": "", + "required": true, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Owner": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "alive": { + "type": "boolean" + } + }, + "required": ["alive", "name"], + "title": "Owner" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "capacity": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + }, + "owner": { + "$ref": "#/definitions/Owner" + } + }, + "required": ["capacity", "description", "name", "owner", "zones"], + "title": "Argument" + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "6428ba37-613c-4316-942f-47893d1579fa", + "type": "apiFunction", + "context": "hotel", + "name": "findReservation1", + "description": "", + "function": { + "arguments": [ + { + "name": "BaconHost", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "baconIpsumType", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "customHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "testKey", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "type": "string" + }, + "definitions": {} + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "5db92528-f219-4531-9056-3b0b4ce3feed", + "type": "apiFunction", + "context": "", + "name": "hotelPersonVerySimpleStuffHere", + "description": "My test function", + "function": { + "arguments": [ + { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "payload", + "required": true, + "type": { + "kind": "object", + "properties": [ + { + "name": "personId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "roomNum", + "description": "", + "required": false, + "type": { + "kind": "primitive", + "type": "number" + } + } + ] + } + }, { + "name": "personName", + "description": "", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "49276383-9ea1-4b1a-b212-cd2b9c03dfd4", + "type": "apiFunction", + "context": "gmaps", + "name": "locationGetXy", + "description": "", + "function": { + "arguments": [ + { + "name": "AAPIKey", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "Lat", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "Lng", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "AdministrativeArea": { + "type": "object", + "additionalProperties": false, + "properties": { + "ID": { + "type": "string" + }, + "LocalizedName": { + "type": "string" + }, + "EnglishName": { + "type": "string" + }, + "Level": { + "type": "integer" + }, + "LocalizedType": { + "type": "string" + }, + "EnglishType": { + "type": "string" + }, + "CountryID": { + "type": "string" + } + }, + "required": ["CountryID", "EnglishName", "EnglishType", "ID", "Level", "LocalizedName", "LocalizedType"], + "title": "AdministrativeArea" + }, + "Country": { + "type": "object", + "additionalProperties": false, + "properties": { + "ID": { + "type": "string" + }, + "LocalizedName": { + "type": "string" + }, + "EnglishName": { + "type": "string" + } + }, + "required": ["EnglishName", "ID", "LocalizedName"], + "title": "Country" + }, + "GeoPosition": { + "type": "object", + "additionalProperties": false, + "properties": { + "Latitude": { + "type": "number" + }, + "Longitude": { + "type": "number" + }, + "Elevation": { + "$ref": "#/definitions/Elevation" + } + }, + "required": ["Elevation", "Latitude", "Longitude"], + "title": "GeoPosition" + }, + "Elevation": { + "type": "object", + "additionalProperties": false, + "properties": { + "Metric": { + "$ref": "#/definitions/Imperial" + }, + "Imperial": { + "$ref": "#/definitions/Imperial" + } + }, + "required": ["Imperial", "Metric"], + "title": "Elevation" + }, + "Imperial": { + "type": "object", + "additionalProperties": false, + "properties": { + "Value": { + "type": "integer" + }, + "Unit": { + "type": "string" + }, + "UnitType": { + "type": "integer" + } + }, + "required": ["Unit", "UnitType", "Value"], + "title": "Imperial" + }, + "SupplementalAdminArea": { + "type": "object", + "additionalProperties": false, + "properties": { + "Level": { + "type": "integer" + }, + "LocalizedName": { + "type": "string" + }, + "EnglishName": { + "type": "string" + } + }, + "required": ["EnglishName", "Level", "LocalizedName"], + "title": "SupplementalAdminArea" + }, + "TimeZone": { + "type": "object", + "additionalProperties": false, + "properties": { + "Code": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "GmtOffset": { + "type": "integer" + }, + "IsDaylightSaving": { + "type": "boolean" + }, + "NextOffsetChange": { + "type": "string", + "format": "date-time" + } + }, + "required": ["Code", "GmtOffset", "IsDaylightSaving", "Name", "NextOffsetChange"], + "title": "TimeZone" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "Version": { + "type": "integer" + }, + "Key": { + "type": "string", + "format": "integer" + }, + "Type": { + "type": "string" + }, + "Rank": { + "type": "integer" + }, + "LocalizedName": { + "type": "string" + }, + "EnglishName": { + "type": "string" + }, + "PrimaryPostalCode": { + "type": "string" + }, + "Region": { + "$ref": "#/definitions/Country" + }, + "Country": { + "$ref": "#/definitions/Country" + }, + "AdministrativeArea": { + "$ref": "#/definitions/AdministrativeArea" + }, + "TimeZone": { + "$ref": "#/definitions/TimeZone" + }, + "GeoPosition": { + "$ref": "#/definitions/GeoPosition" + }, + "IsAlias": { + "type": "boolean" + }, + "SupplementalAdminAreas": { + "type": "array", + "items": { + "$ref": "#/definitions/SupplementalAdminArea" + } + }, + "DataSets": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "AdministrativeArea", "Country", "DataSets", "EnglishName", "GeoPosition", "IsAlias", "Key", "LocalizedName", + "PrimaryPostalCode", "Rank", "Region", "SupplementalAdminAreas", "TimeZone", "Type", "Version" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "409d5d1c-0ef7-4cd5-8a50-581d9d15bd83", + "type": "apiFunction", + "context": "shipping", + "name": "gMapsGetXyLocation", + "description": "This API call retrieves geographical data for a given address. The response contains address components (street number, route, locality, postal code, etc.) and the corresponding latitude and longitude coordinates. The sample response payload shows the result of retrieving geodata for the Empire State Building's address.", + "function": { + "arguments": [ + { + "name": "address", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "GAPIKey", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Location": { + "type": "object", + "additionalProperties": false, + "properties": { + "lat": { + "type": "number" + }, + "lng": { + "type": "number" + } + }, + "required": ["lat", "lng"], + "title": "Location" + }, + "Viewport": { + "type": "object", + "additionalProperties": false, + "properties": { + "northeast": { + "$ref": "#/definitions/Location" + }, + "southwest": { + "$ref": "#/definitions/Location" + } + }, + "required": ["northeast", "southwest"], + "title": "Viewport" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "location": { + "$ref": "#/definitions/Location" + }, + "location_type": { + "type": "string" + }, + "viewport": { + "$ref": "#/definitions/Viewport" + } + }, + "required": ["location", "location_type", "viewport"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "3b8551cf-a8e5-43d5-8b37-c65df5f374b8", + "type": "apiFunction", + "context": "cat", + "name": "getFacts", + "description": "Retrieve a random cat fact from the cat-facts API. The response includes information about the fact's status, ID, user, text, source, and timestamps. No request payload is required.", + "function": { + "arguments": [], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "type": "array", + "items": { + "$ref": "#/definitions/ResponseTypeElement" + }, + "definitions": { + "ResponseTypeElement": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "$ref": "#/definitions/Status" + }, + "_id": { + "type": "string" + }, + "user": { + "type": "string" + }, + "text": { + "type": "string" + }, + "__v": { + "type": "integer" + }, + "source": { + "type": "string" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "deleted": { + "type": "boolean" + }, + "used": { + "type": "boolean" + } + }, + "required": [ + "__v", "_id", "createdAt", "deleted", "source", "status", "text", "type", "updatedAt", "used", "user" + ], + "title": "ResponseTypeElement" + }, + "Status": { + "type": "object", + "additionalProperties": false, + "properties": { + "verified": { + "type": "boolean" + }, + "feedback": { + "type": "string" + }, + "sentCount": { + "type": "integer" + } + }, + "required": ["feedback", "sentCount", "verified"], + "title": "Status" + } + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "37d656a3-0ea9-43b6-9eab-c7dca66e5ab1", + "type": "apiFunction", + "context": "comms.messaging", + "name": "testGetHotel", + "description": "My test function", + "function": { + "arguments": [ + { + "name": "AUTH_TOKEN", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "X-MyHeader", + "description": "", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "2c950f6a-0084-40b2-841d-e7e3141b0091", + "type": "apiFunction", + "context": "codesandbox.movies", + "name": "query", + "description": "This API call is used to query the list of movies from the codesandbox database. It returns the name, genre, and actor's name for each movie.", + "function": { + "arguments": [], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Data": { + "type": "object", + "additionalProperties": false, + "properties": { + "movies": { + "type": "array", + "items": { + "$ref": "#/definitions/Movie" + } + } + }, + "required": ["movies"], + "title": "Data" + }, + "Movie": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "genre": { + "type": "string" + }, + "actor": { + "$ref": "#/definitions/Actor" + } + }, + "required": ["actor", "genre", "name"], + "title": "Movie" + }, + "Actor": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + } + }, + "required": ["name"], + "title": "Actor" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/definitions/Data" + } + }, + "required": ["data"], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "graphql" +}, { + "id": "19810789-608f-4eef-8623-544b156a3fb3", + "type": "apiFunction", + "context": "", + "name": "hotelPersonVerySimpleStuffHere2", + "description": "", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personId", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "myHeader", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "personName", + "description": "", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "primitive", + "type": "string" + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "032df56d-14da-428b-8564-ca668ee5a38d", + "type": "apiFunction", + "context": "hotelApi.v3.rooms", + "name": "updateGuestDetails", + "description": "This API call is used to update the details of a guest staying in a room in a hotel. The details include the guest's name, age, number of days of stay, and whether they are staying alone. The response includes various details about the Pipedream platform, such as the event ID, workflow ID, owner ID,", + "function": { + "arguments": [ + { + "name": "roomId", + "description": "A string that represents the unique identifier of the room in which the guest is staying.", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "name", + "description": "A string that represents the name of the guest staying in the room.", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "age", + "description": "A number that represents the age of the guest staying in the room.", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "days", + "description": "A number that represents the number of days the guest will be staying in the room.", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "alone", + "description": "A boolean that indicates whether the guest is staying in the room alone. If true, the guest is staying alone. If false, the guest is not staying alone.", + "required": true, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "inspect": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "quickstart": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + } + }, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ], + "title": "ResponseType" + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "apiType": "rest" +}, { + "id": "9c966044-2d5a-43dc-8988-f676310f55fe", + "type": "serverFunction", + "context": "security", + "name": "securityCheck", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "event", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + }, { + "name": "headers", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + }, { + "name": "params", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "any" + }, + "synchronous": false + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = require(\"polyapi\");\nasync function securityCheck(event, headers, params) {\n if (event.signature === '12321323213213') {\n polyapi_1.polyCustom.responseStatusCode = 204;\n return true;\n }\n else {\n return {\n message: 'Signature is not valid'\n };\n }\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "f4d21631-5095-49a9-8317-d3494d88f598", + "type": "serverFunction", + "context": "test", + "name": "importedArgument", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "data", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "capacity": { + "type": "number" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + }, + "owner": { + "$ref": "#/definitions/HotelApi.HotelData.Create$HotelDataBody.Owner" + } + }, + "additionalProperties": false, + "required": ["capacity", "description", "name", "owner", "zones"], + "definitions": { + "HotelApi.HotelData.Create$HotelDataBody.Owner": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "alive": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": ["alive", "name"] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "status": { + "type": "number" + }, + "data": { + "$ref": "#/definitions/T" + }, + "headers": { + "$ref": "#/definitions/Record" + } + }, + "additionalProperties": false, + "required": ["data", "headers", "status"], + "definitions": { + "T": { + "type": "object", + "properties": { + "about": { + "type": "string" + }, + "event_id": { + "type": "string" + }, + "workflow_id": { + "type": "string" + }, + "owner_id": { + "type": "string" + }, + "deployment_id": { + "type": "string" + }, + "timestamp": { + "type": "string" + }, + "inspect": { + "type": "string" + }, + "quickstart": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "about", "deployment_id", "event_id", "inspect", "owner_id", "quickstart", "timestamp", "workflow_id" + ] + }, + "Record": { + "type": "object", + "additionalProperties": false + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + }, + "synchronous": false + }, + "code": "var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = __importStar(require(\"polyapi\"));\nasync function importedArgument(data) {\n let result = await polyapi_1.default.security.securityFalse({}, {});\n console.log('%c RESULT', 'background: yellow; color: black', result);\n try {\n polyapi_1.polyCustom.executionApiKey = 'executionApiKey';\n result = await polyapi_1.default.security.securityFalse({}, {});\n }\n catch (e) {\n console.log('Failed as expected');\n }\n polyapi_1.polyCustom.executionApiKey = null;\n result = await polyapi_1.default.security.securityFalse({}, {});\n console.log('%c RESULT2', 'background: yellow; color: black', result);\n return {\n data: {\n about: 'this is all about imported arguments',\n event_id: data.name,\n workflow_id: 'workflow_id',\n owner_id: 'owner_id',\n inspect: 'inspect',\n deployment_id: 'deployment_id',\n quickstart: 'quickstart',\n timestamp: 'timestamp'\n },\n status: 200,\n headers: {}\n };\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "e16af2fe-8a67-4655-a059-1cf33e29a88d", + "type": "customFunction", + "context": "test.customfuntionObject", + "name": "createMyBird2", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "bird", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "scientificName": { + "type": "string" + }, + "lifespan": { + "type": "number" + }, + "size": { + "$ref": "#/definitions/MockApi.Birds.Create$BirdObject.Size" + }, + "features": { + "$ref": "#/definitions/MockApi.Birds.Create$BirdObject.Features" + }, + "diet": { + "type": "array", + "items": { + "$ref": "#/definitions/MockApi.Birds.Create$BirdObject.Diet" + } + } + }, + "additionalProperties": false, + "required": ["diet", "features", "lifespan", "name", "scientificName", "size"], + "definitions": { + "MockApi.Birds.Create$BirdObject.Size": { + "type": "object", + "properties": { + "height": { + "type": "number" + }, + "weight": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["height", "weight"] + }, + "MockApi.Birds.Create$BirdObject.Features": { + "type": "object", + "properties": { + "color": { + "description": "string separated by commas to include multiple values", + "type": "string" + }, + "beak": { + "type": "string" + }, + "wings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": ["beak", "color", "wings"] + }, + "MockApi.Birds.Create$BirdObject.Diet": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "percentage": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["percentage", "type"] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "scientificName": { + "type": "string" + }, + "lifespan": { + "type": "number" + }, + "size": { + "$ref": "#/definitions/MockApi.Birds.Create.Size" + }, + "features": { + "$ref": "#/definitions/MockApi.Birds.Create.Features" + }, + "diet": { + "type": "array", + "items": { + "$ref": "#/definitions/MockApi.Birds.Create.Diet" + } + } + }, + "additionalProperties": false, + "required": ["diet", "features", "id", "lifespan", "name", "scientificName", "size"], + "definitions": { + "MockApi.Birds.Create.Size": { + "type": "object", + "properties": { + "height": { + "type": "number" + }, + "weight": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["height", "weight"] + }, + "MockApi.Birds.Create.Features": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "beak": { + "type": "string" + }, + "wings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": ["beak", "color", "wings"] + }, + "MockApi.Birds.Create.Diet": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "percentage": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["percentage", "type"] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + }, + "synchronous": false + }, + "code": "var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = __importDefault(require(\"polyapi\"));\nasync function createMyBird2(bird) {\n const res = await polyapi_1.default.mockApi.birds.create(\"foobie\", bird);\n return res.data;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "85b7934d-6453-47b6-b178-1ffa19d4fb82", + "type": "serverFunction", + "context": "test.customfuntionObject", + "name": "createMyBird", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "bird", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "scientificName": { + "type": "string" + }, + "lifespan": { + "type": "number" + }, + "size": { + "$ref": "#/definitions/MockApi.Birds.Create$BirdObject.Size" + }, + "features": { + "$ref": "#/definitions/MockApi.Birds.Create$BirdObject.Features" + }, + "diet": { + "type": "array", + "items": { + "$ref": "#/definitions/MockApi.Birds.Create$BirdObject.Diet" + } + } + }, + "additionalProperties": false, + "required": ["diet", "features", "lifespan", "name", "scientificName", "size"], + "definitions": { + "MockApi.Birds.Create$BirdObject.Size": { + "type": "object", + "properties": { + "height": { + "type": "number" + }, + "weight": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["height", "weight"] + }, + "MockApi.Birds.Create$BirdObject.Features": { + "type": "object", + "properties": { + "color": { + "description": "string separated by commas to include multiple values", + "type": "string" + }, + "beak": { + "type": "string" + }, + "wings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": ["beak", "color", "wings"] + }, + "MockApi.Birds.Create$BirdObject.Diet": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "percentage": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["percentage", "type"] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "scientificName": { + "type": "string" + }, + "lifespan": { + "type": "number" + }, + "size": { + "$ref": "#/definitions/MockApi.Birds.Create.Size" + }, + "features": { + "$ref": "#/definitions/MockApi.Birds.Create.Features" + }, + "diet": { + "type": "array", + "items": { + "$ref": "#/definitions/MockApi.Birds.Create.Diet" + } + } + }, + "additionalProperties": false, + "required": ["diet", "features", "id", "lifespan", "name", "scientificName", "size"], + "definitions": { + "MockApi.Birds.Create.Size": { + "type": "object", + "properties": { + "height": { + "type": "number" + }, + "weight": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["height", "weight"] + }, + "MockApi.Birds.Create.Features": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "beak": { + "type": "string" + }, + "wings": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": ["beak", "color", "wings"] + }, + "MockApi.Birds.Create.Diet": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "percentage": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["percentage", "type"] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + }, + "synchronous": false + }, + "code": "var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = __importDefault(require(\"polyapi\"));\nasync function createMyBird(bird) {\n const res = await polyapi_1.default.mockApi.birds.create(\"foobie\", bird);\n return res.data;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "af2e6566-6481-4981-a437-0dd99c9938d0", + "type": "customFunction", + "context": "security", + "name": "securityFalse2", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "event", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + }, { + "name": "headers", + "required": true, + "type": { + "kind": "plain", + "value": "Record" + } + } + ], + "returnType": { + "kind": "plain", + "value": "boolean" + }, + "synchronous": false + }, + "code": "async function securityFalse2(event, headers) {\n console.log('event', event);\n console.log('headers', headers);\n return false;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "d710b7f4-7bc1-4ebf-ac5a-be5e06904a3b", + "type": "serverFunction", + "context": "test", + "name": "responseStatus", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "data", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + } + ], + "returnType": { + "kind": "plain", + "value": "any" + }, + "synchronous": false + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = require(\"polyapi\");\nasync function responseStatus(data) {\n console.log('data', data);\n console.log('polyCustom', polyapi_1.polyCustom);\n // polyCustom.responseStatusCode = 404;\n return data;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "ffe56ed6-2944-4089-b0c3-3ce3e3a03a86", + "type": "serverFunction", + "context": "", + "name": "sayHelloSimpleServer", + "description": "This API call is used to return a greeting message to the user. The message is a simple 'Hello' followed by the user's name.", + "requirements": ["njwt"], + "function": { + "arguments": [ + { + "name": "name", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nasync function sayHelloSimpleServer(name) {\n return `Hello ${name}`;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "e88fe1d9-8c68-47ed-b55d-d4e7553a55f8", + "type": "serverFunction", + "context": "test.server", + "name": "testServerFunction", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "value", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "power", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "text", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": true + }, + "code": "function testServerFunction(value, power, text) {\n return `${value}, ${power}, ${text}`;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "e88fe1d9-8c68-47ed-b55d-d4e7553a55f7", + "type": "serverFunction", + "context": "symphony", + "name": "getBotToken", + "description": "", + "requirements": ["njwt"], + "function": { + "arguments": [ + { + "name": "pkFileName", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "botName", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": true + }, + "code": "const fs = require('fs');\nconst nJwt = require('njwt');\nfunction getBotToken(pkFileName, botName) {\n console.log(fs.existsSync(pkFileName));\n const contents = '-----BEGIN PRIVATE KEY-----\\n' +\n 'MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKNwapOQ6rQJHetP\\n' +\n 'HRlJBIh1OsOsUBiXb3rXXE3xpWAxAha0MH+UPRblOko+5T2JqIb+xKf9Vi3oTM3t\\n' +\n 'KvffaOPtzKXZauscjq6NGzA3LgeiMy6q19pvkUUOlGYK6+Xfl+B7Xw6+hBMkQuGE\\n' +\n 'nUS8nkpR5mK4ne7djIyfHFfMu4ptAgMBAAECgYA+s0PPtMq1osG9oi4xoxeAGikf\\n' +\n 'JB3eMUptP+2DYW7mRibc+ueYKhB9lhcUoKhlQUhL8bUUFVZYakP8xD21thmQqnC4\\n' +\n 'f63asad0ycteJMLb3r+z26LHuCyOdPg1pyLk3oQ32lVQHBCYathRMcVznxOG16VK\\n' +\n 'I8BFfstJTaJu0lK/wQJBANYFGusBiZsJQ3utrQMVPpKmloO2++4q1v6ZR4puDQHx\\n' +\n 'TjLjAIgrkYfwTJBLBRZxec0E7TmuVQ9uJ+wMu/+7zaUCQQDDf2xMnQqYknJoKGq+\\n' +\n 'oAnyC66UqWC5xAnQS32mlnJ632JXA0pf9pb1SXAYExB1p9Dfqd3VAwQDwBsDDgP6\\n' +\n 'HD8pAkEA0lscNQZC2TaGtKZk2hXkdcH1SKru/g3vWTkRHxfCAznJUaza1fx0wzdG\\n' +\n 'GcES1Bdez0tbW4llI5By/skZc2eE3QJAFl6fOskBbGHde3Oce0F+wdZ6XIJhEgCP\\n' +\n 'iukIcKZoZQzoiMJUoVRrA5gqnmaYDI5uRRl/y57zt6YksR3KcLUIuQJAd242M/WF\\n' +\n '6YAZat3q/wEeETeQq1wrooew+8lHl05/Nt0cCpV48RGEhJ83pzBm3mnwHf8lTBJH\\n' +\n 'x6XroMXsmbnsEw==\\n' +\n '-----END PRIVATE KEY-----\\n';\n const claims = {\n 'sub': botName\n };\n const jwt = nJwt.create(claims, contents, 'RS512');\n jwt.setExpiration(new Date().getTime() + (3 * 60 * 1000));\n return jwt.compact();\n}\n// npx poly function add getBotToken getBotToken.ts --context symphony\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "ddb8041b-7348-4e5c-9d1b-537f0a0e3890", + "type": "serverFunction", + "context": "test", + "name": "processEnumEvent2", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "eventTypes", + "required": true, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "string[]" + }, + "synchronous": true + }, + "code": "var EventType;\n(function (EventType) {\n EventType[\"AccountUpdated\"] = \"account.updated\";\n EventType[\"AccountApplicationDeauthorized\"] = \"account.application.deauthorized\";\n EventType[\"AccountExternalAccountCreated\"] = \"account.external_account.created\";\n})(EventType || (EventType = {}));\nfunction processEnumEvent2(eventTypes) {\n return eventTypes;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "c0e81f1a-a5ea-4515-8fa4-ce7397fb5630", + "type": "serverFunction", + "context": "comm", + "name": "availAIOptimized", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "name", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "plain", + "value": "Promise" + }, + "synchronous": true + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nasync function availAIOptimized(name) {\n return `Hello ${name}`;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "ba7f47a0-1cd9-4e9c-8b74-de484ad36c4e", + "type": "serverFunction", + "context": "testik", + "name": "sayHello", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "teamId", + "description": "asdsad", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "tag", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "limit", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "offset", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "items", + "required": true, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "Promise<{ id: string; teamId: string; tag: string; limit: number; offset: number }[]>" + }, + "synchronous": true + }, + "code": "async function getPeople(teamId, tag, limit, offset, items) {\n const people = await poly.postComments(teamId);\n return people.split('').map(person => ({\n id: person,\n teamId,\n tag,\n limit,\n offset,\n }));\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "b8794476-664a-4149-a4cd-fd8c121d933e", + "type": "customFunction", + "context": "hotel.test", + "name": "getPeople", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "teamId", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "tag", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "limit", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "offset", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "items", + "required": true, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "{ id: string; teamId: string; tag: string; limit: number; offset: number }[]" + }, + "synchronous": true + }, + "code": "function getPeople(teamId, tag, limit, offset, items) {\n var people = poly.shipping.getPeople(teamId, limit, offset);\n return people.map(function (person) { return ({\n id: person.id,\n teamId: teamId,\n tag: tag,\n limit: limit,\n offset: offset,\n }); });\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "a2330d1d-b5c0-48b9-8a59-ed5d7a22c3c8", + "type": "serverFunction", + "context": "", + "name": "multiPromise", + "description": "This API call is used to send multiple messages simultaneously using the PolyAPI. It uses the 'sayHelloSimple2' function to send two messages 'Hello' and 'world' and then joins the responses.", + "requirements": ["njwt"], + "function": { + "arguments": [], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = __importDefault(require(\"polyapi\"));\nasync function multiPromise() {\n const result = await Promise.all([\n polyapi_1.default.sayHelloSimple2('Hello'),\n polyapi_1.default.sayHelloSimple2('world')\n ]);\n return result.join(' ');\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "9bf3bf6d-a177-4956-a9c7-a664177657a9", + "type": "serverFunction", + "context": "test", + "name": "getBotToken", + "description": "", + "requirements": ["njwt"], + "function": { + "arguments": [ + { + "name": "pkFileName", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "botData", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["name"], + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "answer": { + "$ref": "#/definitions/Answer" + }, + "state": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["answer", "state"], + "definitions": { + "Answer": { + "type": "object", + "properties": { + "botName": { + "type": "string" + }, + "token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["botName"] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + } + }, + "synchronous": false + }, + "code": "const fs = require('fs');\nconst nJwt = require('njwt');\nasync function getBotToken(pkFileName, botData) {\n console.log(fs.existsSync(pkFileName));\n const contents = '-----BEGIN PRIVATE KEY-----\\n' +\n 'MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKNwapOQ6rQJHetP\\n' +\n 'HRlJBIh1OsOsUBiXb3rXXE3xpWAxAha0MH+UPRblOko+5T2JqIb+xKf9Vi3oTM3t\\n' +\n 'KvffaOPtzKXZauscjq6NGzA3LgeiMy6q19pvkUUOlGYK6+Xfl+B7Xw6+hBMkQuGE\\n' +\n 'nUS8nkpR5mK4ne7djIyfHFfMu4ptAgMBAAECgYA+s0PPtMq1osG9oi4xoxeAGikf\\n' +\n 'JB3eMUptP+2DYW7mRibc+ueYKhB9lhcUoKhlQUhL8bUUFVZYakP8xD21thmQqnC4\\n' +\n 'f63asad0ycteJMLb3r+z26LHuCyOdPg1pyLk3oQ32lVQHBCYathRMcVznxOG16VK\\n' +\n 'I8BFfstJTaJu0lK/wQJBANYFGusBiZsJQ3utrQMVPpKmloO2++4q1v6ZR4puDQHx\\n' +\n 'TjLjAIgrkYfwTJBLBRZxec0E7TmuVQ9uJ+wMu/+7zaUCQQDDf2xMnQqYknJoKGq+\\n' +\n 'oAnyC66UqWC5xAnQS32mlnJ632JXA0pf9pb1SXAYExB1p9Dfqd3VAwQDwBsDDgP6\\n' +\n 'HD8pAkEA0lscNQZC2TaGtKZk2hXkdcH1SKru/g3vWTkRHxfCAznJUaza1fx0wzdG\\n' +\n 'GcES1Bdez0tbW4llI5By/skZc2eE3QJAFl6fOskBbGHde3Oce0F+wdZ6XIJhEgCP\\n' +\n 'iukIcKZoZQzoiMJUoVRrA5gqnmaYDI5uRRl/y57zt6YksR3KcLUIuQJAd242M/WF\\n' +\n '6YAZat3q/wEeETeQq1wrooew+8lHl05/Nt0cCpV48RGEhJ83pzBm3mnwHf8lTBJH\\n' +\n 'x6XroMXsmbnsEw==\\n' +\n '-----END PRIVATE KEY-----\\n';\n const claims = {\n 'sub': botData.name,\n };\n const jwt = nJwt.create(claims, contents, 'RS512');\n jwt.setExpiration(new Date().getTime() + (3 * 60 * 1000));\n return {\n answer: {\n token: jwt.compact(),\n botName: botData.name,\n },\n state: 'OK'\n };\n}\n// npx poly function add getBotToken getBotToken.ts --context symphony\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "9bf3bf6d-a177-4956-a9c7-a664177657a8", + "type": "serverFunction", + "context": "auth.server", + "name": "getAuthToken", + "description": "", + "requirements": [], + "function": { + "arguments": [], + "returnType": { + "kind": "plain", + "value": "Promise" + }, + "synchronous": true + }, + "code": "var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = __importDefault(require(\"polyapi\"));\nconst clientId = '4qfOQaBzpqplSz9nncGxK0vmaCpYJ309';\nconst clientSecret = 'DfVx5LR4VXamHRkPmn3wuG-jXmbR_iexXBQ9XepkF7TJ4_A2wVRkR8iN31iYx3c6';\nconst scopes = ['offline_access'];\nasync function getAuthToken() {\n return new Promise((resolve, reject) => {\n const { close } = polyapi_1.default.auth0.getToken(clientId, clientSecret, scopes, (token, url, error) => {\n close();\n if (error) {\n reject(error);\n }\n else {\n resolve(token || url);\n }\n }, {\n audience: `https://develop.polyapi.io`,\n userId: POLY_USER_SESSION_ID,\n });\n });\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "91f187b2-403e-42fe-af3d-40023fd5ea80", + "type": "serverFunction", + "context": "test", + "name": "sayHello", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "name", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "plain", + "value": "Promise" + }, + "synchronous": true + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nasync function sayHello(name) {\n return `Hello ${name}`;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "8f9edaba-c7f0-49bf-825d-b1413f848f51", + "type": "customFunction", + "context": "client", + "name": "processEnumEvent2", + "description": "This API call is used to process different types of account related events in Stripe. It can handle events such as account updates, application deauthorizations, and external account creations.", + "requirements": [], + "function": { + "arguments": [ + { + "name": "eventTypes", + "description": "This is an object that represents different types of account related events in Stripe. It can handle events such as account updates, application deauthorizations, and external account creations.", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "api_version": { + "type": "string" + }, + "livemode": { + "type": "boolean" + }, + "created": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["api_version", "created", "id", "livemode", "object"] + } + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "string[]" + }, + "synchronous": true + }, + "code": "var EventType;\n(function (EventType) {\n EventType[\"AccountUpdated\"] = \"account.updated\";\n EventType[\"AccountApplicationDeauthorized\"] = \"account.application.deauthorized\";\n EventType[\"AccountExternalAccountCreated\"] = \"account.external_account.created\";\n})(EventType || (EventType = {}));\nfunction processEnumEvent2(eventTypes) {\n return ['eventTypes'];\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "8dc73644-b82b-4930-8a39-3c85c72c37d1", + "type": "customFunction", + "context": "hotel", + "name": "getPeople", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "teamId", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "tag", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "limit", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "offset", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + }, { + "name": "items", + "required": true, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "{ id: string; teamId: string; tag: string; limit: number; offset: number }[]" + }, + "synchronous": true + }, + "code": "function getPeople(teamId, tag, limit, offset, items) {\n var people = poly.shipping.getPeople(teamId, limit, offset);\n return people.map(function (person) { return ({\n id: person.id,\n teamId: teamId,\n tag: tag,\n limit: limit,\n offset: offset,\n }); });\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "7efcefea-800a-431e-a4cf-d5e40b599dbf", + "type": "serverFunction", + "context": "test", + "name": "processEvent", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "value", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "api_version": { + "type": "string" + }, + "livemode": { + "type": "boolean" + }, + "created": { + "type": "number" + } + }, + "additionalProperties": false, + "required": ["api_version", "created", "id", "livemode", "object"], + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "void" + }, + "synchronous": true + }, + "code": "function processEvent(value) {\n console.log(value);\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "7e309405-17cc-49ab-9001-8e0a58d533cf", + "type": "customFunction", + "context": "auth.interface", + "name": "getBotToken", + "description": "", + "requirements": ["njwt"], + "function": { + "arguments": [ + { + "name": "pkFileName", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "botData", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false, + "required": ["name"], + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "Promise" + }, + "synchronous": true + }, + "code": "const fs = require('fs');\nconst nJwt = require('njwt');\nasync function getBotToken(pkFileName, botData) {\n console.log(fs.existsSync(pkFileName));\n const contents = '-----BEGIN PRIVATE KEY-----\\n' +\n 'MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKNwapOQ6rQJHetP\\n' +\n 'HRlJBIh1OsOsUBiXb3rXXE3xpWAxAha0MH+UPRblOko+5T2JqIb+xKf9Vi3oTM3t\\n' +\n 'KvffaOPtzKXZauscjq6NGzA3LgeiMy6q19pvkUUOlGYK6+Xfl+B7Xw6+hBMkQuGE\\n' +\n 'nUS8nkpR5mK4ne7djIyfHFfMu4ptAgMBAAECgYA+s0PPtMq1osG9oi4xoxeAGikf\\n' +\n 'JB3eMUptP+2DYW7mRibc+ueYKhB9lhcUoKhlQUhL8bUUFVZYakP8xD21thmQqnC4\\n' +\n 'f63asad0ycteJMLb3r+z26LHuCyOdPg1pyLk3oQ32lVQHBCYathRMcVznxOG16VK\\n' +\n 'I8BFfstJTaJu0lK/wQJBANYFGusBiZsJQ3utrQMVPpKmloO2++4q1v6ZR4puDQHx\\n' +\n 'TjLjAIgrkYfwTJBLBRZxec0E7TmuVQ9uJ+wMu/+7zaUCQQDDf2xMnQqYknJoKGq+\\n' +\n 'oAnyC66UqWC5xAnQS32mlnJ632JXA0pf9pb1SXAYExB1p9Dfqd3VAwQDwBsDDgP6\\n' +\n 'HD8pAkEA0lscNQZC2TaGtKZk2hXkdcH1SKru/g3vWTkRHxfCAznJUaza1fx0wzdG\\n' +\n 'GcES1Bdez0tbW4llI5By/skZc2eE3QJAFl6fOskBbGHde3Oce0F+wdZ6XIJhEgCP\\n' +\n 'iukIcKZoZQzoiMJUoVRrA5gqnmaYDI5uRRl/y57zt6YksR3KcLUIuQJAd242M/WF\\n' +\n '6YAZat3q/wEeETeQq1wrooew+8lHl05/Nt0cCpV48RGEhJ83pzBm3mnwHf8lTBJH\\n' +\n 'x6XroMXsmbnsEw==\\n' +\n '-----END PRIVATE KEY-----\\n';\n const claims = {\n 'sub': botData.name,\n };\n const jwt = nJwt.create(claims, contents, 'RS512');\n jwt.setExpiration(new Date().getTime() + (3 * 60 * 1000));\n return {\n answer: {\n token: jwt.compact(),\n botName: botData.name,\n },\n state: 'OK'\n };\n}\n// npx poly function add getBotToken getBotToken.ts --context symphony\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "77c095ca-6df4-4a85-83e5-7ac9350ec627", + "type": "serverFunction", + "context": "math", + "name": "doubleValue", + "description": "Calculates double of given value", + "requirements": [], + "function": { + "arguments": [ + { + "name": "value", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + } + ], + "returnType": { + "kind": "plain", + "value": "number" + }, + "synchronous": true + }, + "code": "async function doubleValue(value) {\n const result = await poly.data.jsonplaceholder.getPostComments(value);\n return result.length * 2;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "6b08ec73-39c9-4351-8ed0-2a96cef3b4bf", + "type": "serverFunction", + "context": "test", + "name": "processEnumEvent", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "eventTypes", + "required": true, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "string[]" + }, + "synchronous": true + }, + "code": "var EventType;\n(function (EventType) {\n EventType[\"AccountUpdated\"] = \"account.updated\";\n EventType[\"AccountApplicationDeauthorized\"] = \"account.application.deauthorized\";\n EventType[\"AccountExternalAccountCreated\"] = \"account.external_account.created\";\n})(EventType || (EventType = {}));\nfunction processEnumEvent(eventTypes) {\n return eventTypes;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "6ade2e99-04cb-47ef-9a0e-213137720fa7", + "type": "serverFunction", + "context": "security", + "name": "securityTrue", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "event", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + }, { + "name": "headers", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + }, { + "name": "params", + "required": true, + "type": { + "kind": "object", + "schema": { + "type": "object", + "additionalProperties": false, + "$schema": "http://json-schema.org/draft-07/schema#" + } + } + } + ], + "returnType": { + "kind": "plain", + "value": "boolean" + }, + "synchronous": false + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nconst polyapi_1 = require(\"polyapi\");\nasync function securityTrue(event, headers, params) {\n console.log('event', event);\n console.log('headers', headers);\n console.log('params', params);\n polyapi_1.polyCustom.responseStatusCode = 204;\n return true;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "69aa3223-be30-4619-924f-9e7b51c22f2f", + "type": "serverFunction", + "context": "security", + "name": "securityFalse", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "event", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + }, { + "name": "headers", + "required": true, + "type": { + "kind": "plain", + "value": "Record" + } + } + ], + "returnType": { + "kind": "plain", + "value": "boolean" + }, + "synchronous": false + }, + "code": "async function securityFalse(event, headers) {\n console.log('event', event);\n console.log('headers', headers);\n return false;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "66d31a50-5a6c-4c82-ba7d-b2ca4e0d4bd1", + "type": "serverFunction", + "context": "test", + "name": "readFiles", + "description": "", + "requirements": [], + "function": { + "arguments": [], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs_1 = __importDefault(require(\"fs\"));\nasync function readFiles() {\n const files = await fs_1.default.promises.writeFile('/workspace/function/test.js', 'testinfo');\n return files.join(', ');\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "61e4b31a-6acb-47e8-bdab-e4e84bde64fb", + "type": "customFunction", + "context": "test2", + "name": "getBotToken", + "description": "desc", + "requirements": ["njwt"], + "function": { + "arguments": [ + { + "name": "pkFileName", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "botName", + "required": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": true + }, + "code": "const fs = require('fs');\nconst nJwt = require('njwt');\nfunction getBotToken(pkFileName, botName) {\n console.log(fs.existsSync(pkFileName));\n const contents = '-----BEGIN PRIVATE KEY-----\\n' +\n 'MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAKNwapOQ6rQJHetP\\n' +\n 'HRlJBIh1OsOsUBiXb3rXXE3xpWAxAha0MH+UPRblOko+5T2JqIb+xKf9Vi3oTM3t\\n' +\n 'KvffaOPtzKXZauscjq6NGzA3LgeiMy6q19pvkUUOlGYK6+Xfl+B7Xw6+hBMkQuGE\\n' +\n 'nUS8nkpR5mK4ne7djIyfHFfMu4ptAgMBAAECgYA+s0PPtMq1osG9oi4xoxeAGikf\\n' +\n 'JB3eMUptP+2DYW7mRibc+ueYKhB9lhcUoKhlQUhL8bUUFVZYakP8xD21thmQqnC4\\n' +\n 'f63asad0ycteJMLb3r+z26LHuCyOdPg1pyLk3oQ32lVQHBCYathRMcVznxOG16VK\\n' +\n 'I8BFfstJTaJu0lK/wQJBANYFGusBiZsJQ3utrQMVPpKmloO2++4q1v6ZR4puDQHx\\n' +\n 'TjLjAIgrkYfwTJBLBRZxec0E7TmuVQ9uJ+wMu/+7zaUCQQDDf2xMnQqYknJoKGq+\\n' +\n 'oAnyC66UqWC5xAnQS32mlnJ632JXA0pf9pb1SXAYExB1p9Dfqd3VAwQDwBsDDgP6\\n' +\n 'HD8pAkEA0lscNQZC2TaGtKZk2hXkdcH1SKru/g3vWTkRHxfCAznJUaza1fx0wzdG\\n' +\n 'GcES1Bdez0tbW4llI5By/skZc2eE3QJAFl6fOskBbGHde3Oce0F+wdZ6XIJhEgCP\\n' +\n 'iukIcKZoZQzoiMJUoVRrA5gqnmaYDI5uRRl/y57zt6YksR3KcLUIuQJAd242M/WF\\n' +\n '6YAZat3q/wEeETeQq1wrooew+8lHl05/Nt0cCpV48RGEhJ83pzBm3mnwHf8lTBJH\\n' +\n 'x6XroMXsmbnsEw==\\n' +\n '-----END PRIVATE KEY-----\\n';\n const claims = {\n 'sub': botName\n };\n const jwt = nJwt.create(claims, contents, 'RS512');\n jwt.setExpiration(new Date().getTime() + (3 * 60 * 1000));\n return jwt.compact();\n}\n// npx poly function add getBotToken getBotToken.ts --context symphony\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "225687b3-13e5-4e02-8fc3-9e4c59b080dd", + "type": "serverFunction", + "context": "test", + "name": "sayHelloSimple", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "name", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "Object.defineProperty(exports, \"__esModule\", { value: true });\nasync function sayHelloSimple(name) {\n return `Hello ${name}`;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "06e2f76b-f334-46a3-9695-7d3694c02e50", + "type": "customFunction", + "context": "client", + "name": "readFiles", + "description": "This API call is used to write data to a file in Node.js using the 'fs' module. The function 'writeFile' is used to asynchronously write data to a file, replacing the file if it already exists. The file path and the data to be written are specified as parameters.", + "requirements": [], + "function": { + "arguments": [ + { + "name": "filter", + "required": true, + "type": { + "kind": "primitive", + "type": "string" + } + }, { + "name": "limit", + "required": true, + "type": { + "kind": "primitive", + "type": "number" + } + } + ], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "var __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs_1 = __importDefault(require(\"fs\"));\nasync function readFiles(filter, limit) {\n const files = await fs_1.default.promises.writeFile('/workspace/function/test.js', 'testinfo');\n return files.join(', ');\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "019838ea-8a63-4377-afe4-0a26212c05ee", + "type": "serverFunction", + "context": "", + "name": "longLasting", + "description": "", + "requirements": [], + "function": { + "arguments": [], + "returnType": { + "kind": "plain", + "value": "string" + }, + "synchronous": false + }, + "code": "async function longLasting() {\n const result = await new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve('Hello world');\n }, 20000);\n });\n return result;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "id": "0143cf0e-bf99-44ae-9b36-fd85bff8d1b4", + "type": "serverFunction", + "context": "security", + "name": "securityTrue2", + "description": "", + "requirements": [], + "function": { + "arguments": [ + { + "name": "event", + "required": true, + "type": { + "kind": "plain", + "value": "any" + } + }, { + "name": "headers", + "required": true, + "type": { + "kind": "plain", + "value": "Record" + } + }, { + "name": "params", + "required": true, + "type": { + "kind": "plain", + "value": "Record" + } + } + ], + "returnType": { + "kind": "plain", + "value": "boolean" + }, + "synchronous": false + }, + "code": "async function securityTrue2(event, headers, params) {\n console.log('event', event);\n console.log('headers', headers);\n console.log('params', params);\n return true;\n}\n", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "7b22849a-c1e2-439f-a334-c936cbf4d06f", + "name": "onTestEvent6", + "context": "test", + "description": "a test webhook, used for testing the new subdomain path feature", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "lowercase name" + }, + "age": { + "type": "integer", + "description": "number between 0 and 100" + } + }, + "required": ["age", "name"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "76bbd077-da3a-4bdb-898b-76d37aac3c42", + "name": "itemPurchased11", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Nested": { + "type": "object", + "additionalProperties": false, + "properties": { + "nestedProp1": { + "type": "string", + "description": "val1 comment" + }, + "nesetdProp2": { + "type": "string", + "description": "val2 comment" + } + }, + "required": ["nesetdProp2", "nestedProp1"], + "title": "Nested" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "something": { + "type": "string", + "description": "something," + }, + "big": { + "type": "string", + "description": "big" + }, + "nested": { + "$ref": "#/definitions/Nested" + } + }, + "required": ["big", "nested", "something"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "0693e56b-587f-428b-b9db-683c712bea5c", + "name": "itemPurchased10", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Nested": { + "type": "object", + "additionalProperties": false, + "properties": { + "nestedProp1": { + "type": "string", + "description": "val1 comment" + }, + "nesetdProp2": { + "type": "string", + "description": "val2 comment" + } + }, + "required": ["nesetdProp2", "nestedProp1"], + "title": "Nested" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "something": { + "type": "string", + "description": "something," + }, + "big": { + "type": "string", + "description": "big" + }, + "nested": { + "$ref": "#/definitions/Nested" + } + }, + "required": ["big", "nested", "something"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "d9466d03-1022-4826-93c7-68eefa7cc527", + "name": "itemPurchased7", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "idTest": { + "type": "integer" + } + }, + "required": ["idTest"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "50df7c8f-da74-441b-92ff-95aae1400968", + "name": "itemPurchased6", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "idTest": { + "type": "integer" + } + }, + "required": ["idTest"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "b14c5b20-6e05-4408-a957-c4b0ec7ba8d8", + "name": "itemGifted", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "6f5dfddd-4132-4850-ba10-8a6fa84d5024", + "name": "itemPurchased", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "4005e0b5-6071-4d67-96a5-405b4d09492f", + "name": "processEvent", + "context": "paymentsstripe", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "eventname": { + "type": "string" + }, + "newCount": { + "type": "integer" + } + }, + "required": ["eventname", "newCount"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "76223072-51e0-4674-b755-e71ec3c9fd52", + "name": "eventReceived", + "context": "", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Data": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "$ref": "#/definitions/Object" + } + }, + "required": ["object"], + "title": "Data" + }, + "Object": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "account_country": { + "type": "string" + }, + "account_name": { + "type": "string" + }, + "account_tax_ids": { + "type": "null" + }, + "amount_due": { + "type": "integer" + }, + "amount_paid": { + "type": "integer" + }, + "amount_remaining": { + "type": "integer" + }, + "amount_shipping": { + "type": "integer" + }, + "application": { + "type": "null" + }, + "application_fee_amount": { + "type": "null" + }, + "attempt_count": { + "type": "integer" + }, + "attempted": { + "type": "boolean" + }, + "auto_advance": { + "type": "boolean" + }, + "automatic_tax": { + "$ref": "#/definitions/AutomaticTax" + }, + "billing_reason": { + "type": "string" + }, + "charge": { + "type": "string" + }, + "collection_method": { + "type": "string" + }, + "created": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "custom_fields": { + "type": "null" + }, + "customer": { + "type": "string" + }, + "customer_address": { + "$ref": "#/definitions/CustomerAddress" + }, + "customer_email": { + "type": "string" + }, + "customer_name": { + "type": "string" + }, + "customer_phone": { + "type": "null" + }, + "customer_shipping": { + "type": "null" + }, + "customer_tax_exempt": { + "type": "string" + }, + "customer_tax_ids": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerTaxID" + } + }, + "default_payment_method": { + "type": "null" + }, + "default_source": { + "type": "null" + }, + "default_tax_rates": { + "type": "array", + "items": {} + }, + "description": { + "type": "null" + }, + "discount": { + "type": "null" + }, + "discounts": { + "type": "array", + "items": {} + }, + "due_date": { + "type": "null" + }, + "ending_balance": { + "type": "integer" + }, + "footer": { + "type": "null" + }, + "from_invoice": { + "type": "null" + }, + "hosted_invoice_url": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "invoice_pdf": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "last_finalization_error": { + "type": "null" + }, + "latest_revision": { + "type": "null" + }, + "lines": { + "$ref": "#/definitions/Lines" + }, + "livemode": { + "type": "boolean" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "next_payment_attempt": { + "type": "null" + }, + "number": { + "type": "string" + }, + "on_behalf_of": { + "type": "null" + }, + "paid": { + "type": "boolean" + }, + "paid_out_of_band": { + "type": "boolean" + }, + "payment_intent": { + "type": "string" + }, + "payment_settings": { + "$ref": "#/definitions/PaymentSettings" + }, + "period_end": { + "type": "integer" + }, + "period_start": { + "type": "integer" + }, + "post_payment_credit_notes_amount": { + "type": "integer" + }, + "pre_payment_credit_notes_amount": { + "type": "integer" + }, + "quote": { + "type": "null" + }, + "receipt_number": { + "type": "null" + }, + "redaction": { + "type": "null" + }, + "rendering_options": { + "type": "null" + }, + "shipping_cost": { + "type": "null" + }, + "shipping_details": { + "type": "null" + }, + "starting_balance": { + "type": "integer" + }, + "statement_descriptor": { + "type": "null" + }, + "status": { + "type": "string" + }, + "status_transitions": { + "$ref": "#/definitions/StatusTransitions" + }, + "subscription": { + "type": "null" + }, + "subtotal": { + "type": "integer" + }, + "subtotal_excluding_tax": { + "type": "integer" + }, + "tax": { + "type": "null" + }, + "test_clock": { + "type": "null" + }, + "total": { + "type": "integer" + }, + "total_discount_amounts": { + "type": "array", + "items": {} + }, + "total_excluding_tax": { + "type": "integer" + }, + "total_tax_amounts": { + "type": "array", + "items": {} + }, + "transfer_data": { + "type": "null" + }, + "webhooks_delivered_at": { + "type": "integer" + } + }, + "required": [ + "account_country", "account_name", "account_tax_ids", "amount_due", "amount_paid", + "amount_remaining", "amount_shipping", "application", "application_fee_amount", + "attempt_count", "attempted", "auto_advance", "automatic_tax", "billing_reason", "charge", + "collection_method", "created", "currency", "custom_fields", "customer", "customer_address", + "customer_email", "customer_name", "customer_phone", "customer_shipping", + "customer_tax_exempt", "customer_tax_ids", "default_payment_method", "default_source", + "default_tax_rates", "description", "discount", "discounts", "due_date", "ending_balance", + "footer", "from_invoice", "hosted_invoice_url", "id", "invoice_pdf", + "last_finalization_error", "latest_revision", "lines", "livemode", "metadata", + "next_payment_attempt", "number", "object", "on_behalf_of", "paid", "paid_out_of_band", + "payment_intent", "payment_settings", "period_end", "period_start", + "post_payment_credit_notes_amount", "pre_payment_credit_notes_amount", "quote", + "receipt_number", "redaction", "rendering_options", "shipping_cost", "shipping_details", + "starting_balance", "statement_descriptor", "status", "status_transitions", "subscription", + "subtotal", "subtotal_excluding_tax", "tax", "test_clock", "total", "total_discount_amounts", + "total_excluding_tax", "total_tax_amounts", "transfer_data", "webhooks_delivered_at" + ], + "title": "Object" + }, + "AutomaticTax": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "status": { + "type": "null" + } + }, + "required": ["enabled", "status"], + "title": "AutomaticTax" + }, + "CustomerAddress": { + "type": "object", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "line1": { + "type": "string" + }, + "line2": { + "type": "string" + }, + "postal_code": { + "type": "string" + }, + "state": { + "type": "string" + } + }, + "required": ["city", "country", "line1", "line2", "postal_code", "state"], + "title": "CustomerAddress" + }, + "CustomerTaxID": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["type", "value"], + "title": "CustomerTaxID" + }, + "Lines": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Datum" + } + }, + "has_more": { + "type": "boolean" + }, + "total_count": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "required": ["data", "has_more", "object", "total_count", "url"], + "title": "Lines" + }, + "Datum": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "amount": { + "type": "integer" + }, + "amount_excluding_tax": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "description": { + "type": "string" + }, + "discount_amounts": { + "type": "array", + "items": {} + }, + "discountable": { + "type": "boolean" + }, + "discounts": { + "type": "array", + "items": {} + }, + "invoice_item": { + "type": "string" + }, + "livemode": { + "type": "boolean" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "period": { + "$ref": "#/definitions/Period" + }, + "plan": { + "type": "null" + }, + "price": { + "$ref": "#/definitions/Price" + }, + "proration": { + "type": "boolean" + }, + "proration_details": { + "$ref": "#/definitions/ProrationDetails" + }, + "quantity": { + "type": "integer" + }, + "subscription": { + "type": "null" + }, + "tax_amounts": { + "type": "array", + "items": {} + }, + "tax_rates": { + "type": "array", + "items": {} + }, + "type": { + "type": "string" + }, + "unit_amount_excluding_tax": { + "type": "string", + "format": "integer" + } + }, + "required": [ + "amount", "amount_excluding_tax", "currency", "description", "discount_amounts", + "discountable", "discounts", "id", "invoice_item", "livemode", "metadata", "object", "period", + "plan", "price", "proration", "proration_details", "quantity", "subscription", "tax_amounts", + "tax_rates", "type", "unit_amount_excluding_tax" + ], + "title": "Datum" + }, + "Metadata": { + "type": "object", + "additionalProperties": false, + "title": "Metadata" + }, + "Period": { + "type": "object", + "additionalProperties": false, + "properties": { + "end": { + "type": "integer" + }, + "start": { + "type": "integer" + } + }, + "required": ["end", "start"], + "title": "Period" + }, + "Price": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "billing_scheme": { + "type": "string" + }, + "created": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "custom_unit_amount": { + "type": "null" + }, + "livemode": { + "type": "boolean" + }, + "lookup_key": { + "type": "null" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "nickname": { + "type": "null" + }, + "product": { + "type": "string" + }, + "recurring": { + "type": "null" + }, + "tax_behavior": { + "type": "string" + }, + "tiers_mode": { + "type": "null" + }, + "transform_quantity": { + "type": "null" + }, + "type": { + "type": "string" + }, + "unit_amount": { + "type": "integer" + }, + "unit_amount_decimal": { + "type": "string", + "format": "integer" + } + }, + "required": [ + "active", "billing_scheme", "created", "currency", "custom_unit_amount", "id", "livemode", + "lookup_key", "metadata", "nickname", "object", "product", "recurring", "tax_behavior", + "tiers_mode", "transform_quantity", "type", "unit_amount", "unit_amount_decimal" + ], + "title": "Price" + }, + "ProrationDetails": { + "type": "object", + "additionalProperties": false, + "properties": { + "credited_items": { + "type": "null" + } + }, + "required": ["credited_items"], + "title": "ProrationDetails" + }, + "PaymentSettings": { + "type": "object", + "additionalProperties": false, + "properties": { + "default_mandate": { + "type": "null" + }, + "payment_method_options": { + "type": "null" + }, + "payment_method_types": { + "type": "null" + } + }, + "required": ["default_mandate", "payment_method_options", "payment_method_types"], + "title": "PaymentSettings" + }, + "StatusTransitions": { + "type": "object", + "additionalProperties": false, + "properties": { + "finalized_at": { + "type": "integer" + }, + "marked_uncollectible_at": { + "type": "null" + }, + "paid_at": { + "type": "integer" + }, + "voided_at": { + "type": "null" + } + }, + "required": ["finalized_at", "marked_uncollectible_at", "paid_at", "voided_at"], + "title": "StatusTransitions" + }, + "Request": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "null" + }, + "idempotency_key": { + "type": "null" + } + }, + "required": ["id", "idempotency_key"], + "title": "Request" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "api_version": { + "type": "string", + "format": "date" + }, + "created": { + "type": "integer" + }, + "data": { + "$ref": "#/definitions/Data" + }, + "livemode": { + "type": "boolean" + }, + "pending_webhooks": { + "type": "integer" + }, + "request": { + "$ref": "#/definitions/Request" + }, + "type": { + "type": "string" + } + }, + "required": [ + "api_version", "created", "data", "id", "livemode", "object", "pending_webhooks", "request", + "type" + ], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "c2a79c48-c06e-4a18-b9c2-ef74d599eba6", + "name": "itemPurchased6", + "context": "test.events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "8c1e3ac3-9ffb-4730-87cf-134623ea6429", + "name": "itemPurchased5", + "context": "test.events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "0eedfa76-df60-4c95-8b01-992aa21ab2f3", + "name": "itemPurchased3", + "context": "events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "AnObject": { + "type": "object", + "additionalProperties": false, + "properties": { + "prop1": { + "type": "string" + }, + "prop2": { + "type": "string" + } + }, + "required": ["prop1"], + "title": "AnObject" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "aNumber": { + "type": "integer" + }, + "aString": { + "type": "string" + }, + "aBoolean": { + "type": "boolean" + }, + "anObject": { + "$ref": "#/definitions/AnObject" + } + }, + "required": ["aBoolean", "aNumber", "aString", "anObject"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "bbbbb20e-6972-4b47-9002-b055c63c9e92", + "name": "itemPurchased", + "context": "test.events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "99137b16-1b83-4755-9286-dd6ef4210464", + "name": "itemPurchased7", + "context": "test.events", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": {}, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer" + } + }, + "required": ["id"], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "webhookHandle", + "id": "00fb95ad-0f22-42c8-994a-1ad309bb4c5c", + "name": "stripeEventReceivedssdes", + "context": "payments", + "description": "", + "function": { + "arguments": [ + { + "name": "callback", + "required": true, + "type": { + "kind": "function", + "spec": { + "arguments": [ + { + "name": "event", + "required": false, + "type": { + "kind": "object", + "schema": { + "$schema": "http://json-schema.org/draft-06/schema#", + "definitions": { + "Data": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "$ref": "#/definitions/Object" + } + }, + "required": ["object"], + "title": "Data" + }, + "Object": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "account_country": { + "type": "string" + }, + "account_name": { + "type": "string" + }, + "account_tax_ids": { + "type": "null" + }, + "amount_due": { + "type": "integer" + }, + "amount_paid": { + "type": "integer" + }, + "amount_remaining": { + "type": "integer" + }, + "amount_shipping": { + "type": "integer" + }, + "application": { + "type": "null" + }, + "application_fee_amount": { + "type": "null" + }, + "attempt_count": { + "type": "integer" + }, + "attempted": { + "type": "boolean" + }, + "auto_advance": { + "type": "boolean" + }, + "automatic_tax": { + "$ref": "#/definitions/AutomaticTax" + }, + "billing_reason": { + "type": "string" + }, + "charge": { + "type": "string" + }, + "collection_method": { + "type": "string" + }, + "created": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "custom_fields": { + "type": "null" + }, + "customer": { + "type": "string" + }, + "customer_address": { + "$ref": "#/definitions/CustomerAddress" + }, + "customer_email": { + "type": "string" + }, + "customer_name": { + "type": "string" + }, + "customer_phone": { + "type": "null" + }, + "customer_shipping": { + "type": "null" + }, + "customer_tax_exempt": { + "type": "string" + }, + "customer_tax_ids": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerTaxID" + } + }, + "default_payment_method": { + "type": "null" + }, + "default_source": { + "type": "null" + }, + "default_tax_rates": { + "type": "array", + "items": {} + }, + "description": { + "type": "null" + }, + "discount": { + "type": "null" + }, + "discounts": { + "type": "array", + "items": {} + }, + "due_date": { + "type": "null" + }, + "ending_balance": { + "type": "integer" + }, + "footer": { + "type": "null" + }, + "from_invoice": { + "type": "null" + }, + "hosted_invoice_url": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "invoice_pdf": { + "type": "string", + "format": "uri", + "qt-uri-protocols": ["https"] + }, + "last_finalization_error": { + "type": "null" + }, + "latest_revision": { + "type": "null" + }, + "lines": { + "$ref": "#/definitions/Lines" + }, + "livemode": { + "type": "boolean" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "next_payment_attempt": { + "type": "null" + }, + "number": { + "type": "string" + }, + "on_behalf_of": { + "type": "null" + }, + "paid": { + "type": "boolean" + }, + "paid_out_of_band": { + "type": "boolean" + }, + "payment_intent": { + "type": "string" + }, + "payment_settings": { + "$ref": "#/definitions/PaymentSettings" + }, + "period_end": { + "type": "integer" + }, + "period_start": { + "type": "integer" + }, + "post_payment_credit_notes_amount": { + "type": "integer" + }, + "pre_payment_credit_notes_amount": { + "type": "integer" + }, + "quote": { + "type": "null" + }, + "receipt_number": { + "type": "null" + }, + "redaction": { + "type": "null" + }, + "rendering_options": { + "type": "null" + }, + "shipping_cost": { + "type": "null" + }, + "shipping_details": { + "type": "null" + }, + "starting_balance": { + "type": "integer" + }, + "statement_descriptor": { + "type": "null" + }, + "status": { + "type": "string" + }, + "status_transitions": { + "$ref": "#/definitions/StatusTransitions" + }, + "subscription": { + "type": "null" + }, + "subtotal": { + "type": "integer" + }, + "subtotal_excluding_tax": { + "type": "integer" + }, + "tax": { + "type": "null" + }, + "test_clock": { + "type": "null" + }, + "total": { + "type": "integer" + }, + "total_discount_amounts": { + "type": "array", + "items": {} + }, + "total_excluding_tax": { + "type": "integer" + }, + "total_tax_amounts": { + "type": "array", + "items": {} + }, + "transfer_data": { + "type": "null" + }, + "webhooks_delivered_at": { + "type": "integer" + } + }, + "required": [ + "account_country", "account_name", "account_tax_ids", "amount_due", "amount_paid", + "amount_remaining", "amount_shipping", "application", "application_fee_amount", + "attempt_count", "attempted", "auto_advance", "automatic_tax", "billing_reason", "charge", + "collection_method", "created", "currency", "custom_fields", "customer", "customer_address", + "customer_email", "customer_name", "customer_phone", "customer_shipping", + "customer_tax_exempt", "customer_tax_ids", "default_payment_method", "default_source", + "default_tax_rates", "description", "discount", "discounts", "due_date", "ending_balance", + "footer", "from_invoice", "hosted_invoice_url", "id", "invoice_pdf", + "last_finalization_error", "latest_revision", "lines", "livemode", "metadata", + "next_payment_attempt", "number", "object", "on_behalf_of", "paid", "paid_out_of_band", + "payment_intent", "payment_settings", "period_end", "period_start", + "post_payment_credit_notes_amount", "pre_payment_credit_notes_amount", "quote", + "receipt_number", "redaction", "rendering_options", "shipping_cost", "shipping_details", + "starting_balance", "statement_descriptor", "status", "status_transitions", "subscription", + "subtotal", "subtotal_excluding_tax", "tax", "test_clock", "total", "total_discount_amounts", + "total_excluding_tax", "total_tax_amounts", "transfer_data", "webhooks_delivered_at" + ], + "title": "Object" + }, + "AutomaticTax": { + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "status": { + "type": "null" + } + }, + "required": ["enabled", "status"], + "title": "AutomaticTax" + }, + "CustomerAddress": { + "type": "object", + "additionalProperties": false, + "properties": { + "city": { + "type": "string" + }, + "country": { + "type": "string" + }, + "line1": { + "type": "string" + }, + "line2": { + "type": "string" + }, + "postal_code": { + "type": "string" + }, + "state": { + "type": "string" + } + }, + "required": ["city", "country", "line1", "line2", "postal_code", "state"], + "title": "CustomerAddress" + }, + "CustomerTaxID": { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "required": ["type", "value"], + "title": "CustomerTaxID" + }, + "Lines": { + "type": "object", + "additionalProperties": false, + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/Datum" + } + }, + "has_more": { + "type": "boolean" + }, + "total_count": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "required": ["data", "has_more", "object", "total_count", "url"], + "title": "Lines" + }, + "Datum": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "amount": { + "type": "integer" + }, + "amount_excluding_tax": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "description": { + "type": "string" + }, + "discount_amounts": { + "type": "array", + "items": {} + }, + "discountable": { + "type": "boolean" + }, + "discounts": { + "type": "array", + "items": {} + }, + "invoice_item": { + "type": "string" + }, + "livemode": { + "type": "boolean" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "period": { + "$ref": "#/definitions/Period" + }, + "plan": { + "type": "null" + }, + "price": { + "$ref": "#/definitions/Price" + }, + "proration": { + "type": "boolean" + }, + "proration_details": { + "$ref": "#/definitions/ProrationDetails" + }, + "quantity": { + "type": "integer" + }, + "subscription": { + "type": "null" + }, + "tax_amounts": { + "type": "array", + "items": {} + }, + "tax_rates": { + "type": "array", + "items": {} + }, + "type": { + "type": "string" + }, + "unit_amount_excluding_tax": { + "type": "string", + "format": "integer" + } + }, + "required": [ + "amount", "amount_excluding_tax", "currency", "description", "discount_amounts", + "discountable", "discounts", "id", "invoice_item", "livemode", "metadata", "object", "period", + "plan", "price", "proration", "proration_details", "quantity", "subscription", "tax_amounts", + "tax_rates", "type", "unit_amount_excluding_tax" + ], + "title": "Datum" + }, + "Metadata": { + "type": "object", + "additionalProperties": false, + "title": "Metadata" + }, + "Period": { + "type": "object", + "additionalProperties": false, + "properties": { + "end": { + "type": "integer" + }, + "start": { + "type": "integer" + } + }, + "required": ["end", "start"], + "title": "Period" + }, + "Price": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "active": { + "type": "boolean" + }, + "billing_scheme": { + "type": "string" + }, + "created": { + "type": "integer" + }, + "currency": { + "type": "string" + }, + "custom_unit_amount": { + "type": "null" + }, + "livemode": { + "type": "boolean" + }, + "lookup_key": { + "type": "null" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "nickname": { + "type": "null" + }, + "product": { + "type": "string" + }, + "recurring": { + "type": "null" + }, + "tax_behavior": { + "type": "string" + }, + "tiers_mode": { + "type": "null" + }, + "transform_quantity": { + "type": "null" + }, + "type": { + "type": "string" + }, + "unit_amount": { + "type": "integer" + }, + "unit_amount_decimal": { + "type": "string", + "format": "integer" + } + }, + "required": [ + "active", "billing_scheme", "created", "currency", "custom_unit_amount", "id", "livemode", + "lookup_key", "metadata", "nickname", "object", "product", "recurring", "tax_behavior", + "tiers_mode", "transform_quantity", "type", "unit_amount", "unit_amount_decimal" + ], + "title": "Price" + }, + "ProrationDetails": { + "type": "object", + "additionalProperties": false, + "properties": { + "credited_items": { + "type": "null" + } + }, + "required": ["credited_items"], + "title": "ProrationDetails" + }, + "PaymentSettings": { + "type": "object", + "additionalProperties": false, + "properties": { + "default_mandate": { + "type": "null" + }, + "payment_method_options": { + "type": "null" + }, + "payment_method_types": { + "type": "null" + } + }, + "required": ["default_mandate", "payment_method_options", "payment_method_types"], + "title": "PaymentSettings" + }, + "StatusTransitions": { + "type": "object", + "additionalProperties": false, + "properties": { + "finalized_at": { + "type": "integer" + }, + "marked_uncollectible_at": { + "type": "null" + }, + "paid_at": { + "type": "integer" + }, + "voided_at": { + "type": "null" + } + }, + "required": ["finalized_at", "marked_uncollectible_at", "paid_at", "voided_at"], + "title": "StatusTransitions" + }, + "Request": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "null" + }, + "idempotency_key": { + "type": "null" + } + }, + "required": ["id", "idempotency_key"], + "title": "Request" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string" + }, + "api_version": { + "type": "string", + "format": "date" + }, + "created": { + "type": "integer" + }, + "data": { + "$ref": "#/definitions/Data" + }, + "livemode": { + "type": "boolean" + }, + "pending_webhooks": { + "type": "integer" + }, + "request": { + "$ref": "#/definitions/Request" + }, + "type": { + "type": "string" + } + }, + "required": [ + "api_version", "created", "data", "id", "livemode", "object", "pending_webhooks", "request", + "type" + ], + "title": "WebhookEventType" + } + } + }, { + "name": "headers", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + }, { + "name": "params", + "required": false, + "type": { + "kind": "object", + "typeName": "Record" + } + } + ], + "returnType": { + "kind": "void" + }, + "synchronous": true + } + } + } + ], + "returnType": { + "kind": "function", + "name": "UnregisterWebhookEventListener", + "spec": { + "arguments": [], + "returnType": { + "kind": "void" + } + } + } + }, + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + } +}, { + "type": "serverVariable", + "id": "297cfb21-f9b2-4cf8-b531-4db7e00780f3", + "name": "secretVar1", + "context": "secrets", + "description": "", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": true, + "valueType": { + "kind": "object" + } + } +}, { + "type": "serverVariable", + "id": "9e412e43-04f4-4e8a-b01e-d354dc5405c8", + "name": "secretVar3", + "context": "secrets", + "description": "This variable serves as a confidential placeholder for storing dynamic data. It is typically utilized in scenarios where information security is paramount as it may hold sensitive or critical information. The usage may vary based on the context, ranging from carrying encoded authentication tokens to storing encrypted user data, functioning in the backend to maintain the integrity and safety of the system or process.", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": false, + "valueType": { + "kind": "primitive", + "type": "string" + }, + "value": null + } +}, { + "type": "serverVariable", + "id": "d6c17239-2a4a-4bb2-85fd-1c7a6129c18a", + "name": "myFavCustomer", + "context": "shipping.orders", + "description": "This variable represents the preferred customer in a shipping order context. It is utilized to easily track, prioritize, and manage orders related to that particular customer.", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": false, + "valueType": { + "kind": "primitive", + "type": "string" + }, + "value": null + } +}, { + "type": "serverVariable", + "id": "7c22bd19-d7f3-42ae-b6c2-244067b60f2b", + "name": "boss", + "context": "people", + "description": "This variable references the individual identified as the boss within a group of people. It is used to store information which includes the boss's preference in clothing, as well as a unique session ID for monitoring or tracking their online activities or transactions.", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": true, + "valueType": { + "kind": "object" + } + } +}, { + "type": "serverVariable", + "id": "326b0727-f52e-4d59-b2e4-8bcccfed72c0", + "name": "accountants", + "context": "people", + "description": "The variable represents a list of accountants, where each accountant is represented as an object that includes their unique identifier and their respective salary. This data could potentially be used to manage payroll, track income distributions within the organization, or for statistical analyses related to income.", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": true, + "valueType": { + "kind": "object" + } + } +}, { + "type": "serverVariable", + "id": "fcd8fc95-6c34-4d31-a2f1-9c1aca477c20", + "name": "employees", + "context": "people", + "description": "This variable is a list that holds information about employees, specifically their names and respective salaries. It is used to manage, process, or analyze data in relation to the workforce in term of remuneration.", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": false, + "valueType": { + "kind": "primitive", + "type": "string" + }, + "value": null + } +}, { + "type": "serverVariable", + "id": "8b863faa-8416-4610-9024-f733d34c4387", + "name": "ohipEnvironmentVariables", + "context": "hosts2", + "description": "This variable is used to store the URL of the environment for the host application. It is typically used for connecting the host application to the defined environment server, providing a central point for fetching and transmitting data.", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": false, + "valueType": { + "kind": "primitive", + "type": "string" + }, + "value": null + } +}, { + "type": "serverVariable", + "id": "4f0b4a74-d424-449b-ae3b-299bb6a6350f", + "name": "instagram", + "context": "hosts", + "description": "", + "visibilityMetadata": { + "visibility": "ENVIRONMENT" + }, + "variable": { + "environmentId": "bb0678ae-44e9-4749-b1a0-938925c49d32", + "secret": false, + "valueType": { + "kind": "primitive", + "type": "string" + }, + "value": null + } +} +] diff --git a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/mojo/DeployFunctionsMojo.java b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/mojo/DeployFunctionsMojo.java index 3057309d..2bbdec7f 100644 --- a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/mojo/DeployFunctionsMojo.java +++ b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/mojo/DeployFunctionsMojo.java @@ -10,6 +10,7 @@ import java.util.Arrays; import java.util.List; +import java.util.Optional; import static com.google.common.base.Predicates.equalTo; import static java.lang.String.join; @@ -31,7 +32,7 @@ public class DeployFunctionsMojo extends PolyApiMojo { protected void execute(String host, Integer port) { log.info("Initiating deployment of Poly functions."); DeploymentService polyFunctionService = new DeploymentServiceImpl(getHttpClient(), getJsonParser(), getMavenService(), host, port); - List functionFilters = Arrays.stream(functions.split(",")) + List functionFilters = Arrays.stream(Optional.ofNullable(functions).orElse("").split(",")) .map(String::trim) .filter(not(equalTo(""))) .toList(); diff --git a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/MavenService.java b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/MavenService.java index d9ed5f7e..bfdafd3e 100644 --- a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/MavenService.java +++ b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/MavenService.java @@ -98,6 +98,7 @@ public URLClassLoader getProjectClassLoader() { project.getRuntimeClasspathElements().stream()), Stream.of(project.getBuild().getOutputDirectory())) .map(File::new) + .filter(File::exists) .map(File::toURI) .map(uri -> { try { @@ -139,7 +140,7 @@ public Set scanPolyFunctions(Predicate filter) { .addClassLoaders(projectClassLoader) .addScanners(MethodsAnnotated) .addUrls(projectClassLoader.getURLs())); - log.debug("Reflections URLS: {}", reflections.getConfiguration().getUrls().size()); + log.info("Reflections URLS: {}", reflections.getConfiguration().getUrls().size()); Set methods = reflections.getMethodsAnnotatedWith(PolyFunction.class).stream() .filter(filter) .collect(toSet()); diff --git a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/PolyFunctionServiceImpl.java b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/PolyFunctionServiceImpl.java index 4dd6d37e..f5962d9a 100644 --- a/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/PolyFunctionServiceImpl.java +++ b/polyapi-maven-plugin/src/main/java/io/polyapi/plugin/service/PolyFunctionServiceImpl.java @@ -78,7 +78,6 @@ private void delete(Specification specification) { relativePath = "variables"; break; } - log.info(format("functions/%s/%s", relativePath, specification.getId())); super.delete(format("functions/%s/%s", relativePath, specification.getId())); log.info("Function with ID '{}'.", specification.getId()); }