Skip to content
This repository has been archived by the owner on Nov 14, 2019. It is now read-only.

Update new process api #125

Merged
merged 1 commit into from
Aug 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion copy-proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mkdir -p src/protobuf/api
mkdir -p src/protobuf/types
mkdir -p src/api/typedef

ressources="event execution instance service workflow"
ressources="event execution instance service process"
for ressource in $ressources; do
curl -o "./src/protobuf/api/${ressource}.proto" "$PROTO_PATH/api/${ressource}.proto"
curl -o "./src/protobuf/types/${ressource}.proto" "$PROTO_PATH/types/${ressource}.proto"
Expand Down
14 changes: 7 additions & 7 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
ExecutionCreateInputs, ExecutionGetInputs, ExecutionUpdateInputs, ExecutionCreateOutputs, ExecutionGetOutputs, ExecutionUpdateOutputs, ExecutionStreamInputs,
InstanceCreateInputs, InstanceGetInputs, InstanceListInputs, InstanceDeleteInputs, InstanceCreateOutputs, InstanceGetOutputs, InstanceListOutputs, InstanceDeleteOutputs,
ServiceCreateInputs, ServiceGetInputs, ServiceListInputs, ServiceDeleteInputs, ServiceCreateOutputs, ServiceGetOutputs, ServiceListOutputs, ServiceDeleteOutputs,
WorkflowCreateInputs, WorkflowGetInputs, WorkflowListInputs, WorkflowDeleteInputs, WorkflowCreateOutputs, WorkflowGetOutputs, WorkflowListOutputs, WorkflowDeleteOutputs,
ProcessCreateInputs, ProcessGetInputs, ProcessListInputs, ProcessDeleteInputs, ProcessCreateOutputs, ProcessGetOutputs, ProcessListOutputs, ProcessDeleteOutputs,
InfoOutputs
} from './types'

Expand All @@ -16,7 +16,7 @@ export default (endpoint: string): API => {
const execution = createClient('Execution', 'protobuf/api/execution.proto', endpoint)
const instance = createClient('Instance', 'protobuf/api/instance.proto', endpoint)
const service = createClient('Service', 'protobuf/api/service.proto', endpoint)
const workflow = createClient('Workflow', 'protobuf/api/workflow.proto', endpoint)
const process = createClient('Process', 'protobuf/api/process.proto', endpoint)
const core = createClient('Core', 'protobuf/api/core.proto', endpoint)
return {
event: {
Expand All @@ -41,11 +41,11 @@ export default (endpoint: string): API => {
list: promisify(service, 'List') as (request: ServiceListInputs) => ServiceListOutputs,
delete: promisify(service, 'Delete') as (request: ServiceDeleteInputs) => ServiceDeleteOutputs
},
workflow: {
create: promisify(workflow, 'Create') as (request: WorkflowCreateInputs) => WorkflowCreateOutputs,
get: promisify(workflow, 'Get') as (request: WorkflowGetInputs) => WorkflowGetOutputs,
list: promisify(workflow, 'List') as (request: WorkflowListInputs) => WorkflowListOutputs,
delete: promisify(workflow, 'Delete') as (request: WorkflowDeleteInputs) => WorkflowDeleteOutputs
process: {
create: promisify(process, 'Create') as (request: ProcessCreateInputs) => ProcessCreateOutputs,
get: promisify(process, 'Get') as (request: ProcessGetInputs) => ProcessGetOutputs,
list: promisify(process, 'List') as (request: ProcessListInputs) => ProcessListOutputs,
delete: promisify(process, 'Delete') as (request: ProcessDeleteInputs) => ProcessDeleteOutputs
},
core: {
info: promisify(core, 'Info') as () => InfoOutputs
Expand Down
4 changes: 2 additions & 2 deletions src/api/mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export default (endpoint: string): API => ({
list() { return Promise.resolve({ services: [] }) },
delete() { return Promise.resolve({}) },
},
workflow: {
process: {
create() { return Promise.resolve({ hash }) },
get() { return Promise.resolve({ }) },
list() { return Promise.resolve({ workflows: [] }) },
list() { return Promise.resolve({ processes: [] }) },
delete() { return Promise.resolve({}) },
},
core: {
Expand Down
8 changes: 4 additions & 4 deletions src/api/typedef/execution.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ declare namespace mesg {
/** Execution tags */
tags?: (string[]|null);

/** Execution workflowHash */
workflowHash?: (Uint8Array|null);
/** Execution processHash */
processHash?: (Uint8Array|null);

/** Execution stepID */
stepID?: (string|null);
Expand Down Expand Up @@ -95,8 +95,8 @@ declare namespace mesg {
/** Execution tags. */
public tags: string[];

/** Execution workflowHash. */
public workflowHash: Uint8Array;
/** Execution processHash. */
public processHash: Uint8Array;

/** Execution stepID. */
public stepID: string;
Expand Down
Loading