@wix/sdk-types 1.5.6 → 1.5.7

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.
@@ -0,0 +1,7 @@
1
+ // src/webhooks.ts
2
+ function EventDefinition(type) {
3
+ return () => ({ type });
4
+ }
5
+ export {
6
+ EventDefinition
7
+ };
package/build/index.d.mts CHANGED
@@ -43,12 +43,12 @@ type AuthenticationStrategy<Host = unknown> = {
43
43
  getAuthHeaders: (host: Host) => Promise<{
44
44
  headers: Record<string, string>;
45
45
  }>;
46
- decodeJWT?: (token: string, verifyCallerClaims?: boolean) => {
46
+ decodeJWT?: (token: string, verifyCallerClaims?: boolean) => Promise<{
47
47
  decoded: {
48
48
  data: string;
49
49
  };
50
50
  valid: boolean;
51
- };
51
+ }>;
52
52
  };
53
53
  type BoundAuthenticationStrategy = {
54
54
  getAuthHeaders: () => Promise<{
@@ -56,14 +56,15 @@ type BoundAuthenticationStrategy = {
56
56
  }>;
57
57
  };
58
58
 
59
- type EventDefinition<Payload = unknown> = {
60
- type: string;
59
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
60
+ type: Type;
61
61
  __payload: Payload;
62
62
  };
63
+ declare function EventDefinition<Type extends string>(type: Type): <Payload = unknown>() => EventDefinition<Payload, Type>;
63
64
 
64
65
  type SPIDefinition<TInput, TResult> = {
65
66
  __input: TInput;
66
67
  __result: TResult;
67
68
  };
68
69
 
69
- export type { APIMetadata, AuthenticationStrategy, BoundAuthenticationStrategy, BuildRESTFunction, EventDefinition, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory, SPIDefinition };
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 };
package/build/index.d.ts CHANGED
@@ -43,12 +43,12 @@ type AuthenticationStrategy<Host = unknown> = {
43
43
  getAuthHeaders: (host: Host) => Promise<{
44
44
  headers: Record<string, string>;
45
45
  }>;
46
- decodeJWT?: (token: string, verifyCallerClaims?: boolean) => {
46
+ decodeJWT?: (token: string, verifyCallerClaims?: boolean) => Promise<{
47
47
  decoded: {
48
48
  data: string;
49
49
  };
50
50
  valid: boolean;
51
- };
51
+ }>;
52
52
  };
53
53
  type BoundAuthenticationStrategy = {
54
54
  getAuthHeaders: () => Promise<{
@@ -56,14 +56,15 @@ type BoundAuthenticationStrategy = {
56
56
  }>;
57
57
  };
58
58
 
59
- type EventDefinition<Payload = unknown> = {
60
- type: string;
59
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
60
+ type: Type;
61
61
  __payload: Payload;
62
62
  };
63
+ declare function EventDefinition<Type extends string>(type: Type): <Payload = unknown>() => EventDefinition<Payload, Type>;
63
64
 
64
65
  type SPIDefinition<TInput, TResult> = {
65
66
  __input: TInput;
66
67
  __result: TResult;
67
68
  };
68
69
 
69
- export type { APIMetadata, AuthenticationStrategy, BoundAuthenticationStrategy, BuildRESTFunction, EventDefinition, Host, HostModule, HostModuleAPI, HttpClient, HttpResponse, RESTFunctionDescriptor, RequestOptions, RequestOptionsFactory, SPIDefinition };
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 };
package/build/index.js CHANGED
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -15,4 +19,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
15
19
 
16
20
  // src/index.ts
17
21
  var src_exports = {};
22
+ __export(src_exports, {
23
+ EventDefinition: () => EventDefinition
24
+ });
18
25
  module.exports = __toCommonJS(src_exports);
26
+
27
+ // src/webhooks.ts
28
+ function EventDefinition(type) {
29
+ return () => ({ type });
30
+ }
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ EventDefinition
34
+ });
package/build/index.mjs CHANGED
@@ -0,0 +1,7 @@
1
+ // src/webhooks.ts
2
+ function EventDefinition(type) {
3
+ return () => ({ type });
4
+ }
5
+ export {
6
+ EventDefinition
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/sdk-types",
3
- "version": "1.5.6",
3
+ "version": "1.5.7",
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": "413000daa6e1e75d69913de2edf89efad884bb828fc97e9482f472a3"
60
+ "falconPackageHash": "11cd2184d696f61c8d1abb447f1f9be0194458f59c8e3b52a4a42c54"
61
61
  }