{ "name": "3. Purge Meters", "nodes": [ { "id": "c0d50910-0ed3-11ef-a415-f705033d8568", "name": "Init", "type": "readers/counter", "params": { "max": 1 }, "partitionKey": null, "schemaVersion": 2, "x": 200, "y": 200 }, { "id": "c5faa1c0-0ed3-11ef-a415-f705033d8568", "name": "Prepare Filter", "type": "transforms/script", "params": { "transform": "await push({ meterTypeId: payload.httpResponse.meterTypes[0].id });\n" }, "partitionKey": null, "schemaVersion": 1, "x": 650, "y": 200 }, { "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": false, "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": { "meterTypeId": "${payload.meterTypeId}" }, "authentication": "password", "secretsWalletEntry": { "secretId": "9073c272-213a-4dbd-9d27-b45b98d0798e", "secretType": "oauth2" } }, "partitionKey": null, "schemaVersion": 11, "x": 800, "y": 200 }, { "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": 950, "y": 200 }, { "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": "password", "secretsWalletEntry": { "secretId": "9073c272-213a-4dbd-9d27-b45b98d0798e", "secretType": "oauth2" } }, "partitionKey": null, "schemaVersion": 11, "x": 1100, "y": 200 }, { "id": "195e8080-11f8-11ef-928a-4f451c85cdd7", "name": "Log", "type": "writers/log", "params": {}, "partitionKey": null, "schemaVersion": 1, "x": 1250, "y": 200 }, { "id": "fb13ee40-595e-11ef-a8f4-9562be45e442", "name": "Find Meter Types", "type": "transforms/http", "params": { "uri": "https://api.digitalroute.io/usage-metering/v1/meter-types", "errorMode": "defer", "cacheSeconds": 300, "useCache": false, "useMockData": false, "method": "GET", "authType": "oAuth2", "shouldRetry": false, "retries": 1, "useResponseHeaderKey": false, "oAuth2Authentication": { "clientAuthentication": "sendInBody", "headerPrefix": "Bearer", "accessTokenURL": "https://api.digitalroute.io/authentication/v1/oauth/token", "audience": "https://api.digitalroute.io/" }, "qs": { "name": "${payload.meterTypeName}" }, "authentication": "password", "secretsWalletEntry": { "secretId": "9073c272-213a-4dbd-9d27-b45b98d0798e", "secretType": "oauth2" } }, "partitionKey": null, "schemaVersion": 11, "x": 500, "y": 200 }, { "id": "fb141550-595e-11ef-a8f4-9562be45e442", "name": "Meter Type Filter", "type": "transforms/script", "params": { "transform": "const meterTypeNames = [\n 'L1_Claude3_Sonnet_Requests',\n 'L1_Gemini_Pro_Requests',\n 'L1_Llama3_Requests',\n 'L2_Claude3_Opus_Requests',\n 'L2_Gemini_Advanced_Requests',\n 'L2_GPT4o_Requests',\n];\n\nfor(const meterTypeName of meterTypeNames)\n await push({ meterTypeName });\n" }, "partitionKey": null, "schemaVersion": 1, "x": 350, "y": 200 } ], "edges": [ { "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": {} }, { "id": "fb141551-595e-11ef-a8f4-9562be45e442", "from": "fb141550-595e-11ef-a8f4-9562be45e442", "to": "fb13ee40-595e-11ef-a8f4-9562be45e442", "config": {} }, { "id": "0496c690-595f-11ef-a8f4-9562be45e442", "from": "c0d50910-0ed3-11ef-a415-f705033d8568", "to": "fb141550-595e-11ef-a8f4-9562be45e442", "config": {} }, { "id": "05cf6da0-595f-11ef-a8f4-9562be45e442", "from": "fb13ee40-595e-11ef-a8f4-9562be45e442", "to": "c5faa1c0-0ed3-11ef-a415-f705033d8568", "config": {} } ] }