@itentialopensource/adapter-alkira 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +6 -0
- package/.eslintrc.js +18 -0
- package/.gitlab/.gitkeep +0 -0
- package/.gitlab/issue_templates/.gitkeep +0 -0
- package/.gitlab/issue_templates/Default.md +17 -0
- package/.gitlab/issue_templates/bugReportTemplate.md +76 -0
- package/.gitlab/issue_templates/featureRequestTemplate.md +14 -0
- package/.jshintrc +0 -0
- package/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +2818 -0
- package/CHANGELOG.md +9 -0
- package/CODE_OF_CONDUCT.md +43 -0
- package/CONTRIBUTING.md +172 -0
- package/ENHANCE.md +69 -0
- package/LICENSE +201 -0
- package/PROPERTIES.md +641 -0
- package/README.md +337 -0
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +39117 -0
- package/adapterBase.js +1787 -0
- package/entities/.generic/action.json +214 -0
- package/entities/.generic/schema.json +28 -0
- package/entities/.system/action.json +50 -0
- package/entities/.system/mockdatafiles/getToken-default.json +3 -0
- package/entities/.system/mockdatafiles/healthcheck-default.json +3 -0
- package/entities/.system/schema.json +19 -0
- package/entities/.system/schemaTokenReq.json +53 -0
- package/entities/.system/schemaTokenResp.json +53 -0
- package/entities/ASPathLists/action.json +126 -0
- package/entities/ASPathLists/mockdatafiles/getAllAsPathLists-default.json +13 -0
- package/entities/ASPathLists/schema.json +24 -0
- package/entities/AWSVPCConnectors/action.json +106 -0
- package/entities/AWSVPCConnectors/mockdatafiles/getAWSVPCConnector-default.json +91 -0
- package/entities/AWSVPCConnectors/mockdatafiles/getawsvpcconnectors-default.json +312 -0
- package/entities/AWSVPCConnectors/schema.json +23 -0
- package/entities/AWSVPCCredentials/action.json +64 -0
- package/entities/AWSVPCCredentials/schema.json +21 -0
- package/entities/ActiveNATTranslation/action.json +44 -0
- package/entities/ActiveNATTranslation/schema.json +20 -0
- package/entities/AkamaiProlexicConnectors/action.json +106 -0
- package/entities/AkamaiProlexicConnectors/mockdatafiles/getAkamaiProlexicConnector-default.json +167 -0
- package/entities/AkamaiProlexicConnectors/mockdatafiles/getAkamaiProlexicconnectors-default.json +863 -0
- package/entities/AkamaiProlexicConnectors/schema.json +23 -0
- package/entities/AkamaiProlexicCredentials/action.json +44 -0
- package/entities/AkamaiProlexicCredentials/schema.json +20 -0
- package/entities/Alerts/action.json +67 -0
- package/entities/Alerts/schema.json +21 -0
- package/entities/ArubaEdgeConnectConnectors/action.json +127 -0
- package/entities/ArubaEdgeConnectConnectors/mockdatafiles/getArubaEdgeConnectConnector-default.json +98 -0
- package/entities/ArubaEdgeConnectConnectors/mockdatafiles/getArubaEdgeconnectconnectors-default.json +89 -0
- package/entities/ArubaEdgeConnectConnectors/schema.json +24 -0
- package/entities/ArubaEdgeConnectCredentials/action.json +44 -0
- package/entities/ArubaEdgeConnectCredentials/schema.json +20 -0
- package/entities/AuditLogs/action.json +46 -0
- package/entities/AuditLogs/schema.json +20 -0
- package/entities/Authentication/action.json +165 -0
- package/entities/Authentication/schema.json +26 -0
- package/entities/AzureCredentials/action.json +64 -0
- package/entities/AzureCredentials/schema.json +21 -0
- package/entities/AzureErConnectors/action.json +127 -0
- package/entities/AzureErConnectors/mockdatafiles/getAzureErConnector-default.json +154 -0
- package/entities/AzureErConnectors/mockdatafiles/getAzureErConnectors-default.json +88 -0
- package/entities/AzureErConnectors/schema.json +24 -0
- package/entities/AzureVNETConnectors/action.json +106 -0
- package/entities/AzureVNETConnectors/mockdatafiles/getazurevnetconnectors-default.json +308 -0
- package/entities/AzureVNETConnectors/schema.json +23 -0
- package/entities/BYOIP/action.json +147 -0
- package/entities/BYOIP/mockdatafiles/createBYOIP-default.json +14 -0
- package/entities/BYOIP/mockdatafiles/getAllBYOIP-default.json +16 -0
- package/entities/BYOIP/mockdatafiles/getBYOIP-default.json +58 -0
- package/entities/BYOIP/mockdatafiles/getBYOIPReferences-default.json +110 -0
- package/entities/BYOIP/schema.json +25 -0
- package/entities/BaseConnectors/action.json +46 -0
- package/entities/BaseConnectors/mockdatafiles/getConnector-default.json +78 -0
- package/entities/BaseConnectors/mockdatafiles/getconnectors-default.json +350 -0
- package/entities/BaseConnectors/schema.json +20 -0
- package/entities/BaseServices/action.json +46 -0
- package/entities/BaseServices/mockdatafiles/getservices-default.json +296 -0
- package/entities/BaseServices/schema.json +20 -0
- package/entities/BillingInfo/action.json +25 -0
- package/entities/BillingInfo/schema.json +19 -0
- package/entities/BillingTags/action.json +106 -0
- package/entities/BillingTags/mockdatafiles/getbillingtags-default.json +46 -0
- package/entities/BillingTags/schema.json +23 -0
- package/entities/CXPs/action.json +25 -0
- package/entities/CXPs/mockdatafiles/getCXPs-default.json +44 -0
- package/entities/CXPs/schema.json +19 -0
- package/entities/CheckPointFWManagementServerCredentials/action.json +64 -0
- package/entities/CheckPointFWManagementServerCredentials/schema.json +21 -0
- package/entities/CheckPointFWServiceCredentials/action.json +64 -0
- package/entities/CheckPointFWServiceCredentials/schema.json +21 -0
- package/entities/CheckPointFWServiceInstanceCredentials/action.json +64 -0
- package/entities/CheckPointFWServiceInstanceCredentials/schema.json +21 -0
- package/entities/CheckPointFWServices/action.json +127 -0
- package/entities/CheckPointFWServices/mockdatafiles/getCheckPointFWServices-default.json +94 -0
- package/entities/CheckPointFWServices/schema.json +24 -0
- package/entities/CiscoFTDvFWCredentials/action.json +64 -0
- package/entities/CiscoFTDvFWCredentials/schema.json +21 -0
- package/entities/CiscoFTDvFWInstanceCredentials/action.json +64 -0
- package/entities/CiscoFTDvFWInstanceCredentials/schema.json +21 -0
- package/entities/CiscoFTDvFWServices/action.json +127 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/createCiscoFTDvFWService-default.json +78 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/deleteCiscoFTDvFWService-default.json +87 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/getCiscoFTDvFWService-default.json +51 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/getCiscoFTDvFWServices-default.json +245 -0
- package/entities/CiscoFTDvFWServices/mockdatafiles/updateCiscoFTDvFWService-default.json +114 -0
- package/entities/CiscoFTDvFWServices/schema.json +24 -0
- package/entities/CiscoSDWANConnectors/action.json +127 -0
- package/entities/CiscoSDWANConnectors/mockdatafiles/getciscosdwaningresses-default.json +559 -0
- package/entities/CiscoSDWANConnectors/schema.json +24 -0
- package/entities/CiscoSDWANInstanceCredentials/action.json +64 -0
- package/entities/CiscoSDWANInstanceCredentials/schema.json +21 -0
- package/entities/CloudInsight/action.json +107 -0
- package/entities/CloudInsight/mockdatafiles/getCloudInsight-default.json +93 -0
- package/entities/CloudInsight/mockdatafiles/getCloudInsightCategorySummaries-default.json +348 -0
- package/entities/CloudInsight/schema.json +23 -0
- package/entities/CloudInsightDefinition/action.json +87 -0
- package/entities/CloudInsightDefinition/schema.json +22 -0
- package/entities/CloudInsightRefreshRequest/action.json +86 -0
- package/entities/CloudInsightRefreshRequest/mockdatafiles/getCloudInsightRefreshRequest-default.json +6 -0
- package/entities/CloudInsightRefreshRequest/schema.json +22 -0
- package/entities/CloudInsightReport/action.json +86 -0
- package/entities/CloudInsightReport/mockdatafiles/getCloudInsightReport-default.json +617 -0
- package/entities/CloudInsightReport/schema.json +22 -0
- package/entities/CloudInsightReportConfiguration/action.json +86 -0
- package/entities/CloudInsightReportConfiguration/mockdatafiles/getCloudInsightReportConfiguration-default.json +34 -0
- package/entities/CloudInsightReportConfiguration/schema.json +22 -0
- package/entities/CloudNativeServices/action.json +25 -0
- package/entities/CloudNativeServices/mockdatafiles/getCloudNativeServices-default.json +83 -0
- package/entities/CloudNativeServices/schema.json +19 -0
- package/entities/CloudProviderAccount/action.json +126 -0
- package/entities/CloudProviderAccount/mockdatafiles/getCloudProviderAccount-default.json +10 -0
- package/entities/CloudProviderAccount/mockdatafiles/getCloudProviderAccounts-default.json +32 -0
- package/entities/CloudProviderAccount/schema.json +24 -0
- package/entities/CloudProviderObject/action.json +109 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObject-default.json +52 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObjectCountByTimes-default.json +27 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObjectCounts-default.json +22 -0
- package/entities/CloudProviderObject/mockdatafiles/getCloudProviderObjectTags-default.json +23 -0
- package/entities/CloudProviderObject/schema.json +23 -0
- package/entities/CloudProviderObjectSyncRequest/action.json +86 -0
- package/entities/CloudProviderObjectSyncRequest/mockdatafiles/getCloudProviderObjectSyncRequest-default.json +10 -0
- package/entities/CloudProviderObjectSyncRequest/schema.json +22 -0
- package/entities/CommunityLists/action.json +126 -0
- package/entities/CommunityLists/mockdatafiles/getAllCommunityLists-default.json +42 -0
- package/entities/CommunityLists/schema.json +24 -0
- package/entities/Credentials/action.json +25 -0
- package/entities/Credentials/mockdatafiles/getallcredentials-default.json +14 -0
- package/entities/Credentials/schema.json +19 -0
- package/entities/DirectConnectConnectors/action.json +127 -0
- package/entities/DirectConnectConnectors/mockdatafiles/getdirectconnectconnectors-default.json +862 -0
- package/entities/DirectConnectConnectors/schema.json +24 -0
- package/entities/ExtendedCommunityLists/action.json +126 -0
- package/entities/ExtendedCommunityLists/mockdatafiles/getAllExtendedCommunityLists-default.json +50 -0
- package/entities/ExtendedCommunityLists/schema.json +24 -0
- package/entities/FeatureFlags/action.json +46 -0
- package/entities/FeatureFlags/mockdatafiles/getTenantEnabledFeatures-default.json +3 -0
- package/entities/FeatureFlags/schema.json +20 -0
- package/entities/FirewallZones/action.json +46 -0
- package/entities/FirewallZones/mockdatafiles/getfirewallzones-default.json +91 -0
- package/entities/FirewallZones/schema.json +20 -0
- package/entities/FlowCapture/action.json +44 -0
- package/entities/FlowCapture/schema.json +20 -0
- package/entities/Flows/action.json +151 -0
- package/entities/Flows/schema.json +25 -0
- package/entities/FortinetFWServiceCredentials/action.json +64 -0
- package/entities/FortinetFWServiceCredentials/schema.json +21 -0
- package/entities/FortinetFWServiceInstanceCredentials/action.json +64 -0
- package/entities/FortinetFWServiceInstanceCredentials/schema.json +21 -0
- package/entities/FortinetFWServices/action.json +127 -0
- package/entities/FortinetFWServices/mockdatafiles/createFortinetFWService-default.json +64 -0
- package/entities/FortinetFWServices/mockdatafiles/getFortinetFWService-default.json +64 -0
- package/entities/FortinetFWServices/mockdatafiles/getFortinetFWServices-default.json +155 -0
- package/entities/FortinetFWServices/mockdatafiles/updateFortinetFWService-default.json +93 -0
- package/entities/FortinetFWServices/schema.json +24 -0
- package/entities/GCPConnectors/action.json +106 -0
- package/entities/GCPConnectors/mockdatafiles/getgcpconnectors-default.json +71 -0
- package/entities/GCPConnectors/schema.json +23 -0
- package/entities/GCPCredentials/action.json +64 -0
- package/entities/GCPCredentials/schema.json +21 -0
- package/entities/GetMessages/action.json +25 -0
- package/entities/GetMessages/mockdatafiles/getMessages-default.json +46 -0
- package/entities/GetMessages/schema.json +19 -0
- package/entities/GlobalCidrLists/action.json +106 -0
- package/entities/GlobalCidrLists/mockdatafiles/createGlobalCidrList-default.json +12 -0
- package/entities/GlobalCidrLists/mockdatafiles/getGlobalCidrList-default.json +12 -0
- package/entities/GlobalCidrLists/mockdatafiles/getGlobalCidrLists-default.json +50 -0
- package/entities/GlobalCidrLists/mockdatafiles/updateGlobalCidrList-default.json +12 -0
- package/entities/GlobalCidrLists/schema.json +34 -0
- package/entities/Groups/action.json +106 -0
- package/entities/Groups/mockdatafiles/getgroups-default.json +107 -0
- package/entities/Groups/schema.json +23 -0
- package/entities/Health/action.json +151 -0
- package/entities/Health/mockdatafiles/retrieveshealthforallconnectorsandservicesinthistenant-default.json +399 -0
- package/entities/Health/mockdatafiles/retrieveshealthforallinternetapplicationsinthistenant-default.json +1254 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificconnectorinthistenant-default.json +751 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificfirewalzoneinthistenant-default.json +1086 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificinstanceofaconnectorinthistenant-default.json +1352 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificinstanceofaserviceinthistenant-default.json +803 -0
- package/entities/Health/mockdatafiles/retrieveshealthforaspecificserviceinthistenant-default.json +730 -0
- package/entities/Health/schema.json +25 -0
- package/entities/Healthv3/action.json +25 -0
- package/entities/Healthv3/schema.json +19 -0
- package/entities/IPSecConnectors/action.json +127 -0
- package/entities/IPSecConnectors/mockdatafiles/getipsecconnectors-default.json +826 -0
- package/entities/IPSecConnectors/schema.json +24 -0
- package/entities/IdentityProviders/action.json +106 -0
- package/entities/IdentityProviders/mockdatafiles/getIdentityProvidersUsingGET-default.json +37 -0
- package/entities/IdentityProviders/schema.json +23 -0
- package/entities/InfoBloxCredentials/action.json +24 -0
- package/entities/InfoBloxCredentials/schema.json +19 -0
- package/entities/InfoBloxGridMasterCredentials/action.json +24 -0
- package/entities/InfoBloxGridMasterCredentials/schema.json +19 -0
- package/entities/InfoBloxInstanceCredentials/action.json +24 -0
- package/entities/InfoBloxInstanceCredentials/schema.json +19 -0
- package/entities/InfoBloxServices/action.json +106 -0
- package/entities/InfoBloxServices/mockdatafiles/getInfoBloxServices-default.json +220 -0
- package/entities/InfoBloxServices/schema.json +23 -0
- package/entities/Integration/action.json +126 -0
- package/entities/Integration/mockdatafiles/createIntegration-default.json +6 -0
- package/entities/Integration/mockdatafiles/deleteIntegration-default.json +6 -0
- package/entities/Integration/mockdatafiles/deleteIntegrations-default.json +8 -0
- package/entities/Integration/mockdatafiles/getIntegrations-default.json +26 -0
- package/entities/Integration/mockdatafiles/getIntegrationsByTypeAndSubType-default.json +20 -0
- package/entities/Integration/mockdatafiles/updateIntegration-default.json +6 -0
- package/entities/Integration/schema.json +24 -0
- package/entities/InternetApplications/action.json +106 -0
- package/entities/InternetApplications/mockdatafiles/getinternetapplications-default.json +383 -0
- package/entities/InternetApplications/schema.json +23 -0
- package/entities/InternetConnectors/action.json +127 -0
- package/entities/InternetConnectors/mockdatafiles/getInternetConnectorConfiguration-default.json +35 -0
- package/entities/InternetConnectors/mockdatafiles/getinternetconnectors-default.json +30 -0
- package/entities/InternetConnectors/schema.json +24 -0
- package/entities/InvoiceSummaries/action.json +46 -0
- package/entities/InvoiceSummaries/schema.json +20 -0
- package/entities/Invoices/action.json +46 -0
- package/entities/Invoices/schema.json +20 -0
- package/entities/Jobs/action.json +46 -0
- package/entities/Jobs/schema.json +20 -0
- package/entities/KeyPairCredentials/action.json +44 -0
- package/entities/KeyPairCredentials/schema.json +20 -0
- package/entities/LDAPCredentials/action.json +64 -0
- package/entities/LDAPCredentials/schema.json +21 -0
- package/entities/LoginSpecification/action.json +65 -0
- package/entities/LoginSpecification/mockdatafiles/createOrUpdateLoginSpecification-default.json +6 -0
- package/entities/LoginSpecification/mockdatafiles/getLoginSpecification-default.json +6 -0
- package/entities/LoginSpecification/schema.json +21 -0
- package/entities/Logs/action.json +44 -0
- package/entities/Logs/schema.json +20 -0
- package/entities/Meters/action.json +46 -0
- package/entities/Meters/schema.json +20 -0
- package/entities/NATPolicies/action.json +106 -0
- package/entities/NATPolicies/mockdatafiles/getNATPolicies-default.json +46 -0
- package/entities/NATPolicies/schema.json +34 -0
- package/entities/NATRules/action.json +106 -0
- package/entities/NATRules/mockdatafiles/getNATRules-default.json +312 -0
- package/entities/NATRules/schema.json +34 -0
- package/entities/OCIVCNConnectors/action.json +106 -0
- package/entities/OCIVCNConnectors/mockdatafiles/getOCIVCNConnectors-default.json +148 -0
- package/entities/OCIVCNConnectors/schema.json +34 -0
- package/entities/OCIVCNCredentials/action.json +64 -0
- package/entities/OCIVCNCredentials/schema.json +21 -0
- package/entities/OneTimePassword/action.json +85 -0
- package/entities/OneTimePassword/mockdatafiles/createOneTimePassword-default.json +10 -0
- package/entities/OneTimePassword/mockdatafiles/getAllUnexpiredOTP-default.json +42 -0
- package/entities/OneTimePassword/schema.json +22 -0
- package/entities/PANCredentials/action.json +64 -0
- package/entities/PANCredentials/schema.json +21 -0
- package/entities/PANFWServices/action.json +188 -0
- package/entities/PANFWServices/mockdatafiles/getpanfwservices-default.json +455 -0
- package/entities/PANFWServices/schema.json +27 -0
- package/entities/PANInstanceCredentials/action.json +64 -0
- package/entities/PANInstanceCredentials/schema.json +21 -0
- package/entities/PANMasterKeyCredentials/action.json +64 -0
- package/entities/PANMasterKeyCredentials/schema.json +21 -0
- package/entities/PANRegistrationCredentials/action.json +64 -0
- package/entities/PANRegistrationCredentials/schema.json +21 -0
- package/entities/PacketCapture/action.json +66 -0
- package/entities/PacketCapture/mockdatafiles/getPacketCaptureResponses-default.json +35 -0
- package/entities/PacketCapture/schema.json +32 -0
- package/entities/PasswordSpecification/action.json +65 -0
- package/entities/PasswordSpecification/mockdatafiles/createOrUpdatePasswordSpecification-default.json +9 -0
- package/entities/PasswordSpecification/mockdatafiles/getPasswordSpecification-default.json +9 -0
- package/entities/PasswordSpecification/schema.json +21 -0
- package/entities/Permissions/action.json +25 -0
- package/entities/Permissions/mockdatafiles/getPermissionsUsingGET-default.json +5 -0
- package/entities/Permissions/schema.json +19 -0
- package/entities/Ping/action.json +44 -0
- package/entities/Ping/schema.json +20 -0
- package/entities/Policies/action.json +106 -0
- package/entities/Policies/mockdatafiles/getPolicies-default.json +42 -0
- package/entities/Policies/schema.json +23 -0
- package/entities/Prefixlists/action.json +106 -0
- package/entities/Prefixlists/mockdatafiles/getPrefixlists-default.json +75 -0
- package/entities/Prefixlists/schema.json +23 -0
- package/entities/Products/action.json +25 -0
- package/entities/Products/mockdatafiles/listofallproducts-default.json +136 -0
- package/entities/Products/schema.json +19 -0
- package/entities/RemoteAccess/action.json +172 -0
- package/entities/RemoteAccess/schema.json +26 -0
- package/entities/RemoteAccessConnectorTemplates/action.json +106 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/createConnectorTemplate-default.json +683 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/deleteConnectorTemplate-default.json +146 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/getConnectorTemplate-default.json +89 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/getConnectorTemplates-default.json +2408 -0
- package/entities/RemoteAccessConnectorTemplates/mockdatafiles/updateConnectorTemplate-default.json +632 -0
- package/entities/RemoteAccessConnectorTemplates/schema.json +23 -0
- package/entities/RemoteAccessConnectors/action.json +107 -0
- package/entities/RemoteAccessConnectors/mockdatafiles/getRemoteAccessConnectors-default.json +629 -0
- package/entities/RemoteAccessConnectors/mockdatafiles/getRemoteAccesssConnector-default.json +662 -0
- package/entities/RemoteAccessConnectors/schema.json +23 -0
- package/entities/ResourceLimits/action.json +25 -0
- package/entities/ResourceLimits/mockdatafiles/getTenantResourceLimits-default.json +10 -0
- package/entities/ResourceLimits/schema.json +19 -0
- package/entities/ResourceUsage/action.json +25 -0
- package/entities/ResourceUsage/mockdatafiles/getResourceUsage-default.json +183 -0
- package/entities/ResourceUsage/schema.json +19 -0
- package/entities/Roles/action.json +106 -0
- package/entities/Roles/mockdatafiles/getRolesUsingGET-default.json +22 -0
- package/entities/Roles/schema.json +23 -0
- package/entities/RoutePolicies/action.json +126 -0
- package/entities/RoutePolicies/mockdatafiles/getAllRoutePolicies-default.json +388 -0
- package/entities/RoutePolicies/schema.json +24 -0
- package/entities/Routes/action.json +25 -0
- package/entities/Routes/schema.json +19 -0
- package/entities/Rulelists/action.json +106 -0
- package/entities/Rulelists/mockdatafiles/getRulelists-default.json +18 -0
- package/entities/Rulelists/schema.json +23 -0
- package/entities/Rules/action.json +106 -0
- package/entities/Rules/mockdatafiles/getRules-default.json +76 -0
- package/entities/Rules/schema.json +23 -0
- package/entities/SegmentResourceShares/action.json +106 -0
- package/entities/SegmentResourceShares/mockdatafiles/getSegmentResourceShares-default.json +64 -0
- package/entities/SegmentResourceShares/schema.json +34 -0
- package/entities/SegmentResources/action.json +106 -0
- package/entities/SegmentResources/mockdatafiles/getsegmentResources-default.json +108 -0
- package/entities/SegmentResources/schema.json +23 -0
- package/entities/Segments/action.json +106 -0
- package/entities/Segments/mockdatafiles/getsegments-default.json +196 -0
- package/entities/Segments/schema.json +23 -0
- package/entities/SplunkHECTokenCredentials/action.json +64 -0
- package/entities/SplunkHECTokenCredentials/schema.json +21 -0
- package/entities/Tenant/action.json +45 -0
- package/entities/Tenant/mockdatafiles/getTenant-default.json +14 -0
- package/entities/Tenant/mockdatafiles/updateTenant-default.json +14 -0
- package/entities/Tenant/schema.json +20 -0
- package/entities/TenantNetworks/action.json +126 -0
- package/entities/TenantNetworks/mockdatafiles/getTenantNetworks-default.json +5816 -0
- package/entities/TenantNetworks/schema.json +24 -0
- package/entities/TenantPreferences/action.json +45 -0
- package/entities/TenantPreferences/mockdatafiles/getTenantPreferences-default.json +10 -0
- package/entities/TenantPreferences/schema.json +20 -0
- package/entities/TraceRoute/action.json +44 -0
- package/entities/TraceRoute/schema.json +20 -0
- package/entities/Traffic/action.json +130 -0
- package/entities/Traffic/mockdatafiles/retrievesactivesessionscountforservicesinthistenant-default.json +18 -0
- package/entities/Traffic/mockdatafiles/retrievesinstancecountforservicesinthistenant-default.json +18 -0
- package/entities/Traffic/mockdatafiles/retrievestheInterCXPtraffic-default.json +53 -0
- package/entities/Traffic/mockdatafiles/retrievestheoveralltrafficgoingtointernetfromCXP-default.json +140 -0
- package/entities/Traffic/mockdatafiles/retrievestrafficstatsforconnectorsinthistenant-default.json +126 -0
- package/entities/Traffic/mockdatafiles/retrievestrafficstatsforservicesinthistenant-default.json +126 -0
- package/entities/Traffic/schema.json +24 -0
- package/entities/UserGroups/action.json +208 -0
- package/entities/UserGroups/mockdatafiles/getUserFromUserGroup-default.json +17 -0
- package/entities/UserGroups/mockdatafiles/getUsersInUserGroup-default.json +19 -0
- package/entities/UserGroups/mockdatafiles/getusergroups-default.json +23 -0
- package/entities/UserGroups/schema.json +28 -0
- package/entities/UsernamePasswordCredentials/action.json +64 -0
- package/entities/UsernamePasswordCredentials/schema.json +21 -0
- package/entities/Users/action.json +147 -0
- package/entities/Users/mockdatafiles/createUsersUsingPOST-default.json +17 -0
- package/entities/Users/mockdatafiles/getAllUsersUsingGET-default.json +70 -0
- package/entities/Users/mockdatafiles/getUsersByIdUsingGET-default.json +17 -0
- package/entities/Users/mockdatafiles/updateUsersByIdUsingPUT-default.json +17 -0
- package/entities/Users/schema.json +25 -0
- package/entities/ZscalerInternetAccessServices/action.json +106 -0
- package/entities/ZscalerInternetAccessServices/mockdatafiles/getZscalerInternetAccessServices-default.json +84 -0
- package/entities/ZscalerInternetAccessServices/schema.json +23 -0
- package/error.json +190 -0
- package/package.json +86 -0
- package/pronghorn.json +44773 -0
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +1248 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/alkira_swagger.json-OpenApi3Json.json +50699 -0
- package/report/creationReport.json +3472 -0
- package/sampleProperties.json +195 -0
- package/test/integration/adapterTestBasicGet.js +83 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +12410 -0
- package/test/unit/adapterBaseTestUnit.js +949 -0
- package/test/unit/adapterTestUnit.js +19120 -0
- package/utils/adapterInfo.js +206 -0
- package/utils/addAuth.js +94 -0
- package/utils/artifactize.js +146 -0
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +178 -0
- package/utils/findPath.js +74 -0
- package/utils/methodDocumentor.js +225 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.js +35 -0
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +32 -0
- package/utils/removeHooks.js +20 -0
- package/utils/setup.js +33 -0
- package/utils/tbScript.js +246 -0
- package/utils/tbUtils.js +490 -0
- package/utils/testRunner.js +298 -0
- package/utils/troubleshootingAdapter.js +195 -0
- package/workflows/README.md +3 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* @copyright Itential, LLC 2019 */
|
|
3
|
+
/* eslint global-require:warn */
|
|
4
|
+
/* eslint import/no-dynamic-require:warn */
|
|
5
|
+
/* eslint prefer-destructuring:warn */
|
|
6
|
+
|
|
7
|
+
const fs = require('fs-extra');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* This script will determine the information about the adapter and store
|
|
12
|
+
* it into a file in the adapter.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* get adapter information
|
|
17
|
+
*/
|
|
18
|
+
function adapterInfo() {
|
|
19
|
+
// set the base pase of the adapter - tool shoud be one level up in utils
|
|
20
|
+
let adaptdir = __dirname;
|
|
21
|
+
const infoRes = {};
|
|
22
|
+
|
|
23
|
+
if (adaptdir.endsWith('/utils')) {
|
|
24
|
+
adaptdir = adaptdir.substring(0, adaptdir.length - 6);
|
|
25
|
+
}
|
|
26
|
+
const pack = require(`${adaptdir}/package.json`);
|
|
27
|
+
infoRes.version = pack.version;
|
|
28
|
+
|
|
29
|
+
let configCount = 0;
|
|
30
|
+
if (fs.existsSync(`${adaptdir}/pronghorn.json`)) {
|
|
31
|
+
const cFile = fs.readFileSync(`${adaptdir}/pronghorn.json`, 'utf8');
|
|
32
|
+
configCount += cFile.split('\n').length;
|
|
33
|
+
} else {
|
|
34
|
+
console.log('Missing - pronghorn.json');
|
|
35
|
+
}
|
|
36
|
+
if (fs.existsSync(`${adaptdir}/propertiesSchema.json`)) {
|
|
37
|
+
const cFile = fs.readFileSync(`${adaptdir}/propertiesSchema.json`, 'utf8');
|
|
38
|
+
configCount += cFile.split('\n').length;
|
|
39
|
+
} else {
|
|
40
|
+
console.log('Missing - propertiesSchema.json');
|
|
41
|
+
}
|
|
42
|
+
if (fs.existsSync(`${adaptdir}/error.json`)) {
|
|
43
|
+
const cFile = fs.readFileSync(`${adaptdir}/error.json`, 'utf8');
|
|
44
|
+
configCount += cFile.split('\n').length;
|
|
45
|
+
} else {
|
|
46
|
+
console.log('Missing - error.json');
|
|
47
|
+
}
|
|
48
|
+
const entitydir = path.join(adaptdir, '/entities');
|
|
49
|
+
if (fs.existsSync(entitydir) && fs.statSync(entitydir).isDirectory()) {
|
|
50
|
+
const entities = fs.readdirSync(entitydir);
|
|
51
|
+
// need to go through each entity in the entities directory
|
|
52
|
+
for (let e = 0; e < entities.length; e += 1) {
|
|
53
|
+
if (fs.statSync(`${entitydir}/${entities[e]}`).isDirectory()) {
|
|
54
|
+
const cfiles = fs.readdirSync(entitydir);
|
|
55
|
+
for (let c = 0; c < cfiles.length; c += 1) {
|
|
56
|
+
if (cfiles[c].endsWith('.json')) {
|
|
57
|
+
const ccFile = fs.readFileSync(`${entitydir}/${entities[e]}/${cfiles[c]}`, 'utf8');
|
|
58
|
+
configCount += ccFile.split('\n').length;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
console.log('Could not find the entities directory');
|
|
65
|
+
}
|
|
66
|
+
infoRes.configLines = configCount;
|
|
67
|
+
|
|
68
|
+
let scodeCount = 0;
|
|
69
|
+
if (fs.existsSync(`${adaptdir}/utils/artifactize.js`)) {
|
|
70
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/artifactize.js`, 'utf8');
|
|
71
|
+
scodeCount += sFile.split('\n').length;
|
|
72
|
+
} else {
|
|
73
|
+
console.log('Missing - utils/artifactize.js');
|
|
74
|
+
}
|
|
75
|
+
if (fs.existsSync(`${adaptdir}/utils/basicGet.js`)) {
|
|
76
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/basicGet.js`, 'utf8');
|
|
77
|
+
scodeCount += sFile.split('\n').length;
|
|
78
|
+
} else {
|
|
79
|
+
console.log('Missing - utils/basicGet.js');
|
|
80
|
+
}
|
|
81
|
+
if (fs.existsSync(`${adaptdir}/utils/checkMigrate.js`)) {
|
|
82
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/checkMigrate.js`, 'utf8');
|
|
83
|
+
scodeCount += sFile.split('\n').length;
|
|
84
|
+
} else {
|
|
85
|
+
console.log('Missing - utils/checkMigrate.js');
|
|
86
|
+
}
|
|
87
|
+
if (fs.existsSync(`${adaptdir}/utils/findPath.js`)) {
|
|
88
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/findPath.js`, 'utf8');
|
|
89
|
+
scodeCount += sFile.split('\n').length;
|
|
90
|
+
} else {
|
|
91
|
+
console.log('Missing - utils/findPath.js');
|
|
92
|
+
}
|
|
93
|
+
if (fs.existsSync(`${adaptdir}/utils/modify.js`)) {
|
|
94
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/modify.js`, 'utf8');
|
|
95
|
+
scodeCount += sFile.split('\n').length;
|
|
96
|
+
} else {
|
|
97
|
+
console.log('Missing - utils/modify.js');
|
|
98
|
+
}
|
|
99
|
+
if (fs.existsSync(`${adaptdir}/utils/packModificationScript.js`)) {
|
|
100
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/packModificationScript.js`, 'utf8');
|
|
101
|
+
scodeCount += sFile.split('\n').length;
|
|
102
|
+
} else {
|
|
103
|
+
console.log('Missing - utils/packModificationScript.js');
|
|
104
|
+
}
|
|
105
|
+
if (fs.existsSync(`${adaptdir}/utils/setup.js`)) {
|
|
106
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/setup.js`, 'utf8');
|
|
107
|
+
scodeCount += sFile.split('\n').length;
|
|
108
|
+
} else {
|
|
109
|
+
console.log('Missing - utils/setup.js');
|
|
110
|
+
}
|
|
111
|
+
if (fs.existsSync(`${adaptdir}/utils/tbScript.js`)) {
|
|
112
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/tbScript.js`, 'utf8');
|
|
113
|
+
scodeCount += sFile.split('\n').length;
|
|
114
|
+
} else {
|
|
115
|
+
console.log('Missing - utils/tbScript.js');
|
|
116
|
+
}
|
|
117
|
+
if (fs.existsSync(`${adaptdir}/utils/tbUtils.js`)) {
|
|
118
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/tbUtils.js`, 'utf8');
|
|
119
|
+
scodeCount += sFile.split('\n').length;
|
|
120
|
+
} else {
|
|
121
|
+
console.log('Missing - utils/tbUtils.js');
|
|
122
|
+
}
|
|
123
|
+
if (fs.existsSync(`${adaptdir}/utils/testRunner.js`)) {
|
|
124
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/testRunner.js`, 'utf8');
|
|
125
|
+
scodeCount += sFile.split('\n').length;
|
|
126
|
+
} else {
|
|
127
|
+
console.log('Missing - utils/testRunner.js');
|
|
128
|
+
}
|
|
129
|
+
if (fs.existsSync(`${adaptdir}/utils/troubleshootingAdapter.js`)) {
|
|
130
|
+
const sFile = fs.readFileSync(`${adaptdir}/utils/troubleshootingAdapter.js`, 'utf8');
|
|
131
|
+
scodeCount += sFile.split('\n').length;
|
|
132
|
+
} else {
|
|
133
|
+
console.log('Missing - utils/troubleshootingAdapter.js');
|
|
134
|
+
}
|
|
135
|
+
infoRes.scriptLines = scodeCount;
|
|
136
|
+
|
|
137
|
+
let codeCount = 0;
|
|
138
|
+
if (fs.existsSync(`${adaptdir}/adapter.js`)) {
|
|
139
|
+
const aFile = fs.readFileSync(`${adaptdir}/adapter.js`, 'utf8');
|
|
140
|
+
codeCount += aFile.split('\n').length;
|
|
141
|
+
} else {
|
|
142
|
+
console.log('Missing - utils/adapter.js');
|
|
143
|
+
}
|
|
144
|
+
if (fs.existsSync(`${adaptdir}/adapterBase.js`)) {
|
|
145
|
+
const aFile = fs.readFileSync(`${adaptdir}/adapterBase.js`, 'utf8');
|
|
146
|
+
codeCount += aFile.split('\n').length;
|
|
147
|
+
} else {
|
|
148
|
+
console.log('Missing - utils/adapterBase.js');
|
|
149
|
+
}
|
|
150
|
+
infoRes.codeLines = codeCount;
|
|
151
|
+
|
|
152
|
+
let tcodeCount = 0;
|
|
153
|
+
let ttestCount = 0;
|
|
154
|
+
if (fs.existsSync(`${adaptdir}/test/integration/adapterTestBasicGet.js`)) {
|
|
155
|
+
const tFile = fs.readFileSync(`${adaptdir}/test/integration/adapterTestBasicGet.js`, 'utf8');
|
|
156
|
+
tcodeCount += tFile.split('\n').length;
|
|
157
|
+
ttestCount += tFile.split('it(\'').length;
|
|
158
|
+
} else {
|
|
159
|
+
console.log('Missing - test/integration/adapterTestBasicGet.js');
|
|
160
|
+
}
|
|
161
|
+
if (fs.existsSync(`${adaptdir}/test/integration/adapterTestConnectivity.js`)) {
|
|
162
|
+
const tFile = fs.readFileSync(`${adaptdir}/test/integration/adapterTestConnectivity.js`, 'utf8');
|
|
163
|
+
tcodeCount += tFile.split('\n').length;
|
|
164
|
+
ttestCount += tFile.split('it(\'').length;
|
|
165
|
+
} else {
|
|
166
|
+
console.log('Missing - test/integration/adapterTestConnectivity.js');
|
|
167
|
+
}
|
|
168
|
+
if (fs.existsSync(`${adaptdir}/test/integration/adapterTestIntegration.js`)) {
|
|
169
|
+
const tFile = fs.readFileSync(`${adaptdir}/test/integration/adapterTestIntegration.js`, 'utf8');
|
|
170
|
+
tcodeCount += tFile.split('\n').length;
|
|
171
|
+
ttestCount += tFile.split('it(\'').length;
|
|
172
|
+
} else {
|
|
173
|
+
console.log('Missing - test/integration/adapterTestIntegration.js');
|
|
174
|
+
}
|
|
175
|
+
if (fs.existsSync(`${adaptdir}/test/unit/adapterBaseTestUnit.js`)) {
|
|
176
|
+
const tFile = fs.readFileSync(`${adaptdir}/test/unit/adapterBaseTestUnit.js`, 'utf8');
|
|
177
|
+
tcodeCount += tFile.split('\n').length;
|
|
178
|
+
ttestCount += tFile.split('it(\'').length;
|
|
179
|
+
} else {
|
|
180
|
+
console.log('Missing - test/unit/adapterBaseTestUnit.js');
|
|
181
|
+
}
|
|
182
|
+
if (fs.existsSync(`${adaptdir}/test/unit/adapterTestUnit.js`)) {
|
|
183
|
+
const tFile = fs.readFileSync(`${adaptdir}/test/unit/adapterTestUnit.js`, 'utf8');
|
|
184
|
+
tcodeCount += tFile.split('\n').length;
|
|
185
|
+
ttestCount += tFile.split('it(\'').length;
|
|
186
|
+
} else {
|
|
187
|
+
console.log('Missing - test/unit/adapterTestUnit.js');
|
|
188
|
+
}
|
|
189
|
+
infoRes.testLines = tcodeCount;
|
|
190
|
+
infoRes.testCases = ttestCount;
|
|
191
|
+
infoRes.totalCodeLines = scodeCount + codeCount + tcodeCount;
|
|
192
|
+
|
|
193
|
+
if (fs.existsSync(`${adaptdir}/pronghorn.json`)) {
|
|
194
|
+
// Read the entity schema from the file system
|
|
195
|
+
const phFile = path.join(adaptdir, '/pronghorn.json');
|
|
196
|
+
const prong = require(phFile);
|
|
197
|
+
infoRes.wfTasks = prong.methods.length;
|
|
198
|
+
} else {
|
|
199
|
+
console.log('Missing - pronghorn.json');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
console.log(JSON.stringify(infoRes));
|
|
203
|
+
fs.writeFileSync(`${adaptdir}/report/adapterInfo.json`, JSON.stringify(infoRes, null, 2));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
adapterInfo();
|
package/utils/addAuth.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable no-plusplus */
|
|
2
|
+
/* eslint global-require: warn */
|
|
3
|
+
/* eslint import/no-dynamic-require: warn */
|
|
4
|
+
|
|
5
|
+
const rls = require('readline-sync');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
|
|
9
|
+
function getQuestions(props, obj) {
|
|
10
|
+
const questions = props.map((p) => `${p}: ${(obj[p] !== undefined) ? `(${obj[p]})` : ''} `);
|
|
11
|
+
return questions;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// function outputs each property for user to edit/confirm
|
|
15
|
+
// props are the fields that need to be changed depending on what the user selects
|
|
16
|
+
// obj is the JSON object that's being updated
|
|
17
|
+
function confirm(props, obj) {
|
|
18
|
+
// create array of questions
|
|
19
|
+
const updatedObj = obj;
|
|
20
|
+
getQuestions(props, obj).forEach((q) => {
|
|
21
|
+
const answer = rls.question(q);
|
|
22
|
+
// only update the field if the answer is NOT and empty string
|
|
23
|
+
if (answer) {
|
|
24
|
+
updatedObj[q.split(':')[0].trim()] = answer;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return updatedObj;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const updateBasicAuth = (auth) => {
|
|
31
|
+
const propsToUpdate = ['username', 'password', 'auth_field', 'auth_field_format'];
|
|
32
|
+
return confirm(propsToUpdate, auth);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const updateStaticTokenAuth = (auth) => {
|
|
36
|
+
const propsToUpdate = ['token', 'auth_field', 'auth_field_format'];
|
|
37
|
+
return confirm(propsToUpdate, auth);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function updateTokenSchemas(user, pw, token) {
|
|
41
|
+
let schemaPath = path.join(__dirname, '..', 'entities/.system/schemaTokenReq.json');
|
|
42
|
+
const reqSchema = require(schemaPath);
|
|
43
|
+
reqSchema.properties.username.external_name = user;
|
|
44
|
+
reqSchema.properties.password.external_name = pw;
|
|
45
|
+
fs.writeFileSync(schemaPath, JSON.stringify(reqSchema, null, 2));
|
|
46
|
+
schemaPath = path.join(__dirname, '..', 'entities/.system/schemaTokenResp.json');
|
|
47
|
+
const respSchema = require(schemaPath);
|
|
48
|
+
respSchema.properties.token.external_name = token;
|
|
49
|
+
fs.writeFileSync(schemaPath, JSON.stringify(respSchema, null, 2));
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function updateRequestToken(auth) {
|
|
53
|
+
const propsToUpdate = [
|
|
54
|
+
'username',
|
|
55
|
+
'password',
|
|
56
|
+
'auth_field',
|
|
57
|
+
'auth_field_format',
|
|
58
|
+
'token_user_field',
|
|
59
|
+
'token_password_field',
|
|
60
|
+
'token_result_field',
|
|
61
|
+
'token_URI_path'
|
|
62
|
+
];
|
|
63
|
+
const newAuth = confirm(propsToUpdate, auth);
|
|
64
|
+
updateTokenSchemas(newAuth.token_user_field, newAuth.token_password_field, newAuth.token_result_field);
|
|
65
|
+
|
|
66
|
+
return newAuth;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// prompt users to pick an auth method from the list above
|
|
70
|
+
const addAuthInfo = (props) => {
|
|
71
|
+
const authOptions = [
|
|
72
|
+
'basic user_password',
|
|
73
|
+
'static_token',
|
|
74
|
+
'request_token',
|
|
75
|
+
'no_authentication'
|
|
76
|
+
];
|
|
77
|
+
const newProps = confirm(['host', 'port', 'base_path'], props);
|
|
78
|
+
|
|
79
|
+
const newAuthMethod = authOptions[rls.keyInSelect(authOptions, 'Which authentication method?')];
|
|
80
|
+
newProps.authentication.auth_method = newAuthMethod;
|
|
81
|
+
|
|
82
|
+
if (newAuthMethod === 'basic user_password') {
|
|
83
|
+
newProps.authentication = updateBasicAuth(newProps.authentication);
|
|
84
|
+
} else if (newAuthMethod === 'static_token') {
|
|
85
|
+
newProps.authentication = updateStaticTokenAuth(newProps.authentication);
|
|
86
|
+
} else if (newAuthMethod === 'request_token') {
|
|
87
|
+
newProps.authentication = updateRequestToken(newProps.authentication);
|
|
88
|
+
}
|
|
89
|
+
console.log('Connectivity and authentication properties have been configured');
|
|
90
|
+
console.log('If you want to make changes, rerun this script to reinstall the adapter');
|
|
91
|
+
return newProps;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
module.exports = { addAuthInfo };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/* @copyright Itential, LLC 2019 */
|
|
3
|
+
|
|
4
|
+
const fs = require('fs-extra');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
async function createBundle(adapterOldDir) {
|
|
8
|
+
// set directories
|
|
9
|
+
const artifactDir = path.join(adapterOldDir, '../artifactTemp');
|
|
10
|
+
const workflowsDir = path.join(adapterOldDir, 'workflows');
|
|
11
|
+
|
|
12
|
+
// read adapter's package and set names
|
|
13
|
+
const adapterPackage = fs.readJSONSync(path.join(adapterOldDir, 'package.json'));
|
|
14
|
+
const originalName = adapterPackage.name.substring(adapterPackage.name.lastIndexOf('/') + 1);
|
|
15
|
+
const shortenedName = originalName.replace('adapter-', '');
|
|
16
|
+
const artifactName = originalName.replace('adapter', 'bundled-adapter');
|
|
17
|
+
|
|
18
|
+
const adapterNewDir = path.join(artifactDir, 'bundles', 'adapters', originalName);
|
|
19
|
+
fs.ensureDirSync(adapterNewDir);
|
|
20
|
+
|
|
21
|
+
const ops = [];
|
|
22
|
+
|
|
23
|
+
// copy old adapterDir to bundled hierarchy location
|
|
24
|
+
ops.push(() => fs.copySync(adapterOldDir, adapterNewDir));
|
|
25
|
+
|
|
26
|
+
// copy readme
|
|
27
|
+
ops.push(() => fs.copySync(path.join(adapterOldDir, 'README.md'), path.join(artifactDir, 'README.md')));
|
|
28
|
+
|
|
29
|
+
// copy changelog
|
|
30
|
+
if (fs.existsSync(path.join(adapterOldDir, 'CHANGELOG.md'))) {
|
|
31
|
+
ops.push(() => fs.copySync(path.join(adapterOldDir, 'CHANGELOG.md'), path.join(artifactDir, 'CHANGELOG.md')));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// copy license
|
|
35
|
+
if (fs.existsSync(path.join(adapterOldDir, 'LICENSE'))) {
|
|
36
|
+
ops.push(() => fs.copySync(path.join(adapterOldDir, 'LICENSE'), path.join(artifactDir, 'LICENSE')));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// create package
|
|
40
|
+
const artifactPackage = {
|
|
41
|
+
name: artifactName,
|
|
42
|
+
version: adapterPackage.version,
|
|
43
|
+
description: `A bundled version of the ${originalName} to be used in adapter-artifacts for easy installation`,
|
|
44
|
+
scripts: {
|
|
45
|
+
test: 'echo "Error: no test specified" && exit 1',
|
|
46
|
+
deploy: 'npm publish --registry=http://registry.npmjs.org'
|
|
47
|
+
},
|
|
48
|
+
keywords: [
|
|
49
|
+
'IAP',
|
|
50
|
+
'artifacts',
|
|
51
|
+
'Itential',
|
|
52
|
+
'Pronghorn',
|
|
53
|
+
'Adapter',
|
|
54
|
+
'Adapter-Artifacts',
|
|
55
|
+
shortenedName
|
|
56
|
+
],
|
|
57
|
+
author: 'Itential Artifacts',
|
|
58
|
+
license: 'Apache-2.0',
|
|
59
|
+
repository: adapterPackage.repository,
|
|
60
|
+
private: false,
|
|
61
|
+
devDependencies: {
|
|
62
|
+
r2: '^2.0.1',
|
|
63
|
+
ajv: '6.10.0',
|
|
64
|
+
'better-ajv-errors': '^0.6.1',
|
|
65
|
+
'fs-extra': '^7.0.1'
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
ops.push(() => fs.writeJSONSync(path.join(artifactDir, 'package.json'), artifactPackage, { spaces: 2 }));
|
|
70
|
+
|
|
71
|
+
// create manifest
|
|
72
|
+
const manifest = {
|
|
73
|
+
bundleName: originalName,
|
|
74
|
+
version: adapterPackage.version,
|
|
75
|
+
fingerprint: 'Some verifiable token',
|
|
76
|
+
createdEpoch: '1554836984020',
|
|
77
|
+
artifacts: [
|
|
78
|
+
{
|
|
79
|
+
id: `${shortenedName}-adapter`,
|
|
80
|
+
name: `${shortenedName}-adapter`,
|
|
81
|
+
type: 'adapter',
|
|
82
|
+
location: `/bundles/adapters/${originalName}`,
|
|
83
|
+
description: artifactPackage.description,
|
|
84
|
+
properties: {
|
|
85
|
+
entryPoint: false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// add workflows into artifact
|
|
92
|
+
if (fs.existsSync(workflowsDir)) {
|
|
93
|
+
const workflowFileNames = fs.readdirSync(workflowsDir);
|
|
94
|
+
|
|
95
|
+
// if folder isnt empty and only file is not readme
|
|
96
|
+
if (workflowFileNames.length !== 0 && (!(workflowFileNames.length === 1 && workflowFileNames[0].split('.')[1] === 'md'))) {
|
|
97
|
+
// add workflows to correct location in bundle
|
|
98
|
+
ops.push(() => fs.copySync(workflowsDir, path.join(artifactDir, 'bundles', 'workflows')));
|
|
99
|
+
|
|
100
|
+
// add workflows to manifest
|
|
101
|
+
workflowFileNames.forEach((filename) => {
|
|
102
|
+
const [filenameNoExt, ext] = filename.split('.');
|
|
103
|
+
if (ext === 'json') {
|
|
104
|
+
manifest.artifacts.push({
|
|
105
|
+
id: `workflow-${filenameNoExt}`,
|
|
106
|
+
name: filenameNoExt,
|
|
107
|
+
type: 'workflow',
|
|
108
|
+
location: `/bundles/workflows/${filename}`,
|
|
109
|
+
description: 'Main entry point to artifact',
|
|
110
|
+
properties: {
|
|
111
|
+
entryPoint: false
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
ops.push(() => fs.writeJSONSync(path.join(artifactDir, 'manifest.json'), manifest, { spaces: 2 }));
|
|
120
|
+
|
|
121
|
+
// Run the commands in parallel
|
|
122
|
+
try {
|
|
123
|
+
await Promise.all(ops.map(async (op) => op()));
|
|
124
|
+
} catch (e) {
|
|
125
|
+
throw new Error(e);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const pathObj = {
|
|
129
|
+
bundlePath: artifactDir,
|
|
130
|
+
bundledAdapterPath: path.join(artifactDir, 'bundles', 'adapters', originalName)
|
|
131
|
+
};
|
|
132
|
+
return pathObj;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async function artifactize(entryPathToAdapter) {
|
|
136
|
+
const truePath = path.resolve(entryPathToAdapter);
|
|
137
|
+
const packagePath = path.join(truePath, 'package');
|
|
138
|
+
// remove adapter from package and move bundle in
|
|
139
|
+
const pathObj = await createBundle(packagePath);
|
|
140
|
+
const { bundlePath } = pathObj;
|
|
141
|
+
fs.removeSync(packagePath);
|
|
142
|
+
fs.moveSync(bundlePath, packagePath);
|
|
143
|
+
return 'Bundle successfully created and old folder system removed';
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
module.exports = { createBundle, artifactize };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* @copyright Itential, LLC 2020 */
|
|
2
|
+
|
|
3
|
+
/* eslint object-shorthand: warn */
|
|
4
|
+
/* eslint import/no-extraneous-dependencies: warn */
|
|
5
|
+
/* eslint global-require: warn */
|
|
6
|
+
/* eslint import/no-unresolved: warn */
|
|
7
|
+
/* eslint import/no-dynamic-require: warn */
|
|
8
|
+
|
|
9
|
+
const winston = require('winston');
|
|
10
|
+
|
|
11
|
+
const logLevel = 'none';
|
|
12
|
+
const myCustomLevels = {
|
|
13
|
+
levels: {
|
|
14
|
+
spam: 6,
|
|
15
|
+
trace: 5,
|
|
16
|
+
debug: 4,
|
|
17
|
+
info: 3,
|
|
18
|
+
warn: 2,
|
|
19
|
+
error: 1,
|
|
20
|
+
none: 0
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const basicGet = {
|
|
25
|
+
/**
|
|
26
|
+
* @summary create Adapter instance
|
|
27
|
+
*
|
|
28
|
+
* @function getAdapterInstance
|
|
29
|
+
* @param {Object} adapter - adaper configuration object required by IAP
|
|
30
|
+
*/
|
|
31
|
+
getAdapterInstance: (adapter) => {
|
|
32
|
+
const Adapter = require('../adapter');
|
|
33
|
+
const adapterProps = JSON.parse(JSON.stringify(adapter.properties.properties));
|
|
34
|
+
adapterProps.stub = false;
|
|
35
|
+
// need to set global logging
|
|
36
|
+
global.log = winston.createLogger({
|
|
37
|
+
level: logLevel,
|
|
38
|
+
levels: myCustomLevels.levels,
|
|
39
|
+
transports: [
|
|
40
|
+
new winston.transports.Console()
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
return new Adapter(
|
|
44
|
+
adapter.id,
|
|
45
|
+
adapterProps
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
module.exports = basicGet;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const semver = require('semver');
|
|
3
|
+
const axios = require('axios');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const packageJson = require('../package.json');
|
|
6
|
+
|
|
7
|
+
const localEngineVer = packageJson.engineVersion;
|
|
8
|
+
const localUtils = execSync('npm list @itentialopensource/adapter-utils', { encoding: 'utf-8' });
|
|
9
|
+
const localUtilsVer = localUtils.split('@').pop().replace(/(\r\n|\n|\r| )/gm, '');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @summary Makes a GET call using axios
|
|
13
|
+
*
|
|
14
|
+
* @function get
|
|
15
|
+
* @param {String} url - url to make the call to
|
|
16
|
+
*/
|
|
17
|
+
function get(url) {
|
|
18
|
+
const config = {
|
|
19
|
+
method: 'get',
|
|
20
|
+
url
|
|
21
|
+
};
|
|
22
|
+
return axios(config);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @summary Checks if adapter can be migrated using migration package
|
|
27
|
+
*
|
|
28
|
+
* @function migratePossible
|
|
29
|
+
*/
|
|
30
|
+
function migratePossible() {
|
|
31
|
+
const adapterTestUnit = fs.readFileSync('./test/unit/adapterTestUnit.js', { encoding: 'utf-8' });
|
|
32
|
+
const readme = fs.readFileSync('./README.md', { encoding: 'utf-8' });
|
|
33
|
+
return packageJson.keywords !== null && adapterTestUnit.indexOf('DO NOT REMOVE THIS COMMENT BLOCK') !== -1
|
|
34
|
+
&& readme.indexOf('available at ') !== -1 && readme.indexOf('You will need to change the credentials and possibly the host information below.') !== -1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @summary Checks if adapter is up-to-date or if migration is needed
|
|
39
|
+
*
|
|
40
|
+
* @function migrateNeeded
|
|
41
|
+
*/
|
|
42
|
+
async function migrateNeeded() {
|
|
43
|
+
const engineUrl = 'https://adapters.itential.io/engineVersion';
|
|
44
|
+
const utilsUrl = 'https://registry.npmjs.org/@itentialopensource/adapter-utils';
|
|
45
|
+
const latestEngineVer = (await get(engineUrl)).data;
|
|
46
|
+
const latestUtilsVer = (await get(utilsUrl)).data['dist-tags'].latest;
|
|
47
|
+
return semver.lt(localEngineVer, latestEngineVer) || semver.lt(localUtilsVer, latestUtilsVer);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Main Script
|
|
51
|
+
if (migratePossible()) {
|
|
52
|
+
migrateNeeded().then((needed) => {
|
|
53
|
+
if (needed) {
|
|
54
|
+
console.log('Migration is needed and possible -- go to dev site to download migration package');
|
|
55
|
+
} else {
|
|
56
|
+
console.log('Migration is possible but not needed at the current time.');
|
|
57
|
+
}
|
|
58
|
+
}).catch((error) => {
|
|
59
|
+
console.log('Could not get latest engine or utils version.', error.message);
|
|
60
|
+
});
|
|
61
|
+
} else {
|
|
62
|
+
console.log('Migration is not possible. Please contact Itential support for assistance');
|
|
63
|
+
}
|