@wix/sdk-types 1.6.0 → 1.6.1
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 +18 -5
- package/build/index.d.ts +18 -5
- package/package.json +2 -2
package/build/index.d.mts
CHANGED
|
@@ -61,14 +61,26 @@ type BoundAuthenticationStrategy = {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
type
|
|
64
|
+
type EventIdentity = {
|
|
65
|
+
identityType: 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
66
|
+
anonymousVisitorId: string;
|
|
67
|
+
memberId: string;
|
|
68
|
+
wixUserId: string;
|
|
69
|
+
appId: string;
|
|
70
|
+
};
|
|
71
|
+
type BaseEventMetadata = {
|
|
72
|
+
instanceId: string;
|
|
73
|
+
identity: EventIdentity;
|
|
74
|
+
};
|
|
75
|
+
type EventDefinition<Payload = unknown, Type extends string = string, Metadata = BaseEventMetadata> = {
|
|
65
76
|
__type: 'event-definition';
|
|
66
77
|
type: Type;
|
|
67
78
|
isDomainEvent?: boolean;
|
|
68
79
|
transformations?: unknown;
|
|
69
80
|
__payload: Payload;
|
|
81
|
+
__metadata: Metadata;
|
|
70
82
|
};
|
|
71
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
83
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown, Metadata = BaseEventMetadata>() => EventDefinition<Payload, Type, Metadata>;
|
|
72
84
|
type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = {
|
|
73
85
|
id: string;
|
|
74
86
|
entityFqdn: string;
|
|
@@ -92,8 +104,9 @@ type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', P
|
|
|
92
104
|
} : ActionType extends 'delete' ? {
|
|
93
105
|
deletedEvent: Payload;
|
|
94
106
|
} : never);
|
|
95
|
-
type PayloadOfEventDefinition<T extends EventDefinition<any, any>> = T extends EventDefinition<infer P, any> ? P : never;
|
|
96
|
-
type
|
|
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>;
|
|
97
110
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
98
111
|
|
|
99
112
|
type SPIDefinition<TInput, TResult> = {
|
|
@@ -101,4 +114,4 @@ type SPIDefinition<TInput, TResult> = {
|
|
|
101
114
|
__result: TResult;
|
|
102
115
|
};
|
|
103
116
|
|
|
104
|
-
export { type APIMetadata, type AuthenticationStrategy, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, type DomainEvent, EventDefinition, type EventHandler, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type SPIDefinition };
|
|
117
|
+
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, type DomainEvent, 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
|
@@ -61,14 +61,26 @@ type BoundAuthenticationStrategy = {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
type
|
|
64
|
+
type EventIdentity = {
|
|
65
|
+
identityType: 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
66
|
+
anonymousVisitorId: string;
|
|
67
|
+
memberId: string;
|
|
68
|
+
wixUserId: string;
|
|
69
|
+
appId: string;
|
|
70
|
+
};
|
|
71
|
+
type BaseEventMetadata = {
|
|
72
|
+
instanceId: string;
|
|
73
|
+
identity: EventIdentity;
|
|
74
|
+
};
|
|
75
|
+
type EventDefinition<Payload = unknown, Type extends string = string, Metadata = BaseEventMetadata> = {
|
|
65
76
|
__type: 'event-definition';
|
|
66
77
|
type: Type;
|
|
67
78
|
isDomainEvent?: boolean;
|
|
68
79
|
transformations?: unknown;
|
|
69
80
|
__payload: Payload;
|
|
81
|
+
__metadata: Metadata;
|
|
70
82
|
};
|
|
71
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
83
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown, Metadata = BaseEventMetadata>() => EventDefinition<Payload, Type, Metadata>;
|
|
72
84
|
type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = {
|
|
73
85
|
id: string;
|
|
74
86
|
entityFqdn: string;
|
|
@@ -92,8 +104,9 @@ type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', P
|
|
|
92
104
|
} : ActionType extends 'delete' ? {
|
|
93
105
|
deletedEvent: Payload;
|
|
94
106
|
} : never);
|
|
95
|
-
type PayloadOfEventDefinition<T extends EventDefinition<any, any>> = T extends EventDefinition<infer P, any> ? P : never;
|
|
96
|
-
type
|
|
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>;
|
|
97
110
|
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
98
111
|
|
|
99
112
|
type SPIDefinition<TInput, TResult> = {
|
|
@@ -101,4 +114,4 @@ type SPIDefinition<TInput, TResult> = {
|
|
|
101
114
|
__result: TResult;
|
|
102
115
|
};
|
|
103
116
|
|
|
104
|
-
export { type APIMetadata, type AuthenticationStrategy, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, type DomainEvent, EventDefinition, type EventHandler, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type SPIDefinition };
|
|
117
|
+
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, type DomainEvent, 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.1",
|
|
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": "3f500110266751683931624a48ec5ccf57781bd46b01deaffd4e4b81"
|
|
61
61
|
}
|