cloudcommerce 0.0.97 → 0.0.98

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.
Files changed (114) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +1 -1
  3. package/packages/api/package.json +1 -1
  4. package/packages/apps/correios/package.json +1 -1
  5. package/packages/apps/custom-shipping/package.json +1 -1
  6. package/packages/apps/discounts/package.json +1 -1
  7. package/packages/apps/frenet/package.json +1 -1
  8. package/packages/apps/tiny-erp/lib/event-to-tiny.js +94 -94
  9. package/packages/apps/tiny-erp/lib/index.js +1 -1
  10. package/packages/apps/tiny-erp/lib/integration/after-tiny-queue.js +74 -71
  11. package/packages/apps/tiny-erp/lib/integration/export-order-to-tiny.js +73 -70
  12. package/packages/apps/tiny-erp/lib/integration/export-product-to-tiny.js +53 -49
  13. package/packages/apps/tiny-erp/lib/integration/helpers/format-tiny-date.js +3 -3
  14. package/packages/apps/tiny-erp/lib/integration/import-order-from-tiny.js +75 -76
  15. package/packages/apps/tiny-erp/lib/integration/import-product-from-tiny.js +140 -137
  16. package/packages/apps/tiny-erp/lib/integration/parsers/order-from-tiny.js +39 -40
  17. package/packages/apps/tiny-erp/lib/integration/parsers/order-to-tiny.js +178 -173
  18. package/packages/apps/tiny-erp/lib/integration/parsers/product-from-tiny.js +171 -173
  19. package/packages/apps/tiny-erp/lib/integration/parsers/product-to-tiny.js +127 -123
  20. package/packages/apps/tiny-erp/lib/integration/parsers/status-from-tiny.js +32 -32
  21. package/packages/apps/tiny-erp/lib/integration/parsers/status-to-tiny.js +37 -37
  22. package/packages/apps/tiny-erp/lib/integration/post-tiny-erp.js +43 -42
  23. package/packages/apps/tiny-erp/lib/tiny-erp.js +6 -8
  24. package/packages/apps/tiny-erp/lib/tiny-webhook.js +73 -76
  25. package/packages/apps/tiny-erp/package.json +1 -1
  26. package/packages/cli/package.json +1 -1
  27. package/packages/config/package.json +1 -1
  28. package/packages/events/package.json +1 -1
  29. package/packages/firebase/lib/config.js +27 -25
  30. package/packages/firebase/lib/const.js +3 -2
  31. package/packages/firebase/lib/env.js +2 -1
  32. package/packages/firebase/lib/handlers/check-store-events.js +146 -145
  33. package/packages/firebase/lib/helpers/pubsub.js +20 -18
  34. package/packages/firebase/lib/helpers/update-app-data.js +38 -38
  35. package/packages/firebase/lib/index.js +9 -7
  36. package/packages/firebase/lib/init.js +2 -1
  37. package/packages/firebase/package.json +1 -1
  38. package/packages/modules/lib/firebase/ajv.js +19 -24
  39. package/packages/modules/lib/firebase/call-app-module.js +116 -110
  40. package/packages/modules/lib/firebase/checkout.js +151 -152
  41. package/packages/modules/lib/firebase/functions-checkout/fix-items.js +194 -187
  42. package/packages/modules/lib/firebase/functions-checkout/get-custumerId.js +25 -26
  43. package/packages/modules/lib/firebase/functions-checkout/handle-order-transaction.js +110 -109
  44. package/packages/modules/lib/firebase/functions-checkout/new-order.js +177 -177
  45. package/packages/modules/lib/firebase/functions-checkout/request-to-module.js +59 -59
  46. package/packages/modules/lib/firebase/functions-checkout/utils.js +195 -197
  47. package/packages/modules/lib/firebase/handle-module.js +144 -146
  48. package/packages/modules/lib/firebase/proxy-apps.js +2 -1
  49. package/packages/modules/lib/firebase/serve-modules-api.js +52 -53
  50. package/packages/modules/lib/firebase.js +4 -6
  51. package/packages/modules/lib/index.js +12 -15
  52. package/packages/modules/package.json +1 -1
  53. package/packages/passport/package.json +1 -1
  54. package/packages/ssr/package.json +1 -1
  55. package/packages/storefront/dist/client/LoginOffcanvas.daf3f717.js +1 -0
  56. package/packages/storefront/dist/client/admin/config.json +1 -0
  57. package/packages/storefront/dist/client/assets/_...522e6bf2.css +4 -0
  58. package/packages/storefront/dist/client/assets/_...a48b75c7.css +1 -0
  59. package/packages/storefront/dist/client/assets/cms-preview.css +274 -0
  60. package/packages/storefront/dist/client/assets/cms.css +114 -0
  61. package/packages/storefront/dist/client/assets/cvv.png +0 -0
  62. package/packages/storefront/dist/client/assets/icons/bootstrap-icons/font/storefront-icons.woff2 +0 -0
  63. package/packages/storefront/dist/client/assets/icons/feather-icons/font/storefront-icons.woff2 +0 -0
  64. package/packages/storefront/dist/client/assets/icons/font-awesome/font/storefront-icons.woff2 +0 -0
  65. package/packages/storefront/dist/client/assets/icons/line-awesome/font/storefront-icons.woff2 +0 -0
  66. package/packages/storefront/dist/client/assets/icons/tabler-icons/font/storefront-icons.woff2 +0 -0
  67. package/packages/storefront/dist/client/assets/img-placeholder.png +0 -0
  68. package/packages/storefront/dist/client/assets/payments.png +0 -0
  69. package/packages/storefront/dist/client/assets/ssl-safe.png +0 -0
  70. package/packages/storefront/dist/client/chunks/LoginForm.d9251274.js +1066 -0
  71. package/packages/storefront/dist/client/chunks/LoginOffcanvas.07fe6492.js +1 -0
  72. package/packages/storefront/dist/client/chunks/index.esm.84a649c7.js +331 -0
  73. package/packages/storefront/dist/client/chunks/preload-helper.f15ab524.js +1 -0
  74. package/packages/storefront/dist/client/chunks/runtime-dom.esm-bundler.738639ee.js +1 -0
  75. package/packages/storefront/dist/client/chunks/workbox-window.prod.es5.4b654ae6.js +2 -0
  76. package/packages/storefront/dist/client/client.b552d86a.js +1 -0
  77. package/packages/storefront/dist/client/hoisted.054c36ac.js +1 -0
  78. package/packages/storefront/dist/client/img/icon.png +0 -0
  79. package/packages/storefront/dist/client/img/large-icon.png +0 -0
  80. package/packages/storefront/dist/client/img/uploads/banner1.png +0 -0
  81. package/packages/storefront/dist/client/img/uploads/banner2.png +0 -0
  82. package/packages/storefront/dist/client/img/uploads/banner2.webp +0 -0
  83. package/packages/storefront/dist/client/img/uploads/favicon.png +0 -0
  84. package/packages/storefront/dist/client/img/uploads/headless.png +0 -0
  85. package/packages/storefront/dist/client/img/uploads/headphone.png +0 -0
  86. package/packages/storefront/dist/client/img/uploads/headphone.webp +0 -0
  87. package/packages/storefront/dist/client/img/uploads/icon.png +0 -0
  88. package/packages/storefront/dist/client/img/uploads/large-icon.png +0 -0
  89. package/packages/storefront/dist/client/img/uploads/logo.png +0 -0
  90. package/packages/storefront/dist/client/img/uploads/logo.webp +0 -0
  91. package/packages/storefront/dist/client/img/uploads/og-image.png +0 -0
  92. package/packages/storefront/dist/client/img/uploads/passion.png +0 -0
  93. package/packages/storefront/dist/client/img/uploads/passion.webp +0 -0
  94. package/packages/storefront/dist/client/img/uploads/pwa-reliable.png +0 -0
  95. package/packages/storefront/dist/client/img/uploads/rect8589.png +0 -0
  96. package/packages/storefront/dist/client/img/uploads/rect859.png +0 -0
  97. package/packages/storefront/dist/client/img/uploads/rect89.png +0 -0
  98. package/packages/storefront/dist/client/img/uploads/rect89.webp +0 -0
  99. package/packages/storefront/dist/client/img/uploads/ssl-safe.png +0 -0
  100. package/packages/storefront/dist/client/manifest.webmanifest +1 -0
  101. package/packages/storefront/dist/client/page.3aa82516.js +1 -0
  102. package/packages/storefront/dist/client/robots.txt +8 -0
  103. package/packages/storefront/dist/client/sw.js +1 -0
  104. package/packages/storefront/dist/client/workbox-6f0d1f78.js +1 -0
  105. package/packages/storefront/dist/client/~partytown/partytown-atomics.js +2 -0
  106. package/packages/storefront/dist/client/~partytown/partytown-media.js +2 -0
  107. package/packages/storefront/dist/client/~partytown/partytown-sw.js +2 -0
  108. package/packages/storefront/dist/client/~partytown/partytown.js +2 -0
  109. package/packages/storefront/dist/server/entry.mjs +2852 -0
  110. package/packages/storefront/dist/server/manifest.webmanifest +1 -0
  111. package/packages/storefront/dist/server/registerSW.js +1 -0
  112. package/packages/storefront/package.json +1 -1
  113. package/packages/storefront/src/lib/layouts/PagesHeader.astro +2 -1
  114. package/packages/types/package.json +1 -1
@@ -1,34 +1,34 @@
1
1
  export default (situacao) => {
2
- let financialStatus;
3
- let fulfillmentStatus;
4
- switch (situacao) {
5
- case 'aprovado':
6
- financialStatus = 'paid';
7
- break;
8
- case 'preparando_envio':
9
- case 'preparando envio':
10
- fulfillmentStatus = 'in_separation';
11
- break;
12
- case 'faturado':
13
- case 'faturado (atendido)':
14
- case 'atendido':
15
- fulfillmentStatus = 'invoice_issued';
16
- break;
17
- case 'pronto_envio':
18
- case 'pronto para envio':
19
- fulfillmentStatus = 'ready_for_shipping';
20
- break;
21
- case 'enviado':
22
- fulfillmentStatus = 'shipped';
23
- break;
24
- case 'entregue':
25
- fulfillmentStatus = 'delivered';
26
- break;
27
- case 'cancelado':
28
- financialStatus = 'voided';
29
- break;
30
- default:
31
- }
32
- return { financialStatus, fulfillmentStatus };
2
+ let financialStatus;
3
+ let fulfillmentStatus;
4
+ switch (situacao) {
5
+ case 'aprovado':
6
+ financialStatus = 'paid';
7
+ break;
8
+ case 'preparando_envio':
9
+ case 'preparando envio':
10
+ fulfillmentStatus = 'in_separation';
11
+ break;
12
+ case 'faturado':
13
+ case 'faturado (atendido)':
14
+ case 'atendido':
15
+ fulfillmentStatus = 'invoice_issued';
16
+ break;
17
+ case 'pronto_envio':
18
+ case 'pronto para envio':
19
+ fulfillmentStatus = 'ready_for_shipping';
20
+ break;
21
+ case 'enviado':
22
+ fulfillmentStatus = 'shipped';
23
+ break;
24
+ case 'entregue':
25
+ fulfillmentStatus = 'delivered';
26
+ break;
27
+ case 'cancelado':
28
+ financialStatus = 'voided';
29
+ break;
30
+ default:
31
+ }
32
+ return { financialStatus, fulfillmentStatus };
33
33
  };
34
- // # sourceMappingURL=status-from-tiny.js.map
34
+ //# sourceMappingURL=status-from-tiny.js.map
@@ -1,39 +1,39 @@
1
1
  export default (order) => {
2
- const financialStatus = order.financial_status && order.financial_status.current;
3
- switch (financialStatus) {
4
- case 'pending':
5
- case 'under_analysis':
6
- case 'unknown':
7
- case 'authorized':
8
- case 'partially_paid':
9
- return 'aberto';
10
- case 'voided':
11
- case 'refunded':
12
- case 'in_dispute':
13
- case 'unauthorized':
14
- return 'cancelado';
15
- default:
16
- }
17
- switch (order.fulfillment_status && order.fulfillment_status.current) {
18
- case 'in_production':
19
- case 'in_separation':
20
- return 'preparando_envio';
21
- case 'invoice_issued':
22
- return 'faturado';
23
- case 'ready_for_shipping':
24
- return 'pronto_envio';
25
- case 'shipped':
26
- case 'partially_shipped':
27
- return 'enviado';
28
- case 'delivered':
29
- return 'entregue';
30
- case 'returned':
31
- return 'cancelado';
32
- default:
33
- }
34
- if (financialStatus === 'paid') {
35
- return 'aprovado';
36
- }
37
- return 'aberto';
2
+ const financialStatus = order.financial_status && order.financial_status.current;
3
+ switch (financialStatus) {
4
+ case 'pending':
5
+ case 'under_analysis':
6
+ case 'unknown':
7
+ case 'authorized':
8
+ case 'partially_paid':
9
+ return 'aberto';
10
+ case 'voided':
11
+ case 'refunded':
12
+ case 'in_dispute':
13
+ case 'unauthorized':
14
+ return 'cancelado';
15
+ default:
16
+ }
17
+ switch (order.fulfillment_status && order.fulfillment_status.current) {
18
+ case 'in_production':
19
+ case 'in_separation':
20
+ return 'preparando_envio';
21
+ case 'invoice_issued':
22
+ return 'faturado';
23
+ case 'ready_for_shipping':
24
+ return 'pronto_envio';
25
+ case 'shipped':
26
+ case 'partially_shipped':
27
+ return 'enviado';
28
+ case 'delivered':
29
+ return 'entregue';
30
+ case 'returned':
31
+ return 'cancelado';
32
+ default:
33
+ }
34
+ if (financialStatus === 'paid') {
35
+ return 'aprovado';
36
+ }
37
+ return 'aberto';
38
38
  };
39
- // # sourceMappingURL=status-to-tiny.js.map
39
+ //# sourceMappingURL=status-to-tiny.js.map
@@ -1,47 +1,48 @@
1
1
  import axios from 'axios';
2
-
3
2
  export default (url, body, token = process.env.TINY_ERP_TOKEN, options = {}) => {
4
- // https://www.tiny.com.br/ajuda/api/api2
5
- let data = `token=${token}&formato=JSON`;
6
- if (body) {
7
- Object.keys(body).forEach((field) => {
8
- if (body[field]) {
9
- switch (typeof body[field]) {
10
- case 'object':
11
- data += `&${field}=${JSON.stringify(body[field])}`;
12
- break;
13
- case 'string':
14
- case 'number':
15
- data += `&${field}=${body[field]}`;
16
- break;
17
- default:
3
+ // https://www.tiny.com.br/ajuda/api/api2
4
+ let data = `token=${token}&formato=JSON`;
5
+ if (body) {
6
+ Object.keys(body).forEach((field) => {
7
+ if (body[field]) {
8
+ switch (typeof body[field]) {
9
+ case 'object':
10
+ data += `&${field}=${JSON.stringify(body[field])}`;
11
+ break;
12
+ case 'string':
13
+ case 'number':
14
+ data += `&${field}=${body[field]}`;
15
+ break;
16
+ default:
17
+ }
18
+ }
19
+ });
20
+ }
21
+ return axios.post(url, data, {
22
+ baseURL: 'https://api.tiny.com.br/api2/',
23
+ timeout: 30000,
24
+ ...options,
25
+ })
26
+ .then((response) => {
27
+ const { retorno } = response.data;
28
+ if (retorno.status === 'Erro') {
29
+ const err = new Error('Tiny error response');
30
+ const tinyErrorCode = parseInt(retorno.codigo_erro, 10);
31
+ if (tinyErrorCode <= 2) {
32
+ response.status = 401;
33
+ }
34
+ else if (tinyErrorCode === 6) {
35
+ response.status = 503;
36
+ }
37
+ else if (tinyErrorCode === 20) {
38
+ response.status = 404;
39
+ }
40
+ err.response = response;
41
+ err.config = response.config;
42
+ err.request = response.request;
43
+ throw err;
18
44
  }
19
- }
20
- });
21
- }
22
- return axios.post(url, data, {
23
- baseURL: 'https://api.tiny.com.br/api2/',
24
- timeout: 30000,
25
- ...options,
26
- })
27
- .then((response) => {
28
- const { retorno } = response.data;
29
- if (retorno.status === 'Erro') {
30
- const err = new Error('Tiny error response');
31
- const tinyErrorCode = parseInt(retorno.codigo_erro, 10);
32
- if (tinyErrorCode <= 2) {
33
- response.status = 401;
34
- } else if (tinyErrorCode === 6) {
35
- response.status = 503;
36
- } else if (tinyErrorCode === 20) {
37
- response.status = 404;
38
- }
39
- err.response = response;
40
- err.config = response.config;
41
- err.request = response.request;
42
- throw err;
43
- }
44
- return retorno;
45
+ return retorno;
45
46
  });
46
47
  };
47
- // # sourceMappingURL=post-tiny-erp.js.map
48
+ //# sourceMappingURL=post-tiny-erp.js.map
@@ -3,16 +3,14 @@ import '@cloudcommerce/firebase/lib/init';
3
3
  // eslint-disable-next-line import/no-unresolved
4
4
  import { onRequest } from 'firebase-functions/v2/https';
5
5
  import config from '@cloudcommerce/firebase/lib/config';
6
- import { createAppEventsFunction } from '@cloudcommerce/firebase/lib/helpers/pubsub';
6
+ import { createAppEventsFunction, } from '@cloudcommerce/firebase/lib/helpers/pubsub';
7
7
  import handleApiEvent from './event-to-tiny.js';
8
8
  import handleTinyWebhook from './tiny-webhook.js';
9
-
10
9
  const { httpsFunctionOptions } = config.get();
11
-
12
10
  export const tinyerp = {
13
- onStoreEvent: createAppEventsFunction('tinyErp', handleApiEvent),
14
- webhook: onRequest(httpsFunctionOptions, (req, res) => {
15
- handleTinyWebhook(req, res);
16
- }),
11
+ onStoreEvent: createAppEventsFunction('tinyErp', handleApiEvent),
12
+ webhook: onRequest(httpsFunctionOptions, (req, res) => {
13
+ handleTinyWebhook(req, res);
14
+ }),
17
15
  };
18
- // # sourceMappingURL=tiny-erp.js.map
16
+ //# sourceMappingURL=tiny-erp.js.map
@@ -3,90 +3,87 @@ import api from '@cloudcommerce/api';
3
3
  import config from '@cloudcommerce/firebase/lib/config';
4
4
  import importProduct from './integration/import-product-from-tiny.js';
5
5
  import importOrder from './integration/import-order-from-tiny.js';
6
-
7
6
  let appData = {};
8
7
  let application;
9
-
10
8
  export default async (req, res) => {
11
- const tinyToken = req.query.token;
12
- if (typeof tinyToken === 'string' && tinyToken && req.body) {
13
- const { dados, tipo } = req.body;
14
- if (dados) {
15
- /*
9
+ const tinyToken = req.query.token;
10
+ if (typeof tinyToken === 'string' && tinyToken && req.body) {
11
+ const { dados, tipo } = req.body;
12
+ if (dados) {
13
+ /*
16
14
  TODO: Check Tiny server IPs
17
15
  const clientIp = req.get('x-forwarded-for') || req.connection.remoteAddress
18
16
  */
19
- const { TINY_ERP_TOKEN } = process.env;
20
- if (!TINY_ERP_TOKEN || TINY_ERP_TOKEN !== tinyToken) {
21
- const { apps: { tinyErp: { appId } } } = config.get();
22
- const applicationId = req.query._id;
23
- const appEndpoint = applicationId && typeof applicationId === 'string'
24
- ? `applications/${applicationId}`
25
- : `applications/app_id:${appId}`;
26
- application = (await api.get(appEndpoint)).data;
27
- appData = {
28
- ...application.data,
29
- ...application.hidden_data,
30
- };
31
- if (appData.tiny_api_token !== tinyToken) {
32
- return res.sendStatus(401);
33
- }
34
- process.env.TINY_ERP_TOKEN = tinyToken;
35
- }
36
- if (dados.idVendaTiny) {
37
- const orderNumber = `id:${dados.idVendaTiny}`;
38
- const queueEntry = {
39
- nextId: orderNumber,
40
- isNotQueued: true,
41
- };
42
- await importOrder({}, queueEntry);
43
- } else if ((tipo === 'produto' || tipo === 'estoque')
17
+ const { TINY_ERP_TOKEN } = process.env;
18
+ if (!TINY_ERP_TOKEN || TINY_ERP_TOKEN !== tinyToken) {
19
+ const { apps: { tinyErp: { appId } } } = config.get();
20
+ const applicationId = req.query._id;
21
+ const appEndpoint = applicationId && typeof applicationId === 'string'
22
+ ? `applications/${applicationId}`
23
+ : `applications/app_id:${appId}`;
24
+ application = (await api.get(appEndpoint)).data;
25
+ appData = {
26
+ ...application.data,
27
+ ...application.hidden_data,
28
+ };
29
+ if (appData.tiny_api_token !== tinyToken) {
30
+ return res.sendStatus(401);
31
+ }
32
+ process.env.TINY_ERP_TOKEN = tinyToken;
33
+ }
34
+ if (dados.idVendaTiny) {
35
+ const orderNumber = `id:${dados.idVendaTiny}`;
36
+ const queueEntry = {
37
+ nextId: orderNumber,
38
+ isNotQueued: true,
39
+ };
40
+ await importOrder({}, queueEntry);
41
+ }
42
+ else if ((tipo === 'produto' || tipo === 'estoque')
44
43
  && (dados.id || dados.idProduto)
45
44
  && (dados.codigo || dados.sku)) {
46
- const nextId = String(dados.skuMapeamento || dados.sku || dados.codigo);
47
- const tinyStockUpdate = {
48
- ref: `${nextId}`,
49
- tipo,
50
- produto: {
51
- id: dados.idProduto,
52
- codigo: dados.sku,
53
- ...dados,
54
- },
55
- };
56
- logger.info(`> Tiny webhook: ${nextId} => ${tinyStockUpdate.produto.saldo}`);
57
- const queueEntry = {
58
- nextId,
59
- tinyStockUpdate,
60
- isNotQueued: true,
61
- app: application,
62
- };
63
- await importProduct({}, queueEntry, appData, false, true);
64
- }
65
- if (tipo === 'produto') {
66
- const mapeamentos = [];
67
- const parseTinyItem = (tinyItem) => {
68
- if (tinyItem) {
69
- const {
70
- idMapeamento, id, codigo, sku,
71
- } = tinyItem;
72
- mapeamentos.push({
73
- idMapeamento: idMapeamento || id,
74
- skuMapeamento: codigo || sku,
75
- });
76
- }
77
- };
78
- parseTinyItem(dados);
79
- if (Array.isArray(dados.variacoes)) {
80
- dados.variacoes.forEach((variacao) => {
81
- parseTinyItem(variacao.id ? variacao : variacao.variacao);
82
- });
45
+ const nextId = String(dados.skuMapeamento || dados.sku || dados.codigo);
46
+ const tinyStockUpdate = {
47
+ ref: `${nextId}`,
48
+ tipo,
49
+ produto: {
50
+ id: dados.idProduto,
51
+ codigo: dados.sku,
52
+ ...dados,
53
+ },
54
+ };
55
+ logger.info(`> Tiny webhook: ${nextId} => ${tinyStockUpdate.produto.saldo}`);
56
+ const queueEntry = {
57
+ nextId,
58
+ tinyStockUpdate,
59
+ isNotQueued: true,
60
+ app: application,
61
+ };
62
+ await importProduct({}, queueEntry, appData, false, true);
63
+ }
64
+ if (tipo === 'produto') {
65
+ const mapeamentos = [];
66
+ const parseTinyItem = (tinyItem) => {
67
+ if (tinyItem) {
68
+ const { idMapeamento, id, codigo, sku, } = tinyItem;
69
+ mapeamentos.push({
70
+ idMapeamento: idMapeamento || id,
71
+ skuMapeamento: codigo || sku,
72
+ });
73
+ }
74
+ };
75
+ parseTinyItem(dados);
76
+ if (Array.isArray(dados.variacoes)) {
77
+ dados.variacoes.forEach((variacao) => {
78
+ parseTinyItem(variacao.id ? variacao : variacao.variacao);
79
+ });
80
+ }
81
+ return res.status(200).send(mapeamentos);
82
+ }
83
+ return res.sendStatus(200);
83
84
  }
84
- return res.status(200).send(mapeamentos);
85
- }
86
- return res.sendStatus(200);
85
+ logger.warn('< Invalid Tiny Webhook body', req.body);
87
86
  }
88
- logger.warn('< Invalid Tiny Webhook body', req.body);
89
- }
90
- return res.sendStatus(403);
87
+ return res.sendStatus(403);
91
88
  };
92
- // # sourceMappingURL=tiny-webhook.js.map
89
+ //# sourceMappingURL=tiny-webhook.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/app-tiny-erp",
3
3
  "type": "module",
4
- "version": "0.0.97",
4
+ "version": "0.0.98",
5
5
  "description": "E-Com Plus Cloud Commerce app for Tiny ERP",
6
6
  "main": "lib/tiny-erp.js",
7
7
  "repository": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/cli",
3
3
  "type": "module",
4
- "version": "0.0.97",
4
+ "version": "0.0.98",
5
5
  "description": "E-Com Plus Cloud Commerce CLI tools",
6
6
  "bin": {
7
7
  "cloudcommerce": "./bin/run.mjs"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/config",
3
3
  "type": "module",
4
- "version": "0.0.97",
4
+ "version": "0.0.98",
5
5
  "description": "E-Com Plus Cloud Commerce base config",
6
6
  "main": "lib/config.js",
7
7
  "exports": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloudcommerce/events",
3
3
  "type": "module",
4
- "version": "0.0.97",
4
+ "version": "0.0.98",
5
5
  "description": "E-Com Plus Cloud Commerce app events",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -1,34 +1,36 @@
1
1
  import config from '@cloudcommerce/config';
2
+
2
3
  const tinyErpEvents = [
3
- 'orders-anyStatusSet',
4
- 'products-new',
5
- 'products-priceSet',
6
- 'applications-dataSet',
4
+ 'orders-anyStatusSet',
5
+ 'products-new',
6
+ 'products-priceSet',
7
+ 'applications-dataSet',
7
8
  ];
8
9
  const mergeConfig = {
9
- hello: 'from @cloudcommerce/firebase',
10
- httpsFunctionOptions: {
11
- region: process.env.DEPLOY_REGION || 'southamerica-east1',
10
+ hello: 'from @cloudcommerce/firebase',
11
+ httpsFunctionOptions: {
12
+ region: process.env.DEPLOY_REGION || 'southamerica-east1',
13
+ },
14
+ apps: {
15
+ discounts: {
16
+ appId: 1252,
12
17
  },
13
- apps: {
14
- discounts: {
15
- appId: 1252,
16
- },
17
- correios: {
18
- appId: 1248,
19
- },
20
- customShipping: {
21
- appId: 1253,
22
- },
23
- frenet: {
24
- appId: 1244,
25
- },
26
- tinyErp: {
27
- appId: 105922,
28
- events: tinyErpEvents,
29
- },
18
+ correios: {
19
+ appId: 1248,
30
20
  },
21
+ customShipping: {
22
+ appId: 1253,
23
+ },
24
+ frenet: {
25
+ appId: 1244,
26
+ },
27
+ tinyErp: {
28
+ appId: 105922,
29
+ events: tinyErpEvents,
30
+ },
31
+ },
31
32
  };
32
33
  config.set(mergeConfig);
34
+
33
35
  export default config;
34
- //# sourceMappingURL=config.js.map
36
+ // # sourceMappingURL=config.js.map
@@ -1,5 +1,6 @@
1
1
  export const EVENT_SKIP_FLAG = '_skip';
2
+
2
3
  export const GET_PUBSUB_TOPIC = (appId) => {
3
- return `app${appId}_api_events`;
4
+ return `app${appId}_api_events`;
4
5
  };
5
- //# sourceMappingURL=const.js.map
6
+ // # sourceMappingURL=const.js.map
@@ -1,3 +1,4 @@
1
1
  import getEnv from '@cloudcommerce/config/lib/env';
2
+
2
3
  export default getEnv;
3
- //# sourceMappingURL=env.js.map
4
+ // # sourceMappingURL=env.js.map