@envoy/envoy-integrations-sdk 2.3.0 → 2.3.2

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.
Files changed (84) hide show
  1. package/README.md +24 -16
  2. package/dist/base/EnvoyAPI.d.ts.map +1 -1
  3. package/dist/base/EnvoyAPI.js +26 -23
  4. package/dist/factories/entryEventBodyFactory.d.ts.map +1 -1
  5. package/dist/factories/entryEventBodyFactory.js +38 -30
  6. package/dist/factories/eventBodyFactory.d.ts.map +1 -1
  7. package/dist/factories/inviteEventBodyFactory.d.ts.map +1 -1
  8. package/dist/factories/inviteEventBodyFactory.js +11 -10
  9. package/dist/factories/routeBodyFactory.d.ts.map +1 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/internal/EnvoyEntryEvent.d.ts.map +1 -1
  13. package/dist/internal/EnvoyInviteEvent.d.ts.map +1 -1
  14. package/dist/internal/EnvoyStorageCommand.d.ts.map +1 -1
  15. package/dist/mocks/EnvoyPluginJobMock.d.ts.map +1 -1
  16. package/dist/mocks/EnvoyPluginStoragePipelineMock.d.ts.map +1 -1
  17. package/dist/mocks/EnvoyPluginStoragePipelineMock.js +1 -1
  18. package/dist/payloads/EntryPayload.d.ts.map +1 -1
  19. package/dist/payloads/InvitePayload.d.ts.map +1 -1
  20. package/dist/payloads/NotificationPayload.d.ts.map +1 -1
  21. package/dist/resources/FlowResource.d.ts +2 -1
  22. package/dist/resources/FlowResource.d.ts.map +1 -1
  23. package/dist/resources/ReservationResource.d.ts +5 -5
  24. package/dist/resources/ReservationResource.d.ts.map +1 -1
  25. package/dist/resources/SignInFieldPageResource.d.ts.map +1 -1
  26. package/dist/sdk/EnvoyMeta.d.ts.map +1 -1
  27. package/dist/sdk/EnvoyPluginAPI.d.ts.map +1 -1
  28. package/dist/sdk/EnvoyPluginJobAttachment.d.ts.map +1 -1
  29. package/dist/sdk/EnvoyPluginSDK.js +1 -1
  30. package/dist/sdk/EnvoyPluginStorage.d.ts.map +1 -1
  31. package/dist/sdk/EnvoyPluginStorage.js +6 -2
  32. package/dist/sdk/EnvoyRequest.d.ts.map +1 -1
  33. package/dist/sdk/EnvoyUserAPI.d.ts +1 -1
  34. package/dist/sdk/EnvoyUserAPI.d.ts.map +1 -1
  35. package/dist/sdk/EnvoyUserAPI.js +8 -8
  36. package/dist/sdk/filters.d.ts.map +1 -1
  37. package/dist/sdk/handlers.d.ts.map +1 -1
  38. package/dist/sdk/handlers.js +3 -1
  39. package/dist/sdk/loggers.js +2 -5
  40. package/dist/sdk/middleware.d.ts.map +1 -1
  41. package/dist/sdk/middleware.js +1 -1
  42. package/dist/util/EnvoySignatureVerifier.d.ts.map +1 -1
  43. package/dist/util/json-api/JSONAPIPaginationParams.d.ts.map +1 -1
  44. package/dist/util/json-api/JSONAPIResponse.d.ts.map +1 -1
  45. package/package.json +14 -6
  46. package/src/base/EnvoyAPI.ts +26 -25
  47. package/src/factories/entryEventBodyFactory.ts +59 -48
  48. package/src/factories/eventBodyFactory.ts +8 -10
  49. package/src/factories/inviteEventBodyFactory.ts +26 -24
  50. package/src/factories/metaFactory.ts +1 -1
  51. package/src/factories/routeBodyFactory.ts +9 -11
  52. package/src/index.ts +2 -0
  53. package/src/internal/EnvoyEntryEvent.ts +7 -7
  54. package/src/internal/EnvoyInviteEvent.ts +10 -10
  55. package/src/internal/EnvoyOption.ts +3 -3
  56. package/src/internal/EnvoyOptionsRouteParams.ts +3 -3
  57. package/src/internal/EnvoyPluginJobUpdate.ts +4 -4
  58. package/src/internal/EnvoyRemoteValueRouteResponseBody.ts +1 -1
  59. package/src/internal/EnvoySelectedValuesRouteParams.ts +1 -1
  60. package/src/internal/EnvoyStorageCommand.ts +21 -20
  61. package/src/mocks/EnvoyPluginJobMock.ts +2 -4
  62. package/src/mocks/EnvoyPluginStoragePipelineMock.ts +12 -4
  63. package/src/payloads/EntryPayload.ts +56 -60
  64. package/src/payloads/InvitePayload.ts +50 -50
  65. package/src/payloads/NotificationPayload.ts +38 -38
  66. package/src/resources/FlowResource.ts +2 -1
  67. package/src/resources/ReservationResource.ts +27 -21
  68. package/src/resources/SignInFieldPageResource.ts +6 -5
  69. package/src/resources/SignInFieldResource.ts +3 -3
  70. package/src/sdk/EnvoyMeta.ts +57 -57
  71. package/src/sdk/EnvoyPluginAPI.ts +5 -1
  72. package/src/sdk/EnvoyPluginJobAttachment.ts +14 -13
  73. package/src/sdk/EnvoyPluginSDK.ts +3 -3
  74. package/src/sdk/EnvoyPluginStorage.ts +8 -4
  75. package/src/sdk/EnvoyRequest.ts +61 -27
  76. package/src/sdk/EnvoyStorageItem.ts +2 -2
  77. package/src/sdk/EnvoyUserAPI.ts +51 -50
  78. package/src/sdk/filters.ts +5 -14
  79. package/src/sdk/handlers.ts +84 -76
  80. package/src/sdk/loggers.ts +15 -15
  81. package/src/sdk/middleware.ts +12 -10
  82. package/src/util/EnvoySignatureVerifier.ts +6 -14
  83. package/src/util/json-api/JSONAPIPaginationParams.ts +1 -2
  84. package/src/util/json-api/JSONAPIResponse.ts +3 -3
@@ -1,19 +1,19 @@
1
- import JSONAPIModel from "../util/json-api/JSONAPIModel";
1
+ import JSONAPIModel from '../util/json-api/JSONAPIModel';
2
2
 
3
3
  export interface ReservationAttributes {
4
- 'is-partial-day': boolean;
5
- 'updated-at': number;
6
- 'is-assignable': boolean;
7
- 'name': string;
8
- 'assigned-to': string | null;
9
- 'neighborhood-id': number;
10
- 'created-at': number;
11
- 'neighborhood': number | null;
12
- 'parent-desk-id': string | null;
13
- 'availability': string | null;
14
- 'enabled': boolean;
15
- 'x-pos': number | null;
16
- 'y-pos': number | null;
4
+ 'is-partial-day': boolean;
5
+ 'updated-at': number;
6
+ 'is-assignable': boolean;
7
+ name: string;
8
+ 'assigned-to': string | null;
9
+ 'neighborhood-id': number;
10
+ 'created-at': number;
11
+ neighborhood: number | null;
12
+ 'parent-desk-id': string | null;
13
+ availability: string | null;
14
+ enabled: boolean;
15
+ 'x-pos': number | null;
16
+ 'y-pos': number | null;
17
17
  }
18
18
 
19
19
  export interface ReservationCreationAttributes {
@@ -25,16 +25,22 @@ export interface ReservationCreationAttributes {
25
25
  locationId?: number | null;
26
26
  inviteId?: number | null;
27
27
  entryId?: number | null;
28
- startTime?: number | null; // Unix timestamp
29
- endTime?: number | null; // Unix timestamp
28
+ startTime?: number | null; // Unix timestamp
29
+ endTime?: number | null; // Unix timestamp
30
30
 
31
31
  meta?: {
32
32
  autoAssignDesk?: boolean;
33
33
  };
34
34
  }
35
35
 
36
- export type ReservationRelationships = 'location' | 'desk' | 'company' | 'floor' | 'employee' | 'entry' | 'invite' | 'user';
37
-
38
- export type ReservationModel = JSONAPIModel<ReservationAttributes, ReservationRelationships, 'reservations'>
39
-
40
-
36
+ export type ReservationRelationships =
37
+ | 'location'
38
+ | 'desk'
39
+ | 'company'
40
+ | 'floor'
41
+ | 'employee'
42
+ | 'entry'
43
+ | 'invite'
44
+ | 'user';
45
+
46
+ export type ReservationModel = JSONAPIModel<ReservationAttributes, ReservationRelationships, 'reservations'>;
@@ -11,11 +11,12 @@ export type SignInFieldPageAttributes = {
11
11
  /**
12
12
  * @category API Resource
13
13
  */
14
- export type SignInFieldPageRelationships = 'flow'
15
- | 'actionable-sign-in-field-actions'
16
- | 'actionable-sign-in-fields'
17
- | 'sign-in-field-actions'
18
- | 'sign-in-fields';
14
+ export type SignInFieldPageRelationships =
15
+ | 'flow'
16
+ | 'actionable-sign-in-field-actions'
17
+ | 'actionable-sign-in-fields'
18
+ | 'sign-in-field-actions'
19
+ | 'sign-in-fields';
19
20
 
20
21
  /**
21
22
  * @category API Resource
@@ -15,9 +15,9 @@ export interface SignInFieldAttributes {
15
15
  'display-name': string;
16
16
  }>;
17
17
  options?: Array<{
18
- value: string,
19
- position: number,
20
- }>,
18
+ value: string;
19
+ position: number;
20
+ }>;
21
21
  position?: number;
22
22
  'store-response'?: boolean;
23
23
  'created-at'?: string;
@@ -2,60 +2,60 @@
2
2
  * @category Meta
3
3
  */
4
4
  export type EnvoyMetaJob<Event extends string = string> = {
5
- id: string,
6
- name: Event,
7
- identifier: string,
5
+ id: string;
6
+ name: Event;
7
+ identifier: string;
8
8
  };
9
9
 
10
10
  /**
11
11
  * @category Meta
12
12
  */
13
13
  export type EnvoyMetaLocation = {
14
- id: string,
15
- type: 'locations',
14
+ id: string;
15
+ type: 'locations';
16
16
  attributes: {
17
- name: string,
18
- 'company-name-override': string | null,
19
- timezone: string,
20
- locale: string | null,
21
- address: string,
22
- 'address-line-one': string | null,
23
- 'address-line-two': string | null,
24
- city: string | null,
25
- state: string | null,
26
- country: string | null,
27
- zip: string | null,
28
- longitude: number | null,
29
- latitude: number | null,
30
- 'created-at': string,
31
- }
17
+ name: string;
18
+ 'company-name-override': string | null;
19
+ timezone: string;
20
+ locale: string | null;
21
+ address: string;
22
+ 'address-line-one': string | null;
23
+ 'address-line-two': string | null;
24
+ city: string | null;
25
+ state: string | null;
26
+ country: string | null;
27
+ zip: string | null;
28
+ longitude: number | null;
29
+ latitude: number | null;
30
+ 'created-at': string;
31
+ };
32
32
  };
33
33
 
34
34
  /**
35
35
  * @category Meta
36
36
  */
37
37
  export type EnvoyMetaCompany = {
38
- id: string,
39
- type: 'companies',
38
+ id: string;
39
+ type: 'companies';
40
40
  attributes: {
41
- name: string,
42
- active: boolean,
43
- 'created-at': string,
44
- }
41
+ name: string;
42
+ active: boolean;
43
+ 'created-at': string;
44
+ };
45
45
  };
46
46
 
47
47
  /**
48
48
  * @category Meta
49
49
  */
50
50
  export type EnvoyMetaZone = {
51
- id: string,
52
- type: 'zones',
51
+ id: string;
52
+ type: 'zones';
53
53
  attributes: {
54
- address: string | null,
55
- 'logo-url': string | null,
56
- name: string,
57
- 'time-zone': string,
58
- }
54
+ address: string | null;
55
+ 'logo-url': string | null;
56
+ name: string;
57
+ 'time-zone': string;
58
+ };
59
59
  };
60
60
 
61
61
  /**
@@ -65,11 +65,11 @@ export type EnvoyMetaZone = {
65
65
  * @category Meta
66
66
  */
67
67
  export type EnvoyMetaAuth = {
68
- token_type: 'Bearer',
69
- access_token: string,
70
- expires_in: number,
71
- refresh_token: string | null,
72
- refresh_token_expires_in: number | null,
68
+ token_type: 'Bearer';
69
+ access_token: string;
70
+ expires_in: number;
71
+ refresh_token: string | null;
72
+ refresh_token_expires_in: number | null;
73
73
  };
74
74
 
75
75
  /**
@@ -78,15 +78,15 @@ export type EnvoyMetaAuth = {
78
78
  * @category Meta
79
79
  */
80
80
  export type EnvoyEventMeta<Event extends string = string, Config = Record<string, unknown>> = {
81
- event: Event,
82
- plugin_id: string,
83
- install_id: string,
84
- config: Config,
85
- job: EnvoyMetaJob<Event>,
86
- location: EnvoyMetaLocation,
87
- company: EnvoyMetaCompany,
88
- zone: EnvoyMetaZone,
89
- auth: EnvoyMetaAuth | null,
81
+ event: Event;
82
+ plugin_id: string;
83
+ install_id: string;
84
+ config: Config;
85
+ job: EnvoyMetaJob<Event>;
86
+ location: EnvoyMetaLocation;
87
+ company: EnvoyMetaCompany;
88
+ zone: EnvoyMetaZone;
89
+ auth: EnvoyMetaAuth | null;
90
90
  };
91
91
 
92
92
  /**
@@ -96,16 +96,16 @@ export type EnvoyEventMeta<Event extends string = string, Config = Record<string
96
96
  * @category Meta
97
97
  */
98
98
  export type EnvoyRouteMeta<Config = Record<string, unknown>, Params = Record<string, unknown>> = {
99
- route: string,
100
- plugin_id: string,
101
- install_id: string,
102
- config: Config,
103
- params: Params,
104
- location: EnvoyMetaLocation,
105
- company: EnvoyMetaCompany,
106
- zone: EnvoyMetaZone,
107
- auth: EnvoyMetaAuth | null,
108
- forwarded_bearer_token?: string,
99
+ route: string;
100
+ plugin_id: string;
101
+ install_id: string;
102
+ config: Config;
103
+ params: Params;
104
+ location: EnvoyMetaLocation;
105
+ company: EnvoyMetaCompany;
106
+ zone: EnvoyMetaZone;
107
+ auth: EnvoyMetaAuth | null;
108
+ forwarded_bearer_token?: string;
109
109
  };
110
110
 
111
111
  /**
@@ -70,7 +70,11 @@ export default class EnvoyPluginAPI extends EnvoyAPI {
70
70
  /**
71
71
  * Gets a plugin access token using `client_credentials` as the grant type.
72
72
  */
73
- static async loginAsPlugin(id = envoyClientId, secret = envoyClientSecret, scope: string[] = ['plugin', 'token.refresh']): Promise<EnvoyMetaAuth> {
73
+ static async loginAsPlugin(
74
+ id = envoyClientId,
75
+ secret = envoyClientSecret,
76
+ scope: string[] = ['plugin', 'token.refresh'],
77
+ ): Promise<EnvoyMetaAuth> {
74
78
  try {
75
79
  const { data } = await axios({
76
80
  auth: {
@@ -4,9 +4,9 @@
4
4
  * @category Attachment
5
5
  */
6
6
  export interface EnvoyPluginTextJobAttachment {
7
- type?: 'text' | 'password' | string,
8
- label: string,
9
- value: string,
7
+ type?: 'text' | 'password' | string;
8
+ label: string;
9
+ value: string;
10
10
  }
11
11
 
12
12
  /**
@@ -15,8 +15,8 @@ export interface EnvoyPluginTextJobAttachment {
15
15
  * @category Attachment
16
16
  */
17
17
  export interface EnvoyPluginLinkJobAttachment extends EnvoyPluginTextJobAttachment {
18
- type: 'link',
19
- url: string,
18
+ type: 'link';
19
+ url: string;
20
20
  }
21
21
 
22
22
  /**
@@ -26,12 +26,12 @@ export interface EnvoyPluginLinkJobAttachment extends EnvoyPluginTextJobAttachme
26
26
  * @category Attachment
27
27
  */
28
28
  export interface EnvoyPluginCredentialJobAttachment extends EnvoyPluginTextJobAttachment {
29
- type: 'credential_image',
30
- title: string,
29
+ type: 'credential_image';
30
+ title: string;
31
31
  image: {
32
- type: 's3',
33
- link: string,
34
- },
32
+ type: 's3';
33
+ link: string;
34
+ };
35
35
  }
36
36
 
37
37
  /**
@@ -41,8 +41,9 @@ export interface EnvoyPluginCredentialJobAttachment extends EnvoyPluginTextJobAt
41
41
  *
42
42
  * @category Attachment
43
43
  */
44
- type EnvoyPluginJobAttachment = EnvoyPluginTextJobAttachment
45
- | EnvoyPluginLinkJobAttachment
46
- | EnvoyPluginCredentialJobAttachment;
44
+ type EnvoyPluginJobAttachment =
45
+ | EnvoyPluginTextJobAttachment
46
+ | EnvoyPluginLinkJobAttachment
47
+ | EnvoyPluginCredentialJobAttachment;
47
48
 
48
49
  export default EnvoyPluginJobAttachment;
@@ -13,8 +13,8 @@ import InvitePayload, { normalizeInvitePayload } from '../payloads/InvitePayload
13
13
  * @category Request
14
14
  */
15
15
  export interface EnvoyRequestBody<Meta, Payload> {
16
- meta: Meta,
17
- payload: Payload,
16
+ meta: Meta;
17
+ payload: Payload;
18
18
  }
19
19
 
20
20
  /**
@@ -96,7 +96,7 @@ export default class EnvoyPluginSDK<Meta = unknown, Payload = unknown> {
96
96
  const meta = this.meta as unknown as EnvoyRouteMeta;
97
97
  const { auth } = meta;
98
98
  let accessToken: string | undefined = auth?.access_token;
99
- if (!accessToken && ('forwarded_bearer_token' in meta)) {
99
+ if (!accessToken && 'forwarded_bearer_token' in meta) {
100
100
  accessToken = meta.forwarded_bearer_token;
101
101
  }
102
102
  if (!accessToken) {
@@ -33,7 +33,7 @@ export default class EnvoyPluginStorage {
33
33
  * Wrapper for single pipeline get.
34
34
  */
35
35
  get<Value = unknown>(key: string) {
36
- return this.pipeline().get(key).executeSingle<EnvoyStorageItem<Value> | { key: string, 'value': undefined }>();
36
+ return this.pipeline().get(key).executeSingle<EnvoyStorageItem<Value> | { key: string; value: undefined }>();
37
37
  }
38
38
 
39
39
  /**
@@ -51,7 +51,9 @@ export default class EnvoyPluginStorage {
51
51
  * Wrapper for single pipeline setUnique.
52
52
  */
53
53
  setUnique(key: string, options: EnvoyStorageSetUniqueOptions = {}) {
54
- return this.pipeline().setUnique(key, options).executeSingle<EnvoyStorageItem<string> | { key: string, 'value': undefined }>();
54
+ return this.pipeline()
55
+ .setUnique(key, options)
56
+ .executeSingle<EnvoyStorageItem<string> | { key: string; value: undefined }>();
55
57
  }
56
58
 
57
59
  /**
@@ -60,7 +62,9 @@ export default class EnvoyPluginStorage {
60
62
  * Wrapper for single pipeline setUnique.
61
63
  */
62
64
  setUniqueNum(key: string, options: EnvoyStorageSetUniqueNumOptions = {}) {
63
- return this.pipeline().setUniqueNum(key, options).executeSingle<EnvoyStorageItem<number> | { key: string, 'value': undefined }>();
65
+ return this.pipeline()
66
+ .setUniqueNum(key, options)
67
+ .executeSingle<EnvoyStorageItem<number> | { key: string; value: undefined }>();
64
68
  }
65
69
 
66
70
  /**
@@ -69,7 +73,7 @@ export default class EnvoyPluginStorage {
69
73
  * Wrapper for single pipeline unset.
70
74
  */
71
75
  unset<Value = unknown>(key: string) {
72
- return this.pipeline().unset(key).executeSingle<EnvoyStorageItem<Value> | { key: string, 'value': undefined }>();
76
+ return this.pipeline().unset(key).executeSingle<EnvoyStorageItem<Value> | { key: string; value: undefined }>();
73
77
  }
74
78
 
75
79
  /**
@@ -24,7 +24,7 @@ export const VERIFIED = Symbol('verified');
24
24
  * @internal
25
25
  */
26
26
  export interface VerifiedRequest extends Request {
27
- [VERIFIED]: boolean
27
+ [VERIFIED]: boolean;
28
28
  }
29
29
 
30
30
  /**
@@ -36,7 +36,7 @@ export interface VerifiedRequest extends Request {
36
36
  * @category Base
37
37
  */
38
38
  export interface EnvoyBaseRequest<Meta = EnvoyMeta, Payload = unknown> extends VerifiedRequest {
39
- envoy: EnvoyPluginSDK<Meta, Payload>
39
+ envoy: EnvoyPluginSDK<Meta, Payload>;
40
40
  }
41
41
 
42
42
  /**
@@ -48,47 +48,61 @@ export type EnvoyRouteRequest<
48
48
  Payload = unknown,
49
49
  Config = Record<string, unknown>,
50
50
  Params = Record<string, unknown>,
51
- > = EnvoyBaseRequest<EnvoyRouteMeta<Config, Params>, Payload>;
51
+ > = EnvoyBaseRequest<EnvoyRouteMeta<Config, Params>, Payload>;
52
52
 
53
53
  /**
54
54
  * Use to type your `req` object in Envoy "migration" route handlers.
55
55
  *
56
56
  * @category Request
57
57
  */
58
- export type EnvoyMigrationRouteRequest<OldConfig = Record<string, unknown>> =
59
- EnvoyRouteRequest<never, OldConfig, never>;
58
+ export type EnvoyMigrationRouteRequest<OldConfig = Record<string, unknown>> = EnvoyRouteRequest<
59
+ never,
60
+ OldConfig,
61
+ never
62
+ >;
60
63
 
61
64
  /**
62
65
  * Use to type your `req` object in Envoy "options URL" route handlers.
63
66
  *
64
67
  * @category Request
65
68
  */
66
- export type EnvoyOptionsRouteRequest<Config = Record<string, unknown>> =
67
- EnvoyRouteRequest<EnvoyOptionsRouteResponseBody, Config, EnvoyOptionsRouteParams>;
69
+ export type EnvoyOptionsRouteRequest<Config = Record<string, unknown>> = EnvoyRouteRequest<
70
+ EnvoyOptionsRouteResponseBody,
71
+ Config,
72
+ EnvoyOptionsRouteParams
73
+ >;
68
74
 
69
75
  /**
70
76
  * Use to type your `req` object in Envoy "selected values URL" route handlers.
71
77
  *
72
78
  * @category Request
73
79
  */
74
- export type EnvoySelectedValuesRouteRequest<Config = Record<string, unknown>> =
75
- EnvoyRouteRequest<EnvoySelectedValuesRouteResponseBody, Config, EnvoySelectedValuesRouteParams>;
80
+ export type EnvoySelectedValuesRouteRequest<Config = Record<string, unknown>> = EnvoyRouteRequest<
81
+ EnvoySelectedValuesRouteResponseBody,
82
+ Config,
83
+ EnvoySelectedValuesRouteParams
84
+ >;
76
85
 
77
86
  /**
78
87
  * Use to type your `req` object in Envoy "remote value URL" route handlers.
79
88
  *
80
89
  * @category Request
81
90
  */
82
- export type EnvoyRemoteValueRouteRequest<Config = Record<string, unknown>> =
83
- EnvoyRouteRequest<EnvoyRemoteValueRouteResponseBody, Config, never>;
91
+ export type EnvoyRemoteValueRouteRequest<Config = Record<string, unknown>> = EnvoyRouteRequest<
92
+ EnvoyRemoteValueRouteResponseBody,
93
+ Config,
94
+ never
95
+ >;
84
96
 
85
97
  /**
86
98
  * Use to type your `req` object in Envoy "validation URL" route handlers.
87
99
  *
88
100
  * @category Request
89
101
  */
90
- export type EnvoyValidationRouteRequest<Payload = Record<string, unknown>, Config = Record<string, unknown>> =
91
- EnvoyRouteRequest<Payload, Config, never>;
102
+ export type EnvoyValidationRouteRequest<
103
+ Payload = Record<string, unknown>,
104
+ Config = Record<string, unknown>,
105
+ > = EnvoyRouteRequest<Payload, Config, never>;
92
106
 
93
107
  /**
94
108
  * Base type for event requests.
@@ -96,8 +110,11 @@ export type EnvoyValidationRouteRequest<Payload = Record<string, unknown>, Confi
96
110
  *
97
111
  * @category Request
98
112
  */
99
- export type EnvoyEventRequest<Event extends string = string, Payload = unknown, Config = Record<string, unknown>> =
100
- EnvoyBaseRequest<EnvoyEventMeta<Event, Config>, Payload>;
113
+ export type EnvoyEventRequest<
114
+ Event extends string = string,
115
+ Payload = unknown,
116
+ Config = Record<string, unknown>,
117
+ > = EnvoyBaseRequest<EnvoyEventMeta<Event, Config>, Payload>;
101
118
 
102
119
  /**
103
120
  * Use to type your `req` object in entry event handlers,
@@ -105,8 +122,11 @@ export type EnvoyEventRequest<Event extends string = string, Payload = unknown,
105
122
  *
106
123
  * @category Request
107
124
  */
108
- export type EnvoyEntryEventRequest<Config = Record<string, unknown>> =
109
- EnvoyEventRequest<EnvoyEntryEvent, EntryPayload, Config>;
125
+ export type EnvoyEntryEventRequest<Config = Record<string, unknown>> = EnvoyEventRequest<
126
+ EnvoyEntryEvent,
127
+ EntryPayload,
128
+ Config
129
+ >;
110
130
 
111
131
  /**
112
132
  * Use to type your `req` object in invite event handlers,
@@ -114,8 +134,11 @@ export type EnvoyEntryEventRequest<Config = Record<string, unknown>> =
114
134
  *
115
135
  * @category Request
116
136
  */
117
- export type EnvoyInviteEventRequest<Config = Record<string, unknown>> =
118
- EnvoyEventRequest<EnvoyInviteEvent, InvitePayload, Config>;
137
+ export type EnvoyInviteEventRequest<Config = Record<string, unknown>> = EnvoyEventRequest<
138
+ EnvoyInviteEvent,
139
+ InvitePayload,
140
+ Config
141
+ >;
119
142
 
120
143
  /**
121
144
  * Use to type your `req` object in location event handlers,
@@ -123,24 +146,33 @@ export type EnvoyInviteEventRequest<Config = Record<string, unknown>> =
123
146
  *
124
147
  * @category Request
125
148
  */
126
- export type EnvoyLocationEventRequest<Config = Record<string, unknown>> =
127
- EnvoyEventRequest<EnvoyLocationEvent, LocationPayload, Config>;
149
+ export type EnvoyLocationEventRequest<Config = Record<string, unknown>> = EnvoyEventRequest<
150
+ EnvoyLocationEvent,
151
+ LocationPayload,
152
+ Config
153
+ >;
128
154
 
129
155
  /**
130
156
  * Use to type your `req` object in your notification event handler.
131
157
  *
132
158
  * @category Request
133
159
  */
134
- export type EnvoyNotificationEventRequest<Config = Record<string, unknown>> =
135
- EnvoyEventRequest<string, NotificationPayload, Config>;
160
+ export type EnvoyNotificationEventRequest<Config = Record<string, unknown>> = EnvoyEventRequest<
161
+ string,
162
+ NotificationPayload,
163
+ Config
164
+ >;
136
165
 
137
166
  /**
138
167
  * Use to type your `req` object in your takeover event handler.
139
168
  *
140
169
  * @category Request
141
170
  */
142
- export type EnvoyTakeoverEventRequest<Config = Record<string, unknown>> =
143
- EnvoyEventRequest<string, TakeoverPayload, Config>;
171
+ export type EnvoyTakeoverEventRequest<Config = Record<string, unknown>> = EnvoyEventRequest<
172
+ string,
173
+ TakeoverPayload,
174
+ Config
175
+ >;
144
176
 
145
177
  /**
146
178
  * You probably won't need to use this type directly.
@@ -149,6 +181,8 @@ export type EnvoyTakeoverEventRequest<Config = Record<string, unknown>> =
149
181
  *
150
182
  * @category Base
151
183
  */
152
- type EnvoyRequest<Payload = unknown, Config = Record<string, unknown>> =
153
- EnvoyBaseRequest<EnvoyRouteMeta<Config> | EnvoyEventMeta<string, Config>, Payload>;
184
+ type EnvoyRequest<Payload = unknown, Config = Record<string, unknown>> = EnvoyBaseRequest<
185
+ EnvoyRouteMeta<Config> | EnvoyEventMeta<string, Config>,
186
+ Payload
187
+ >;
154
188
  export default EnvoyRequest;
@@ -2,8 +2,8 @@
2
2
  * @category Storage
3
3
  */
4
4
  type EnvoyStorageItem<Value = unknown> = {
5
- key: string,
6
- value: Value,
5
+ key: string;
6
+ value: Value;
7
7
  };
8
8
 
9
9
  export default EnvoyStorageItem;