@wix/sdk-types 1.5.7 → 1.5.9
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 +28 -3
- package/build/index.d.ts +28 -3
- package/build/index.js +2 -2
- package/build/index.mjs +2 -2
- package/package.json +2 -2
package/build/browser/index.mjs
CHANGED
package/build/index.d.mts
CHANGED
|
@@ -39,7 +39,7 @@ type APIMetadata = {
|
|
|
39
39
|
};
|
|
40
40
|
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
41
41
|
|
|
42
|
-
type AuthenticationStrategy<Host = unknown> = {
|
|
42
|
+
type AuthenticationStrategy<Host = unknown, WithAuth extends ((...args: any) => AuthenticationStrategy<Host, WithAuth>) | undefined = undefined> = {
|
|
43
43
|
getAuthHeaders: (host: Host) => Promise<{
|
|
44
44
|
headers: Record<string, string>;
|
|
45
45
|
}>;
|
|
@@ -49,6 +49,7 @@ type AuthenticationStrategy<Host = unknown> = {
|
|
|
49
49
|
};
|
|
50
50
|
valid: boolean;
|
|
51
51
|
}>;
|
|
52
|
+
withAuth?: WithAuth;
|
|
52
53
|
};
|
|
53
54
|
type BoundAuthenticationStrategy = {
|
|
54
55
|
getAuthHeaders: () => Promise<{
|
|
@@ -58,13 +59,37 @@ type BoundAuthenticationStrategy = {
|
|
|
58
59
|
|
|
59
60
|
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
60
61
|
type: Type;
|
|
62
|
+
isDomainEvent?: boolean;
|
|
61
63
|
__payload: Payload;
|
|
62
64
|
};
|
|
63
|
-
declare function EventDefinition<Type extends string>(type: Type): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
65
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
66
|
+
type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = {
|
|
67
|
+
id: string;
|
|
68
|
+
entityFqdn: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
entityId: string;
|
|
71
|
+
eventTime: Date;
|
|
72
|
+
triggeredByAnonymizeRequest: boolean;
|
|
73
|
+
originatedFrom: string;
|
|
74
|
+
} & (ActionType extends 'action' ? {
|
|
75
|
+
actionEvent: {
|
|
76
|
+
body: Payload;
|
|
77
|
+
};
|
|
78
|
+
} : ActionType extends 'create' ? {
|
|
79
|
+
createdEvent: {
|
|
80
|
+
entity: Payload;
|
|
81
|
+
};
|
|
82
|
+
} : ActionType extends 'update' ? {
|
|
83
|
+
updatedEvent: {
|
|
84
|
+
currentEntity: Payload;
|
|
85
|
+
};
|
|
86
|
+
} : ActionType extends 'delete' ? {
|
|
87
|
+
deletedEvent: Payload;
|
|
88
|
+
} : never);
|
|
64
89
|
|
|
65
90
|
type SPIDefinition<TInput, TResult> = {
|
|
66
91
|
__input: TInput;
|
|
67
92
|
__result: TResult;
|
|
68
93
|
};
|
|
69
94
|
|
|
70
|
-
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 };
|
|
95
|
+
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 };
|
package/build/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ type APIMetadata = {
|
|
|
39
39
|
};
|
|
40
40
|
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
41
41
|
|
|
42
|
-
type AuthenticationStrategy<Host = unknown> = {
|
|
42
|
+
type AuthenticationStrategy<Host = unknown, WithAuth extends ((...args: any) => AuthenticationStrategy<Host, WithAuth>) | undefined = undefined> = {
|
|
43
43
|
getAuthHeaders: (host: Host) => Promise<{
|
|
44
44
|
headers: Record<string, string>;
|
|
45
45
|
}>;
|
|
@@ -49,6 +49,7 @@ type AuthenticationStrategy<Host = unknown> = {
|
|
|
49
49
|
};
|
|
50
50
|
valid: boolean;
|
|
51
51
|
}>;
|
|
52
|
+
withAuth?: WithAuth;
|
|
52
53
|
};
|
|
53
54
|
type BoundAuthenticationStrategy = {
|
|
54
55
|
getAuthHeaders: () => Promise<{
|
|
@@ -58,13 +59,37 @@ type BoundAuthenticationStrategy = {
|
|
|
58
59
|
|
|
59
60
|
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
60
61
|
type: Type;
|
|
62
|
+
isDomainEvent?: boolean;
|
|
61
63
|
__payload: Payload;
|
|
62
64
|
};
|
|
63
|
-
declare function EventDefinition<Type extends string>(type: Type): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
65
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
66
|
+
type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = {
|
|
67
|
+
id: string;
|
|
68
|
+
entityFqdn: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
entityId: string;
|
|
71
|
+
eventTime: Date;
|
|
72
|
+
triggeredByAnonymizeRequest: boolean;
|
|
73
|
+
originatedFrom: string;
|
|
74
|
+
} & (ActionType extends 'action' ? {
|
|
75
|
+
actionEvent: {
|
|
76
|
+
body: Payload;
|
|
77
|
+
};
|
|
78
|
+
} : ActionType extends 'create' ? {
|
|
79
|
+
createdEvent: {
|
|
80
|
+
entity: Payload;
|
|
81
|
+
};
|
|
82
|
+
} : ActionType extends 'update' ? {
|
|
83
|
+
updatedEvent: {
|
|
84
|
+
currentEntity: Payload;
|
|
85
|
+
};
|
|
86
|
+
} : ActionType extends 'delete' ? {
|
|
87
|
+
deletedEvent: Payload;
|
|
88
|
+
} : never);
|
|
64
89
|
|
|
65
90
|
type SPIDefinition<TInput, TResult> = {
|
|
66
91
|
__input: TInput;
|
|
67
92
|
__result: TResult;
|
|
68
93
|
};
|
|
69
94
|
|
|
70
|
-
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 };
|
|
95
|
+
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 };
|
package/build/index.js
CHANGED
|
@@ -25,8 +25,8 @@ __export(src_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(src_exports);
|
|
26
26
|
|
|
27
27
|
// src/webhooks.ts
|
|
28
|
-
function EventDefinition(type) {
|
|
29
|
-
return () => ({ type });
|
|
28
|
+
function EventDefinition(type, isDomainEvent = false) {
|
|
29
|
+
return () => ({ type, isDomainEvent });
|
|
30
30
|
}
|
|
31
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
32
|
0 && (module.exports = {
|
package/build/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.9",
|
|
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": "60a557fff40ccbf29cbab65dd635b6c045e748173ad0c9d3fd1b7b66"
|
|
61
61
|
}
|