Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rest-g5-senior

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-g5-senior

Em desenvolvimento...

  • 0.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

rest-g5-senior

Em desenvolvimento...

Registrar Credenciais

Registra as credenciais que serão utilizadas nas requisições.

Opcionalmente, as credenciais podem ser enviadas diretamente na requisição.

import { G5Credential, RestG5Senior } from "rest-g5-senior";

/**
 *  Credential
 */
const credential: G5Credential = {
  user: "userName",
  password: "my-pass",
  encryption: "0"

}

RestG5Senior.registry(credential);

URL Base

URL base para as requisições (sem o nome do serviço).

Ex.: http://servidor:1234/g5-senior-services/modulo_Sync

Opcionalmente o wsdl completo pode ser enviado em cada requisição no atributo wsdl, omitindo o service.

import { G5Config, RestG5Senior } from "rest-g5-senior";

/**
 * Base URL
 */
const config: G5Config = {
  baseUrl: "http://servidor:1234/g5-senior-services/modulo_Sync"
}
RestG5Senior.g5config(config);

Parametros da Requisição

O atributo service pode receber o nome do serviço com "." ou "_". Ex.: com.senior.cad... e com_senior_cad... são equivalentes.

Opcionalmente pode-se enviar o wsdl completo (exatamente como indicado na documentação Senior), nesse caso o atributo service é desconsiderado. Exemplo no item Requisição sem registro prévio

import { G5Request } from "rest-g5-senior";

/**
 * Request Params
 */
const request: G5Request = {
  service: "com.senior...",
  port: "Gravar...",
  parameters: {
    codEmp: "1",
    codFil: "1",
    others: "...."
  },
};

Requisição (Rxjs)

import { RestG5Senior } from "rest-g5-senior";

/**
 * Request
 */
RestG5Senior.request(request).subscribe({
  next: (res: any) => {
    const fixedRes = RestG5Senior.fixTableIndex(res);
    console.log(fixedRes);
  },
  error: (err: any) => console.log(err),
});

Requisição (Promise)

/**
 * Async Request
 */
import { RestG5Senior } from "rest-g5-senior";

RestG5Senior.asyncRequest(request).then((res: any) => {
  const fixedRes = RestG5Senior.fixTableIndex(res);
  console.log(fixedRes);
}).catch((err: any) => 
  console.log(err)
)

Requisição sem registro prévio

import { G5Request, RestG5Senior } from "rest-g5-senior";

/**
 * Request Params
 */
const request: G5Request = {
  wsdl: "http://servidor:1234/g5-senior-services/modulo_Synccom.senior...",
  port: "Gravar...",
  parameters: {
    codEmp: "1",
    codFil: "1",
    others: "...."
  },
};
/**
 * Request
 */
RestG5Senior.request(request, credential).subscribe({
  next: (res: any) => {
    const fixedRes = RestG5Senior.fixTableIndex(res);
    console.log(fixedRes);
  },
  error: (err: any) => console.log(err),
});

FAQs

Package last updated on 01 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc