Skip to content

Commit

Permalink
Merge pull request #31 from sisgha/dev-gabriel
Browse files Browse the repository at this point in the history
feat(js/spec): arquivo: operations: ArquivoGetFileOperation
  • Loading branch information
guesant authored Apr 29, 2024
2 parents 30220ec + a40e728 commit 832a0ef
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './types';
export * from './EntityDeclaration';

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { IDeclaredEntity, IEntityDeclarationRawProperty } from '../EntityDeclaration/EntityDeclaration';

export type IOperationDeclaration = {
name: string;
description: string;

input?:
| {
strategy: 'file';
}
| {
strategy: 'dto';

dto?: Record<string, IEntityDeclarationRawProperty> | null;

body?: Record<string, IEntityDeclarationRawProperty> | null;
query?: Record<string, IEntityDeclarationRawProperty> | null;
params?: Record<string, IEntityDeclarationRawProperty> | null;

combineInputs?: (inputs: { body: Record<string, unknown>; query: Record<string, unknown>; params?: unknown }) => unknown;
}
| null;

output:
| {
strategy: 'file';
}
| {
strateg: 'dto';
dto: IDeclaredEntity<any>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './OperationDeclaration';
1 change: 1 addition & 0 deletions javascript/sisgea-spec/src/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './EntityDeclaration';
export * from './OperationDeclaration';
export * from './pick';
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { IOperationDeclaration, PropertyTypes } from '@/helpers';

export const ArquivoGetFileOperation = () => {
return {
name: 'ArquivoGetFile',

description: 'Obtêm o conteúdo de um arquivo.',

input: {
strategy: 'dto',
params: {
id: {
required: true,
nullable: false,
type: PropertyTypes.UUID,
description: 'ID do arquivo.',
},
},
query: {
['acesso.recurso.nome']: {
required: true,
nullable: false,
type: PropertyTypes.STRING,
description: 'Acesso via recurso: nome',
},
['acesso.recurso.id']: {
required: true,
nullable: false,
type: PropertyTypes.UUID,
description: 'Acesso via recurso: id',
},
},
},

output: {
strategy: 'file',
},
} satisfies IOperationDeclaration;
};
1 change: 1 addition & 0 deletions javascript/sisgea-spec/src/sisgea/base/arquivo/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './arquivo.declaration';
export * from './arquivo.operations';

0 comments on commit 832a0ef

Please sign in to comment.