Compare commits
25 Commits
WEBINT-335
...
1.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 985c85da59 | |||
| 23c61097a8 | |||
| 5372045bd7 | |||
| 72d61b8376 | |||
| 526c094494 | |||
| 474f7b7c68 | |||
| f8692e3e2e | |||
| 62715fae34 | |||
| f8678a68bb | |||
| 8f8ae22f23 | |||
| 2611147eb3 | |||
| b0b3badd5c | |||
| 2b812098fb | |||
| 3146efec64 | |||
| 44e4b98e35 | |||
| 6adb4d5c95 | |||
| bcb1a28164 | |||
| d5798602e2 | |||
| 1f94a89520 | |||
| 44bbc8f17c | |||
| 9e6877c329 | |||
| d5883ba75e | |||
| 421d0aa705 | |||
| 69b5958296 | |||
| b9e3e1784f |
@@ -6,6 +6,8 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
internal:
|
internal:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
volumes:
|
||||||
|
rabbitmq_data:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
rabbitmq-sim-broker:
|
rabbitmq-sim-broker:
|
||||||
@@ -28,6 +30,7 @@ services:
|
|||||||
entrypoint: ["bash", "/usr/local/bin/docker-entrypoint-wrapper.sh"]
|
entrypoint: ["bash", "/usr/local/bin/docker-entrypoint-wrapper.sh"]
|
||||||
command: ["rabbitmq-server"]
|
command: ["rabbitmq-server"]
|
||||||
volumes:
|
volumes:
|
||||||
|
- rabbitmq_data:/var/lib/rabbitmq
|
||||||
- ./rabbit/docker-entrypoint-wrapper.sh:/usr/local/bin/docker-entrypoint-wrapper.sh:ro
|
- ./rabbit/docker-entrypoint-wrapper.sh:/usr/local/bin/docker-entrypoint-wrapper.sh:ro
|
||||||
- ./rabbitmq_plugins/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
- ./rabbitmq_plugins/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||||
- ./rabbit/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
|
- ./rabbit/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
|
||||||
@@ -73,7 +76,9 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./.env:/home/node/app/.env:ro
|
- ./.env:/home/node/app/.env:ro
|
||||||
- ./sim-consumidor-nos.env:/home/node/app/packages/sim-consumidor-nos/.env:ro
|
- ./sim-consumidor-nos.env:/home/node/app/packages/sim-consumidor-nos/.env:ro
|
||||||
|
- ./sim-consumidor-alai.env:/home/node/app/packages/sim-consumidor-alai/.env:ro
|
||||||
- ./sim-consumidor-objenious.env:/home/node/app/packages/sim-consumidor-objenious/.env:ro
|
- ./sim-consumidor-objenious.env:/home/node/app/packages/sim-consumidor-objenious/.env:ro
|
||||||
|
- ./wsaccess_alaisecure_com_cert_client_new.p12:/home/node/app/packages/sim-consumidor-alai/certificates/wsaccess_alaisecure_com_cert_client_new.p12:ro
|
||||||
- ./sim-objenious-cron.env:/home/node/app/packages/sim-objenious-cron/.env:ro
|
- ./sim-objenious-cron.env:/home/node/app/packages/sim-objenious-cron/.env:ro
|
||||||
- ./obj.pem:/home/node/app/packages/sim-consumidor-objenious/obj.pem:ro
|
- ./obj.pem:/home/node/app/packages/sim-consumidor-objenious/obj.pem:ro
|
||||||
- ./obj.pem:/home/node/app/packages/sim-objenious-cron/obj.pem:ro
|
- ./obj.pem:/home/node/app/packages/sim-objenious-cron/obj.pem:ro
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ pipeline {
|
|||||||
stage("🧱 Building") {
|
stage("🧱 Building") {
|
||||||
steps {
|
steps {
|
||||||
sh 'rm -rf dist/'
|
sh 'rm -rf dist/'
|
||||||
sh 'yarn run build'
|
sh 'yarn run build:prod'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("🏗 Deploying") {
|
stage("🏗 Deploying") {
|
||||||
@@ -40,31 +40,11 @@ pipeline {
|
|||||||
),
|
),
|
||||||
sshTransfer(
|
sshTransfer(
|
||||||
cleanRemote: false,
|
cleanRemote: false,
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/.env $APP_REMOTE_PATH/.env"
|
execCommand: "rm -rf $APP_REMOTE_PATH/dist"
|
||||||
),
|
),
|
||||||
sshTransfer(
|
sshTransfer(
|
||||||
cleanRemote: false,
|
cleanRemote: false,
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-consumidor-objenious.env $APP_REMOTE_PATH/packages/sim-consumidor-objenious/.env"
|
execCommand: "ls -la $BASE_REMOTE_PATH/vault/savefamily/sf-sims/"
|
||||||
),
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-consumidor-nos.env $APP_REMOTE_PATH/packages/sim-consumidor-nos/.env"
|
|
||||||
),
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-consumidor-alai.env $APP_REMOTE_PATH/packages/sim-consumidor-alai/.env"
|
|
||||||
),
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/wsaccess_alaisecure_com_cert_client_new.p12 $APP_REMOTE_PATH/packages/wsaccess_alaisecure_com_cert_client_new.p12"
|
|
||||||
),
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-objenious-cron.env $APP_REMOTE_PATH/packages/sim-objenious-cron/.env"
|
|
||||||
),
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/obj.pem $APP_REMOTE_PATH/packages/sim-consumidor-objenious/obj.pem"
|
|
||||||
),
|
),
|
||||||
sshTransfer(
|
sshTransfer(
|
||||||
cleanRemote: false,
|
cleanRemote: false,
|
||||||
@@ -72,6 +52,34 @@ pipeline {
|
|||||||
sourceFiles: "dist/**/*",
|
sourceFiles: "dist/**/*",
|
||||||
excludes: "dist/**/node_modules/**"
|
excludes: "dist/**/node_modules/**"
|
||||||
),
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/.env $APP_REMOTE_PATH/.env"
|
||||||
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/wsaccess_alaisecure_com_cert_client_new.p12 $APP_REMOTE_PATH/wsaccess_alaisecure_com_cert_client_new.p12"
|
||||||
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-consumidor-objenious.env $APP_REMOTE_PATH/sim-consumidor-objenious.env"
|
||||||
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-consumidor-nos.env $APP_REMOTE_PATH/sim-consumidor-nos.env"
|
||||||
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-consumidor-alai.env $APP_REMOTE_PATH/sim-consumidor-alai.env"
|
||||||
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/sim-objenious-cron.env $APP_REMOTE_PATH/sim-objenious-cron.env"
|
||||||
|
),
|
||||||
|
sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: "ln -sf $BASE_REMOTE_PATH/vault/savefamily/sf-sims/obj.pem $APP_REMOTE_PATH/obj.pem"
|
||||||
|
),
|
||||||
sshTransfer(
|
sshTransfer(
|
||||||
cleanRemote: false,
|
cleanRemote: false,
|
||||||
remoteDirectory: "$APP_REMOTE_PATH",
|
remoteDirectory: "$APP_REMOTE_PATH",
|
||||||
|
|||||||
@@ -1,90 +1,92 @@
|
|||||||
{
|
{
|
||||||
"rabbit_version": "4.2.2",
|
"rabbit_version": "4.2.2",
|
||||||
"rabbitmq_version": "4.2.2",
|
"rabbitmq_version": "4.2.2",
|
||||||
"product_name": "RabbitMQ",
|
"product_name": "RabbitMQ",
|
||||||
"product_version": "4.2.2",
|
"product_version": "4.2.2",
|
||||||
"users": [
|
"users": [
|
||||||
{
|
{
|
||||||
"name": "RABBITMQ_USER_PLACEHOLDER",
|
"name": "RABBITMQ_USER_PLACEHOLDER",
|
||||||
"password": "RABBITMQ_PASSWORD_PLACEHOLDER",
|
"password": "RABBITMQ_PASSWORD_PLACEHOLDER",
|
||||||
"tags": ["administrator"]
|
"tags": [
|
||||||
}
|
"administrator"
|
||||||
],
|
]
|
||||||
"vhosts": [
|
}
|
||||||
{
|
],
|
||||||
"name": "sim-vhost"
|
"vhosts": [
|
||||||
}
|
{
|
||||||
],
|
"name": "sim-vhost"
|
||||||
"permissions": [
|
}
|
||||||
{
|
],
|
||||||
"user": "RABBITMQ_USER_PLACEHOLDER",
|
"permissions": [
|
||||||
"vhost": "sim-vhost",
|
{
|
||||||
"configure": ".*",
|
"user": "RABBITMQ_USER_PLACEHOLDER",
|
||||||
"write": ".*",
|
"vhost": "sim-vhost",
|
||||||
"read": ".*"
|
"configure": ".*",
|
||||||
}
|
"write": ".*",
|
||||||
],
|
"read": ".*"
|
||||||
"topic_permissions": [],
|
}
|
||||||
"parameters": [],
|
],
|
||||||
"global_parameters": [
|
"topic_permissions": [],
|
||||||
{
|
"parameters": [],
|
||||||
"name": "cluster_name",
|
"global_parameters": [
|
||||||
"value": "rabbit@a8d5c6e08439"
|
{
|
||||||
},
|
"name": "cluster_name",
|
||||||
{
|
"value": "rabbit@a8d5c6e08439"
|
||||||
"name": "internal_cluster_id",
|
},
|
||||||
"value": "rabbitmq-cluster-id-gXeBLbsUC2W2tU0Bx_QY_w"
|
{
|
||||||
}
|
"name": "internal_cluster_id",
|
||||||
],
|
"value": "rabbitmq-cluster-id-gXeBLbsUC2W2tU0Bx_QY_w"
|
||||||
"policies": [
|
}
|
||||||
{
|
],
|
||||||
"vhost": "sim-vhost",
|
"policies": [
|
||||||
"name": "pol.sim.dlx",
|
{
|
||||||
"pattern": "sim.*",
|
"vhost": "sim-vhost",
|
||||||
"apply-to": "queues",
|
"name": "pol.sim.dlx",
|
||||||
"definition": {
|
"pattern": "sim.*",
|
||||||
"dead-letter-exchange": "sim.dlx"
|
"apply-to": "queues",
|
||||||
},
|
"definition": {
|
||||||
"priority": 7
|
"dead-letter-exchange": "sim.dlx"
|
||||||
}
|
},
|
||||||
],
|
"priority": 7
|
||||||
"exchanges": [
|
}
|
||||||
{
|
],
|
||||||
"name": "sim.exchange",
|
"exchanges": [
|
||||||
"vhost": "sim-vhost",
|
{
|
||||||
"type": "topic",
|
"name": "sim.exchange",
|
||||||
"durable": true,
|
"vhost": "sim-vhost",
|
||||||
"auto_delete": false,
|
"type": "topic",
|
||||||
"internal": false,
|
"durable": true,
|
||||||
"argurments": {}
|
"auto_delete": false,
|
||||||
},
|
"internal": false,
|
||||||
{
|
"argurments": {}
|
||||||
"name": "sim.dlx",
|
},
|
||||||
"vhost": "sim-vhost",
|
{
|
||||||
"type": "topic",
|
"name": "sim.dlx",
|
||||||
"durable": true,
|
"vhost": "sim-vhost",
|
||||||
"auto_delete": false,
|
"type": "topic",
|
||||||
"internal": false,
|
"durable": true,
|
||||||
"argurments": {}
|
"auto_delete": false,
|
||||||
}
|
"internal": false,
|
||||||
],
|
"argurments": {}
|
||||||
"queues": [
|
}
|
||||||
{
|
],
|
||||||
"name": "sim.logs",
|
"queues": [
|
||||||
"vhost": "sim-vhost",
|
{
|
||||||
"durable": true,
|
"name": "sim.logs",
|
||||||
"auto_delete": false,
|
"vhost": "sim-vhost",
|
||||||
"arguments": {}
|
"durable": true,
|
||||||
}
|
"auto_delete": false,
|
||||||
],
|
"arguments": {}
|
||||||
"bindings": [
|
}
|
||||||
{
|
],
|
||||||
"source": "sim.exchange",
|
"bindings": [
|
||||||
"vhost": "sim-vhost",
|
{
|
||||||
"destination": "sim.logs",
|
"source": "sim.exchange",
|
||||||
"destination_type": "queue",
|
"vhost": "sim-vhost",
|
||||||
"routing_key": "sim.#",
|
"destination": "sim.logs",
|
||||||
"arguments": {}
|
"destination_type": "queue",
|
||||||
}
|
"routing_key": "sim.#",
|
||||||
]
|
"arguments": {}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest watch",
|
"test": "vitest watch",
|
||||||
"build": "rm -rf ./dist && yarn workspaces foreach -Api run build && yarn setup:runtime",
|
"build": "rm -rf ./dist && yarn workspaces foreach -Api run build && yarn setup:runtime",
|
||||||
|
"build:prod": "rm -rf ./dist && yarn workspaces foreach -Api run build:prod && yarn setup:runtime",
|
||||||
"setup:runtime": "mkdir -p dist/packages/node_modules && ln -sf ../sim-shared dist/packages/node_modules/sim-shared && ln -sf ../sf-consumidor-objenious dist/packages/node_modules/sim-consumidor-objenious",
|
"setup:runtime": "mkdir -p dist/packages/node_modules && ln -sf ../sim-shared dist/packages/node_modules/sim-shared && ln -sf ../sf-consumidor-objenious dist/packages/node_modules/sim-consumidor-objenious",
|
||||||
"start": "yarn workspaces foreach -Apiv run start",
|
"start": "yarn workspaces foreach -Apiv run start",
|
||||||
"typecheck": "npx tsc --noEmit",
|
"typecheck": "npx tsc --noEmit",
|
||||||
|
|||||||
@@ -144,6 +144,8 @@ export class SimAlaiUsecases {
|
|||||||
|
|
||||||
const applyOrder = await this.alaiRepository.applyOrder(orderId)
|
const applyOrder = await this.alaiRepository.applyOrder(orderId)
|
||||||
if (applyOrder.error != undefined) {
|
if (applyOrder.error != undefined) {
|
||||||
|
// TODO: gestion del error
|
||||||
|
// reusar el orderId
|
||||||
return applyOrder
|
return applyOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,9 +39,10 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp package.json ../../dist/packages/sim-consumidor-nos/ && cp -r certificates/ ../../dist/packages/sim-consumidor-alai/",
|
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp -P .env package.json ../../dist/packages/sim-consumidor-alai/ && cp -r certificates/ ../../dist/packages/sim-consumidor-alai/",
|
||||||
|
"build:prod": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp -P package.json ../../dist/packages/sim-consumidor-alai/ && mkdir ../../dist/packages/sim-consumidor-alai/certificates",
|
||||||
"esbuild": "esbuild index.ts --platform=node",
|
"esbuild": "esbuild index.ts --platform=node",
|
||||||
"start": "node ../../dist/packages/sim-consumidor-nos/index.js",
|
"start": "node ../../dist/packages/sim-consumidor-alai/index.js",
|
||||||
"dev": "tsx watch index.ts"
|
"dev": "tsx watch index.ts"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ export const env = {
|
|||||||
RABBITMQ_RETRY_INTERVAL: process.env.RABBITMQ_INTERVAL,
|
RABBITMQ_RETRY_INTERVAL: process.env.RABBITMQ_INTERVAL,
|
||||||
RABBITMQ_VHOST: String(process.env.RABBITMQ_VHOST),
|
RABBITMQ_VHOST: String(process.env.RABBITMQ_VHOST),
|
||||||
|
|
||||||
APP_PORT: Number(process.env.NOS_PORT),
|
APP_PORT: Number(process.env.NOS_PORT ?? 3001),
|
||||||
APP_HOST: String(process.env.NOS_HOST),
|
APP_HOST: String(process.env.NOS_HOST ?? "0.0.0.0"),
|
||||||
|
|
||||||
// ESPECIFICO NOS
|
// ESPECIFICO NOS
|
||||||
NOS_BASE_URL: String(process.env.NOS_BASE_URL),
|
NOS_BASE_URL: String(process.env.NOS_BASE_URL),
|
||||||
|
|||||||
@@ -39,7 +39,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp package.json ../../dist/packages/sim-consumidor-nos/",
|
"build": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp -P .env package.json ../../dist/packages/sim-consumidor-nos/",
|
||||||
|
"build:prod": "yarn tsc --project tsconfig.json && yarn tsc-alias && cp -P package.json ../../dist/packages/sim-consumidor-nos/",
|
||||||
"esbuild": "esbuild index.ts --platform=node",
|
"esbuild": "esbuild index.ts --platform=node",
|
||||||
"start": "node ../../dist/packages/sim-consumidor-nos/index.js",
|
"start": "node ../../dist/packages/sim-consumidor-nos/index.js",
|
||||||
"dev": "tsx watch index.ts"
|
"dev": "tsx watch index.ts"
|
||||||
|
|||||||
@@ -46,8 +46,8 @@ async function buildQueues(channel: Channel) {
|
|||||||
await channel.assertExchange(EXCHANGES.DLX, "topic")
|
await channel.assertExchange(EXCHANGES.DLX, "topic")
|
||||||
await channel.assertExchange(EXCHANGES.MAIN, "topic")
|
await channel.assertExchange(EXCHANGES.MAIN, "topic")
|
||||||
|
|
||||||
await channel.assertQueue(QUEUES.OBJ)
|
await channel.assertQueue(QUEUES.OBJ, { durable: true })
|
||||||
await channel.assertQueue(QUEUES.OBJDLX)
|
await channel.assertQueue(QUEUES.OBJDLX, { durable: true })
|
||||||
await channel.assertQueue(QUEUES.OBJDEL, {
|
await channel.assertQueue(QUEUES.OBJDEL, {
|
||||||
durable: true,
|
durable: true,
|
||||||
arguments: {
|
arguments: {
|
||||||
|
|||||||
@@ -55,7 +55,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --import tsx --test ./**/*.test.ts",
|
"test": "node --import tsx --test ./**/*.test.ts",
|
||||||
"dev": "tsx watch index.ts",
|
"dev": "tsx watch index.ts",
|
||||||
"build": "tsc --build && yarn tsc-alias -p tsconfig.json && cp .env package.json ../../dist/packages/sim-consumidor-objenious/",
|
"build": "tsc --build && yarn tsc-alias -p tsconfig.json && cp -P ./.env ./package.json ../../dist/packages/sim-consumidor-objenious/",
|
||||||
|
"build:prod": "tsc --build && yarn tsc-alias -p tsconfig.json && cp -P ./package.json ../../dist/packages/sim-consumidor-objenious/",
|
||||||
"start": "node ../../dist/packages/sim-consumidor-objenious/index.js",
|
"start": "node ../../dist/packages/sim-consumidor-objenious/index.js",
|
||||||
"type:test": "tsc --noEmit"
|
"type:test": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --import tsx --test ./**/*.test.ts",
|
"test": "node --import tsx --test ./**/*.test.ts",
|
||||||
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-entrada-eventos/",
|
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-entrada-eventos/",
|
||||||
|
"build:prod": "yarn build",
|
||||||
"dev": "tsx watch index.ts",
|
"dev": "tsx watch index.ts",
|
||||||
"start": "node ../../dist/packages/sim-entrada-eventos/index.js"
|
"start": "node ../../dist/packages/sim-entrada-eventos/index.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --import tsx --test ./**/*.test.ts",
|
"test": "node --import tsx --test ./**/*.test.ts",
|
||||||
"build": "tsc --build && tsc-alias -p tsconfig.json && cp .env package.json ../../dist/packages/sim-objenious-cron/",
|
"build": "tsc --build && tsc-alias -p tsconfig.json && cp .env package.json ../../dist/packages/sim-objenious-cron/",
|
||||||
|
"build:prod": "yarn build",
|
||||||
"dev": "tsx watch index.ts",
|
"dev": "tsx watch index.ts",
|
||||||
"start": "node ../../dist/packages/sim-objenious-cron/index.js"
|
"start": "node ../../dist/packages/sim-objenious-cron/index.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,7 +40,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node --import tsx --test ./**/*.test.ts",
|
"test": "node --import tsx --test ./**/*.test.ts",
|
||||||
"dev": "echo \" Shared no es un modulo ejecutable \" ",
|
"dev": "echo \" Shared no es un modulo ejecutable \" ",
|
||||||
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-shared/"
|
"build": "tsc --build && tsc-alias -p tsconfig.json && cp package.json ../../dist/packages/sim-shared/",
|
||||||
|
"build:prod": "yarn build"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
|||||||
13
test_api.ts
13
test_api.ts
@@ -1,35 +1,34 @@
|
|||||||
import { NosHttpClient } from "./packages/sim-consumidor-nos/infrastructure/NosHttpClient.js";
|
import { NosHttpClient } from "./packages/sim-consumidor-nos/infrastructure/NosHttpClient.js";
|
||||||
import { NosRepository } from "./packages/sim-consumidor-nos/infrastructure/NosRepository.js";
|
|
||||||
import { env } from "./packages/sim-consumidor-nos/config/env/env.js";
|
import { env } from "./packages/sim-consumidor-nos/config/env/env.js";
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log("NOS_BASE_URL", env.NOS_BASE_URL);
|
console.log("NOS_BASE_URL", env.NOS_BASE_URL);
|
||||||
const client = new NosHttpClient(env.NOS_BASE_URL);
|
const client = new NosHttpClient(env.NOS_BASE_URL);
|
||||||
|
|
||||||
// Try to get a subscriber
|
// Try to get a subscriber
|
||||||
const res = await client.get("/subscribers", { params: { limit: 1 } });
|
const res = await client.get("/subscribers", { params: { limit: 1 } });
|
||||||
console.log("SUBSCRIBER:", res.data.content[0].physicalId);
|
console.log("SUBSCRIBER:", res.data.content[0].physicalId);
|
||||||
|
|
||||||
const iccid = res.data.content[0].physicalId;
|
const iccid = res.data.content[0].physicalId;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const history = await client.get(`/subscribers/${iccid}/history`);
|
const history = await client.get(`/subscribers/${iccid}/history`);
|
||||||
console.log("HISTORY:", history.data);
|
console.log("HISTORY:", history.data);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.error("HISTORY ERROR");
|
console.error("HISTORY ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const audit = await client.get(`/subscribers/${iccid}/audit`);
|
const audit = await client.get(`/subscribers/${iccid}/audit`);
|
||||||
console.log("AUDIT:", audit.data);
|
console.log("AUDIT:", audit.data);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.error("AUDIT ERROR");
|
console.error("AUDIT ERROR");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const actions = await client.get(`/subscribers/${iccid}/actions`);
|
const actions = await client.get(`/subscribers/${iccid}/actions`);
|
||||||
console.log("ACTIONS:", actions.data);
|
console.log("ACTIONS:", actions.data);
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.error("ACTIONS ERROR");
|
console.error("ACTIONS ERROR");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user