Hi @DinoChiesa ,
Hope you are doing great!
I came across a requirement to retrieve all app's associated to a API Product or Proxy , I found these scripts in git. but unfortunately both the scripts giving me below error. Required libraries were installed. I'm using other scripts like listProduct.js, listProxy.js etc. without issue. Only for "find" js scripts, I'm facing this issue. Kindly suggest?
findAppForProxy.js
Command executed: node .\findAppForProxy.js -o $ORG -P testapi --apigeex apigee.googleapis.com --token $token
Parameters passed:
--token ApigeeX gcloud access token
-P Proxy name "testapi"
node .\findAppForProxy.js -o $ORG -P testapi --apigeex apigee.googleapis.com --token $token
Apigee Edge findAppForProxy.js tool, version: 20190211-1313
Node.js v20.11.1
[2024-Mar-18 12:23:43] start
[2024-Mar-18 12:23:43] searching...
[2024-Mar-18 12:23:44] total count of API products for that org: 105
C:\Users\Desktop\git-repos\apigee-edge-js-examples\findAppForProxy.js:65
return (product.proxies.indexOf(opt.options.proxy) >= 0);
^
TypeError: Cannot read properties of undefined (reading 'indexOf')
at C:\Users\Desktop\git-repos\apigee-edge-js-examples\findAppForProxy.js:65:35
at Array.filter ()
at C:\Users\Desktop\git-repos\apigee-edge-js-examples\findAppForProxy.js:64:40
at Request._callback (C:\Users\Desktop\git-repos\apigee-edge-js-examples\node_modules\apigee-edge-js\lib\common.js:91:7)
at self.callback (C:\Users\Desktop\git-repos\apigee-edge-js-examples\node_modules\postman-request\request.js:311:12)
at Request.emit (node:events:518:28)
at Request. (C:\Users\Desktop\git-repos\apigee-edge-js-examples\node_modules\postman-request\request.js:1577:10)
at Request.emit (node:events:518:28)
at IncomingMessage. (C:\Users\Desktop\git-repos\apigee-edge-js-examples\node_modules\postman-request\request.js:1448:12)
at Object.onceWrapper (node:events:632:28)
at IncomingMessage.emit (node:events:530:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
findAppForApiProduct.js
Same issue when using findAppForApiProduct.js:
Command executed: node .\findAppForApiProduct.js -o $ORG -P testapi-product --apigeex apigee.googleapis.com --token $token
Parameters passed:
--token ApigeeX gcloud access token
-P Product name "testapi-product"
Apigee findAppForApiProduct.js tool, version: 20220929-0953
Node.js v20.11.1
[2024-Mar-15 12:46:39] start
[2024-Mar-15 12:46:39] connect: {"orgname":"dev","loginBaseUrl":"https://login.apigee.com","user":null,"mgmtServer":"https://apigee.googleapis.com"}
[2024-Mar-15 12:46:39] searching...
[2024-Mar-15 12:46:39] GET https://apigee.googleapis.com/v1/organizations/dev/apps?expand=true
[2024-Mar-15 12:47:00] status: 200
[2024-Mar-15 12:47:00] total count of apps for that org: 26
while executing, error: TypeError: Cannot read properties of undefined (reading 'find')
at C:\Users\Desktop\git-repos\apigee-edge-js-examples\findAppForApiProduct.js:66:30
at Array.filter ()
at C:\Users\Desktop\git-repos\apigee-edge-js-examples\findAppForApiProduct.js:65:58
at Array.filter ()
at C:\Users\Desktop\git-repos\apigee-edge-js-examples\findAppForApiProduct.js:64:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Thanks In Advance for your support.
Regards,
Yuvi