-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from sisgha/dev-gabriel
feat(js/spec): arquivo: operations: ArquivoGetFileOperation
- Loading branch information
Showing
8 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './types'; | ||
export * from './EntityDeclaration'; |
1 change: 0 additions & 1 deletion
1
javascript/sisgea-spec/src/helpers/EntityDeclaration/types/index.ts
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
javascript/sisgea-spec/src/helpers/OperationDeclaration/OperationDeclaration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
}; | ||
}; |
1 change: 1 addition & 0 deletions
1
javascript/sisgea-spec/src/helpers/OperationDeclaration/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './OperationDeclaration'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './EntityDeclaration'; | ||
export * from './OperationDeclaration'; | ||
export * from './pick'; |
39 changes: 39 additions & 0 deletions
39
javascript/sisgea-spec/src/sisgea/base/arquivo/arquivo.operations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './arquivo.declaration'; | ||
export * from './arquivo.operations'; |