import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { Guid } from "./protobuf-net/bcl.js"; export declare const protobufPackage = "Cratis.Chronicle.Contracts.Occurrences"; export declare enum EffectOutcome { Appended = 0, NoEvents = 1, Refused = 2, UNRECOGNIZED = -1 } export declare function effectOutcomeFromJSON(object: any): EffectOutcome; export declare function effectOutcomeToJSON(object: EffectOutcome): string; export declare enum EffectReceiptStatus { EFFECT_RECEIPT_STATUS_Recorded = 0, EFFECT_RECEIPT_STATUS_AlreadyRecorded = 1, UNRECOGNIZED = -1 } export declare function effectReceiptStatusFromJSON(object: any): EffectReceiptStatus; export declare function effectReceiptStatusToJSON(object: EffectReceiptStatus): string; export declare enum OccurrenceIngressStatus { OCCURRENCE_INGRESS_STATUS_Recorded = 0, OCCURRENCE_INGRESS_STATUS_AlreadyRecorded = 1, OccurrenceIdConflict = 2, OccurrencePayloadInvalid = 3, UNRECOGNIZED = -1 } export declare function occurrenceIngressStatusFromJSON(object: any): OccurrenceIngressStatus; export declare function occurrenceIngressStatusToJSON(object: OccurrenceIngressStatus): string; export declare enum OccurrenceKind { Application = 0, Schedule = 1, Startup = 2, Shutdown = 3, UNRECOGNIZED = -1 } export declare function occurrenceKindFromJSON(object: any): OccurrenceKind; export declare function occurrenceKindToJSON(object: OccurrenceKind): string; export declare enum OccurrenceLeaseResult { Updated = 0, AlreadyCompleted = 1, OccurrenceLeaseLost = 2, UNRECOGNIZED = -1 } export declare function occurrenceLeaseResultFromJSON(object: any): OccurrenceLeaseResult; export declare function occurrenceLeaseResultToJSON(object: OccurrenceLeaseResult): string; export declare enum OccurrenceState { Pending = 0, Leased = 1, Completed = 2, Quarantined = 3, Skipped = 4, UNRECOGNIZED = -1 } export declare function occurrenceStateFromJSON(object: any): OccurrenceState; export declare function occurrenceStateToJSON(object: OccurrenceState): string; export declare enum ValidationResultSeverity { Unknown = 0, Information = 1, Warning = 2, Error = 3, UNRECOGNIZED = -1 } export declare function validationResultSeverityFromJSON(object: any): ValidationResultSeverity; export declare function validationResultSeverityToJSON(object: ValidationResultSeverity): string; export interface ClaimOccurrencesRequest { EventStore: string; Namespace: string; Trigger: string; WorkerId: string; LeaseSeconds: number; Max: number; ApplicationScope: boolean; } export interface ClaimOccurrencesResponse { Claims: OccurrenceClaimDetails[]; } export interface CommandResultBoolean { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: boolean; } export interface CommandResultClaimOccurrencesResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: ClaimOccurrencesResponse | undefined; } export interface CommandResultCompleteOccurrenceResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: CompleteOccurrenceResponse | undefined; } export interface CommandResultRecordEffectReceiptResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: RecordEffectReceiptResponse | undefined; } export interface CommandResultRecordLifecycleOccurrenceResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: RecordLifecycleOccurrenceResponse | undefined; } export interface CommandResultRecordOccurrenceResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: RecordOccurrenceResponse | undefined; } export interface CommandResultRegisterTriggersResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: RegisterTriggersResponse | undefined; } export interface CompleteOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; Epoch: bigint; ApplicationScope: boolean; } export interface CompleteOccurrenceResponse { Status: OccurrenceLeaseResult; } export interface EffectReceipt { OccurrenceId: string; EffectKey: string; Epoch: bigint; Response: string; } export interface EffectReceiptDetails { Id: string; OccurrenceId: string; Epoch: bigint; Outcome: EffectOutcome; EventSequenceId: string; FirstSequenceNumber: bigint; LastSequenceNumber: bigint; Reasons: string[]; Response: string; RecordedAt: SerializableDateTimeOffset | undefined; } export interface EffectReceiptRecordResponse { Id: string; OccurrenceId: string; Epoch: bigint; Outcome: EffectOutcome; EventSequenceId: string; FirstSequenceNumber: bigint; LastSequenceNumber: bigint; Reasons: string[]; Response: string; RecordedAt: SerializableDateTimeOffset | undefined; } export interface FailOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; Epoch: bigint; Error: string; ApplicationScope: boolean; } export interface GetEffectReceiptRequest { EventStore: string; Namespace: string; OccurrenceId: string; EffectKey: string; } export interface GetOccurrenceRequest { EventStore: string; Namespace: string; OccurrenceId: string; ApplicationScope: boolean; } export interface ObserveOccurrencesRequest { EventStore: string; Namespace: string; Trigger: string; ApplicationScope: boolean; } export interface OccurrenceClaimDetails { Id: string; Trigger: string; Kind: OccurrenceKind; Payload: string; SchemaRevision: bigint; RecordedAt: SerializableDateTimeOffset | undefined; Due: SerializableDateTimeOffset | undefined; Attempts: number; Epoch: bigint; LeaseExpiry: SerializableDateTimeOffset | undefined; } export interface OccurrenceEffectReceipt { Namespace: string; Receipt: EffectReceiptDetails | undefined; } export interface OccurrenceSnapshotResponse { Id: string; Trigger: string; Kind: OccurrenceKind; Payload: string; SchemaRevision: bigint; RecordedAt: SerializableDateTimeOffset | undefined; Due: SerializableDateTimeOffset | undefined; State: OccurrenceState; Attempts: number; Epoch: bigint; Owner: string; LeaseExpiry: SerializableDateTimeOffset | undefined; LastError: string; NextAttempt: SerializableDateTimeOffset | undefined; RetriedBy: string; RetriedAt: SerializableDateTimeOffset | undefined; Receipts: OccurrenceEffectReceipt[]; } export interface QueryResultEffectReceiptRecordResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: EffectReceiptRecordResponse | undefined; } export interface QueryResultIEnumerableOccurrenceSnapshotResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: OccurrenceSnapshotResponse[]; } export interface QueryResultOccurrenceSnapshotResponse { CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: OccurrenceSnapshotResponse | undefined; } export interface RecordEffectReceiptRequest { EventStore: string; Namespace: string; EffectReceipt: EffectReceipt | undefined; Outcome: EffectOutcome; Reasons: string[]; } export interface RecordEffectReceiptResponse { Status: EffectReceiptStatus; Receipt: EffectReceiptDetails | undefined; } export interface RecordLifecycleOccurrenceRequest { EventStore: string; ActivationId: string; Kind: OccurrenceKind; AllNamespaces: boolean; } export interface RecordLifecycleOccurrenceResponse { Id: string; Status: OccurrenceIngressStatus; Namespaces: string[]; } export interface RecordOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; IdempotencyId: string; Payload: string; Kind: OccurrenceKind; ApplicationScope: boolean; } export interface RecordOccurrenceResponse { Id: string; Status: OccurrenceIngressStatus; } export interface RegisterTriggersRequest { EventStore: string; Triggers: TriggerRegistration[]; } export interface RegisterTriggersResponse { Registered: boolean; Errors: string[]; } export interface RenewOccurrenceLeaseRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; Epoch: bigint; LeaseSeconds: number; ApplicationScope: boolean; } export interface RetryQuarantinedOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; ApplicationScope: boolean; } export interface SerializableDateTimeOffset { Value: string; } export interface TriggerRegistration { Id: string; Name: string; Schema: string; } export interface ValidationResult { Severity: ValidationResultSeverity; Message: string; Members: string[]; } export declare const ClaimOccurrencesRequest: MessageFns; export declare const ClaimOccurrencesResponse: MessageFns; export declare const CommandResultBoolean: MessageFns; export declare const CommandResultClaimOccurrencesResponse: MessageFns; export declare const CommandResultCompleteOccurrenceResponse: MessageFns; export declare const CommandResultRecordEffectReceiptResponse: MessageFns; export declare const CommandResultRecordLifecycleOccurrenceResponse: MessageFns; export declare const CommandResultRecordOccurrenceResponse: MessageFns; export declare const CommandResultRegisterTriggersResponse: MessageFns; export declare const CompleteOccurrenceRequest: MessageFns; export declare const CompleteOccurrenceResponse: MessageFns; export declare const EffectReceipt: MessageFns; export declare const EffectReceiptDetails: MessageFns; export declare const EffectReceiptRecordResponse: MessageFns; export declare const FailOccurrenceRequest: MessageFns; export declare const GetEffectReceiptRequest: MessageFns; export declare const GetOccurrenceRequest: MessageFns; export declare const ObserveOccurrencesRequest: MessageFns; export declare const OccurrenceClaimDetails: MessageFns; export declare const OccurrenceEffectReceipt: MessageFns; export declare const OccurrenceSnapshotResponse: MessageFns; export declare const QueryResultEffectReceiptRecordResponse: MessageFns; export declare const QueryResultIEnumerableOccurrenceSnapshotResponse: MessageFns; export declare const QueryResultOccurrenceSnapshotResponse: MessageFns; export declare const RecordEffectReceiptRequest: MessageFns; export declare const RecordEffectReceiptResponse: MessageFns; export declare const RecordLifecycleOccurrenceRequest: MessageFns; export declare const RecordLifecycleOccurrenceResponse: MessageFns; export declare const RecordOccurrenceRequest: MessageFns; export declare const RecordOccurrenceResponse: MessageFns; export declare const RegisterTriggersRequest: MessageFns; export declare const RegisterTriggersResponse: MessageFns; export declare const RenewOccurrenceLeaseRequest: MessageFns; export declare const RetryQuarantinedOccurrenceRequest: MessageFns; export declare const SerializableDateTimeOffset: MessageFns; export declare const TriggerRegistration: MessageFns; export declare const ValidationResult: MessageFns; export type OccurrencesDefinition = typeof OccurrencesDefinition; export declare const OccurrencesDefinition: { readonly name: "Occurrences"; readonly fullName: "Cratis.Chronicle.Contracts.Occurrences.Occurrences"; readonly methods: { readonly claimOccurrences: { readonly name: "ClaimOccurrences"; readonly requestType: typeof ClaimOccurrencesRequest; readonly requestStream: false; readonly responseType: typeof CommandResultClaimOccurrencesResponse; readonly responseStream: false; readonly options: {}; }; readonly completeOccurrence: { readonly name: "CompleteOccurrence"; readonly requestType: typeof CompleteOccurrenceRequest; readonly requestStream: false; readonly responseType: typeof CommandResultCompleteOccurrenceResponse; readonly responseStream: false; readonly options: {}; }; readonly failOccurrence: { readonly name: "FailOccurrence"; readonly requestType: typeof FailOccurrenceRequest; readonly requestStream: false; readonly responseType: typeof CommandResultCompleteOccurrenceResponse; readonly responseStream: false; readonly options: {}; }; readonly getEffectReceipt: { readonly name: "GetEffectReceipt"; readonly requestType: typeof GetEffectReceiptRequest; readonly requestStream: false; readonly responseType: typeof QueryResultEffectReceiptRecordResponse; readonly responseStream: false; readonly options: {}; }; readonly getOccurrence: { readonly name: "GetOccurrence"; readonly requestType: typeof GetOccurrenceRequest; readonly requestStream: false; readonly responseType: typeof QueryResultOccurrenceSnapshotResponse; readonly responseStream: false; readonly options: {}; }; readonly observeOccurrences: { readonly name: "ObserveOccurrences"; readonly requestType: typeof ObserveOccurrencesRequest; readonly requestStream: false; readonly responseType: typeof QueryResultIEnumerableOccurrenceSnapshotResponse; readonly responseStream: true; readonly options: {}; }; readonly recordEffectReceipt: { readonly name: "RecordEffectReceipt"; readonly requestType: typeof RecordEffectReceiptRequest; readonly requestStream: false; readonly responseType: typeof CommandResultRecordEffectReceiptResponse; readonly responseStream: false; readonly options: {}; }; readonly recordLifecycleOccurrence: { readonly name: "RecordLifecycleOccurrence"; readonly requestType: typeof RecordLifecycleOccurrenceRequest; readonly requestStream: false; readonly responseType: typeof CommandResultRecordLifecycleOccurrenceResponse; readonly responseStream: false; readonly options: {}; }; readonly recordOccurrence: { readonly name: "RecordOccurrence"; readonly requestType: typeof RecordOccurrenceRequest; readonly requestStream: false; readonly responseType: typeof CommandResultRecordOccurrenceResponse; readonly responseStream: false; readonly options: {}; }; readonly registerTriggers: { readonly name: "RegisterTriggers"; readonly requestType: typeof RegisterTriggersRequest; readonly requestStream: false; readonly responseType: typeof CommandResultRegisterTriggersResponse; readonly responseStream: false; readonly options: {}; }; readonly renewOccurrenceLease: { readonly name: "RenewOccurrenceLease"; readonly requestType: typeof RenewOccurrenceLeaseRequest; readonly requestStream: false; readonly responseType: typeof CommandResultCompleteOccurrenceResponse; readonly responseStream: false; readonly options: {}; }; readonly retryQuarantinedOccurrence: { readonly name: "RetryQuarantinedOccurrence"; readonly requestType: typeof RetryQuarantinedOccurrenceRequest; readonly requestStream: false; readonly responseType: typeof CommandResultBoolean; readonly responseStream: false; readonly options: {}; }; }; }; export interface OccurrencesServiceImplementation { claimOccurrences(request: ClaimOccurrencesRequest, context: CallContext & CallContextExt): Promise>; completeOccurrence(request: CompleteOccurrenceRequest, context: CallContext & CallContextExt): Promise>; failOccurrence(request: FailOccurrenceRequest, context: CallContext & CallContextExt): Promise>; getEffectReceipt(request: GetEffectReceiptRequest, context: CallContext & CallContextExt): Promise>; getOccurrence(request: GetOccurrenceRequest, context: CallContext & CallContextExt): Promise>; observeOccurrences(request: ObserveOccurrencesRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult>; recordEffectReceipt(request: RecordEffectReceiptRequest, context: CallContext & CallContextExt): Promise>; recordLifecycleOccurrence(request: RecordLifecycleOccurrenceRequest, context: CallContext & CallContextExt): Promise>; recordOccurrence(request: RecordOccurrenceRequest, context: CallContext & CallContextExt): Promise>; registerTriggers(request: RegisterTriggersRequest, context: CallContext & CallContextExt): Promise>; renewOccurrenceLease(request: RenewOccurrenceLeaseRequest, context: CallContext & CallContextExt): Promise>; retryQuarantinedOccurrence(request: RetryQuarantinedOccurrenceRequest, context: CallContext & CallContextExt): Promise>; } export interface OccurrencesClient { claimOccurrences(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; completeOccurrence(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; failOccurrence(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; getEffectReceipt(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; getOccurrence(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; observeOccurrences(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; recordEffectReceipt(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; recordLifecycleOccurrence(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; recordOccurrence(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; registerTriggers(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; renewOccurrenceLease(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; retryQuarantinedOccurrence(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; export type DeepPartial = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial; } : Partial; export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator; }; export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; } export {}; //# sourceMappingURL=occurrences.d.ts.map