@autofleet/rabbit 1.4.0 → 1.4.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/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +158 -0
- package/.idea/modules.xml +8 -0
- package/.idea/rabbit.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +92 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -0
- package/package.json +2 -2
- package/src/index.ts +17 -3
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
|
2
|
+
<profile version="1.0">
|
|
3
|
+
<option name="myName" value="Project Default" />
|
|
4
|
+
<inspection_tool class="AmdModulesDependencies" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
5
|
+
<inspection_tool class="BadExpressionStatementJS" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
6
|
+
<inspection_tool class="CallerJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
7
|
+
<inspection_tool class="CommaExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
8
|
+
<inspection_tool class="ConstantConditionalExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
9
|
+
<inspection_tool class="ContinueOrBreakFromFinallyBlockJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
10
|
+
<inspection_tool class="ES6AwaitOutsideAsyncFunction" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
11
|
+
<inspection_tool class="ES6BindWithArrowFunction" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
12
|
+
<inspection_tool class="ES6CheckImport" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
13
|
+
<inspection_tool class="ES6ClassMemberInitializationOrder" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
14
|
+
<inspection_tool class="ES6ConvertLetToConst" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
15
|
+
<inspection_tool class="ES6ConvertModuleExportToExport" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
16
|
+
<inspection_tool class="ES6ConvertRequireIntoImport" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
17
|
+
<inspection_tool class="ES6ConvertToForOf" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
18
|
+
<inspection_tool class="ES6ConvertVarToLetConst" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
19
|
+
<inspection_tool class="ES6DestructuringVariablesMerge" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
20
|
+
<inspection_tool class="ES6MissingAwait" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
21
|
+
<inspection_tool class="ES6ModulesDependencies" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
22
|
+
<inspection_tool class="ES6PossiblyAsyncFunction" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
23
|
+
<inspection_tool class="ES6PreferShortImport" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
24
|
+
<inspection_tool class="ES6RedundantAwait" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
25
|
+
<inspection_tool class="ES6RedundantNestingInTemplateLiteral" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
26
|
+
<inspection_tool class="ES6ShorthandObjectProperty" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
27
|
+
<inspection_tool class="ES6UnusedImports" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
28
|
+
<inspection_tool class="EmptyStatementBodyJS" enabled="false" level="WARNING" enabled_by_default="false">
|
|
29
|
+
<option name="m_reportEmptyBlocks" value="false" />
|
|
30
|
+
</inspection_tool>
|
|
31
|
+
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
|
|
32
|
+
<inspection_tool class="ExceptionCaughtLocallyJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
33
|
+
<inspection_tool class="FallThroughInSwitchStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
34
|
+
<inspection_tool class="FlowJSConfig" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
35
|
+
<inspection_tool class="FlowJSFlagCommentPlacement" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
36
|
+
<inspection_tool class="IncompatibleMaskJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
37
|
+
<inspection_tool class="InfiniteLoopJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
38
|
+
<inspection_tool class="InfiniteRecursionJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
39
|
+
<inspection_tool class="JSAccessibilityCheck" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
40
|
+
<inspection_tool class="JSAnnotator" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
41
|
+
<inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
42
|
+
<inspection_tool class="JSAssignmentUsedAsCondition" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
43
|
+
<inspection_tool class="JSBitwiseOperatorUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
44
|
+
<inspection_tool class="JSCheckFunctionSignatures" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
45
|
+
<inspection_tool class="JSClosureCompilerSyntax" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
46
|
+
<inspection_tool class="JSCommentMatchesSignature" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
47
|
+
<inspection_tool class="JSComparisonWithNaN" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
48
|
+
<inspection_tool class="JSConsecutiveCommasInArrayLiteral" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
49
|
+
<inspection_tool class="JSConstantReassignment" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
50
|
+
<inspection_tool class="JSDeprecatedSymbols" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
51
|
+
<inspection_tool class="JSDuplicateCaseLabel" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
52
|
+
<inspection_tool class="JSDuplicatedDeclaration" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
53
|
+
<inspection_tool class="JSEqualityComparisonWithCoercion" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
54
|
+
<inspection_tool class="JSFileReferences" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
55
|
+
<inspection_tool class="JSFunctionExpressionToArrowFunction" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
56
|
+
<inspection_tool class="JSIgnoredPromiseFromCall" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
57
|
+
<inspection_tool class="JSIncompatibleTypesComparison" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
58
|
+
<inspection_tool class="JSJQueryEfficiency" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
59
|
+
<inspection_tool class="JSJoinVariableDeclarationAndAssignment" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
60
|
+
<inspection_tool class="JSLastCommaInArrayLiteral" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
61
|
+
<inspection_tool class="JSLastCommaInObjectLiteral" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
62
|
+
<inspection_tool class="JSMethodCanBeStatic" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
63
|
+
<inspection_tool class="JSMismatchedCollectionQueryUpdate" enabled="false" level="WARNING" enabled_by_default="false">
|
|
64
|
+
<option name="queries" value="trace,write,forEach,length,size" />
|
|
65
|
+
<option name="updates" value="pop,push,shift,splice,unshift,add,insert,remove,reverse,copyWithin,fill,sort" />
|
|
66
|
+
</inspection_tool>
|
|
67
|
+
<inspection_tool class="JSMissingSwitchBranches" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
68
|
+
<inspection_tool class="JSMissingSwitchDefault" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
69
|
+
<inspection_tool class="JSNonASCIINames" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
70
|
+
<inspection_tool class="JSObjectNullOrUndefined" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
71
|
+
<inspection_tool class="JSObsoletePrivateAccessSyntax" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
72
|
+
<inspection_tool class="JSOctalInteger" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
73
|
+
<inspection_tool class="JSPotentiallyInvalidConstructorUsage" enabled="false" level="WARNING" enabled_by_default="false">
|
|
74
|
+
<option name="myConsiderUppercaseFunctionsToBeConstructors" value="true" />
|
|
75
|
+
</inspection_tool>
|
|
76
|
+
<inspection_tool class="JSPotentiallyInvalidTargetOfIndexedPropertyAccess" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
77
|
+
<inspection_tool class="JSPotentiallyInvalidUsageOfClassThis" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
78
|
+
<inspection_tool class="JSPotentiallyInvalidUsageOfThis" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
79
|
+
<inspection_tool class="JSPrimitiveTypeWrapperUsage" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
80
|
+
<inspection_tool class="JSRedundantSwitchStatement" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
81
|
+
<inspection_tool class="JSReferencingArgumentsOutsideOfFunction" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
82
|
+
<inspection_tool class="JSReferencingMutableVariableFromClosure" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
83
|
+
<inspection_tool class="JSRemoveUnnecessaryParentheses" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
84
|
+
<inspection_tool class="JSStringConcatenationToES6Template" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
85
|
+
<inspection_tool class="JSSuspiciousEqPlus" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
86
|
+
<inspection_tool class="JSSuspiciousNameCombination" enabled="false" level="WARNING" enabled_by_default="false">
|
|
87
|
+
<group names="x,width,left,right" />
|
|
88
|
+
<group names="y,height,top,bottom" />
|
|
89
|
+
<exclude classes="Math" />
|
|
90
|
+
</inspection_tool>
|
|
91
|
+
<inspection_tool class="JSSwitchVariableDeclarationIssue" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
92
|
+
<inspection_tool class="JSTestFailedLine" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
93
|
+
<inspection_tool class="JSTypeOfValues" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
94
|
+
<inspection_tool class="JSUndeclaredVariable" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
95
|
+
<inspection_tool class="JSUndefinedPropertyAssignment" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
96
|
+
<inspection_tool class="JSUnfilteredForInLoop" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
97
|
+
<inspection_tool class="JSUnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
98
|
+
<inspection_tool class="JSUnreachableSwitchBranches" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
99
|
+
<inspection_tool class="JSUnresolvedExtXType" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
100
|
+
<inspection_tool class="JSUnresolvedFunction" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
101
|
+
<inspection_tool class="JSUnresolvedLibraryURL" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
102
|
+
<inspection_tool class="JSUnresolvedVariable" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
103
|
+
<inspection_tool class="JSUnusedAssignment" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
104
|
+
<inspection_tool class="JSUnusedGlobalSymbols" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
105
|
+
<inspection_tool class="JSUnusedLocalSymbols" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
106
|
+
<inspection_tool class="JSValidateJSDoc" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
107
|
+
<inspection_tool class="JSValidateTypes" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
108
|
+
<inspection_tool class="JSXNamespaceValidation" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
109
|
+
<inspection_tool class="KarmaConfigFile" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
110
|
+
<inspection_tool class="LoopStatementThatDoesntLoopJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
111
|
+
<inspection_tool class="NodeCoreCodingAssistance" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
112
|
+
<inspection_tool class="NodeModulesDependencies" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
113
|
+
<inspection_tool class="NpmUsedModulesInstalled" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
114
|
+
<inspection_tool class="PackageJsonMismatchedDependency" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
115
|
+
<inspection_tool class="PointlessArithmeticExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
116
|
+
<inspection_tool class="PointlessBooleanExpressionJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
117
|
+
<inspection_tool class="ReservedWordUsedAsNameJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
118
|
+
<inspection_tool class="ReturnFromFinallyBlockJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
119
|
+
<inspection_tool class="ShiftOutOfRangeJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
120
|
+
<inspection_tool class="SillyAssignmentJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
121
|
+
<inspection_tool class="SuspiciousTypeOfGuard" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
122
|
+
<inspection_tool class="ThisExpressionReferencesGlobalObjectJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
123
|
+
<inspection_tool class="ThrowFromFinallyBlockJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
124
|
+
<inspection_tool class="TrivialConditionalJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
125
|
+
<inspection_tool class="TrivialIfJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
126
|
+
<inspection_tool class="TypeScriptAbstractClassConstructorCanBeMadeProtected" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
127
|
+
<inspection_tool class="TypeScriptAccessibilityCheck" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
128
|
+
<inspection_tool class="TypeScriptCheckImport" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
129
|
+
<inspection_tool class="TypeScriptConfig" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
130
|
+
<inspection_tool class="TypeScriptDuplicateUnionOrIntersectionType" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
131
|
+
<inspection_tool class="TypeScriptExplicitMemberType" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
132
|
+
<inspection_tool class="TypeScriptFieldCanBeMadeReadonly" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
133
|
+
<inspection_tool class="TypeScriptLibrary" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
134
|
+
<inspection_tool class="TypeScriptMissingAugmentationImport" enabled="false" level="INFORMATION" enabled_by_default="false" />
|
|
135
|
+
<inspection_tool class="TypeScriptMissingConfigOption" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
136
|
+
<inspection_tool class="TypeScriptRedundantGenericType" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
137
|
+
<inspection_tool class="TypeScriptSmartCast" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
138
|
+
<inspection_tool class="TypeScriptSuspiciousConstructorParameterAssignment" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
139
|
+
<inspection_tool class="TypeScriptUMDGlobal" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
140
|
+
<inspection_tool class="TypeScriptUnresolvedFunction" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
141
|
+
<inspection_tool class="TypeScriptUnresolvedVariable" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
142
|
+
<inspection_tool class="TypeScriptValidateGenericTypes" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
143
|
+
<inspection_tool class="TypeScriptValidateJSTypes" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
|
144
|
+
<inspection_tool class="TypeScriptValidateTypes" enabled="false" level="ERROR" enabled_by_default="false" />
|
|
145
|
+
<inspection_tool class="UnnecessaryContinueJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
146
|
+
<inspection_tool class="UnnecessaryLabelJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
147
|
+
<inspection_tool class="UnnecessaryLabelOnBreakStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
148
|
+
<inspection_tool class="UnnecessaryLabelOnContinueStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
149
|
+
<inspection_tool class="UnnecessaryLocalVariableJS" enabled="false" level="WARNING" enabled_by_default="false">
|
|
150
|
+
<option name="m_ignoreImmediatelyReturnedVariables" value="false" />
|
|
151
|
+
<option name="m_ignoreAnnotatedVariables" value="false" />
|
|
152
|
+
</inspection_tool>
|
|
153
|
+
<inspection_tool class="UnnecessaryReturnJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
154
|
+
<inspection_tool class="UnreachableCodeJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
155
|
+
<inspection_tool class="WebpackConfigHighlighting" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
156
|
+
<inspection_tool class="WithStatementJS" enabled="false" level="WARNING" enabled_by_default="false" />
|
|
157
|
+
</profile>
|
|
158
|
+
</component>
|
package/.idea/rabbit.iml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
package/.idea/vcs.xml
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="AutoImportSettings">
|
|
4
|
+
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
|
+
</component>
|
|
6
|
+
<component name="ChangeListManager">
|
|
7
|
+
<list default="true" id="1723b515-3530-42bb-82ff-6779499ab47b" name="Default Changelist" comment="" />
|
|
8
|
+
<option name="SHOW_DIALOG" value="false" />
|
|
9
|
+
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
10
|
+
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
11
|
+
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
12
|
+
</component>
|
|
13
|
+
<component name="Git.Settings">
|
|
14
|
+
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
15
|
+
</component>
|
|
16
|
+
<component name="ProjectId" id="1kkbq4cPpgJtXBPfswsGj3HyZyE" />
|
|
17
|
+
<component name="ProjectViewState">
|
|
18
|
+
<option name="compactDirectories" value="true" />
|
|
19
|
+
<option name="hideEmptyMiddlePackages" value="true" />
|
|
20
|
+
<option name="showLibraryContents" value="true" />
|
|
21
|
+
<option name="showMembers" value="true" />
|
|
22
|
+
</component>
|
|
23
|
+
<component name="PropertiesComponent">
|
|
24
|
+
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
|
|
25
|
+
<property name="WebServerToolWindowFactoryState" value="false" />
|
|
26
|
+
<property name="editorconfig.notification" value="null" />
|
|
27
|
+
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
|
28
|
+
<property name="node.js.detected.package.eslint" value="true" />
|
|
29
|
+
<property name="node.js.path.for.package.eslint" value="project" />
|
|
30
|
+
<property name="node.js.selected.package.eslint" value="(autodetect)" />
|
|
31
|
+
<property name="nodejs_package_manager_path" value="npm" />
|
|
32
|
+
<property name="settings.editor.selected.configurable" value="preference.i18nPlugin" />
|
|
33
|
+
<property name="ts.external.directory.path" value="$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/jsLanguageServicesImpl/external" />
|
|
34
|
+
<property name="vue.rearranger.settings.migration" value="true" />
|
|
35
|
+
</component>
|
|
36
|
+
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
37
|
+
<component name="TaskManager">
|
|
38
|
+
<task active="true" id="Default" summary="Default task">
|
|
39
|
+
<changelist id="1723b515-3530-42bb-82ff-6779499ab47b" name="Default Changelist" comment="" />
|
|
40
|
+
<created>1606247725673</created>
|
|
41
|
+
<option name="number" value="Default" />
|
|
42
|
+
<option name="presentableId" value="Default" />
|
|
43
|
+
<updated>1606247725673</updated>
|
|
44
|
+
<workItem from="1606247727265" duration="11736000" />
|
|
45
|
+
</task>
|
|
46
|
+
<task id="LOCAL-00001" summary="validate name before usage">
|
|
47
|
+
<created>1606375684964</created>
|
|
48
|
+
<option name="number" value="00001" />
|
|
49
|
+
<option name="presentableId" value="LOCAL-00001" />
|
|
50
|
+
<option name="project" value="LOCAL" />
|
|
51
|
+
<updated>1606375684964</updated>
|
|
52
|
+
</task>
|
|
53
|
+
<option name="localTasksCounter" value="2" />
|
|
54
|
+
<servers />
|
|
55
|
+
</component>
|
|
56
|
+
<component name="TypeScriptGeneratedFilesManager">
|
|
57
|
+
<option name="version" value="3" />
|
|
58
|
+
</component>
|
|
59
|
+
<component name="Vcs.Log.Tabs.Properties">
|
|
60
|
+
<option name="TAB_STATES">
|
|
61
|
+
<map>
|
|
62
|
+
<entry key="MAIN">
|
|
63
|
+
<value>
|
|
64
|
+
<State />
|
|
65
|
+
</value>
|
|
66
|
+
</entry>
|
|
67
|
+
</map>
|
|
68
|
+
</option>
|
|
69
|
+
</component>
|
|
70
|
+
<component name="VcsManagerConfiguration">
|
|
71
|
+
<MESSAGE value="validate name before usage" />
|
|
72
|
+
<option name="LAST_COMMIT_MESSAGE" value="validate name before usage" />
|
|
73
|
+
</component>
|
|
74
|
+
<component name="WindowStateProjectService">
|
|
75
|
+
<state x="0" y="25" width="1792" height="1095" key="CommitChangelistDialog2" timestamp="1606375684235">
|
|
76
|
+
<screen x="0" y="25" width="1792" height="1095" />
|
|
77
|
+
</state>
|
|
78
|
+
<state x="0" y="25" width="1792" height="1095" key="CommitChangelistDialog2/0.25.1792.1095/1792.25.1920.1055@0.25.1792.1095" timestamp="1606375684235" />
|
|
79
|
+
<state x="100" y="125" width="1592" height="895" key="DiffContextDialog" timestamp="1606321283909">
|
|
80
|
+
<screen x="0" y="25" width="1792" height="1095" />
|
|
81
|
+
</state>
|
|
82
|
+
<state x="100" y="125" width="1592" height="895" key="DiffContextDialog/0.25.1792.1095/1792.25.1920.1055@0.25.1792.1095" timestamp="1606321283909" />
|
|
83
|
+
<state x="496" y="291" key="Vcs.Push.Dialog.v2" timestamp="1606375687293">
|
|
84
|
+
<screen x="0" y="25" width="1792" height="1095" />
|
|
85
|
+
</state>
|
|
86
|
+
<state x="496" y="291" key="Vcs.Push.Dialog.v2/0.25.1792.1095/1792.25.1920.1055@0.25.1792.1095" timestamp="1606375687293" />
|
|
87
|
+
<state x="561" y="269" width="670" height="676" key="search.everywhere.popup" timestamp="1606323061773">
|
|
88
|
+
<screen x="0" y="25" width="1792" height="1095" />
|
|
89
|
+
</state>
|
|
90
|
+
<state x="561" y="269" width="670" height="676" key="search.everywhere.popup/0.25.1792.1095/1792.25.1920.1055@0.25.1792.1095" timestamp="1606323061773" />
|
|
91
|
+
</component>
|
|
92
|
+
</project>
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const amqp_connection_manager_1 = require("amqp-connection-manager");
|
|
4
4
|
const events_1 = require("events");
|
|
5
|
+
class RabbitError extends Error {
|
|
6
|
+
}
|
|
5
7
|
const connectionCreatedConst = 'connectionCreated';
|
|
6
8
|
class RabbitMq {
|
|
7
9
|
constructor() {
|
|
@@ -39,6 +41,11 @@ class RabbitMq {
|
|
|
39
41
|
catch (e) { }
|
|
40
42
|
return Object.assign({}, msg, { content });
|
|
41
43
|
}
|
|
44
|
+
static validateName(type, name) {
|
|
45
|
+
if (!name || name === '') {
|
|
46
|
+
throw new RabbitError(`error while using ${type} with no name`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
42
49
|
async getConnection() {
|
|
43
50
|
return new Promise(async (resolve) => {
|
|
44
51
|
if (this.creatingConnection) {
|
|
@@ -86,10 +93,12 @@ class RabbitMq {
|
|
|
86
93
|
});
|
|
87
94
|
}
|
|
88
95
|
async assertQueue(queue, options) {
|
|
96
|
+
RabbitMq.validateName('queue', queue);
|
|
89
97
|
const channel = await this.assertChannel();
|
|
90
98
|
return channel.addSetup((c) => c.assertQueue(queue));
|
|
91
99
|
}
|
|
92
100
|
async consume(queue, callback, options) {
|
|
101
|
+
RabbitMq.validateName('queue', queue);
|
|
93
102
|
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
94
103
|
const channel = await this.assertChannel();
|
|
95
104
|
await this.assertQueue(queue);
|
|
@@ -101,6 +110,8 @@ class RabbitMq {
|
|
|
101
110
|
});
|
|
102
111
|
}
|
|
103
112
|
async consumeFromExchange(queue, exchange, callback, options) {
|
|
113
|
+
RabbitMq.validateName('queue', queue);
|
|
114
|
+
RabbitMq.validateName('exchange', exchange);
|
|
104
115
|
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
105
116
|
const channel = await this.assertChannel();
|
|
106
117
|
await Promise.all([
|
|
@@ -116,11 +127,13 @@ class RabbitMq {
|
|
|
116
127
|
});
|
|
117
128
|
}
|
|
118
129
|
async publish(exchange, content) {
|
|
130
|
+
RabbitMq.validateName('exchange', exchange);
|
|
119
131
|
const channel = await this.assertChannel();
|
|
120
132
|
await this.assertExchange(exchange);
|
|
121
133
|
return channel.publish(exchange, '', Buffer.from(JSON.stringify(content)));
|
|
122
134
|
}
|
|
123
135
|
async sendToQueue(queue, content) {
|
|
136
|
+
RabbitMq.validateName('queue', queue);
|
|
124
137
|
const channel = await this.assertChannel();
|
|
125
138
|
await this.assertQueue(queue);
|
|
126
139
|
return channel.sendToQueue(queue, Buffer.from(JSON.stringify(content)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autofleet/rabbit",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@types/amqplib": "^0.5.9",
|
|
15
15
|
"@types/jest": "^23.3.10",
|
|
16
16
|
"amqp-connection-manager": "^3.2.1",
|
|
17
|
-
"amqplib": "^0.
|
|
17
|
+
"amqplib": "^0.6.0",
|
|
18
18
|
"jest": "^23.6.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { ConfirmChannel } from 'amqplib';
|
|
|
2
2
|
import { connect, AmqpConnectionManager, ChannelWrapper } from 'amqp-connection-manager';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
4
|
|
|
5
|
+
class RabbitError extends Error { }
|
|
6
|
+
|
|
5
7
|
interface ExchangesCache {
|
|
6
8
|
[key: string]: any
|
|
7
9
|
}
|
|
@@ -21,7 +23,13 @@ class RabbitMq {
|
|
|
21
23
|
content,
|
|
22
24
|
}
|
|
23
25
|
}
|
|
24
|
-
|
|
26
|
+
|
|
27
|
+
static validateName(type: string, name: string) {
|
|
28
|
+
if (!name || name === '') {
|
|
29
|
+
throw new RabbitError(`error while using ${type} with no name`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
channel: ChannelWrapper | null;
|
|
26
34
|
connection: AmqpConnectionManager | null;
|
|
27
35
|
em: EventEmitter;
|
|
@@ -107,11 +115,13 @@ class RabbitMq {
|
|
|
107
115
|
}
|
|
108
116
|
|
|
109
117
|
async assertQueue(queue: string, options?: any) {
|
|
118
|
+
RabbitMq.validateName('queue', queue);
|
|
110
119
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
111
120
|
return channel.addSetup((c: ConfirmChannel) => c.assertQueue(queue));
|
|
112
121
|
}
|
|
113
122
|
|
|
114
123
|
async consume(queue: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any) {
|
|
124
|
+
RabbitMq.validateName('queue', queue);
|
|
115
125
|
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
116
126
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
117
127
|
await this.assertQueue(queue);
|
|
@@ -124,13 +134,15 @@ class RabbitMq {
|
|
|
124
134
|
}
|
|
125
135
|
|
|
126
136
|
async consumeFromExchange(queue: string, exchange: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any) {
|
|
137
|
+
RabbitMq.validateName('queue', queue);
|
|
138
|
+
RabbitMq.validateName('exchange', exchange);
|
|
127
139
|
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
128
140
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
129
141
|
await Promise.all([
|
|
130
142
|
this.assertExchange(exchange),
|
|
131
143
|
this.assertQueue(queue),
|
|
132
144
|
]);
|
|
133
|
-
|
|
145
|
+
|
|
134
146
|
return channel.addSetup(async (c: ConfirmChannel) => {
|
|
135
147
|
await c.prefetch(limit, true);
|
|
136
148
|
return Promise.all([
|
|
@@ -141,16 +153,18 @@ class RabbitMq {
|
|
|
141
153
|
}
|
|
142
154
|
|
|
143
155
|
async publish(exchange: string, content: any) {
|
|
156
|
+
RabbitMq.validateName('exchange', exchange);
|
|
144
157
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
145
158
|
await this.assertExchange(exchange);
|
|
146
159
|
return channel.publish(exchange, '', Buffer.from(JSON.stringify(content)));
|
|
147
160
|
}
|
|
148
161
|
|
|
149
162
|
async sendToQueue(queue: string, content: any) {
|
|
163
|
+
RabbitMq.validateName('queue', queue);
|
|
150
164
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
151
165
|
await this.assertQueue(queue);
|
|
152
166
|
return channel.sendToQueue(queue, Buffer.from(JSON.stringify(content)));
|
|
153
167
|
}
|
|
154
168
|
}
|
|
155
169
|
|
|
156
|
-
export default RabbitMq;
|
|
170
|
+
export default RabbitMq;
|