From c7c10976529224062e1f09838d102e7de5346fb5 Mon Sep 17 00:00:00 2001 From: g Date: Fri, 26 Jan 2024 18:24:47 -0700 Subject: [PATCH] fix: update protoc to latest --- .../clients/admin/admin-client.test.ts | 3 - .../hatchet/clients/admin/admin-client.ts | 3 - .../clients/dispatcher/action-listener.ts | 2 - .../dispatcher/dispatcher-client.test.ts | 6 +- .../clients/dispatcher/dispatcher-client.ts | 2 - .../clients/event/event-client.test.ts | 1 - .../hatchet/clients/event/event-client.ts | 1 - .../hatchet/clients/worker/worker.ts | 2 - .../protoc/dispatcher/dispatcher.ts | 135 ++++------------ typescript-sdk/protoc/events/events.ts | 83 ++-------- typescript-sdk/protoc/workflows/workflows.ts | 151 +++--------------- 11 files changed, 71 insertions(+), 318 deletions(-) diff --git a/typescript-sdk/hatchet/clients/admin/admin-client.test.ts b/typescript-sdk/hatchet/clients/admin/admin-client.test.ts index 86f06ce8e..6b783fb1b 100644 --- a/typescript-sdk/hatchet/clients/admin/admin-client.test.ts +++ b/typescript-sdk/hatchet/clients/admin/admin-client.test.ts @@ -184,7 +184,6 @@ describe('AdminClient', () => { await client.put_workflow(workflow); expect(existingSpy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', name: 'workflow1', }); @@ -245,7 +244,6 @@ describe('AdminClient', () => { await client.put_workflow(workflow, { autoVersion: false }); expect(existingSpy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', name: 'workflow1', }); @@ -277,7 +275,6 @@ describe('AdminClient', () => { }); expect(spy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', workflowId: 'workflowId', schedules: [now], }); diff --git a/typescript-sdk/hatchet/clients/admin/admin-client.ts b/typescript-sdk/hatchet/clients/admin/admin-client.ts index fd8ecdc38..00f2eb821 100644 --- a/typescript-sdk/hatchet/clients/admin/admin-client.ts +++ b/typescript-sdk/hatchet/clients/admin/admin-client.ts @@ -50,7 +50,6 @@ export class AdminClient { try { existing = await this.client.getWorkflowByName({ - tenantId: this.config.tenant_id, name: workflow.name, }); } catch (e: any) { @@ -70,7 +69,6 @@ export class AdminClient { try { await this.client.putWorkflow({ - tenantId: this.config.tenant_id, opts: workflow, }); } catch (e: any) { @@ -81,7 +79,6 @@ export class AdminClient { schedule_workflow(workflowId: string, options?: { schedules?: Date[] }) { try { this.client.scheduleWorkflow({ - tenantId: this.config.tenant_id, workflowId, schedules: options?.schedules, }); diff --git a/typescript-sdk/hatchet/clients/dispatcher/action-listener.ts b/typescript-sdk/hatchet/clients/dispatcher/action-listener.ts index 36d385ed4..d7e9d4f9d 100644 --- a/typescript-sdk/hatchet/clients/dispatcher/action-listener.ts +++ b/typescript-sdk/hatchet/clients/dispatcher/action-listener.ts @@ -65,7 +65,6 @@ export class ActionListener { await sleep(DEFAULT_ACTION_LISTENER_RETRY_INTERVAL); this.listener = this.client.listen({ - tenantId: this.config.tenant_id, workerId: this.workerId, }); @@ -83,7 +82,6 @@ export class ActionListener { async unregister() { try { return this.client.unsubscribe({ - tenantId: this.config.tenant_id, workerId: this.workerId, }); } catch (e: any) { diff --git a/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.test.ts b/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.test.ts index d24e54694..324de56b3 100644 --- a/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.test.ts +++ b/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.test.ts @@ -58,14 +58,12 @@ describe('DispatcherClient', () => { }); expect(clientSpy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', workerName: 'WORKER_NAME', services: ['SERVICE'], actions: ['ACTION'], }); expect(listenerSpy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', workerId: 'WORKER_ID', }); @@ -82,7 +80,6 @@ describe('DispatcherClient', () => { }); client.send_action_event({ - tenantId: 'TENANT_ID', workerId: 'WORKER_ID', actionId: 'ACTION_ID', eventType: ActionEventType.STEP_EVENT_TYPE_COMPLETED, @@ -95,7 +92,6 @@ describe('DispatcherClient', () => { }); expect(clientSpy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', workerId: 'WORKER_ID', actionId: 'ACTION_ID', eventType: ActionEventType.STEP_EVENT_TYPE_COMPLETED, @@ -104,7 +100,7 @@ describe('DispatcherClient', () => { jobRunId: 'b', stepId: 'c', stepRunId: 'd', - eventTimestamp: expect.any(Date), + eventTimestamp: expect.any(Object), }); }); }); diff --git a/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.ts b/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.ts index 06837190f..d0458f7e4 100644 --- a/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.ts +++ b/typescript-sdk/hatchet/clients/dispatcher/dispatcher-client.ts @@ -26,13 +26,11 @@ export class DispatcherClient { async get_action_listener(options: GetActionListenerOptions) { // Register the worker const registration = await this.client.register({ - tenantId: this.config.tenant_id, ...options, }); // Subscribe to the worker const listener = this.client.listen({ - tenantId: this.config.tenant_id, workerId: registration.workerId, }); diff --git a/typescript-sdk/hatchet/clients/event/event-client.test.ts b/typescript-sdk/hatchet/clients/event/event-client.test.ts index ce574f25f..cb817913b 100644 --- a/typescript-sdk/hatchet/clients/event/event-client.test.ts +++ b/typescript-sdk/hatchet/clients/event/event-client.test.ts @@ -53,7 +53,6 @@ describe('EventClient', () => { client.push('type', { foo: 'bar' }); expect(clientSpy).toHaveBeenCalledWith({ - tenantId: 'TENANT_ID', key: 'type', payload: '{"foo":"bar"}', eventTimestamp: expect.any(Date), diff --git a/typescript-sdk/hatchet/clients/event/event-client.ts b/typescript-sdk/hatchet/clients/event/event-client.ts index 59a9059f4..537d1ec0c 100644 --- a/typescript-sdk/hatchet/clients/event/event-client.ts +++ b/typescript-sdk/hatchet/clients/event/event-client.ts @@ -19,7 +19,6 @@ export class EventClient { push(type: string, input: T) { const req: PushEventRequest = { - tenantId: this.config.tenant_id, key: type, payload: JSON.stringify(input), eventTimestamp: new Date(), diff --git a/typescript-sdk/hatchet/clients/worker/worker.ts b/typescript-sdk/hatchet/clients/worker/worker.ts index 504328aa0..6ef2b86b4 100644 --- a/typescript-sdk/hatchet/clients/worker/worker.ts +++ b/typescript-sdk/hatchet/clients/worker/worker.ts @@ -138,7 +138,6 @@ export class Worker { get_action_event(action: Action, eventType: ActionEventType, payload: any = ''): ActionEvent { return { - tenantId: action.tenantId, workerId: this.name, jobId: action.jobId, jobRunId: action.jobRunId, @@ -226,6 +225,5 @@ export class Worker { if (retries > 5) { throw new HatchetError('Could not start worker after 5 retries'); } - // await this.start(retryCount + 1); } } diff --git a/typescript-sdk/protoc/dispatcher/dispatcher.ts b/typescript-sdk/protoc/dispatcher/dispatcher.ts index be4b4e388..568eaa5df 100644 --- a/typescript-sdk/protoc/dispatcher/dispatcher.ts +++ b/typescript-sdk/protoc/dispatcher/dispatcher.ts @@ -84,8 +84,6 @@ export function actionEventTypeToJSON(object: ActionEventType): string { } export interface WorkerRegisterRequest { - /** the tenant id */ - tenantId: string; /** the name of the worker */ workerName: string; /** a list of actions that this worker can run */ @@ -125,15 +123,11 @@ export interface AssignedAction { } export interface WorkerListenRequest { - /** the tenant id */ - tenantId: string; /** the id of the worker */ workerId: string; } export interface WorkerUnsubscribeRequest { - /** the tenant id to unsubscribe from */ - tenantId: string; /** the id of the worker */ workerId: string; } @@ -146,8 +140,6 @@ export interface WorkerUnsubscribeResponse { } export interface ActionEvent { - /** the tenant id */ - tenantId: string; /** the id of the worker */ workerId: string; /** the id of the job */ @@ -177,22 +169,19 @@ export interface ActionEventResponse { } function createBaseWorkerRegisterRequest(): WorkerRegisterRequest { - return { tenantId: "", workerName: "", actions: [], services: [] }; + return { workerName: "", actions: [], services: [] }; } export const WorkerRegisterRequest = { encode(message: WorkerRegisterRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.workerName !== "") { - writer.uint32(18).string(message.workerName); + writer.uint32(10).string(message.workerName); } for (const v of message.actions) { - writer.uint32(26).string(v!); + writer.uint32(18).string(v!); } for (const v of message.services) { - writer.uint32(34).string(v!); + writer.uint32(26).string(v!); } return writer; }, @@ -209,27 +198,20 @@ export const WorkerRegisterRequest = { break; } - message.tenantId = reader.string(); + message.workerName = reader.string(); continue; case 2: if (tag !== 18) { break; } - message.workerName = reader.string(); + message.actions.push(reader.string()); continue; case 3: if (tag !== 26) { break; } - message.actions.push(reader.string()); - continue; - case 4: - if (tag !== 34) { - break; - } - message.services.push(reader.string()); continue; } @@ -243,7 +225,6 @@ export const WorkerRegisterRequest = { fromJSON(object: any): WorkerRegisterRequest { return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", workerName: isSet(object.workerName) ? globalThis.String(object.workerName) : "", actions: globalThis.Array.isArray(object?.actions) ? object.actions.map((e: any) => globalThis.String(e)) : [], services: globalThis.Array.isArray(object?.services) ? object.services.map((e: any) => globalThis.String(e)) : [], @@ -252,9 +233,6 @@ export const WorkerRegisterRequest = { toJSON(message: WorkerRegisterRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.workerName !== "") { obj.workerName = message.workerName; } @@ -272,7 +250,6 @@ export const WorkerRegisterRequest = { }, fromPartial(object: DeepPartial): WorkerRegisterRequest { const message = createBaseWorkerRegisterRequest(); - message.tenantId = object.tenantId ?? ""; message.workerName = object.workerName ?? ""; message.actions = object.actions?.map((e) => e) || []; message.services = object.services?.map((e) => e) || []; @@ -559,16 +536,13 @@ export const AssignedAction = { }; function createBaseWorkerListenRequest(): WorkerListenRequest { - return { tenantId: "", workerId: "" }; + return { workerId: "" }; } export const WorkerListenRequest = { encode(message: WorkerListenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.workerId !== "") { - writer.uint32(18).string(message.workerId); + writer.uint32(10).string(message.workerId); } return writer; }, @@ -585,13 +559,6 @@ export const WorkerListenRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.workerId = reader.string(); continue; } @@ -604,17 +571,11 @@ export const WorkerListenRequest = { }, fromJSON(object: any): WorkerListenRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "", - }; + return { workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "" }; }, toJSON(message: WorkerListenRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.workerId !== "") { obj.workerId = message.workerId; } @@ -626,23 +587,19 @@ export const WorkerListenRequest = { }, fromPartial(object: DeepPartial): WorkerListenRequest { const message = createBaseWorkerListenRequest(); - message.tenantId = object.tenantId ?? ""; message.workerId = object.workerId ?? ""; return message; }, }; function createBaseWorkerUnsubscribeRequest(): WorkerUnsubscribeRequest { - return { tenantId: "", workerId: "" }; + return { workerId: "" }; } export const WorkerUnsubscribeRequest = { encode(message: WorkerUnsubscribeRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.workerId !== "") { - writer.uint32(18).string(message.workerId); + writer.uint32(10).string(message.workerId); } return writer; }, @@ -659,13 +616,6 @@ export const WorkerUnsubscribeRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.workerId = reader.string(); continue; } @@ -678,17 +628,11 @@ export const WorkerUnsubscribeRequest = { }, fromJSON(object: any): WorkerUnsubscribeRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "", - }; + return { workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "" }; }, toJSON(message: WorkerUnsubscribeRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.workerId !== "") { obj.workerId = message.workerId; } @@ -700,7 +644,6 @@ export const WorkerUnsubscribeRequest = { }, fromPartial(object: DeepPartial): WorkerUnsubscribeRequest { const message = createBaseWorkerUnsubscribeRequest(); - message.tenantId = object.tenantId ?? ""; message.workerId = object.workerId ?? ""; return message; }, @@ -782,7 +725,6 @@ export const WorkerUnsubscribeResponse = { function createBaseActionEvent(): ActionEvent { return { - tenantId: "", workerId: "", jobId: "", jobRunId: "", @@ -797,35 +739,32 @@ function createBaseActionEvent(): ActionEvent { export const ActionEvent = { encode(message: ActionEvent, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.workerId !== "") { - writer.uint32(18).string(message.workerId); + writer.uint32(10).string(message.workerId); } if (message.jobId !== "") { - writer.uint32(26).string(message.jobId); + writer.uint32(18).string(message.jobId); } if (message.jobRunId !== "") { - writer.uint32(34).string(message.jobRunId); + writer.uint32(26).string(message.jobRunId); } if (message.stepId !== "") { - writer.uint32(42).string(message.stepId); + writer.uint32(34).string(message.stepId); } if (message.stepRunId !== "") { - writer.uint32(50).string(message.stepRunId); + writer.uint32(42).string(message.stepRunId); } if (message.actionId !== "") { - writer.uint32(58).string(message.actionId); + writer.uint32(50).string(message.actionId); } if (message.eventTimestamp !== undefined) { - Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(66).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(58).fork()).ldelim(); } if (message.eventType !== 0) { - writer.uint32(72).int32(message.eventType); + writer.uint32(64).int32(message.eventType); } if (message.eventPayload !== "") { - writer.uint32(82).string(message.eventPayload); + writer.uint32(74).string(message.eventPayload); } return writer; }, @@ -842,66 +781,59 @@ export const ActionEvent = { break; } - message.tenantId = reader.string(); + message.workerId = reader.string(); continue; case 2: if (tag !== 18) { break; } - message.workerId = reader.string(); + message.jobId = reader.string(); continue; case 3: if (tag !== 26) { break; } - message.jobId = reader.string(); + message.jobRunId = reader.string(); continue; case 4: if (tag !== 34) { break; } - message.jobRunId = reader.string(); + message.stepId = reader.string(); continue; case 5: if (tag !== 42) { break; } - message.stepId = reader.string(); + message.stepRunId = reader.string(); continue; case 6: if (tag !== 50) { break; } - message.stepRunId = reader.string(); + message.actionId = reader.string(); continue; case 7: if (tag !== 58) { break; } - message.actionId = reader.string(); - continue; - case 8: - if (tag !== 66) { - break; - } - message.eventTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); continue; - case 9: - if (tag !== 72) { + case 8: + if (tag !== 64) { break; } message.eventType = reader.int32() as any; continue; - case 10: - if (tag !== 82) { + case 9: + if (tag !== 74) { break; } @@ -918,7 +850,6 @@ export const ActionEvent = { fromJSON(object: any): ActionEvent { return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", workerId: isSet(object.workerId) ? globalThis.String(object.workerId) : "", jobId: isSet(object.jobId) ? globalThis.String(object.jobId) : "", jobRunId: isSet(object.jobRunId) ? globalThis.String(object.jobRunId) : "", @@ -933,9 +864,6 @@ export const ActionEvent = { toJSON(message: ActionEvent): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.workerId !== "") { obj.workerId = message.workerId; } @@ -971,7 +899,6 @@ export const ActionEvent = { }, fromPartial(object: DeepPartial): ActionEvent { const message = createBaseActionEvent(); - message.tenantId = object.tenantId ?? ""; message.workerId = object.workerId ?? ""; message.jobId = object.jobId ?? ""; message.jobRunId = object.jobRunId ?? ""; diff --git a/typescript-sdk/protoc/events/events.ts b/typescript-sdk/protoc/events/events.ts index 8a3e2317a..fed7e6757 100644 --- a/typescript-sdk/protoc/events/events.ts +++ b/typescript-sdk/protoc/events/events.ts @@ -19,8 +19,6 @@ export interface Event { } export interface PushEventRequest { - /** the tenant id */ - tenantId: string; /** the key for the event */ key: string; /** the payload for the event */ @@ -30,8 +28,6 @@ export interface PushEventRequest { } export interface ListEventRequest { - /** (required) the tenant id */ - tenantId: string; /** (optional) the number of events to skip */ offset: number; /** (optional) the key for the event */ @@ -44,8 +40,6 @@ export interface ListEventResponse { } export interface ReplayEventRequest { - /** the tenant id */ - tenantId: string; /** the event id to replay */ eventId: string; } @@ -170,22 +164,19 @@ export const Event = { }; function createBasePushEventRequest(): PushEventRequest { - return { tenantId: "", key: "", payload: "", eventTimestamp: undefined }; + return { key: "", payload: "", eventTimestamp: undefined }; } export const PushEventRequest = { encode(message: PushEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.key !== "") { - writer.uint32(18).string(message.key); + writer.uint32(10).string(message.key); } if (message.payload !== "") { - writer.uint32(26).string(message.payload); + writer.uint32(18).string(message.payload); } if (message.eventTimestamp !== undefined) { - Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(34).fork()).ldelim(); + Timestamp.encode(toTimestamp(message.eventTimestamp), writer.uint32(26).fork()).ldelim(); } return writer; }, @@ -202,27 +193,20 @@ export const PushEventRequest = { break; } - message.tenantId = reader.string(); + message.key = reader.string(); continue; case 2: if (tag !== 18) { break; } - message.key = reader.string(); + message.payload = reader.string(); continue; case 3: if (tag !== 26) { break; } - message.payload = reader.string(); - continue; - case 4: - if (tag !== 34) { - break; - } - message.eventTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32())); continue; } @@ -236,7 +220,6 @@ export const PushEventRequest = { fromJSON(object: any): PushEventRequest { return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", key: isSet(object.key) ? globalThis.String(object.key) : "", payload: isSet(object.payload) ? globalThis.String(object.payload) : "", eventTimestamp: isSet(object.eventTimestamp) ? fromJsonTimestamp(object.eventTimestamp) : undefined, @@ -245,9 +228,6 @@ export const PushEventRequest = { toJSON(message: PushEventRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.key !== "") { obj.key = message.key; } @@ -265,7 +245,6 @@ export const PushEventRequest = { }, fromPartial(object: DeepPartial): PushEventRequest { const message = createBasePushEventRequest(); - message.tenantId = object.tenantId ?? ""; message.key = object.key ?? ""; message.payload = object.payload ?? ""; message.eventTimestamp = object.eventTimestamp ?? undefined; @@ -274,19 +253,16 @@ export const PushEventRequest = { }; function createBaseListEventRequest(): ListEventRequest { - return { tenantId: "", offset: 0, key: "" }; + return { offset: 0, key: "" }; } export const ListEventRequest = { encode(message: ListEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.offset !== 0) { - writer.uint32(16).int32(message.offset); + writer.uint32(8).int32(message.offset); } if (message.key !== "") { - writer.uint32(26).string(message.key); + writer.uint32(18).string(message.key); } return writer; }, @@ -299,21 +275,14 @@ export const ListEventRequest = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (tag !== 10) { - break; - } - - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 16) { + if (tag !== 8) { break; } message.offset = reader.int32(); continue; - case 3: - if (tag !== 26) { + case 2: + if (tag !== 18) { break; } @@ -330,7 +299,6 @@ export const ListEventRequest = { fromJSON(object: any): ListEventRequest { return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0, key: isSet(object.key) ? globalThis.String(object.key) : "", }; @@ -338,9 +306,6 @@ export const ListEventRequest = { toJSON(message: ListEventRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.offset !== 0) { obj.offset = Math.round(message.offset); } @@ -355,7 +320,6 @@ export const ListEventRequest = { }, fromPartial(object: DeepPartial): ListEventRequest { const message = createBaseListEventRequest(); - message.tenantId = object.tenantId ?? ""; message.offset = object.offset ?? 0; message.key = object.key ?? ""; return message; @@ -420,16 +384,13 @@ export const ListEventResponse = { }; function createBaseReplayEventRequest(): ReplayEventRequest { - return { tenantId: "", eventId: "" }; + return { eventId: "" }; } export const ReplayEventRequest = { encode(message: ReplayEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.eventId !== "") { - writer.uint32(18).string(message.eventId); + writer.uint32(10).string(message.eventId); } return writer; }, @@ -446,13 +407,6 @@ export const ReplayEventRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.eventId = reader.string(); continue; } @@ -465,17 +419,11 @@ export const ReplayEventRequest = { }, fromJSON(object: any): ReplayEventRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - eventId: isSet(object.eventId) ? globalThis.String(object.eventId) : "", - }; + return { eventId: isSet(object.eventId) ? globalThis.String(object.eventId) : "" }; }, toJSON(message: ReplayEventRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.eventId !== "") { obj.eventId = message.eventId; } @@ -487,7 +435,6 @@ export const ReplayEventRequest = { }, fromPartial(object: DeepPartial): ReplayEventRequest { const message = createBaseReplayEventRequest(); - message.tenantId = object.tenantId ?? ""; message.eventId = object.eventId ?? ""; return message; }, diff --git a/typescript-sdk/protoc/workflows/workflows.ts b/typescript-sdk/protoc/workflows/workflows.ts index 9dfcd3c44..e800f4bff 100644 --- a/typescript-sdk/protoc/workflows/workflows.ts +++ b/typescript-sdk/protoc/workflows/workflows.ts @@ -7,7 +7,6 @@ import { StringValue } from "../google/protobuf/wrappers"; export const protobufPackage = ""; export interface PutWorkflowRequest { - tenantId: string; opts: CreateWorkflowVersionOpts | undefined; } @@ -57,11 +56,9 @@ export interface CreateWorkflowStepOpts { /** ListWorkflowsRequest is the request for ListWorkflows. */ export interface ListWorkflowsRequest { - tenantId: string; } export interface ScheduleWorkflowRequest { - tenantId: string; workflowId: string; schedules: Date[]; /** (optional) the input data for the workflow */ @@ -75,7 +72,6 @@ export interface ListWorkflowsResponse { /** ListWorkflowsForEventRequest is the request for ListWorkflowsForEvent. */ export interface ListWorkflowsForEventRequest { - tenantId: string; eventKey: string; } @@ -160,26 +156,21 @@ export interface Step { } export interface DeleteWorkflowRequest { - tenantId: string; workflowId: string; } export interface GetWorkflowByNameRequest { - tenantId: string; name: string; } function createBasePutWorkflowRequest(): PutWorkflowRequest { - return { tenantId: "", opts: undefined }; + return { opts: undefined }; } export const PutWorkflowRequest = { encode(message: PutWorkflowRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.opts !== undefined) { - CreateWorkflowVersionOpts.encode(message.opts, writer.uint32(18).fork()).ldelim(); + CreateWorkflowVersionOpts.encode(message.opts, writer.uint32(10).fork()).ldelim(); } return writer; }, @@ -196,13 +187,6 @@ export const PutWorkflowRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.opts = CreateWorkflowVersionOpts.decode(reader, reader.uint32()); continue; } @@ -215,17 +199,11 @@ export const PutWorkflowRequest = { }, fromJSON(object: any): PutWorkflowRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - opts: isSet(object.opts) ? CreateWorkflowVersionOpts.fromJSON(object.opts) : undefined, - }; + return { opts: isSet(object.opts) ? CreateWorkflowVersionOpts.fromJSON(object.opts) : undefined }; }, toJSON(message: PutWorkflowRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.opts !== undefined) { obj.opts = CreateWorkflowVersionOpts.toJSON(message.opts); } @@ -237,7 +215,6 @@ export const PutWorkflowRequest = { }, fromPartial(object: DeepPartial): PutWorkflowRequest { const message = createBasePutWorkflowRequest(); - message.tenantId = object.tenantId ?? ""; message.opts = (object.opts !== undefined && object.opts !== null) ? CreateWorkflowVersionOpts.fromPartial(object.opts) : undefined; @@ -636,14 +613,11 @@ export const CreateWorkflowStepOpts = { }; function createBaseListWorkflowsRequest(): ListWorkflowsRequest { - return { tenantId: "" }; + return {}; } export const ListWorkflowsRequest = { - encode(message: ListWorkflowsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } + encode(_: ListWorkflowsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, @@ -654,13 +628,6 @@ export const ListWorkflowsRequest = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.tenantId = reader.string(); - continue; } if ((tag & 7) === 4 || tag === 0) { break; @@ -670,45 +637,38 @@ export const ListWorkflowsRequest = { return message; }, - fromJSON(object: any): ListWorkflowsRequest { - return { tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "" }; + fromJSON(_: any): ListWorkflowsRequest { + return {}; }, - toJSON(message: ListWorkflowsRequest): unknown { + toJSON(_: ListWorkflowsRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } return obj; }, create(base?: DeepPartial): ListWorkflowsRequest { return ListWorkflowsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListWorkflowsRequest { + fromPartial(_: DeepPartial): ListWorkflowsRequest { const message = createBaseListWorkflowsRequest(); - message.tenantId = object.tenantId ?? ""; return message; }, }; function createBaseScheduleWorkflowRequest(): ScheduleWorkflowRequest { - return { tenantId: "", workflowId: "", schedules: [], input: "" }; + return { workflowId: "", schedules: [], input: "" }; } export const ScheduleWorkflowRequest = { encode(message: ScheduleWorkflowRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.workflowId !== "") { - writer.uint32(18).string(message.workflowId); + writer.uint32(10).string(message.workflowId); } for (const v of message.schedules) { - Timestamp.encode(toTimestamp(v!), writer.uint32(26).fork()).ldelim(); + Timestamp.encode(toTimestamp(v!), writer.uint32(18).fork()).ldelim(); } if (message.input !== "") { - writer.uint32(34).string(message.input); + writer.uint32(26).string(message.input); } return writer; }, @@ -725,27 +685,20 @@ export const ScheduleWorkflowRequest = { break; } - message.tenantId = reader.string(); + message.workflowId = reader.string(); continue; case 2: if (tag !== 18) { break; } - message.workflowId = reader.string(); + message.schedules.push(fromTimestamp(Timestamp.decode(reader, reader.uint32()))); continue; case 3: if (tag !== 26) { break; } - message.schedules.push(fromTimestamp(Timestamp.decode(reader, reader.uint32()))); - continue; - case 4: - if (tag !== 34) { - break; - } - message.input = reader.string(); continue; } @@ -759,7 +712,6 @@ export const ScheduleWorkflowRequest = { fromJSON(object: any): ScheduleWorkflowRequest { return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", workflowId: isSet(object.workflowId) ? globalThis.String(object.workflowId) : "", schedules: globalThis.Array.isArray(object?.schedules) ? object.schedules.map((e: any) => fromJsonTimestamp(e)) @@ -770,9 +722,6 @@ export const ScheduleWorkflowRequest = { toJSON(message: ScheduleWorkflowRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.workflowId !== "") { obj.workflowId = message.workflowId; } @@ -790,7 +739,6 @@ export const ScheduleWorkflowRequest = { }, fromPartial(object: DeepPartial): ScheduleWorkflowRequest { const message = createBaseScheduleWorkflowRequest(); - message.tenantId = object.tenantId ?? ""; message.workflowId = object.workflowId ?? ""; message.schedules = object.schedules?.map((e) => e) || []; message.input = object.input ?? ""; @@ -860,16 +808,13 @@ export const ListWorkflowsResponse = { }; function createBaseListWorkflowsForEventRequest(): ListWorkflowsForEventRequest { - return { tenantId: "", eventKey: "" }; + return { eventKey: "" }; } export const ListWorkflowsForEventRequest = { encode(message: ListWorkflowsForEventRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.eventKey !== "") { - writer.uint32(18).string(message.eventKey); + writer.uint32(10).string(message.eventKey); } return writer; }, @@ -886,13 +831,6 @@ export const ListWorkflowsForEventRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.eventKey = reader.string(); continue; } @@ -905,17 +843,11 @@ export const ListWorkflowsForEventRequest = { }, fromJSON(object: any): ListWorkflowsForEventRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - eventKey: isSet(object.eventKey) ? globalThis.String(object.eventKey) : "", - }; + return { eventKey: isSet(object.eventKey) ? globalThis.String(object.eventKey) : "" }; }, toJSON(message: ListWorkflowsForEventRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.eventKey !== "") { obj.eventKey = message.eventKey; } @@ -927,7 +859,6 @@ export const ListWorkflowsForEventRequest = { }, fromPartial(object: DeepPartial): ListWorkflowsForEventRequest { const message = createBaseListWorkflowsForEventRequest(); - message.tenantId = object.tenantId ?? ""; message.eventKey = object.eventKey ?? ""; return message; }, @@ -1971,16 +1902,13 @@ export const Step = { }; function createBaseDeleteWorkflowRequest(): DeleteWorkflowRequest { - return { tenantId: "", workflowId: "" }; + return { workflowId: "" }; } export const DeleteWorkflowRequest = { encode(message: DeleteWorkflowRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.workflowId !== "") { - writer.uint32(18).string(message.workflowId); + writer.uint32(10).string(message.workflowId); } return writer; }, @@ -1997,13 +1925,6 @@ export const DeleteWorkflowRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.workflowId = reader.string(); continue; } @@ -2016,17 +1937,11 @@ export const DeleteWorkflowRequest = { }, fromJSON(object: any): DeleteWorkflowRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - workflowId: isSet(object.workflowId) ? globalThis.String(object.workflowId) : "", - }; + return { workflowId: isSet(object.workflowId) ? globalThis.String(object.workflowId) : "" }; }, toJSON(message: DeleteWorkflowRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.workflowId !== "") { obj.workflowId = message.workflowId; } @@ -2038,23 +1953,19 @@ export const DeleteWorkflowRequest = { }, fromPartial(object: DeepPartial): DeleteWorkflowRequest { const message = createBaseDeleteWorkflowRequest(); - message.tenantId = object.tenantId ?? ""; message.workflowId = object.workflowId ?? ""; return message; }, }; function createBaseGetWorkflowByNameRequest(): GetWorkflowByNameRequest { - return { tenantId: "", name: "" }; + return { name: "" }; } export const GetWorkflowByNameRequest = { encode(message: GetWorkflowByNameRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tenantId !== "") { - writer.uint32(10).string(message.tenantId); - } if (message.name !== "") { - writer.uint32(18).string(message.name); + writer.uint32(10).string(message.name); } return writer; }, @@ -2071,13 +1982,6 @@ export const GetWorkflowByNameRequest = { break; } - message.tenantId = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - message.name = reader.string(); continue; } @@ -2090,17 +1994,11 @@ export const GetWorkflowByNameRequest = { }, fromJSON(object: any): GetWorkflowByNameRequest { - return { - tenantId: isSet(object.tenantId) ? globalThis.String(object.tenantId) : "", - name: isSet(object.name) ? globalThis.String(object.name) : "", - }; + return { name: isSet(object.name) ? globalThis.String(object.name) : "" }; }, toJSON(message: GetWorkflowByNameRequest): unknown { const obj: any = {}; - if (message.tenantId !== "") { - obj.tenantId = message.tenantId; - } if (message.name !== "") { obj.name = message.name; } @@ -2112,7 +2010,6 @@ export const GetWorkflowByNameRequest = { }, fromPartial(object: DeepPartial): GetWorkflowByNameRequest { const message = createBaseGetWorkflowByNameRequest(); - message.tenantId = object.tenantId ?? ""; message.name = object.name ?? ""; return message; },