sim-node-lib 0.4.11 → 0.4.13

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.
@@ -40,6 +40,7 @@ export declare enum PubSubTableEnum {
40
40
  grupoPromocao = "grupo_promocao",
41
41
  inquilino = "inquilino",
42
42
  item = "item",
43
+ itemCodigoDeBarras = "item_codigo_de_barras",
43
44
  itemTag = "item_tag",
44
45
  modeloPredicao = "modelo_predicao",
45
46
  nivelInterferencia = "nivel_interferencia",
@@ -44,6 +44,7 @@ var PubSubTableEnum;
44
44
  PubSubTableEnum["grupoPromocao"] = "grupo_promocao";
45
45
  PubSubTableEnum["inquilino"] = "inquilino";
46
46
  PubSubTableEnum["item"] = "item";
47
+ PubSubTableEnum["itemCodigoDeBarras"] = "item_codigo_de_barras";
47
48
  PubSubTableEnum["itemTag"] = "item_tag";
48
49
  PubSubTableEnum["modeloPredicao"] = "modelo_predicao";
49
50
  PubSubTableEnum["nivelInterferencia"] = "nivel_interferencia";
@@ -23,6 +23,7 @@ function basic(dirname) {
23
23
  plugins: { 'sim-eslint': simEslint },
24
24
  rules: {
25
25
  'sim-eslint/ensure-bindings': 'error',
26
+ 'sim-eslint/pub-sub': 'error'
26
27
  },
27
28
  },
28
29
  eslintPluginPrettierRecommended,
@@ -50,6 +51,7 @@ function recommendedBasic(dirname) {
50
51
  plugins: { 'sim-eslint': simEslint },
51
52
  rules: {
52
53
  'sim-eslint/ensure-bindings': 'error',
54
+ 'sim-eslint/pub-sub': 'error'
53
55
  },
54
56
  },
55
57
  eslintPluginPrettierRecommended,
@@ -77,6 +79,7 @@ function recommendedTypeChecked(dirname) {
77
79
  plugins: { 'sim-eslint': simEslint },
78
80
  rules: {
79
81
  'sim-eslint/ensure-bindings': 'error',
82
+ 'sim-eslint/pub-sub': 'error'
80
83
  },
81
84
  },
82
85
  eslintPluginPrettierRecommended,
@@ -1,2 +0,0 @@
1
- declare let existsPubSubV2: boolean;
2
- declare let auxAppProvider: boolean;
@@ -1,36 +1,14 @@
1
- let existsPubSubV2 = false;
2
- let auxAppProvider = false;
3
1
  module.exports = {
4
2
  meta: {
5
3
  type: 'problem',
6
4
  docs: {
7
- description: 'Enforce passing both query and bindings parameters to whereRaw() or rawQuery() method, enforce the use of the v2 of pubsub',
5
+ description: 'Enforce passing both query and bindings parameters to whereRaw() or rawQuery() method',
8
6
  },
9
7
  },
10
8
  create: function (context) {
11
- const curFilename = context.getFilename();
12
- const appProvider = 'AppProvider.ts';
13
- const isAppProvider = curFilename.includes(appProvider);
14
9
  return {
15
10
  CallExpression(node) {
16
11
  const callee = node.callee;
17
- if (isAppProvider) {
18
- auxAppProvider = true;
19
- if (callee.type === 'MemberExpression' && callee.property.type === 'Identifier' && callee.property.name === 'listenMessagesV2') {
20
- existsPubSubV2 = true;
21
- }
22
- }
23
- else {
24
- if (auxAppProvider) {
25
- auxAppProvider = false;
26
- if (!existsPubSubV2) {
27
- context.report({
28
- node,
29
- message: '"AppProvider.ts" must contain the v2 of pubsub.',
30
- });
31
- }
32
- }
33
- }
34
12
  if (callee.type === 'MemberExpression' && callee.property.type === 'Identifier') {
35
13
  let raw = false;
36
14
  switch (callee.property.name) {
@@ -0,0 +1,2 @@
1
+ declare let existsPubSubV2: boolean;
2
+ declare let auxAppProvider: boolean;
@@ -0,0 +1,37 @@
1
+ let existsPubSubV2 = false;
2
+ let auxAppProvider = false;
3
+ module.exports = {
4
+ meta: {
5
+ type: 'problem',
6
+ docs: {
7
+ description: 'Enforce the use of the v2 of pubsub',
8
+ },
9
+ },
10
+ create: function (context) {
11
+ const curFilename = context.getFilename();
12
+ const appProvider = 'AppProvider.ts';
13
+ const isAppProvider = curFilename.includes(appProvider);
14
+ return {
15
+ CallExpression(node) {
16
+ const callee = node.callee;
17
+ if (isAppProvider) {
18
+ auxAppProvider = true;
19
+ if (callee.type === 'MemberExpression' && callee.property.type === 'Identifier' && callee.property.name === 'listenMessagesV2') {
20
+ existsPubSubV2 = true;
21
+ }
22
+ }
23
+ else {
24
+ if (auxAppProvider) {
25
+ auxAppProvider = false;
26
+ if (!existsPubSubV2) {
27
+ context.report({
28
+ node,
29
+ message: '"AppProvider.ts" must contain the v2 of pubsub.',
30
+ });
31
+ }
32
+ }
33
+ }
34
+ },
35
+ };
36
+ },
37
+ };
@@ -1,4 +1,5 @@
1
1
  declare const ensureBindingsRule: any;
2
+ declare const pubSubRule: any;
2
3
  declare const plugin: {
3
4
  meta: {
4
5
  name: string;
@@ -6,5 +7,6 @@ declare const plugin: {
6
7
  };
7
8
  rules: {
8
9
  'ensure-bindings': any;
10
+ 'pub-sub': any;
9
11
  };
10
12
  };
@@ -1,6 +1,10 @@
1
1
  const ensureBindingsRule = require('./rules/ensure-bindings');
2
+ const pubSubRule = require('./rules/pub-sub');
2
3
  const plugin = {
3
- meta: { name: 'sim-eslint', version: '1.0.0' },
4
- rules: { 'ensure-bindings': ensureBindingsRule },
4
+ meta: { name: 'sim-eslint', version: '1.0.1' },
5
+ rules: {
6
+ 'ensure-bindings': ensureBindingsRule,
7
+ 'pub-sub': pubSubRule
8
+ },
5
9
  };
6
10
  module.exports = plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sim-node-lib",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "Library from SIMLabs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",