@wix/sdk-types 1.6.3 → 1.7.0
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 +10 -1
- package/build/index.d.mts +26 -4
- package/build/index.d.ts +26 -4
- package/build/index.js +12 -2
- package/build/index.mjs +10 -1
- package/package.json +2 -2
package/build/browser/index.mjs
CHANGED
|
@@ -7,6 +7,15 @@ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
|
|
|
7
7
|
transformations: _transformations
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
// src/service-plugins.ts
|
|
12
|
+
function ServicePluginDefinition(methods) {
|
|
13
|
+
return {
|
|
14
|
+
__type: "service-plugin-definition",
|
|
15
|
+
methods
|
|
16
|
+
};
|
|
17
|
+
}
|
|
10
18
|
export {
|
|
11
|
-
EventDefinition
|
|
19
|
+
EventDefinition,
|
|
20
|
+
ServicePluginDefinition
|
|
12
21
|
};
|
package/build/index.d.mts
CHANGED
|
@@ -83,9 +83,31 @@ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?
|
|
|
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
|
|
|
86
|
-
type
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
type ServicePluginContract = Record<string, (payload: {
|
|
87
|
+
request: any;
|
|
88
|
+
metadata: any;
|
|
89
|
+
}) => unknown | Promise<unknown>>;
|
|
90
|
+
type ServicePluginMethodMetadata = {
|
|
91
|
+
name: string;
|
|
92
|
+
primaryHttpMappingPath: string;
|
|
93
|
+
transformations: {
|
|
94
|
+
fromREST: (...args: unknown[]) => unknown;
|
|
95
|
+
toREST: (...args: unknown[]) => unknown;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
99
|
+
__type: 'service-plugin-definition';
|
|
100
|
+
methods: ServicePluginMethodMetadata[];
|
|
101
|
+
__contract: Contract;
|
|
102
|
+
};
|
|
103
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
104
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = {
|
|
105
|
+
provide(implementation: T['__contract']): void;
|
|
106
|
+
processRequest(request: Request): Promise<Response>;
|
|
107
|
+
process(request: {
|
|
108
|
+
url: string;
|
|
109
|
+
body: string;
|
|
110
|
+
}): Promise<unknown>;
|
|
89
111
|
};
|
|
90
112
|
|
|
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
|
|
113
|
+
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, EventDefinition, type EventHandler, type EventIdentity, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodMetadata };
|
package/build/index.d.ts
CHANGED
|
@@ -83,9 +83,31 @@ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?
|
|
|
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
|
|
|
86
|
-
type
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
type ServicePluginContract = Record<string, (payload: {
|
|
87
|
+
request: any;
|
|
88
|
+
metadata: any;
|
|
89
|
+
}) => unknown | Promise<unknown>>;
|
|
90
|
+
type ServicePluginMethodMetadata = {
|
|
91
|
+
name: string;
|
|
92
|
+
primaryHttpMappingPath: string;
|
|
93
|
+
transformations: {
|
|
94
|
+
fromREST: (...args: unknown[]) => unknown;
|
|
95
|
+
toREST: (...args: unknown[]) => unknown;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
99
|
+
__type: 'service-plugin-definition';
|
|
100
|
+
methods: ServicePluginMethodMetadata[];
|
|
101
|
+
__contract: Contract;
|
|
102
|
+
};
|
|
103
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
104
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = {
|
|
105
|
+
provide(implementation: T['__contract']): void;
|
|
106
|
+
processRequest(request: Request): Promise<Response>;
|
|
107
|
+
process(request: {
|
|
108
|
+
url: string;
|
|
109
|
+
body: string;
|
|
110
|
+
}): Promise<unknown>;
|
|
89
111
|
};
|
|
90
112
|
|
|
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
|
|
113
|
+
export { type APIMetadata, type AuthenticationStrategy, type BaseEventMetadata, type BoundAuthenticationStrategy, type BuildEventDefinition, type BuildRESTFunction, type BuildServicePluginDefinition, EventDefinition, type EventHandler, type EventIdentity, type Host, type HostModule, type HostModuleAPI, type HttpClient, type HttpResponse, type RESTFunctionDescriptor, type RequestOptions, type RequestOptionsFactory, type ServicePluginContract, ServicePluginDefinition, type ServicePluginMethodMetadata };
|
package/build/index.js
CHANGED
|
@@ -20,7 +20,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
EventDefinition: () => EventDefinition
|
|
23
|
+
EventDefinition: () => EventDefinition,
|
|
24
|
+
ServicePluginDefinition: () => ServicePluginDefinition
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(src_exports);
|
|
26
27
|
|
|
@@ -33,7 +34,16 @@ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
|
|
|
33
34
|
transformations: _transformations
|
|
34
35
|
});
|
|
35
36
|
}
|
|
37
|
+
|
|
38
|
+
// src/service-plugins.ts
|
|
39
|
+
function ServicePluginDefinition(methods) {
|
|
40
|
+
return {
|
|
41
|
+
__type: "service-plugin-definition",
|
|
42
|
+
methods
|
|
43
|
+
};
|
|
44
|
+
}
|
|
36
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
46
|
0 && (module.exports = {
|
|
38
|
-
EventDefinition
|
|
47
|
+
EventDefinition,
|
|
48
|
+
ServicePluginDefinition
|
|
39
49
|
});
|
package/build/index.mjs
CHANGED
|
@@ -7,6 +7,15 @@ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
|
|
|
7
7
|
transformations: _transformations
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
// src/service-plugins.ts
|
|
12
|
+
function ServicePluginDefinition(methods) {
|
|
13
|
+
return {
|
|
14
|
+
__type: "service-plugin-definition",
|
|
15
|
+
methods
|
|
16
|
+
};
|
|
17
|
+
}
|
|
10
18
|
export {
|
|
11
|
-
EventDefinition
|
|
19
|
+
EventDefinition,
|
|
20
|
+
ServicePluginDefinition
|
|
12
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/sdk-types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
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": "9b7f2792da45401c94a36006c1ff758bcf66103fbd3a40b1d48d3bff"
|
|
61
61
|
}
|