{ "name": "3. Purge Meters", "nodes": [ { "id": "c0d50910-0ed3-11ef-a415-f705033d8568", "name": "Init", "type": "readers/counter", "params": { "max": 1 }, "partitionKey": null, "schemaVersion": 2, "x": 350, "y": 50 }, { "id": "85940b71-45d4-11ef-a193-8bcf9ece763e", "name": "List Meter Type API", "type": "transforms/http", "params": { "uri": "https://api.digitalroute.io/usage-metering/v1/meter-types", "errorMode": "defer", "cacheSeconds": 300, "useCache": false, "useMockData": true, "method": "GET", "authType": "oAuth2", "shouldRetry": false, "useResponseHeaderKey": true, "oAuth2Authentication": { "clientAuthentication": "sendInBody", "headerPrefix": "Bearer", "accessTokenURL": "https://api.digitalroute.io/authentication/v1/oauth/token", "audience": "https://api.digitalroute.io/" }, "retries": 1, "qs": { "name": "Pay-Per-Print" }, "authentication": "client_credentials" }, "partitionKey": null, "schemaVersion": 11, "x": 550, "y": 50 }, { "id": "85940b70-45d4-11ef-a193-8bcf9ece763e", "name": "Prepare Meter Types", "type": "transforms/script", "params": { "transform": "for(let meterType of payload.httpResponse.meterTypes) {\n await push({ meterType });\n}" }, "partitionKey": null, "schemaVersion": 1, "x": 750, "y": 50 }, { "id": "c5faa1c0-0ed3-11ef-a415-f705033d8568", "name": "Prepare Filter", "type": "transforms/script", "params": { "transform": "/** REPLACE THIS VALUE **/\n\nconst METER_KEY = \"dd11e0a0-1381-11ef-9a8f-cdc91c56d42c\";\n\n/**************************/\n\nconst METER_TYPES = [payload.meterType.id];\n\nfor(const meterTypeId of METER_TYPES) {\n await push({\n meterKey: METER_KEY,\n meterTypeId: meterTypeId\n });\n}\n" }, "partitionKey": null, "schemaVersion": 1, "x": 950, "y": 50 }, { "id": "3e5b2bc0-0ed5-11ef-a415-f705033d8568", "name": "List Meter API", "type": "transforms/http", "params": { "uri": "https://api.digitalroute.io/usage-metering/v1/meters", "errorMode": "defer", "cacheSeconds": 300, "useCache": false, "useMockData": true, "method": "GET", "authType": "oAuth2", "shouldRetry": false, "useResponseHeaderKey": true, "oAuth2Authentication": { "clientAuthentication": "sendInBody", "headerPrefix": "Bearer", "accessTokenURL": "https://api.digitalroute.io/authentication/v1/oauth/token", "audience": "https://api.digitalroute.io/" }, "retries": 1, "qs": { "meterKey": "${payload.meterKey}", "meterTypeId": "${payload.meterTypeId}" }, "authentication": "client_credentials" }, "partitionKey": null, "schemaVersion": 9, "x": 1150, "y": 50 }, { "id": "2281a210-11f7-11ef-928a-4f451c85cdd7", "name": "Prepare Delete", "type": "transforms/script", "params": { "transform": "for(let meter of payload.httpResponse.meters) {\n await push({ meter });\n}" }, "partitionKey": null, "schemaVersion": 1, "x": 1350, "y": 50 }, { "id": "33e8e4f0-11f7-11ef-928a-4f451c85cdd7", "name": "Delete Meter API", "type": "transforms/http", "params": { "uri": "https://api.digitalroute.io/usage-metering/v1/meters/${payload.meter.id}", "errorMode": "defer", "cacheSeconds": 300, "useCache": false, "useMockData": true, "method": "DELETE", "authType": "oAuth2", "shouldRetry": false, "useResponseHeaderKey": true, "oAuth2Authentication": { "clientAuthentication": "sendInBody", "headerPrefix": "Bearer", "accessTokenURL": "https://api.digitalroute.io/authentication/v1/oauth/token", "audience": "https://api.digitalroute.io/" }, "retries": 1, "authentication": "client_credentials" }, "partitionKey": null, "schemaVersion": 9, "x": 1550, "y": 50 }, { "id": "195e8080-11f8-11ef-928a-4f451c85cdd7", "name": "Log", "type": "writers/log", "params": {}, "partitionKey": null, "schemaVersion": 1, "x": 1750, "y": 50 } ], "edges": [ { "id": "c899ddb0-0ed3-11ef-a415-f705033d8568", "from": "c0d50910-0ed3-11ef-a415-f705033d8568", "to": "85940b71-45d4-11ef-a193-8bcf9ece763e", "config": {} }, { "id": "c46ac690-45d4-11ef-a193-8bcf9ece763e", "from": "85940b71-45d4-11ef-a193-8bcf9ece763e", "to": "85940b70-45d4-11ef-a193-8bcf9ece763e", "config": {} }, { "id": "da21db90-45d4-11ef-a193-8bcf9ece763e", "from": "85940b70-45d4-11ef-a193-8bcf9ece763e", "to": "c5faa1c0-0ed3-11ef-a415-f705033d8568", "config": {} }, { "id": "408efbb0-0ed5-11ef-a415-f705033d8568", "from": "c5faa1c0-0ed3-11ef-a415-f705033d8568", "to": "3e5b2bc0-0ed5-11ef-a415-f705033d8568", "config": {} }, { "id": "2b621fe0-11f7-11ef-928a-4f451c85cdd7", "from": "3e5b2bc0-0ed5-11ef-a415-f705033d8568", "to": "2281a210-11f7-11ef-928a-4f451c85cdd7", "config": {} }, { "id": "364a7ba0-11f7-11ef-928a-4f451c85cdd7", "from": "2281a210-11f7-11ef-928a-4f451c85cdd7", "to": "33e8e4f0-11f7-11ef-928a-4f451c85cdd7", "config": {} }, { "id": "1be9bf40-11f8-11ef-928a-4f451c85cdd7", "from": "33e8e4f0-11f7-11ef-928a-4f451c85cdd7", "to": "195e8080-11f8-11ef-928a-4f451c85cdd7", "config": {} } ] }