@wix/sdk-types
Advanced tools
Comparing version 1.5.7 to 1.5.8
@@ -61,5 +61,29 @@ type HostModule<T, H extends Host> = { | ||
type: Type; | ||
isDomainEvent?: boolean; | ||
__payload: Payload; | ||
}; | ||
declare function EventDefinition<Type extends string>(type: Type): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean): <Payload = unknown>() => EventDefinition<Payload, Type>; | ||
type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = { | ||
id: string; | ||
entityFqdn: string; | ||
slug: string; | ||
entityId: string; | ||
eventTime: Date; | ||
triggeredByAnonymizeRequest: boolean; | ||
originatedFrom: string; | ||
} & (ActionType extends 'action' ? { | ||
actionEvent: { | ||
body: Payload; | ||
}; | ||
} : ActionType extends 'create' ? { | ||
createdEvent: { | ||
entity: Payload; | ||
}; | ||
} : ActionType extends 'update' ? { | ||
updatedEvent: { | ||
currentEntity: Payload; | ||
}; | ||
} : ActionType extends 'delete' ? { | ||
deletedEvent: Payload; | ||
} : never); | ||
@@ -71,2 +95,2 @@ type SPIDefinition<TInput, TResult> = { | ||
export { type APIMetadata, type AuthenticationStrategy, type BoundAuthenticationStrategy, type BuildRESTFunction, EventDefinition, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type SPIDefinition }; | ||
export { type APIMetadata, type AuthenticationStrategy, type BoundAuthenticationStrategy, type BuildRESTFunction, type DomainEvent, EventDefinition, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type SPIDefinition }; |
@@ -28,4 +28,4 @@ "use strict"; | ||
// src/webhooks.ts | ||
function EventDefinition(type) { | ||
return () => ({ type }); | ||
function EventDefinition(type, isDomainEvent = false) { | ||
return () => ({ type, isDomainEvent }); | ||
} | ||
@@ -32,0 +32,0 @@ // Annotate the CommonJS export names for ESM import in node: |
{ | ||
"name": "@wix/sdk-types", | ||
"version": "1.5.7", | ||
"version": "1.5.8", | ||
"license": "UNLICENSED", | ||
@@ -60,3 +60,3 @@ "author": { | ||
}, | ||
"falconPackageHash": "11cd2184d696f61c8d1abb447f1f9be0194458f59c8e3b52a4a42c54" | ||
"falconPackageHash": "c863e1912299e6c0a29e751a05c4ca155ec801e710e0515a5c94fc31" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9062
136