Skip to content
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
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PROTO_PATHS = paths=source_relative:$(PROTO_OUT)
OAPI_OUT := openapi
OAPI3_PATH := .components.schemas.Payload

NEX_GEN ?= nex-gen
NEX_GEN ?= nexgen

$(PROTO_OUT):
mkdir $(PROTO_OUT)
Expand Down Expand Up @@ -144,20 +144,29 @@ nexus-rpc-yaml-install:
##### Compile system Nexus WIT files #####
system-nexus-wit: system-nexus-wit-install nex-gen-install
printf $(COLOR) "Generate system Nexus WIT..."
protoc -I $(PROTO_ROOT) \
tmp=$$(mktemp -d); trap 'rm -rf "$$tmp"' EXIT; \
protoc -I $(PROTO_ROOT) --include_imports \
--descriptor_set_out="$$tmp/system.bin" \
--system-nexus-wit_opt=output=nexus/workflow-service.wit \
--system-nexus-wit_opt=nex_gen=$(NEX_GEN) \
--system-nexus-wit_opt=linked_input=nexus/deps \
--system-nexus-wit_out=. \
temporal/api/workflowservice/v1/service.proto
temporal/api/workflowservice/v1/service.proto \
temporal/api/notificationservice/v1/request_response.proto && \
$(NEX_GEN) add-message \
--descriptors "$$tmp/system.bin" \
--file temporal/api/notificationservice/v1/request_response.proto \
--input nexus/notification-service.wit \
--input nexus/deps \
--output nexus/notification-service.wit

system-nexus-wit-install:
printf $(COLOR) "Build and install protoc-gen-system-nexus-wit..."
@cd cmd/protoc-gen-system-nexus-wit && go install .

nex-gen-install:
printf $(COLOR) "Install nex-gen if missing..."
command -v $(NEX_GEN) >/dev/null || cargo install nex-gen --version ^0.1
printf $(COLOR) "Install nexgen if missing..."
command -v $(NEX_GEN) >/dev/null || cargo install nexgen --version ^0.2 --features advanced

##### Clean #####
clean:
Expand Down
34 changes: 34 additions & 0 deletions nexus/notification-service.wit
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package temporal:nexus@1.0.0;

world system {
export notification-service;
}

interface notification-service {
use nexus:temporal-types/model@1.0.0.{
failure,
placeholder,
};

/// @nexus.type-parameter
type source-context-t = placeholder;

/// @nexus.type-parameter
type output-t = placeholder;

/// @nexus.proto "temporal.api.notificationservice.v1.OnCompleteRequest.result"
variant on-complete-request-result {
success(output-t),
failure(failure),
}

/// @nexus.proto "temporal.api.notificationservice.v1.OnCompleteRequest"
record on-complete-request {
%result: on-complete-request-result,
source-context: source-context-t,
}

/// @nexus.proto "temporal.api.notificationservice.v1.OnCompleteResponse"
record on-complete-response {
}
}
Loading