@wix/sdk-types 1.6.1 → 1.6.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/index.d.mts +4 -30
- package/build/index.d.ts +4 -30
- package/package.json +2 -2
package/build/index.d.mts
CHANGED
|
@@ -72,41 +72,15 @@ type BaseEventMetadata = {
|
|
|
72
72
|
instanceId: string;
|
|
73
73
|
identity: EventIdentity;
|
|
74
74
|
};
|
|
75
|
-
type EventDefinition<Payload = unknown, Type extends string = string
|
|
75
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
76
76
|
__type: 'event-definition';
|
|
77
77
|
type: Type;
|
|
78
78
|
isDomainEvent?: boolean;
|
|
79
79
|
transformations?: unknown;
|
|
80
80
|
__payload: Payload;
|
|
81
|
-
__metadata: Metadata;
|
|
82
81
|
};
|
|
83
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown
|
|
84
|
-
type
|
|
85
|
-
id: string;
|
|
86
|
-
entityFqdn: string;
|
|
87
|
-
slug: string;
|
|
88
|
-
entityId: string;
|
|
89
|
-
eventTime: Date;
|
|
90
|
-
triggeredByAnonymizeRequest: boolean;
|
|
91
|
-
originatedFrom: string;
|
|
92
|
-
} & (ActionType extends 'action' ? {
|
|
93
|
-
actionEvent: {
|
|
94
|
-
body: Payload;
|
|
95
|
-
};
|
|
96
|
-
} : ActionType extends 'create' ? {
|
|
97
|
-
createdEvent: {
|
|
98
|
-
entity: Payload;
|
|
99
|
-
};
|
|
100
|
-
} : ActionType extends 'update' ? {
|
|
101
|
-
updatedEvent: {
|
|
102
|
-
currentEntity: Payload;
|
|
103
|
-
};
|
|
104
|
-
} : ActionType extends 'delete' ? {
|
|
105
|
-
deletedEvent: Payload;
|
|
106
|
-
} : never);
|
|
107
|
-
type PayloadOfEventDefinition<T extends EventDefinition<any, any, any>> = T extends EventDefinition<infer P, any, any> ? P : never;
|
|
108
|
-
type MetadataOfEventDefinition<T extends EventDefinition<any, any, any>> = T extends EventDefinition<any, any, infer M> ? M : never;
|
|
109
|
-
type EventHandler<T extends EventDefinition> = (payload: PayloadOfEventDefinition<T>, metadata: MetadataOfEventDefinition<T>) => void | Promise<void>;
|
|
82
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
83
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
110
84
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
111
85
|
|
|
112
86
|
type SPIDefinition<TInput, TResult> = {
|
|
@@ -114,4 +88,4 @@ type SPIDefinition<TInput, TResult> = {
|
|
|
114
88
|
__result: TResult;
|
|
115
89
|
};
|
|
116
90
|
|
|
117
|
-
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction,
|
|
91
|
+
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, EventDefinition, type EventHandler, type EventIdentity, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type SPIDefinition };
|
package/build/index.d.ts
CHANGED
|
@@ -72,41 +72,15 @@ type BaseEventMetadata = {
|
|
|
72
72
|
instanceId: string;
|
|
73
73
|
identity: EventIdentity;
|
|
74
74
|
};
|
|
75
|
-
type EventDefinition<Payload = unknown, Type extends string = string
|
|
75
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
76
76
|
__type: 'event-definition';
|
|
77
77
|
type: Type;
|
|
78
78
|
isDomainEvent?: boolean;
|
|
79
79
|
transformations?: unknown;
|
|
80
80
|
__payload: Payload;
|
|
81
|
-
__metadata: Metadata;
|
|
82
81
|
};
|
|
83
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown
|
|
84
|
-
type
|
|
85
|
-
id: string;
|
|
86
|
-
entityFqdn: string;
|
|
87
|
-
slug: string;
|
|
88
|
-
entityId: string;
|
|
89
|
-
eventTime: Date;
|
|
90
|
-
triggeredByAnonymizeRequest: boolean;
|
|
91
|
-
originatedFrom: string;
|
|
92
|
-
} & (ActionType extends 'action' ? {
|
|
93
|
-
actionEvent: {
|
|
94
|
-
body: Payload;
|
|
95
|
-
};
|
|
96
|
-
} : ActionType extends 'create' ? {
|
|
97
|
-
createdEvent: {
|
|
98
|
-
entity: Payload;
|
|
99
|
-
};
|
|
100
|
-
} : ActionType extends 'update' ? {
|
|
101
|
-
updatedEvent: {
|
|
102
|
-
currentEntity: Payload;
|
|
103
|
-
};
|
|
104
|
-
} : ActionType extends 'delete' ? {
|
|
105
|
-
deletedEvent: Payload;
|
|
106
|
-
} : never);
|
|
107
|
-
type PayloadOfEventDefinition<T extends EventDefinition<any, any, any>> = T extends EventDefinition<infer P, any, any> ? P : never;
|
|
108
|
-
type MetadataOfEventDefinition<T extends EventDefinition<any, any, any>> = T extends EventDefinition<any, any, infer M> ? M : never;
|
|
109
|
-
type EventHandler<T extends EventDefinition> = (payload: PayloadOfEventDefinition<T>, metadata: MetadataOfEventDefinition<T>) => void | Promise<void>;
|
|
82
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
83
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
110
84
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
111
85
|
|
|
112
86
|
type SPIDefinition<TInput, TResult> = {
|
|
@@ -114,4 +88,4 @@ type SPIDefinition<TInput, TResult> = {
|
|
|
114
88
|
__result: TResult;
|
|
115
89
|
};
|
|
116
90
|
|
|
117
|
-
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction,
|
|
91
|
+
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, EventDefinition, type EventHandler, type EventIdentity, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type SPIDefinition };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.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": "8bdee3bf0efc29f94318cd08f133a2fce89a11e0eee7723cefc8437e"
|
|
61
61
|
}
|