Skip to content

Commit

Permalink
Merge pull request #15 from brunogasparetto/master
Browse files Browse the repository at this point in the history
Adiciona alguns elementos dos serviços SOAP
  • Loading branch information
brunogasparetto authored Mar 24, 2024
2 parents dff3928 + 6944949 commit 54783ca
Show file tree
Hide file tree
Showing 10 changed files with 2,276 additions and 1,156 deletions.
2,867 changes: 1,714 additions & 1,153 deletions fluig.d.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluig-declaration-type",
"version": "1.2.0",
"version": "1.3.0",
"description": "Fluig decaration types",
"types": "fluig.d.ts",
"scripts": {
Expand All @@ -22,6 +22,7 @@
"homepage": "https://github.com/brunogasparetto/fluig-declaration-type#readme",
"devDependencies": {
"gulp": "^4.0.2",
"gulp-cli": "^2.3.0",
"gulp-concat": "^2.6.1"
}
}
54 changes: 52 additions & 2 deletions src/fluig/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ declare namespace globalVars {
* - WKManagerMode: Identifica se o processo está sendo movimentado pela visão do gestor do processo ou não. Só funciona no Workflow
* - WKReplacement: Código do usuário substituto
* - WKIsTransfer: Permite verificar se o usuário está ou não transferindo uma tarefa
* -
*/
declare function getValue(nomePropriedade: string): string;

Expand Down Expand Up @@ -123,5 +122,56 @@ declare namespace ServiceManager {
* var service = ServiceManager.getService("ems2_v10");
* var serviceHelper = service.getBean();
*/
declare function getService(serviceId: string): object;
declare function getService(serviceId: string): ServiceInstantiate;
};

declare class ServiceInstantiate {
/**
* Pega o Helper para instanciar os objetos
*/
getBean(): ServiceHelper;
}

/**
* Classe para instanciar objetos do WS SOAP
*/
declare class ServiceHelper {
/**
* Instancia um objeto da classe indicada
*
* @param classPath Caminho da Classe
*
* @example
* var serviceHelper = ServiceManager.getService("ECMCardService").getBean();
* var cardDto = serviceHelper.instantiate("com.totvs.technology.ecm.dm.ws.CardDto");
*/
instantiate(classPath: string): object;

/**
* Instancia o serviço com autenticação Basic
*
* @param service Instância do serviço que será autenticado
* @param classPath Caminho da Classe a ser instanciada
* @param user Usuário da Autenticação
* @param password Senha da Autenticação
*
* @example
* var serviceHelper = ServiceManager
* .getService("RM_CONSULTA_SQL")
* .getBean()
* ;
*
* var service = serviceHelper
* .instantiate("com.totvs.WsConsultaSQL")
* .getRMIwsConsultaSQL()
* ;
*
* var serviceSqlAuthenticated = serviceHelper.getBasicAuthenticatedClient(
* service,
* "com.totvs.IwsConsultaSQL",
* "meuUsuário",
* "minhaSenha"
* );
*/
getBasicAuthenticatedClient(service: object, classPath: string, user: string, password: string): object;
}
5 changes: 5 additions & 0 deletions src/fluig/log.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ declare namespace log {
* Log com "criticidade" FATAL
*/
declare function fatal(message: string): void;

/**
* Log com "criticidade" INFO para objetos ao invés de texto
*/
declare function dir(item: object): void;
};
60 changes: 60 additions & 0 deletions src/fluigSoap/ECMCardService.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
declare namespace com.totvs.technology.ecm.dm.ws {

/**
* Serviço para tratar registros de formulários
*/
declare class CardService {

/**
* Cria um registro de formulário
*/
create(companyId: number, username: string, password: string, card: CardDtoArray): WebServiceMessageArray;

/**
* Atualiza o registro do formulário
*/
updateCardData(companyId: number, username: string, password: string, cardId: number, cardData: CardFieldDtoArray): WebServiceMessageArray;

/**
* Apaga o registro do formulário
*/
deleteCard(companyId: number, username: string, password: string, cardId: number): WebServiceMessageArray;
}

/**
* Representa um Documento/Formulário
*/
declare class CardDto {
setUserNotify(notify: boolean): void;
setInheritSecurity(inherit: boolean): void;
setDocumentDescription(description: string): void;
setParentDocumentId(parentId: number): void;
getCardData(): java.util.List<CardFieldDto>;
}

/**
* Representa um campo do Documento/Formulário
*/
declare class CardFieldDto {
setField(field: string): void;
setValue(value: string): void;
}

/**
* Representa um conjunto de Documentos/Formulários
*
* Utilizado ao criar um documento/formulário.
*/
declare class CardDtoArray {
getItem(): java.util.List<CardDto>;
}

/**
* Representa um conjunto de campos do Documento/Formulário
*
* Utilizado ao editar um documento/formulário.
*/
declare class CardFieldDtoArray {
getItem(): java.util.List<CardFieldDto>;
}
}
78 changes: 78 additions & 0 deletions src/fluigSoap/ECMDocumentService.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
declare namespace com.totvs.technology.ecm.dm.ws {
/**
* Serviço para gerenciar os documentos via SOAP
*
* @example
* var serviceHelper = ServiceManager.getService("ECMDocumentService").getBean();
*
* // Instanciando o objeto da classe DocumentService
* var service = serviceHelper
* .instantiate("com.totvs.technology.ecm.dm.ws.ECMDocumentServiceService")
* .getDocumentServicePort()
* ;
*/
declare class DocumentService {
/**
* Cria um documento do jeito simplificado
*/
createSimpleDocument(
username: string,
password: string,
companyId: number,
folderId: number,
publisherCode: string,
fileName: string,
attachmentArray: AttachmentArray
): WebServiceMessageArray;

/**
* Pega o conteúdo de um arquivo do GED
*/
getDocumentContent(
username: string,
password: string,
companyId: number,
documentId: number,
userCode: string,
version: number,
documentDescription: string
): java.lang.Byte[];
}

declare class Attachment {
setFileName(fileName: string): void;
setFileSize(fileSize: number): void;
setAttach(isAttach: boolean): void;
setEditing(isEditing: boolean): void;
setPrincipal(isPrincipal: boolean): void;

/**
* Configura o conteúdo do arquivo
*
* @param content Conteúdo em ByteArray
*
* @example
* var serviceHelper = ServiceManager
* .getService("ECMDocumentService")
* .getBean()
* ;
*
* var service = serviceHelper
* .instantiate("com.totvs.technology.ecm.dm.ws.ECMDocumentServiceService")
* .getDocumentServicePort()
* ;
*
* var attachment = serviceHelper
* .instantiate("com.totvs.technology.ecm.dm.ws.Attachment")
* ;
*
* // Inserindo conteúdo em Base64
* attachment.setFileContent(java.util.Base64.getDecoder().decode(new java.lang.String("string em Base64").getBytes("UTF-8"))
*/
setFilecontent(content: java.lang.Byte[]): void;
}

declare class AttachmentArray {
getItem(): java.util.List<Attachment>;
}
}
Loading

0 comments on commit 54783ca

Please sign in to comment.