@wix/sdk-types 1.5.8 → 1.5.10

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.
@@ -1,6 +1,11 @@
1
1
  // src/webhooks.ts
2
- function EventDefinition(type, isDomainEvent = false) {
3
- return () => ({ type, isDomainEvent });
2
+ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
3
+ return () => ({
4
+ __type: "event-definition",
5
+ type,
6
+ isDomainEvent,
7
+ transformations: _transformations
8
+ });
4
9
  }
5
10
  export {
6
11
  EventDefinition
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<{
@@ -57,11 +58,13 @@ type BoundAuthenticationStrategy = {
57
58
  };
58
59
 
59
60
  type EventDefinition<Payload = unknown, Type extends string = string> = {
61
+ __type: 'event-definition';
60
62
  type: Type;
61
63
  isDomainEvent?: boolean;
64
+ transformations?: unknown;
62
65
  __payload: Payload;
63
66
  };
64
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean): <Payload = unknown>() => EventDefinition<Payload, Type>;
67
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
65
68
  type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = {
66
69
  id: string;
67
70
  entityFqdn: string;
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<{
@@ -57,11 +58,13 @@ type BoundAuthenticationStrategy = {
57
58
  };
58
59
 
59
60
  type EventDefinition<Payload = unknown, Type extends string = string> = {
61
+ __type: 'event-definition';
60
62
  type: Type;
61
63
  isDomainEvent?: boolean;
64
+ transformations?: unknown;
62
65
  __payload: Payload;
63
66
  };
64
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean): <Payload = unknown>() => EventDefinition<Payload, Type>;
67
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
65
68
  type DomainEvent<ActionType extends 'create' | 'update' | 'delete' | 'action', Payload> = {
66
69
  id: string;
67
70
  entityFqdn: string;
package/build/index.js CHANGED
@@ -25,8 +25,13 @@ __export(src_exports, {
25
25
  module.exports = __toCommonJS(src_exports);
26
26
 
27
27
  // src/webhooks.ts
28
- function EventDefinition(type, isDomainEvent = false) {
29
- return () => ({ type, isDomainEvent });
28
+ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
29
+ return () => ({
30
+ __type: "event-definition",
31
+ type,
32
+ isDomainEvent,
33
+ transformations: _transformations
34
+ });
30
35
  }
31
36
  // Annotate the CommonJS export names for ESM import in node:
32
37
  0 && (module.exports = {
package/build/index.mjs CHANGED
@@ -1,6 +1,11 @@
1
1
  // src/webhooks.ts
2
- function EventDefinition(type, isDomainEvent = false) {
3
- return () => ({ type, isDomainEvent });
2
+ function EventDefinition(type, isDomainEvent = false, _transformations = {}) {
3
+ return () => ({
4
+ __type: "event-definition",
5
+ type,
6
+ isDomainEvent,
7
+ transformations: _transformations
8
+ });
4
9
  }
5
10
  export {
6
11
  EventDefinition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.5.8",
3
+ "version": "1.5.10",
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": "c863e1912299e6c0a29e751a05c4ca155ec801e710e0515a5c94fc31"
60
+ "falconPackageHash": "efb91115c561f417a9474bbbb64813644684f0305d8d0ea2a205132c"
61
61
  }