This directory contains a simple test client that you can use emulate custom action requests sent from Frame.io. The test client reads in its request body from a file, signs the request and sends it to the URL you specify on its command line.
To install dependencies (you only need to do this once):
npm install
To run the test client:
- Create a file named
request.json
, containing the payload to send to the web service. The minimal payload is an empty JSON object:{}
- Run the test client, supplying your Frame.io custom action secret and the web service URL on the command line. For example, if you deployed the custom action code to Rising Cloud:
FRAMEIO_SECRET=<your secret> node test_client.js https://$WEB_SERVICE.risingcloud.app
If all is well, the web service will respond with a JSON form:
200 OK
connection: close
content-length: 288
content-type: application/json; charset=utf-8
date: Wed, 07 Sep 2022 22:39:03 GMT
etag: W/"120-ozzDQOhSKITFjOwTkLIXonz3AGg"
keep-alive: timeout=5
strict-transport-security: max-age=604800
vary: Accept-Encoding
x-powered-by: Express
{"title":"Import or Export?","description":"Import from Backblaze B2, or export to Backblaze B2?","fields":[{"type":"select","label":"Import or Export","name":"copytype","options":[{"name":"Export to Backblaze B2","value":"export"},{"name":"Import from Backblaze B2","value":"import"}]}]}
You can edit request.json
to simulate other requests from Frame.io. Use a service such as Request Bin to create a test HTTP endpoint, set up a custom action to post to it, and copy the request. You can then add the data property. For example, to import a file from B2:
{
"action_id": "use the default request...",
"data": {
"b2path": "path/to/some/file.jpg"
}
}