@itentialopensource/adapter-azure_devops 0.1.1 → 0.1.2
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/AUTH.md +39 -0
- package/BROKER.md +199 -0
- package/CALLS.md +169 -0
- package/CHANGELOG.md +9 -2
- package/CODE_OF_CONDUCT.md +12 -17
- package/CONTRIBUTING.md +88 -74
- package/ENHANCE.md +69 -0
- package/PROPERTIES.md +641 -0
- package/README.md +221 -571
- package/SUMMARY.md +9 -0
- package/SYSTEMINFO.md +11 -0
- package/TROUBLESHOOT.md +47 -0
- package/adapter.js +11999 -57
- package/adapterBase.js +1007 -253
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/README.md +59 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/specificCallScript.js +97 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/update.js +532 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/adapter.js +11651 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/AnnotatedTags/action.json +43 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/AnnotatedTags/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/AnnotatedTags/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Blobs/action.json +43 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Blobs/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Blobs/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/CherryPicks/action.json +64 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/CherryPicks/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/CherryPicks/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Commits/action.json +85 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Commits/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Commits/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Diffs/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Diffs/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Diffs/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Forks/action.json +85 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Forks/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Forks/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/ImportRequests/action.json +84 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/ImportRequests/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/ImportRequests/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Items/action.json +43 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Items/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Items/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/MergeBases/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/MergeBases/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/MergeBases/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Merges/action.json +43 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Merges/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Merges/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PolicyConfigurations/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PolicyConfigurations/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PolicyConfigurations/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestAttachments/action.json +84 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestAttachments/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestAttachments/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestCommentLikes/action.json +63 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestCommentLikes/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestCommentLikes/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestCommits/action.json +44 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestCommits/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestCommits/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterationChanges/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterationChanges/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterationChanges/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterationStatuses/action.json +104 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterationStatuses/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterationStatuses/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterations/action.json +44 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterations/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestIterations/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestLabels/action.json +84 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestLabels/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestLabels/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestProperties/action.json +43 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestProperties/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestProperties/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestQuery/action.json +22 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestQuery/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestQuery/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestReviewers/action.json +164 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestReviewers/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestReviewers/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestShare/action.json +22 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestShare/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestShare/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestStatuses/action.json +104 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestStatuses/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestStatuses/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestThreadComments/action.json +104 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestThreadComments/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestThreadComments/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestThreads/action.json +84 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestThreads/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestThreads/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestWorkItems/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestWorkItems/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequestWorkItems/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequests/action.json +126 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequests/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/PullRequests/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Pushes/action.json +64 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Pushes/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Pushes/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Refs/action.json +63 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Refs/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Refs/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/RefsFavorites/action.json +84 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/RefsFavorites/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/RefsFavorites/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Repositories/action.json +186 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Repositories/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Repositories/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Reverts/action.json +64 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Reverts/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Reverts/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Stats/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Stats/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Stats/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Statuses/action.json +43 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Statuses/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Statuses/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Suggestions/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Suggestions/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Suggestions/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Trees/action.json +23 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Trees/mockdatafiles/mockdata.json +20817 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/entities/Trees/schema.json +125 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/methods.json +74975 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/pronghorn.json +11730 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/test/integration/adapterTestIntegration.js +5493 -0
- package/adapter_modifications/archive/UPD-2022-04-29T13:05:13.710Z/updateFiles/components/test/unit/adapterTestUnit.js +10889 -0
- package/entities/.generic/action.json +105 -0
- package/entities/.generic/schema.json +6 -1
- package/entities/AnnotatedTags/action.json +45 -0
- package/entities/AnnotatedTags/schema.json +20 -0
- package/entities/Blobs/action.json +45 -0
- package/entities/Blobs/schema.json +20 -0
- package/entities/CherryPicks/action.json +66 -0
- package/entities/CherryPicks/schema.json +21 -0
- package/entities/Commits/action.json +87 -0
- package/entities/Commits/mockdatafiles/commitsGetCommitsBatch-default.json +707 -0
- package/entities/Commits/mockdatafiles/commitsGetPushCommits-default.json +336 -0
- package/entities/Commits/schema.json +22 -0
- package/entities/Diffs/action.json +25 -0
- package/entities/Diffs/schema.json +19 -0
- package/entities/Forks/action.json +87 -0
- package/entities/Forks/mockdatafiles/forksGetForkSyncRequests-default.json +200 -0
- package/entities/Forks/mockdatafiles/forksList-default.json +102 -0
- package/entities/Forks/schema.json +22 -0
- package/entities/ImportRequests/action.json +86 -0
- package/entities/ImportRequests/mockdatafiles/importRequestsQuery-default.json +91 -0
- package/entities/ImportRequests/schema.json +22 -0
- package/entities/Items/action.json +45 -0
- package/entities/Items/mockdatafiles/itemsGetItemsBatch-default.json +5 -0
- package/entities/Items/mockdatafiles/itemsList-default.json +40 -0
- package/entities/Items/schema.json +20 -0
- package/entities/MergeBases/action.json +25 -0
- package/entities/MergeBases/mockdatafiles/mergeBasesList-default.json +580 -0
- package/entities/MergeBases/schema.json +19 -0
- package/entities/Merges/action.json +45 -0
- package/entities/Merges/schema.json +20 -0
- package/entities/PolicyConfigurations/action.json +25 -0
- package/entities/PolicyConfigurations/mockdatafiles/policyConfigurationsGet-default.json +20 -0
- package/entities/PolicyConfigurations/schema.json +19 -0
- package/entities/PullRequestAttachments/action.json +86 -0
- package/entities/PullRequestAttachments/mockdatafiles/pullRequestAttachmentsList-default.json +159 -0
- package/entities/PullRequestAttachments/schema.json +22 -0
- package/entities/PullRequestCommentLikes/action.json +65 -0
- package/entities/PullRequestCommentLikes/mockdatafiles/pullRequestCommentLikesList-default.json +10 -0
- package/entities/PullRequestCommentLikes/schema.json +21 -0
- package/entities/PullRequestCommits/action.json +46 -0
- package/entities/PullRequestCommits/mockdatafiles/pullRequestCommitsGetPullRequestCommits-default.json +818 -0
- package/entities/PullRequestCommits/mockdatafiles/pullRequestCommitsGetPullRequestIterationCommits-default.json +813 -0
- package/entities/PullRequestCommits/schema.json +20 -0
- package/entities/PullRequestIterationChanges/action.json +25 -0
- package/entities/PullRequestIterationChanges/schema.json +19 -0
- package/entities/PullRequestIterationStatuses/action.json +106 -0
- package/entities/PullRequestIterationStatuses/mockdatafiles/pullRequestIterationStatusesList-default.json +71 -0
- package/entities/PullRequestIterationStatuses/schema.json +23 -0
- package/entities/PullRequestIterations/action.json +46 -0
- package/entities/PullRequestIterations/mockdatafiles/pullRequestIterationsList-default.json +2403 -0
- package/entities/PullRequestIterations/schema.json +20 -0
- package/entities/PullRequestLabels/action.json +86 -0
- package/entities/PullRequestLabels/mockdatafiles/pullRequestLabelsList-default.json +20 -0
- package/entities/PullRequestLabels/schema.json +22 -0
- package/entities/PullRequestProperties/action.json +45 -0
- package/entities/PullRequestProperties/schema.json +20 -0
- package/entities/PullRequestQuery/action.json +24 -0
- package/entities/PullRequestQuery/schema.json +19 -0
- package/entities/PullRequestReviewers/action.json +166 -0
- package/entities/PullRequestReviewers/mockdatafiles/pullRequestReviewersCreatePullRequestReviewers-default.json +10 -0
- package/entities/PullRequestReviewers/mockdatafiles/pullRequestReviewersList-default.json +10 -0
- package/entities/PullRequestReviewers/schema.json +26 -0
- package/entities/PullRequestShare/action.json +24 -0
- package/entities/PullRequestShare/schema.json +19 -0
- package/entities/PullRequestStatuses/action.json +106 -0
- package/entities/PullRequestStatuses/mockdatafiles/pullRequestStatusesList-default.json +48 -0
- package/entities/PullRequestStatuses/schema.json +23 -0
- package/entities/PullRequestThreadComments/action.json +106 -0
- package/entities/PullRequestThreadComments/mockdatafiles/pullRequestThreadCommentsList-default.json +215 -0
- package/entities/PullRequestThreadComments/schema.json +23 -0
- package/entities/PullRequestThreads/action.json +86 -0
- package/entities/PullRequestThreads/mockdatafiles/pullRequestThreadsList-default.json +395 -0
- package/entities/PullRequestThreads/schema.json +22 -0
- package/entities/PullRequestWorkItems/action.json +25 -0
- package/entities/PullRequestWorkItems/mockdatafiles/pullRequestWorkItemsList-default.json +18 -0
- package/entities/PullRequestWorkItems/schema.json +19 -0
- package/entities/PullRequests/action.json +128 -0
- package/entities/PullRequests/mockdatafiles/pullRequestsGetPullRequests-default.json +6555 -0
- package/entities/PullRequests/mockdatafiles/pullRequestsGetPullRequestsByProject-default.json +5929 -0
- package/entities/PullRequests/schema.json +24 -0
- package/entities/Pushes/action.json +66 -0
- package/entities/Pushes/mockdatafiles/pushesList-default.json +34 -0
- package/entities/Pushes/schema.json +21 -0
- package/entities/Refs/action.json +65 -0
- package/entities/Refs/mockdatafiles/refsList-default.json +500 -0
- package/entities/Refs/mockdatafiles/refsUpdateRefs-default.json +13 -0
- package/entities/Refs/schema.json +21 -0
- package/entities/RefsFavorites/action.json +86 -0
- package/entities/RefsFavorites/mockdatafiles/refsFavoritesList-default.json +35 -0
- package/entities/RefsFavorites/schema.json +22 -0
- package/entities/Repositories/action.json +188 -0
- package/entities/Repositories/mockdatafiles/repositoriesGetDeletedRepositories-default.json +54 -0
- package/entities/Repositories/mockdatafiles/repositoriesGetRecycleBinRepositories-default.json +28 -0
- package/entities/Repositories/mockdatafiles/repositoriesList-default.json +123 -0
- package/entities/Repositories/schema.json +27 -0
- package/entities/Reverts/action.json +66 -0
- package/entities/Reverts/schema.json +21 -0
- package/entities/Stats/action.json +25 -0
- package/entities/Stats/mockdatafiles/statsList-default.json +195 -0
- package/entities/Stats/schema.json +19 -0
- package/entities/Statuses/action.json +45 -0
- package/entities/Statuses/mockdatafiles/statusesList-default.json +94 -0
- package/entities/Statuses/schema.json +20 -0
- package/entities/Suggestions/action.json +25 -0
- package/entities/Suggestions/mockdatafiles/suggestionsList-default.json +14 -0
- package/entities/Suggestions/schema.json +19 -0
- package/entities/Trees/action.json +25 -0
- package/entities/Trees/schema.json +19 -0
- package/error.json +6 -0
- package/package.json +5 -3
- package/previousVersion.zip +0 -0
- package/pronghorn.json +49635 -378
- package/propertiesDecorators.json +14 -0
- package/propertiesSchema.json +421 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +10 -0
- package/report/updateReport1653439219306.json +120 -0
- package/sampleProperties.json +90 -1
- package/test/integration/adapterTestBasicGet.js +1 -1
- package/test/integration/adapterTestIntegration.js +4869 -105
- package/test/unit/adapterBaseTestUnit.js +30 -25
- package/test/unit/adapterTestUnit.js +11057 -159
- package/utils/adapterInfo.js +206 -0
- package/utils/entitiesToDB.js +12 -57
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/pre-commit.sh +3 -0
- package/utils/tbScript.js +35 -20
- package/utils/tbUtils.js +59 -35
- package/utils/testRunner.js +16 -16
- package/versions.json +135 -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/entitiesToDB.js
CHANGED
|
@@ -14,10 +14,8 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const fs = require('fs');
|
|
17
|
-
const { MongoClient } = require('mongodb');
|
|
18
17
|
const path = require('path');
|
|
19
|
-
|
|
20
|
-
// const { string } = require('yargs');
|
|
18
|
+
const utils = require('./tbUtils');
|
|
21
19
|
|
|
22
20
|
// get the pronghorn database information
|
|
23
21
|
const getPronghornProps = async (iapDir) => {
|
|
@@ -99,7 +97,7 @@ const optionsHandler = (options) => {
|
|
|
99
97
|
/**
|
|
100
98
|
* Function used to put the adapter configuration into the provided database
|
|
101
99
|
*/
|
|
102
|
-
const moveEntitiesToDB = (targetPath, options) => {
|
|
100
|
+
const moveEntitiesToDB = async (targetPath, options) => {
|
|
103
101
|
// set local variables
|
|
104
102
|
let myOpts = options;
|
|
105
103
|
let myPath = targetPath;
|
|
@@ -120,25 +118,7 @@ const moveEntitiesToDB = (targetPath, options) => {
|
|
|
120
118
|
}
|
|
121
119
|
|
|
122
120
|
// get the pronghorn database properties
|
|
123
|
-
optionsHandler(options).then((currentProps) => {
|
|
124
|
-
let mongoUrl;
|
|
125
|
-
let dbName;
|
|
126
|
-
|
|
127
|
-
// find the mongo properties so we can connect
|
|
128
|
-
if (currentProps.mongoProps) {
|
|
129
|
-
mongoUrl = currentProps.mongoProps.url;
|
|
130
|
-
dbName = currentProps.mongoProps.db;
|
|
131
|
-
} else if (currentProps.mongo) {
|
|
132
|
-
if (currentProps.mongo.url) {
|
|
133
|
-
mongoUrl = currentProps.mongo.url;
|
|
134
|
-
} else {
|
|
135
|
-
mongoUrl = `mongodb://${currentProps.mongo.host}:${currentProps.mongo.port}`;
|
|
136
|
-
}
|
|
137
|
-
dbName = currentProps.mongo.database;
|
|
138
|
-
} else {
|
|
139
|
-
throw new Error('Mongo properties are not specified in adapter preferences!');
|
|
140
|
-
}
|
|
141
|
-
|
|
121
|
+
return optionsHandler(options).then(async (currentProps) => {
|
|
142
122
|
// Check valid filepath provided
|
|
143
123
|
if (!myPath) {
|
|
144
124
|
// if no path use the current directory without the utils
|
|
@@ -184,41 +164,16 @@ const moveEntitiesToDB = (targetPath, options) => {
|
|
|
184
164
|
});
|
|
185
165
|
|
|
186
166
|
// Upload documents to db collection
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
collection.insertMany(docs, { checkKeys: false }, (error, res) => {
|
|
197
|
-
if (error) {
|
|
198
|
-
log.error(JSON.stringify(error));
|
|
199
|
-
throw error;
|
|
200
|
-
}
|
|
201
|
-
// log the insertion, close the database and return
|
|
202
|
-
log.debug(`Inserted ${docs.length} documents to ${dbName}.${myOpts.targetCollection} with response ${JSON.stringify(res)}`);
|
|
203
|
-
db.close();
|
|
204
|
-
return res;
|
|
205
|
-
});
|
|
206
|
-
});
|
|
167
|
+
const iapDir = utils.getIAPHome();
|
|
168
|
+
const db = await utils.connect(iapDir, currentProps).catch((err) => { console.error(err); throw err; });
|
|
169
|
+
if (!db) {
|
|
170
|
+
console.error('Error occured when connectiong to database', currentProps);
|
|
171
|
+
throw new Error('Database not found');
|
|
172
|
+
}
|
|
173
|
+
const collection = db.collection(myOpts.targetCollection);
|
|
174
|
+
const res = await collection.insertMany(docs, { checkKeys: false }).catch((err) => { console.error(err); throw err; });
|
|
175
|
+
return res;
|
|
207
176
|
});
|
|
208
177
|
};
|
|
209
178
|
|
|
210
|
-
// const args = process.argv.slice(2);
|
|
211
|
-
|
|
212
|
-
// throw new SyntaxError(args[0]);
|
|
213
|
-
|
|
214
|
-
// if (args.length === 0) {
|
|
215
|
-
// console.error('ERROR: target path not specified!');
|
|
216
|
-
// } else if (args[0] === 'help') {
|
|
217
|
-
// log.trace('node ./entitiesToDB <target path> <options object: {iapDir: string, pronghornProps: string, targetCollection: string}>');
|
|
218
|
-
// } else if (args.length === 1) {
|
|
219
|
-
// console.error('ERROR: IAP directory not specified');
|
|
220
|
-
// } else {
|
|
221
|
-
// moveEntitiesToDB(args[0], args[1]);
|
|
222
|
-
// }
|
|
223
|
-
|
|
224
179
|
module.exports = { moveEntitiesToDB };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const semverSatisfies = require('semver/functions/satisfies');
|
|
3
|
+
const packageJson = require('../package.json');
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
// pattern supplied by semver.org via https://regex101.com/r/vkijKf/1/ but removed gm from end to only match a single semver
|
|
7
|
+
// const semverPat = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
8
|
+
// pattern supplied by semver.org via https://regex101.com/r/Ly7O1x/3/ with following changes
|
|
9
|
+
// removed P's from before capturing group names and
|
|
10
|
+
// removed gm from end to only match a single semver
|
|
11
|
+
// const semverPat = /^(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
12
|
+
|
|
13
|
+
const patches = (fs.existsSync('./patches')) ? fs.readdirSync('./patches', { withFileTypes: true }) : [];
|
|
14
|
+
if (!patches.length) {
|
|
15
|
+
console.error('\nno patches - nothing to do\n');
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const dependencies = packageJson.dependencies || {};
|
|
20
|
+
if (!Object.keys(dependencies).length) {
|
|
21
|
+
console.error('\nno dependencies - nothing to do\n');
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let changed = false;
|
|
26
|
+
console.error('\nprocessing patches');
|
|
27
|
+
const bundledDependencies = packageJson.bundledDependencies || packageJson.bundleDependencies || [];
|
|
28
|
+
|
|
29
|
+
patches.forEach((patch) => {
|
|
30
|
+
if (!patch.isFile()) {
|
|
31
|
+
console.error(`${patch.name} skipped, is not a regular file`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (!patch.name.endsWith('.patch')) {
|
|
35
|
+
console.error(`${patch.name} skipped, does not end with .patch`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const splits = patch.name.slice(0, -6).split('+');
|
|
39
|
+
if (splits.length > 4) {
|
|
40
|
+
console.error(`${patch.name} skipped, does not follow the naming convention (cannot use '+' other than to separate scope/package/semver and at most once within semver)`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const scope = splits[0][0] === '@' ? splits.shift() : null;
|
|
44
|
+
const packageName = splits.shift();
|
|
45
|
+
const semver = splits.join('+');
|
|
46
|
+
// const { groups } = semver.match(semverPat);
|
|
47
|
+
const file = scope ? `${scope}/${packageName}` : packageName;
|
|
48
|
+
if (dependencies[file] && semverSatisfies(semver, dependencies[file])) {
|
|
49
|
+
if (!bundledDependencies.includes(file)) {
|
|
50
|
+
bundledDependencies.push(file);
|
|
51
|
+
console.error(`added ${file} to bundledDependencies`);
|
|
52
|
+
changed = true;
|
|
53
|
+
} else {
|
|
54
|
+
console.error(`bundledDependencies already has ${file}`);
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
const depmsg = dependencies[file] ? `version mismatch (${dependencies[file]}) in dependencies` : 'not found in dependencies';
|
|
58
|
+
console.error(`patch ${patch.name} ${depmsg}`);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (!packageJson.bundledDependencies && bundledDependencies.length) {
|
|
63
|
+
delete packageJson.bundleDependencies;
|
|
64
|
+
packageJson.bundledDependencies = bundledDependencies;
|
|
65
|
+
console.error('renaming bundleDependencies to bundledDependencies');
|
|
66
|
+
changed = true;
|
|
67
|
+
}
|
|
68
|
+
if (changed) {
|
|
69
|
+
fs.writeFileSync('./package.json.new', JSON.stringify(packageJson, null, 2));
|
|
70
|
+
console.error('wrote package.json.new');
|
|
71
|
+
fs.renameSync('./package.json', './package.json.old');
|
|
72
|
+
console.error('moved package.json to package.json.old');
|
|
73
|
+
fs.renameSync('./package.json.new', './package.json');
|
|
74
|
+
console.error('moved package.json.new to package.json');
|
|
75
|
+
} else {
|
|
76
|
+
console.error('no changes\n');
|
|
77
|
+
process.exitCode = 1;
|
|
78
|
+
}
|
|
79
|
+
} catch (e) {
|
|
80
|
+
if (e) {
|
|
81
|
+
// caught error, exit with status 2 to signify abject failure
|
|
82
|
+
console.error(`\ncaught exception - ${e}\n`);
|
|
83
|
+
process.exitCode = 2;
|
|
84
|
+
} else {
|
|
85
|
+
// caught false, exit with status 1 to signify nothing done
|
|
86
|
+
process.exitCode = 1;
|
|
87
|
+
}
|
|
88
|
+
} finally {
|
|
89
|
+
console.error('done\n');
|
|
90
|
+
}
|
package/utils/pre-commit.sh
CHANGED
|
@@ -17,6 +17,9 @@ printf "%b" "Running pre-commit hooks...\\n"
|
|
|
17
17
|
# verify testing script is stubbed and no credentials
|
|
18
18
|
node utils/testRunner.js -r
|
|
19
19
|
|
|
20
|
+
# update the adapter information file
|
|
21
|
+
node utils/adapterInfo.js
|
|
22
|
+
|
|
20
23
|
# security audit on the code
|
|
21
24
|
npm audit --registry=https://registry.npmjs.org --audit-level=moderate
|
|
22
25
|
|
package/utils/tbScript.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* eslint no-console
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
2
|
/* eslint import/no-unresolved: warn */
|
|
3
3
|
/* eslint global-require: warn */
|
|
4
4
|
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
/* eslint import/no-extraneous-dependencies: warn */
|
|
8
8
|
/* eslint import/no-dynamic-require: warn */
|
|
9
9
|
|
|
10
|
-
const path = require('path');
|
|
11
10
|
const program = require('commander');
|
|
12
11
|
const rls = require('readline-sync');
|
|
13
12
|
const utils = require('./tbUtils');
|
|
@@ -19,32 +18,39 @@ const { addAuthInfo } = require('./addAuth');
|
|
|
19
18
|
|
|
20
19
|
const { troubleshoot, offline } = require('./troubleshootingAdapter');
|
|
21
20
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
console.
|
|
28
|
-
|
|
29
|
-
}
|
|
21
|
+
const executeInStandaloneMode = async (command) => {
|
|
22
|
+
console.info('\n> Executing the script outside of IAP installation directory');
|
|
23
|
+
console.info('> Using sampleProperties.json configuration');
|
|
24
|
+
switch (command) {
|
|
25
|
+
case 'install': {
|
|
26
|
+
console.error('Not currently in IAP directory - installation not possible');
|
|
27
|
+
break;
|
|
28
|
+
}
|
|
29
|
+
case 'connectivity': {
|
|
30
30
|
const { host } = sampleProperties.properties;
|
|
31
31
|
console.log(`perform networking diagnositics to ${host}`);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
32
|
+
utils.runConnectivity(host);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
case 'healthcheck': {
|
|
35
36
|
const a = basicGet.getAdapterInstance({ properties: sampleProperties });
|
|
36
37
|
await utils.healthCheck(a);
|
|
37
|
-
|
|
38
|
-
} else if (command === 'basicget') {
|
|
39
|
-
await utils.runBasicGet();
|
|
40
|
-
process.exit(0);
|
|
38
|
+
break;
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
case 'basicget': {
|
|
41
|
+
utils.runBasicGet();
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
default: {
|
|
45
|
+
if (rls.keyInYN('Troubleshooting without IAP?')) {
|
|
46
|
+
await offline();
|
|
47
|
+
}
|
|
44
48
|
}
|
|
45
|
-
process.exit(0);
|
|
46
49
|
}
|
|
50
|
+
process.exit(0);
|
|
51
|
+
};
|
|
47
52
|
|
|
53
|
+
const executeUnderIAPInstallationDirectory = async (command) => {
|
|
48
54
|
if (command === undefined) {
|
|
49
55
|
await troubleshoot({}, true, true);
|
|
50
56
|
} else if (command === 'install') {
|
|
@@ -79,6 +85,7 @@ const main = async (command) => {
|
|
|
79
85
|
process.exit(0);
|
|
80
86
|
}
|
|
81
87
|
} else {
|
|
88
|
+
const dirname = utils.getCurrentExecutionPath();
|
|
82
89
|
utils.verifyInstallationDir(dirname, name);
|
|
83
90
|
utils.runTest();
|
|
84
91
|
if (rls.keyInYN(`Do you want to install ${name} to IAP?`)) {
|
|
@@ -123,6 +130,14 @@ const main = async (command) => {
|
|
|
123
130
|
}
|
|
124
131
|
};
|
|
125
132
|
|
|
133
|
+
const main = async (command) => {
|
|
134
|
+
if (!utils.areWeUnderIAPinstallationDirectory()) {
|
|
135
|
+
executeInStandaloneMode(command); // configuration from sampleproperties.json
|
|
136
|
+
} else {
|
|
137
|
+
executeUnderIAPInstallationDirectory(command); // configuration from $IAP_HOME/properties.json
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
126
141
|
program
|
|
127
142
|
.command('connectivity')
|
|
128
143
|
.alias('c')
|
package/utils/tbUtils.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint import/no-extraneous-dependencies: warn */
|
|
4
4
|
/* eslint global-require: warn */
|
|
5
5
|
/* eslint import/no-dynamic-require: warn */
|
|
6
|
+
/* eslint-disable no-console */
|
|
6
7
|
|
|
7
8
|
const path = require('path');
|
|
8
9
|
const fs = require('fs-extra');
|
|
@@ -100,8 +101,8 @@ module.exports = {
|
|
|
100
101
|
*
|
|
101
102
|
* @function decryptProperties
|
|
102
103
|
*/
|
|
103
|
-
decryptProperties: (props,
|
|
104
|
-
const propertyEncryptionClassPath = path.join(
|
|
104
|
+
decryptProperties: (props, iapDir, discovery) => {
|
|
105
|
+
const propertyEncryptionClassPath = path.join(iapDir, 'node_modules/@itential/pronghorn-core/core/PropertyEncryption.js');
|
|
105
106
|
const isEncrypted = props.pathProps.encrypted;
|
|
106
107
|
const PropertyEncryption = discovery.require(propertyEncryptionClassPath, isEncrypted);
|
|
107
108
|
const propertyEncryption = new PropertyEncryption({
|
|
@@ -177,12 +178,12 @@ module.exports = {
|
|
|
177
178
|
verifyInstallationDir: (dirname, name) => {
|
|
178
179
|
const pathArray = dirname.split(path.sep);
|
|
179
180
|
const expectedPath = `node_modules/${name}`;
|
|
180
|
-
const currentPath = pathArray.slice(pathArray.length -
|
|
181
|
+
const currentPath = pathArray.slice(pathArray.length - 3, pathArray.length).join('/');
|
|
181
182
|
if (currentPath.trim() !== expectedPath.trim()) {
|
|
182
|
-
throw new Error(`adapter should be installed under ${expectedPath}`);
|
|
183
|
+
throw new Error(`adapter should be installed under ${expectedPath} but is installed under ${currentPath}`);
|
|
183
184
|
}
|
|
184
185
|
|
|
185
|
-
const serverFile = path.join(dirname, '
|
|
186
|
+
const serverFile = path.join(dirname, '../../../', 'server.js');
|
|
186
187
|
if (!fs.existsSync(serverFile)) {
|
|
187
188
|
throw new Error(`adapter should be installed under IAP/${expectedPath}`);
|
|
188
189
|
}
|
|
@@ -305,9 +306,9 @@ module.exports = {
|
|
|
305
306
|
* @param {Object} sampleProperties - './sampleProperties.json' in adapter dir
|
|
306
307
|
*/
|
|
307
308
|
createAdapter: function createAdapter(pronghornProps, profileItem, sampleProperties, adapterPronghorn) {
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const info = JSON.parse(fs.readFileSync(
|
|
309
|
+
const iapDir = this.getIAPHome();
|
|
310
|
+
const packageFile = path.join(iapDir, 'package.json');
|
|
311
|
+
const info = JSON.parse(fs.readFileSync(packageFile));
|
|
311
312
|
const version = parseInt(info.version.split('.')[0], 10);
|
|
312
313
|
|
|
313
314
|
let adapter = {};
|
|
@@ -345,17 +346,17 @@ module.exports = {
|
|
|
345
346
|
console.log('Decrypting properties...');
|
|
346
347
|
const { Discovery } = require(path.join(iapDir, 'node_modules/@itential/itential-utils'));
|
|
347
348
|
const discovery = new Discovery();
|
|
348
|
-
const pronghornProps = this.decryptProperties(rawProps,
|
|
349
|
+
const pronghornProps = this.decryptProperties(rawProps, iapDir, discovery);
|
|
349
350
|
console.log('Found properties.\n');
|
|
350
351
|
return pronghornProps;
|
|
351
352
|
},
|
|
352
353
|
|
|
353
354
|
// get database connection and existing adapter config
|
|
354
355
|
getAdapterConfig: async function getAdapterConfig() {
|
|
355
|
-
const iapDir =
|
|
356
|
+
const iapDir = this.getIAPHome();
|
|
356
357
|
const pronghornProps = this.getPronghornProps(iapDir);
|
|
357
358
|
console.log('Connecting to Database...');
|
|
358
|
-
const database = await this.connect(pronghornProps);
|
|
359
|
+
const database = await this.connect(iapDir, pronghornProps);
|
|
359
360
|
console.log('Connection established.');
|
|
360
361
|
const { name } = require(path.join(__dirname, '..', 'package.json'));
|
|
361
362
|
const serviceItem = await database.collection(this.SERVICE_CONFIGS_COLLECTION).findOne(
|
|
@@ -399,33 +400,42 @@ module.exports = {
|
|
|
399
400
|
},
|
|
400
401
|
|
|
401
402
|
/**
|
|
402
|
-
* @summary
|
|
403
|
-
*
|
|
404
|
-
* @
|
|
405
|
-
* @
|
|
403
|
+
* @summary Obtain the IAP installation directory depending on how adapter is used:
|
|
404
|
+
* by IAP, or by npm run CLI interface
|
|
405
|
+
* @returns IAP installation directory or null if adapter running without IAP
|
|
406
|
+
* @function getIAPHome
|
|
406
407
|
*/
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
408
|
+
getIAPHome: function getIAPHome() {
|
|
409
|
+
let IAPHomePath = null;
|
|
410
|
+
// check if adapter started via IAP, use path injected by core
|
|
411
|
+
if (process.env.iap_home) IAPHomePath = process.env.iap_home;
|
|
412
|
+
// check if adapter started via CLI `npm run <command>` so we have to be located under
|
|
413
|
+
// <IAP_HOME>/node_modules/@itentialopensource/<adapter_name>/ directory
|
|
414
|
+
const currentExecutionPath = this.getCurrentExecutionPath();
|
|
415
|
+
if (currentExecutionPath.indexOf('/node_modules') >= 0) {
|
|
416
|
+
[IAPHomePath] = currentExecutionPath.split('/node_modules');
|
|
413
417
|
}
|
|
418
|
+
return IAPHomePath;
|
|
414
419
|
},
|
|
415
420
|
|
|
416
421
|
/**
|
|
417
|
-
* @summary
|
|
418
|
-
*
|
|
419
|
-
* @returns
|
|
420
|
-
*
|
|
421
|
-
* @function getDirname
|
|
422
|
+
* @summary get current execution path without resolving symbolic links,
|
|
423
|
+
* use `pwd` command wihout '-P' option (resolving symlinks) https://linux.die.net/man/1/pwd
|
|
424
|
+
* @returns
|
|
425
|
+
* @function getCurrentExecutionPAth
|
|
422
426
|
*/
|
|
423
|
-
|
|
424
|
-
if (this.withinIAP(path.join(__dirname, '../../../../'))) {
|
|
425
|
-
return __dirname;
|
|
426
|
-
}
|
|
427
|
+
getCurrentExecutionPath: function getCurrentExecutionPAth() {
|
|
427
428
|
const { stdout } = this.systemSync('pwd', true);
|
|
428
|
-
return
|
|
429
|
+
return stdout.trim();
|
|
430
|
+
},
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @summary checks if command executed from <IAP_HOME>/node_modules/@itentialopensource/<adapter_name>/ location
|
|
434
|
+
* @returns true if command executed under <IAP_HOME>/node_modules/@itentialopensource/<adapter_name>/ path
|
|
435
|
+
* @function areWeUnderIAPinstallationDirectory
|
|
436
|
+
*/
|
|
437
|
+
areWeUnderIAPinstallationDirectory: function areWeUnderIAPinstallationDirectory() {
|
|
438
|
+
return path.join(this.getCurrentExecutionPath(), '../../..') === this.getIAPHome();
|
|
429
439
|
},
|
|
430
440
|
|
|
431
441
|
/**
|
|
@@ -434,10 +444,24 @@ module.exports = {
|
|
|
434
444
|
* @function connect
|
|
435
445
|
* @param {Object} properties - pronghornProps
|
|
436
446
|
*/
|
|
437
|
-
connect: async function connect(properties) {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
447
|
+
connect: async function connect(iapDir, properties) {
|
|
448
|
+
let dbConnectionProperties = {};
|
|
449
|
+
if (properties.mongoProps) {
|
|
450
|
+
dbConnectionProperties = properties.mongoProps;
|
|
451
|
+
} else if (properties.mongo) {
|
|
452
|
+
if (properties.mongo.url) {
|
|
453
|
+
dbConnectionProperties.url = properties.mongo.url;
|
|
454
|
+
} else {
|
|
455
|
+
dbConnectionProperties.url = `mongodb://${properties.mongo.host}:${properties.mongo.port}`;
|
|
456
|
+
}
|
|
457
|
+
dbConnectionProperties.db = properties.mongo.database;
|
|
458
|
+
}
|
|
459
|
+
if (!dbConnectionProperties.url || !dbConnectionProperties.db) {
|
|
460
|
+
throw new Error('Mongo properties are not specified in IAP configuration!');
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const { MongoDBConnection } = require(path.join(iapDir, 'node_modules/@itential/database'));
|
|
464
|
+
const connection = new MongoDBConnection(dbConnectionProperties);
|
|
441
465
|
const database = await connection.connect(true);
|
|
442
466
|
return database;
|
|
443
467
|
}
|