@wix/sdk-types 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/browser/index.mjs +2 -2
- package/build/index.d.mts +2 -2
- package/build/index.d.ts +2 -2
- package/build/index.js +2 -2
- package/build/index.mjs +2 -2
- package/package.json +2 -2
package/build/browser/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/event-handlers-modules.ts
|
|
2
|
-
function EventDefinition(type, isDomainEvent = false,
|
|
2
|
+
function EventDefinition(type, isDomainEvent = false, transformations = (x) => x) {
|
|
3
3
|
return () => ({
|
|
4
4
|
__type: "event-definition",
|
|
5
5
|
type,
|
|
6
6
|
isDomainEvent,
|
|
7
|
-
transformations
|
|
7
|
+
transformations
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
package/build/index.d.mts
CHANGED
|
@@ -76,10 +76,10 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
|
76
76
|
__type: 'event-definition';
|
|
77
77
|
type: Type;
|
|
78
78
|
isDomainEvent?: boolean;
|
|
79
|
-
transformations?: unknown;
|
|
79
|
+
transformations?: (envelope: unknown) => Payload;
|
|
80
80
|
__payload: Payload;
|
|
81
81
|
};
|
|
82
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean,
|
|
82
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
83
83
|
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
84
84
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
85
85
|
|
package/build/index.d.ts
CHANGED
|
@@ -76,10 +76,10 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
|
76
76
|
__type: 'event-definition';
|
|
77
77
|
type: Type;
|
|
78
78
|
isDomainEvent?: boolean;
|
|
79
|
-
transformations?: unknown;
|
|
79
|
+
transformations?: (envelope: unknown) => Payload;
|
|
80
80
|
__payload: Payload;
|
|
81
81
|
};
|
|
82
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean,
|
|
82
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
83
83
|
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
84
84
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
85
85
|
|
package/build/index.js
CHANGED
|
@@ -26,12 +26,12 @@ __export(src_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(src_exports);
|
|
27
27
|
|
|
28
28
|
// src/event-handlers-modules.ts
|
|
29
|
-
function EventDefinition(type, isDomainEvent = false,
|
|
29
|
+
function EventDefinition(type, isDomainEvent = false, transformations = (x) => x) {
|
|
30
30
|
return () => ({
|
|
31
31
|
__type: "event-definition",
|
|
32
32
|
type,
|
|
33
33
|
isDomainEvent,
|
|
34
|
-
transformations
|
|
34
|
+
transformations
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
|
package/build/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/event-handlers-modules.ts
|
|
2
|
-
function EventDefinition(type, isDomainEvent = false,
|
|
2
|
+
function EventDefinition(type, isDomainEvent = false, transformations = (x) => x) {
|
|
3
3
|
return () => ({
|
|
4
4
|
__type: "event-definition",
|
|
5
5
|
type,
|
|
6
6
|
isDomainEvent,
|
|
7
|
-
transformations
|
|
7
|
+
transformations
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
10
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ronny Ringel",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"wallaby": {
|
|
58
58
|
"autoDetect": true
|
|
59
59
|
},
|
|
60
|
-
"falconPackageHash": "
|
|
60
|
+
"falconPackageHash": "090d1e823bbdc07dcb40409533d801ef3e87d89a7b97e8f1fd422674"
|
|
61
61
|
}
|