@wix/sdk-types 1.7.0 → 1.7.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.
@@ -9,9 +9,10 @@ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
9
9
  }
10
10
 
11
11
  // src/service-plugins.ts
12
- function ServicePluginDefinition(methods) {
12
+ function ServicePluginDefinition(componentType, methods) {
13
13
  return {
14
14
  __type: "service-plugin-definition",
15
+ componentType,
15
16
  methods
16
17
  };
17
18
  }
package/build/index.d.mts CHANGED
@@ -83,31 +83,26 @@ 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 ServicePluginContract = Record<string, (payload: {
86
+ type ServicePluginMethodInput = {
87
87
  request: any;
88
88
  metadata: any;
89
- }) => unknown | Promise<unknown>>;
89
+ };
90
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
90
91
  type ServicePluginMethodMetadata = {
91
92
  name: string;
92
93
  primaryHttpMappingPath: string;
93
94
  transformations: {
94
- fromREST: (...args: unknown[]) => unknown;
95
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
95
96
  toREST: (...args: unknown[]) => unknown;
96
97
  };
97
98
  };
98
99
  type ServicePluginDefinition<Contract extends ServicePluginContract> = {
99
100
  __type: 'service-plugin-definition';
101
+ componentType: string;
100
102
  methods: ServicePluginMethodMetadata[];
101
103
  __contract: Contract;
102
104
  };
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>;
111
- };
105
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
106
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
112
107
 
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 };
108
+ 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 ServicePluginMethodInput, type ServicePluginMethodMetadata };
package/build/index.d.ts CHANGED
@@ -83,31 +83,26 @@ 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 ServicePluginContract = Record<string, (payload: {
86
+ type ServicePluginMethodInput = {
87
87
  request: any;
88
88
  metadata: any;
89
- }) => unknown | Promise<unknown>>;
89
+ };
90
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
90
91
  type ServicePluginMethodMetadata = {
91
92
  name: string;
92
93
  primaryHttpMappingPath: string;
93
94
  transformations: {
94
- fromREST: (...args: unknown[]) => unknown;
95
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
95
96
  toREST: (...args: unknown[]) => unknown;
96
97
  };
97
98
  };
98
99
  type ServicePluginDefinition<Contract extends ServicePluginContract> = {
99
100
  __type: 'service-plugin-definition';
101
+ componentType: string;
100
102
  methods: ServicePluginMethodMetadata[];
101
103
  __contract: Contract;
102
104
  };
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>;
111
- };
105
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
106
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
112
107
 
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 };
108
+ 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 ServicePluginMethodInput, type ServicePluginMethodMetadata };
package/build/index.js CHANGED
@@ -36,9 +36,10 @@ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
36
36
  }
37
37
 
38
38
  // src/service-plugins.ts
39
- function ServicePluginDefinition(methods) {
39
+ function ServicePluginDefinition(componentType, methods) {
40
40
  return {
41
41
  __type: "service-plugin-definition",
42
+ componentType,
42
43
  methods
43
44
  };
44
45
  }
package/build/index.mjs CHANGED
@@ -9,9 +9,10 @@ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
9
9
  }
10
10
 
11
11
  // src/service-plugins.ts
12
- function ServicePluginDefinition(methods) {
12
+ function ServicePluginDefinition(componentType, methods) {
13
13
  return {
14
14
  __type: "service-plugin-definition",
15
+ componentType,
15
16
  methods
16
17
  };
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.7.0",
3
+ "version": "1.7.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": "9b7f2792da45401c94a36006c1ff758bcf66103fbd3a40b1d48d3bff"
60
+ "falconPackageHash": "1625d05bd31b4f3c4d050efc021096c2680fe38d4b6c6c0da9f479f1"
61
61
  }