@envoy/envoy-integrations-sdk 2.0.1-beta.5 → 2.0.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 (291) hide show
  1. package/README.md +178 -110
  2. package/dist/base/EnvoyAPI.d.ts +28 -0
  3. package/dist/base/EnvoyAPI.d.ts.map +1 -0
  4. package/dist/base/EnvoyAPI.js +121 -0
  5. package/dist/base/EnvoyPluginStoragePipeline.d.ts +51 -0
  6. package/dist/base/EnvoyPluginStoragePipeline.d.ts.map +1 -0
  7. package/dist/base/EnvoyPluginStoragePipeline.js +140 -0
  8. package/dist/constants.d.ts +5 -0
  9. package/dist/constants.d.ts.map +1 -0
  10. package/dist/constants.js +12 -0
  11. package/dist/factories/entryEventBodyFactory.d.ts +42 -0
  12. package/dist/factories/entryEventBodyFactory.d.ts.map +1 -0
  13. package/dist/factories/entryEventBodyFactory.js +105 -0
  14. package/dist/factories/eventBodyFactory.d.ts +18 -0
  15. package/dist/factories/eventBodyFactory.d.ts.map +1 -0
  16. package/dist/factories/eventBodyFactory.js +15 -0
  17. package/dist/factories/inviteEventBodyFactory.d.ts +38 -0
  18. package/dist/factories/inviteEventBodyFactory.d.ts.map +1 -0
  19. package/dist/factories/inviteEventBodyFactory.js +92 -0
  20. package/dist/factories/metaFactory.d.ts +10 -0
  21. package/dist/factories/metaFactory.d.ts.map +1 -0
  22. package/dist/factories/metaFactory.js +90 -0
  23. package/dist/factories/routeBodyFactory.d.ts +19 -0
  24. package/dist/factories/routeBodyFactory.d.ts.map +1 -0
  25. package/dist/factories/routeBodyFactory.js +15 -0
  26. package/dist/index.d.ts +52 -0
  27. package/dist/index.d.ts.map +1 -0
  28. package/dist/index.js +74 -0
  29. package/dist/internal/EnvoyEntryEvent.d.ts +3 -0
  30. package/dist/internal/EnvoyEntryEvent.d.ts.map +1 -0
  31. package/dist/internal/EnvoyEntryEvent.js +2 -0
  32. package/dist/internal/EnvoyInviteEvent.d.ts +3 -0
  33. package/dist/internal/EnvoyInviteEvent.d.ts.map +1 -0
  34. package/dist/internal/EnvoyInviteEvent.js +2 -0
  35. package/dist/internal/EnvoyLocationEvent.d.ts +3 -0
  36. package/dist/internal/EnvoyLocationEvent.d.ts.map +1 -0
  37. package/dist/internal/EnvoyLocationEvent.js +2 -0
  38. package/dist/internal/EnvoyOption.d.ts +6 -0
  39. package/dist/internal/EnvoyOption.d.ts.map +1 -0
  40. package/dist/internal/EnvoyOption.js +2 -0
  41. package/dist/internal/EnvoyOptionsRouteParams.d.ts +7 -0
  42. package/dist/internal/EnvoyOptionsRouteParams.d.ts.map +1 -0
  43. package/dist/internal/EnvoyOptionsRouteParams.js +2 -0
  44. package/dist/internal/EnvoyOptionsRouteResponseBody.d.ts +4 -0
  45. package/dist/internal/EnvoyOptionsRouteResponseBody.d.ts.map +1 -0
  46. package/dist/internal/EnvoyOptionsRouteResponseBody.js +2 -0
  47. package/dist/internal/EnvoyPluginJobUpdate.d.ts +11 -0
  48. package/dist/internal/EnvoyPluginJobUpdate.d.ts.map +1 -0
  49. package/dist/internal/EnvoyPluginJobUpdate.js +2 -0
  50. package/dist/internal/EnvoyRemoteValueRouteResponseBody.d.ts +5 -0
  51. package/dist/internal/EnvoyRemoteValueRouteResponseBody.d.ts.map +1 -0
  52. package/dist/internal/EnvoyRemoteValueRouteResponseBody.js +2 -0
  53. package/dist/internal/EnvoySelectedValuesRouteParams.d.ts +5 -0
  54. package/dist/internal/EnvoySelectedValuesRouteParams.d.ts.map +1 -0
  55. package/dist/internal/EnvoySelectedValuesRouteParams.js +2 -0
  56. package/dist/internal/EnvoySelectedValuesRouteResponseBody.d.ts +4 -0
  57. package/dist/internal/EnvoySelectedValuesRouteResponseBody.d.ts.map +1 -0
  58. package/dist/internal/EnvoySelectedValuesRouteResponseBody.js +2 -0
  59. package/dist/internal/EnvoyStorageCommand.d.ts +42 -0
  60. package/dist/internal/EnvoyStorageCommand.d.ts.map +1 -0
  61. package/dist/internal/EnvoyStorageCommand.js +7 -0
  62. package/dist/internal/EnvoyStorageResult.d.ts +4 -0
  63. package/dist/internal/EnvoyStorageResult.d.ts.map +1 -0
  64. package/dist/internal/EnvoyStorageResult.js +2 -0
  65. package/dist/internal/HttpStatus.d.ts +13 -0
  66. package/dist/internal/HttpStatus.d.ts.map +1 -0
  67. package/dist/internal/HttpStatus.js +15 -0
  68. package/dist/mocks/EnvoyPluginJobMock.d.ts +12 -0
  69. package/dist/mocks/EnvoyPluginJobMock.d.ts.map +1 -0
  70. package/dist/mocks/EnvoyPluginJobMock.js +60 -0
  71. package/dist/mocks/EnvoyPluginStoragePipelineMock.d.ts +24 -0
  72. package/dist/mocks/EnvoyPluginStoragePipelineMock.d.ts.map +1 -0
  73. package/dist/mocks/EnvoyPluginStoragePipelineMock.js +212 -0
  74. package/dist/payloads/EntryPayload.d.ts +80 -0
  75. package/dist/payloads/EntryPayload.d.ts.map +1 -0
  76. package/dist/payloads/EntryPayload.js +28 -0
  77. package/dist/payloads/InvitePayload.d.ts +66 -0
  78. package/dist/payloads/InvitePayload.d.ts.map +1 -0
  79. package/dist/payloads/InvitePayload.js +24 -0
  80. package/dist/payloads/LocationPayload.d.ts +7 -0
  81. package/dist/payloads/LocationPayload.d.ts.map +1 -0
  82. package/dist/payloads/LocationPayload.js +2 -0
  83. package/dist/payloads/NotificationPayload.d.ts +54 -0
  84. package/dist/payloads/NotificationPayload.d.ts.map +1 -0
  85. package/dist/payloads/NotificationPayload.js +2 -0
  86. package/dist/resources/AgreementPageResource.d.ts +17 -0
  87. package/dist/resources/AgreementPageResource.d.ts.map +1 -0
  88. package/dist/resources/AgreementPageResource.js +2 -0
  89. package/dist/resources/AgreementResource.d.ts +24 -0
  90. package/dist/resources/AgreementResource.d.ts.map +1 -0
  91. package/dist/resources/AgreementResource.js +2 -0
  92. package/dist/resources/CompanyResource.d.ts +19 -0
  93. package/dist/resources/CompanyResource.d.ts.map +1 -0
  94. package/dist/resources/CompanyResource.js +2 -0
  95. package/dist/resources/CompanyRoleResource.d.ts +8 -0
  96. package/dist/resources/CompanyRoleResource.d.ts.map +1 -0
  97. package/dist/resources/CompanyRoleResource.js +2 -0
  98. package/dist/resources/CurrentUserResource.d.ts +8 -0
  99. package/dist/resources/CurrentUserResource.d.ts.map +1 -0
  100. package/dist/resources/CurrentUserResource.js +2 -0
  101. package/dist/resources/EmployeeResource.d.ts +43 -0
  102. package/dist/resources/EmployeeResource.d.ts.map +1 -0
  103. package/dist/resources/EmployeeResource.js +2 -0
  104. package/dist/resources/FlowResource.d.ts +31 -0
  105. package/dist/resources/FlowResource.d.ts.map +1 -0
  106. package/dist/resources/FlowResource.js +2 -0
  107. package/dist/resources/InviteResource.d.ts +86 -0
  108. package/dist/resources/InviteResource.d.ts.map +1 -0
  109. package/dist/resources/InviteResource.js +2 -0
  110. package/dist/resources/LocationResource.d.ts +64 -0
  111. package/dist/resources/LocationResource.d.ts.map +1 -0
  112. package/dist/resources/LocationResource.js +2 -0
  113. package/dist/resources/LocationRoleResource.d.ts +8 -0
  114. package/dist/resources/LocationRoleResource.d.ts.map +1 -0
  115. package/dist/resources/LocationRoleResource.js +2 -0
  116. package/dist/resources/SignInFieldPageResource.d.ts +17 -0
  117. package/dist/resources/SignInFieldPageResource.d.ts.map +1 -0
  118. package/dist/resources/SignInFieldPageResource.js +2 -0
  119. package/dist/resources/SignInFieldResource.d.ts +33 -0
  120. package/dist/resources/SignInFieldResource.d.ts.map +1 -0
  121. package/dist/resources/SignInFieldResource.js +2 -0
  122. package/dist/resources/UserResource.d.ts +13 -0
  123. package/dist/resources/UserResource.d.ts.map +1 -0
  124. package/dist/resources/UserResource.js +2 -0
  125. package/dist/sdk/EnvoyMeta.d.ts +96 -0
  126. package/dist/sdk/EnvoyMeta.d.ts.map +1 -0
  127. package/dist/sdk/EnvoyMeta.js +2 -0
  128. package/dist/sdk/EnvoyPluginAPI.d.ts +31 -0
  129. package/dist/sdk/EnvoyPluginAPI.d.ts.map +1 -0
  130. package/dist/sdk/EnvoyPluginAPI.js +205 -0
  131. package/dist/sdk/EnvoyPluginJob.d.ts +49 -0
  132. package/dist/sdk/EnvoyPluginJob.d.ts.map +1 -0
  133. package/dist/sdk/EnvoyPluginJob.js +99 -0
  134. package/dist/sdk/EnvoyPluginJobAttachment.d.ts +43 -0
  135. package/dist/sdk/EnvoyPluginJobAttachment.d.ts.map +1 -0
  136. package/dist/sdk/EnvoyPluginJobAttachment.js +2 -0
  137. package/dist/sdk/EnvoyPluginSDK.d.ts +100 -0
  138. package/dist/sdk/EnvoyPluginSDK.d.ts.map +1 -0
  139. package/dist/sdk/EnvoyPluginSDK.js +204 -0
  140. package/dist/sdk/EnvoyPluginStorage.d.ts +69 -0
  141. package/dist/sdk/EnvoyPluginStorage.d.ts.map +1 -0
  142. package/dist/sdk/EnvoyPluginStorage.js +78 -0
  143. package/dist/sdk/EnvoyRequest.d.ts +116 -0
  144. package/dist/sdk/EnvoyRequest.d.ts.map +1 -0
  145. package/dist/sdk/EnvoyRequest.js +7 -0
  146. package/dist/sdk/EnvoyResponse.d.ts +42 -0
  147. package/dist/sdk/EnvoyResponse.d.ts.map +1 -0
  148. package/dist/sdk/EnvoyResponse.js +2 -0
  149. package/dist/sdk/EnvoyStorageItem.d.ts +9 -0
  150. package/dist/sdk/EnvoyStorageItem.d.ts.map +1 -0
  151. package/dist/sdk/EnvoyStorageItem.js +2 -0
  152. package/dist/sdk/EnvoyUserAPI.d.ts +119 -0
  153. package/dist/sdk/EnvoyUserAPI.d.ts.map +1 -0
  154. package/dist/sdk/EnvoyUserAPI.js +493 -0
  155. package/dist/sdk/filters.d.ts +30 -0
  156. package/dist/sdk/filters.d.ts.map +1 -0
  157. package/dist/sdk/filters.js +72 -0
  158. package/dist/sdk/handlers.d.ts +125 -0
  159. package/dist/sdk/handlers.d.ts.map +1 -0
  160. package/dist/sdk/handlers.js +108 -0
  161. package/dist/sdk/loggers.d.ts +6 -0
  162. package/dist/sdk/loggers.d.ts.map +1 -0
  163. package/dist/sdk/loggers.js +161 -0
  164. package/dist/sdk/middleware.d.ts +19 -0
  165. package/dist/sdk/middleware.d.ts.map +1 -0
  166. package/dist/sdk/middleware.js +159 -0
  167. package/dist/util/EnvoyJWT.d.ts +17 -0
  168. package/dist/util/EnvoyJWT.d.ts.map +1 -0
  169. package/dist/util/EnvoyJWT.js +54 -0
  170. package/dist/util/EnvoySignatureVerifier.d.ts +26 -0
  171. package/dist/util/EnvoySignatureVerifier.d.ts.map +1 -0
  172. package/dist/util/EnvoySignatureVerifier.js +53 -0
  173. package/dist/util/axiosConstructor.d.ts +4 -0
  174. package/dist/util/axiosConstructor.d.ts.map +1 -0
  175. package/dist/util/axiosConstructor.js +58 -0
  176. package/dist/util/errorHandling.d.ts +2 -0
  177. package/dist/util/errorHandling.d.ts.map +1 -0
  178. package/dist/util/errorHandling.js +18 -0
  179. package/dist/util/json-api/JSONAPIData.d.ts +5 -0
  180. package/dist/util/json-api/JSONAPIData.d.ts.map +1 -0
  181. package/dist/util/json-api/JSONAPIData.js +2 -0
  182. package/dist/util/json-api/JSONAPIFilterParams.d.ts +5 -0
  183. package/dist/util/json-api/JSONAPIFilterParams.d.ts.map +1 -0
  184. package/dist/util/json-api/JSONAPIFilterParams.js +2 -0
  185. package/dist/util/json-api/JSONAPIModel.d.ts +10 -0
  186. package/dist/util/json-api/JSONAPIModel.d.ts.map +1 -0
  187. package/dist/util/json-api/JSONAPIModel.js +2 -0
  188. package/dist/util/json-api/JSONAPIPaginationParams.d.ts +9 -0
  189. package/dist/util/json-api/JSONAPIPaginationParams.d.ts.map +1 -0
  190. package/dist/util/json-api/JSONAPIPaginationParams.js +2 -0
  191. package/dist/util/json-api/JSONAPIParams.d.ts +4 -0
  192. package/dist/util/json-api/JSONAPIParams.d.ts.map +1 -0
  193. package/dist/util/json-api/JSONAPIParams.js +2 -0
  194. package/dist/util/json-api/JSONAPIResponse.d.ts +6 -0
  195. package/dist/util/json-api/JSONAPIResponse.d.ts.map +1 -0
  196. package/dist/util/json-api/JSONAPIResponse.js +2 -0
  197. package/package.json +48 -13
  198. package/src/base/EnvoyAPI.ts +87 -0
  199. package/src/base/EnvoyPluginStoragePipeline.ts +99 -0
  200. package/src/constants.ts +7 -0
  201. package/src/factories/entryEventBodyFactory.ts +124 -0
  202. package/src/factories/eventBodyFactory.ts +35 -0
  203. package/src/factories/inviteEventBodyFactory.ts +107 -0
  204. package/src/factories/metaFactory.ts +109 -0
  205. package/src/factories/routeBodyFactory.ts +37 -0
  206. package/src/index.ts +86 -0
  207. package/src/internal/EnvoyEntryEvent.ts +10 -0
  208. package/src/internal/EnvoyInviteEvent.ts +13 -0
  209. package/src/internal/EnvoyLocationEvent.ts +3 -0
  210. package/src/internal/EnvoyOption.ts +6 -0
  211. package/src/internal/EnvoyOptionsRouteParams.ts +7 -0
  212. package/src/internal/EnvoyOptionsRouteResponseBody.ts +4 -0
  213. package/src/internal/EnvoyPluginJobUpdate.ts +11 -0
  214. package/src/internal/EnvoyRemoteValueRouteResponseBody.ts +4 -0
  215. package/src/internal/EnvoySelectedValuesRouteParams.ts +5 -0
  216. package/src/internal/EnvoySelectedValuesRouteResponseBody.ts +4 -0
  217. package/src/internal/EnvoyStorageCommand.ts +60 -0
  218. package/src/internal/EnvoyStorageResult.ts +5 -0
  219. package/src/internal/HttpStatus.ts +12 -0
  220. package/src/mocks/EnvoyPluginJobMock.ts +33 -0
  221. package/src/mocks/EnvoyPluginStoragePipelineMock.ts +204 -0
  222. package/src/payloads/EntryPayload.ts +101 -0
  223. package/src/payloads/InvitePayload.ts +79 -0
  224. package/src/payloads/LocationPayload.ts +8 -0
  225. package/src/payloads/NotificationPayload.ts +54 -0
  226. package/src/resources/AgreementPageResource.ts +19 -0
  227. package/src/resources/AgreementResource.ts +26 -0
  228. package/src/resources/CompanyResource.ts +21 -0
  229. package/src/resources/CompanyRoleResource.ts +10 -0
  230. package/src/resources/CurrentUserResource.ts +10 -0
  231. package/src/resources/EmployeeResource.ts +47 -0
  232. package/src/resources/FlowResource.ts +35 -0
  233. package/src/resources/InviteResource.ts +92 -0
  234. package/src/resources/LocationResource.ts +68 -0
  235. package/src/resources/LocationRoleResource.ts +10 -0
  236. package/src/resources/SignInFieldPageResource.ts +23 -0
  237. package/src/resources/SignInFieldResource.ts +35 -0
  238. package/src/resources/UserResource.ts +14 -0
  239. package/src/sdk/EnvoyMeta.ts +101 -0
  240. package/src/sdk/EnvoyPluginAPI.ts +95 -0
  241. package/src/sdk/EnvoyPluginJob.ts +90 -0
  242. package/src/sdk/EnvoyPluginJobAttachment.ts +48 -0
  243. package/src/sdk/EnvoyPluginSDK.ts +185 -0
  244. package/src/sdk/EnvoyPluginStorage.ts +83 -0
  245. package/src/sdk/EnvoyRequest.ts +145 -0
  246. package/src/sdk/EnvoyResponse.ts +46 -0
  247. package/src/sdk/EnvoyStorageItem.ts +9 -0
  248. package/src/sdk/EnvoyUserAPI.ts +339 -0
  249. package/src/sdk/filters.ts +96 -0
  250. package/src/sdk/handlers.ts +234 -0
  251. package/src/sdk/loggers.ts +165 -0
  252. package/src/sdk/middleware.ts +101 -0
  253. package/src/util/EnvoyJWT.ts +51 -0
  254. package/src/util/EnvoySignatureVerifier.ts +61 -0
  255. package/src/util/axiosConstructor.ts +46 -0
  256. package/src/util/errorHandling.ts +15 -0
  257. package/src/util/json-api/JSONAPIData.ts +4 -0
  258. package/src/util/json-api/JSONAPIFilterParams.ts +5 -0
  259. package/src/util/json-api/JSONAPIModel.ts +10 -0
  260. package/src/util/json-api/JSONAPIPaginationParams.ts +12 -0
  261. package/src/util/json-api/JSONAPIParams.ts +3 -0
  262. package/src/util/json-api/JSONAPIResponse.ts +5 -0
  263. package/.eslintrc.js +0 -46
  264. package/.github/workflows/package.yaml +0 -43
  265. package/.github/workflows/test.yaml +0 -15
  266. package/asynchandler.md +0 -46
  267. package/envoyapi.md +0 -150
  268. package/envoyjwt.md +0 -46
  269. package/envoypluginjob.md +0 -106
  270. package/envoypluginsdk.md +0 -87
  271. package/envoypluginstorage.md +0 -95
  272. package/envoypluginstoragepipeline.md +0 -125
  273. package/envoysignatureverifier.md +0 -43
  274. package/errormiddleware.md +0 -41
  275. package/index.js +0 -49
  276. package/lib/EnvoyAPI.js +0 -564
  277. package/lib/EnvoyJWT.js +0 -72
  278. package/lib/EnvoyPluginJob.js +0 -124
  279. package/lib/EnvoyPluginSDK.js +0 -192
  280. package/lib/EnvoyPluginStorage.js +0 -121
  281. package/lib/EnvoyPluginStoragePipeline.js +0 -155
  282. package/lib/EnvoyResponseError.js +0 -18
  283. package/lib/EnvoySignatureVerifier.js +0 -67
  284. package/lib/HttpStatus.js +0 -20
  285. package/lib/asyncHandler.js +0 -17
  286. package/lib/axios.js +0 -34
  287. package/lib/errorMiddleware.js +0 -27
  288. package/lib/middleware.js +0 -110
  289. package/middleware.md +0 -53
  290. package/test/axios.test.js +0 -57
  291. package/test/promises.test.js +0 -82
package/envoyapi.md DELETED
@@ -1,150 +0,0 @@
1
- ---
2
- description: Makes calls to the Envoy API.
3
- ---
4
-
5
- # EnvoyAPI
6
-
7
- Note that there are many API calls not covered by this class. Please add to this class as necessary!
8
-
9
- ## Constructor
10
-
11
- #### const api = new EnvoyAPI\(token\)
12
-
13
- | Param | Type |
14
- | :--- | :--- |
15
- | token | `string` |
16
-
17
- ## Properties and Methods
18
-
19
- * _instance_
20
- * .flows\(locationId\) ⇒ `Promise.<Array.<EnvoyObject>>`
21
- * .signInPage\(flowId\) ⇒ `Promise.<EnvoyObject>`
22
- * .signInFields\(pageId\) ⇒ `Promise.<Array.<EnvoyObject>>`
23
- * .createNotificationEvent\(event\) ⇒ `Promise.<EnvoyObject>`
24
- * .updateJob\(jobId, updates\) ⇒ `Promise.<EnvoyObject>`
25
- * .storagePipeline\(commands, \[installId\]\) ⇒ `Promise.<Array.<PluginStorageItem>>`
26
- * _static_
27
- * .login\(\[id\], \[secret\]\)
28
-
29
- #### envoyAPI.flows\(locationId\) ⇒ `Promise.<Array.<EnvoyObject>>`
30
-
31
- Fetches the visitor types for this location.
32
-
33
- **Kind**: instance method of `EnvoyAPI`
34
-
35
- | Param | Type |
36
- | :--- | :--- |
37
- | locationId | `string` \| `number` |
38
-
39
- #### envoyAPI.signInPage\(flowId\) ⇒ `Promise.<EnvoyObject>`
40
-
41
- Fetches the sign-in page details for this flow.
42
-
43
- **Kind**: instance method of `EnvoyAPI`
44
-
45
- | Param | Type |
46
- | :--- | :--- |
47
- | flowId | `string` \| `number` |
48
-
49
- #### envoyAPI.signInFields\(pageId\) ⇒ `Promise.<Array.<EnvoyObject>>`
50
-
51
- Fetches the sign-in fields for this page.
52
-
53
- **Kind**: instance method of `EnvoyAPI`
54
-
55
- | Param | Type |
56
- | :--- | :--- |
57
- | pageId | `string` \| `number` |
58
-
59
- #### envoyAPI.createNotificationEvent\(event\) ⇒ `Promise.<EnvoyObject>`
60
-
61
- Creates a notification event.
62
-
63
- **Kind**: instance method of `EnvoyAPI`
64
-
65
- | Param | Type |
66
- | :--- | :--- |
67
- | event | `Object` |
68
-
69
- #### envoyAPI.updateJob\(jobId, updates\) ⇒ `Promise.<EnvoyObject>`
70
-
71
- Updates the job.
72
-
73
- **Kind**: instance method of `EnvoyAPI`
74
-
75
- | Param | Type |
76
- | :--- | :--- |
77
- | jobId | `string` \| `uuid` |
78
- | updates | `JobUpdate` |
79
-
80
- #### envoyAPI.storagePipeline\(commands, \[installId\]\) ⇒ `Promise.<Array.<PluginStorageItem>>`
81
-
82
- Runs the storage pipeline.
83
-
84
- **Kind**: instance method of `EnvoyAPI`
85
-
86
- | Param | Type | Default |
87
- | :--- | :--- | :--- |
88
- | commands | `Array.<Command>` | |
89
- | \[installId\] | `string` \| `uuid` \| `number` | `null` |
90
-
91
- #### EnvoyAPI.login\(\[id\], \[secret\]\)
92
-
93
- Gets an access token using client\_credentials as the grant type.
94
-
95
- **Kind**: static method of `EnvoyAPI`
96
-
97
- | Param | Type | Default |
98
- | :--- | :--- | :--- |
99
- | \[id\] | `string` | `process.env.ENVOY_CLIENT_ID` |
100
- | \[secret\] | `string` | `process.env.ENVOY_CLIENT_SECRET` |
101
-
102
- ## Related Classes
103
-
104
- ### EnvoyObject : `Object`
105
-
106
- **Properties**
107
-
108
- | Name | Type | Description |
109
- | :--- | :--- | :--- |
110
- | id | `string` \| `number` \| `uuid` | the ID of the object |
111
- | attributes | `Object` | the object's attributes, in dash-case. |
112
-
113
- ### Attachment : `Object`
114
-
115
- **Properties**
116
-
117
- | Name | Type | Description |
118
- | :--- | :--- | :--- |
119
- | type | `string` | only "password" supported :\( |
120
- | label | `string` | the label to display in Garaje |
121
- | value | `string` | the value to display in Garaje |
122
-
123
- ### JobUpdate : `Object`
124
-
125
- **Properties**
126
-
127
- | Name | Type |
128
- | :--- | :--- |
129
- | \[status\] | `string` |
130
- | \[status\_message\] | `string` |
131
- | \[failure\_reason\] | `string` |
132
- | \[attachments\] | `Array.<Attachment>` |
133
-
134
- ### PluginStorageItem : `Object`
135
-
136
- **Properties**
137
-
138
- | Name | Type |
139
- | :--- | :--- |
140
- | key | `string` |
141
- | value | |
142
-
143
- ### Command : `Object`
144
-
145
- **Properties**
146
-
147
- | Name | Type | Description |
148
- | :--- | :--- | :--- |
149
- | action | `string` | the type of command to run |
150
- | key | `string` | the key to operate on |
package/envoyjwt.md DELETED
@@ -1,46 +0,0 @@
1
- ---
2
- description: Encodes/decodes JWTs
3
- ---
4
-
5
- # EnvoyJWT
6
-
7
- ## Constructor
8
-
9
- #### const jwt = new EnvoyJWT\(\[secret\], \[algorithm\]\)
10
-
11
- | Param | Type | Default |
12
- | :--- | :--- | :--- |
13
- | \[secret\] | `string` | `process.env.JWT_SECRET` |
14
- | \[algorithm\] | `string` | `"HS256"` |
15
-
16
- ## Properties and Methods
17
-
18
- * _instance_
19
- * .encode\(subject, expiresIn, \[payload\]\) ⇒ `Promise.<string>`
20
- * .decode\(token, \[options\]\) ⇒ `Promise.<{}>`
21
-
22
- #### envoyJWT.encode\(subject, expiresIn, \[payload\]\) ⇒ `Promise.<string>`
23
-
24
- Creates a JWT.
25
-
26
- **Kind**: instance method of `EnvoyJWT`
27
-
28
- | Param | Type | Description |
29
- | :--- | :--- | :--- |
30
- | subject | `string` \| `number` \| `null` | |
31
- | expiresIn | `string` \| `number` \| `null` | seconds or string like: [https://github.com/zeit/ms](https://github.com/zeit/ms) |
32
- | \[payload\] | `Object` | |
33
-
34
- #### envoyJWT.decode\(token, \[options\]\) ⇒ `Promise.<{}>`
35
-
36
- **Kind**: instance method of `EnvoyJWT`
37
-
38
- | Param | Type |
39
- | :--- | :--- |
40
- | token | `string` |
41
- | \[options\] | `JWTOptions` |
42
-
43
- ### JWTOptions : `Object`
44
-
45
- [https://www.npmjs.com/package/jsonwebtoken\#jwtverifytoken-secretorpublickey-options-callback](https://www.npmjs.com/package/jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback)
46
-
package/envoypluginjob.md DELETED
@@ -1,106 +0,0 @@
1
- ---
2
- description: 'Updates jobs by updating statuses, adding attachments, etc.'
3
- ---
4
-
5
- # EnvoyPluginJob
6
-
7
- ## Constructor
8
-
9
- #### const job = new EnvoyPluginJob\(pluginAPI, jobId\)
10
-
11
- | Param | Type |
12
- | :--- | :--- |
13
- | pluginAPI | `EnvoyAPI` |
14
- | jobId | `string` \| `uuid` |
15
-
16
- ## Properties and Methods
17
-
18
- * _instance_
19
- * .api : `EnvoyAPI`
20
- * .id : `string` \| `uuid`
21
- * .execute\(status, message, \[reason\], \[attachments\]\) ⇒ `Promise.<EnvoyObject>`
22
- * .attach\(...attachments\) ⇒ `Promise.<EnvoyObject>`
23
- * .complete\(message, \[...attachments\]\) ⇒ `Promise.<EnvoyObject>`
24
- * .ignore\(message, reason\) ⇒ `Promise.<EnvoyObject>`
25
- * .fail\(message, reason\) ⇒ `Promise.<EnvoyObject>`
26
- * .update\(message, \[...attachments\]\) ⇒ `Promise.<EnvoyObject>`
27
-
28
- #### envoyPluginJob.execute\(status, message, \[reason\], \[attachments\]\) ⇒ `Promise.<EnvoyObject>`
29
-
30
- Updates a job.
31
-
32
- **Kind**: instance method of `EnvoyPluginJob`
33
-
34
- | Param | Type |
35
- | :--- | :--- |
36
- | status | `string` \| `null` |
37
- | message | `string` \| `null` |
38
- | \[reason\] | `string` \| `null` |
39
- | \[attachments\] | `Array.<Attachment>` \| `null` |
40
-
41
- #### envoyPluginJob.attach\(...attachments\) ⇒ `Promise.<EnvoyObject>`
42
-
43
- Attaches items to an in-progress job.
44
-
45
- **Kind**: instance method of `EnvoyPluginJob`
46
-
47
- | Param | Type |
48
- | :--- | :--- |
49
- | ...attachments | `Attachment` |
50
-
51
- #### envoyPluginJob.complete\(message, \[...attachments\]\) ⇒ `Promise.<EnvoyObject>`
52
-
53
- Completes the job.
54
-
55
- **Kind**: instance method of `EnvoyPluginJob`
56
-
57
- | Param | Type |
58
- | :--- | :--- |
59
- | message | `string` |
60
- | \[...attachments\] | `Attachment` |
61
-
62
- #### envoyPluginJob.ignore\(message, reason\) ⇒ `Promise.<EnvoyObject>`
63
-
64
- Ignores the job.
65
-
66
- **Kind**: instance method of `EnvoyPluginJob`
67
-
68
- | Param | Type |
69
- | :--- | :--- |
70
- | message | `string` |
71
- | reason | `string` |
72
-
73
- #### envoyPluginJob.fail\(message, reason\) ⇒ `Promise.<EnvoyObject>`
74
-
75
- Fails the job.
76
-
77
- **Kind**: instance method of `EnvoyPluginJob`
78
-
79
- | Param | Type |
80
- | :--- | :--- |
81
- | message | `string` |
82
- | reason | `string` |
83
-
84
- #### envoyPluginJob.update\(message, \[...attachments\]\) ⇒ `Promise.<EnvoyObject>`
85
-
86
- Updates the job's message, with optional attachments. Useful for multi-step jobs.
87
-
88
- **Kind**: instance method of `EnvoyPluginJob`
89
-
90
- | Param | Type |
91
- | :--- | :--- |
92
- | message | |
93
- | \[...attachments\] | `Attachment` |
94
-
95
- ## Related Classes
96
-
97
- ### Attachment : `Object`
98
-
99
- **Properties**
100
-
101
- | Name | Type | Description |
102
- | :--- | :--- | :--- |
103
- | \[type\] | `string` | only "password" supported :\( |
104
- | label | `string` | the label to display in Garaje |
105
- | value | `string` | the value to display in Garaje |
106
-
package/envoypluginsdk.md DELETED
@@ -1,87 +0,0 @@
1
- ---
2
- description: The Envoy SDK. Typically you'd interact with this directly.
3
- ---
4
-
5
- # EnvoyPluginSDK
6
-
7
- ## Constructor
8
-
9
- #### const envoy = new EnvoyPluginSDK\(body, \[isVerified=false\], \[pluginAccessToken=null\]\)
10
-
11
- | Param | Type | Default |
12
- | :--- | :--- | :--- |
13
- | body | `Object` | |
14
- | \[isVerified\] | `boolean` | `false` |
15
- | \[pluginAccessToken\] | `string` | `null` |
16
-
17
- ## Properties and Methods
18
-
19
- * _instance_
20
- * .body : `Object`
21
- * Comes from `req.body`
22
- * .isVerified : `boolean`
23
- * If the request is verified to have come from Envoy
24
- * .pluginAccessToken : `string`
25
- * Access token for use with plugin-scoped endpoints
26
- * .meta : `Meta`
27
- * Metadata associated with this request
28
- * .payload : `EnvoyObject` \| `Object`
29
- * The object that the event is about
30
- * .userAPI : `EnvoyAPI`
31
- * Envoy's API scoped to the installer \(user\)
32
- * Applicable only in setup routes
33
- * .pluginAPI : `EnvoyAPI`
34
- * Envoy's API scoped to the plugin itself
35
- * For use with jobs and storage
36
- * .installStorage : `EnvoyPluginStorage`
37
- * Key/value storage scoped to the current install
38
- * .globalStorage : `EnvoyPluginStorage`
39
- * Key/value storage scoped across installs
40
- * .job : `EnvoyPluginJob`
41
- * Represents the current job
42
- * Applicable only in workers \(event listeners\)
43
- * .jobId : `string` \| `uuid` \| `null`
44
- * The current job ID
45
- * Applicable only in workers
46
- * .jwt : `EnvoyJWT`
47
- * Helper to encode and decode JWTs
48
- * .getJob\(jobId\) ⇒ `EnvoyPluginJob`
49
- * Load a job other than the current
50
-
51
- #### envoyPluginSDK.getJob\(jobId\) ⇒ `EnvoyPluginJob`
52
-
53
- Returns a job based on an ID.
54
-
55
- **Kind**: instance method of `EnvoyPluginSDK`
56
-
57
- | Param | Type |
58
- | :--- | :--- |
59
- | jobId | `string` \| `uuid` |
60
-
61
- ## Related Classes
62
-
63
- ### EnvoyObject : `Object`
64
-
65
- **Properties**
66
-
67
- | Name | Type | Description |
68
- | :--- | :--- | :--- |
69
- | id | `string` \| `number` \| `uuid` | the ID of the object |
70
- | attributes | `Object` | the object's attributes, in dash-case. |
71
-
72
- ### Meta : `Object`
73
-
74
- **Properties**
75
-
76
- | Name | Type | Description |
77
- | :--- | :--- | :--- |
78
- | event | `string` | the name of the event \(workers only\) |
79
- | route | `string` | the name of the route \(routes only\) |
80
- | plugin\_id | `number` | the plugin ID |
81
- | install\_id | `number` | the plugin install ID |
82
- | config | `Object` | config data for this install |
83
- | params | `Object` | The optional URL query params sent in the request \(routes only\) |
84
- | location | `EnvoyObject` | the location this event happened \(location installs only\) |
85
- | company | `EnvoyObject` | the company that installed the plugin |
86
- | auth | `Object` | contains the installer's `access_token` |
87
-
@@ -1,95 +0,0 @@
1
- ---
2
- description: Interacts with the key/value storage system.
3
- ---
4
-
5
- # EnvoyPluginStorage
6
-
7
- ## Constructor
8
-
9
- #### const storage = new EnvoyPluginStorage\(pluginAPI, \[installId\]\)
10
-
11
- | Param | Type | Default |
12
- | :--- | :--- | :--- |
13
- | pluginAPI | `EnvoyAPI` | |
14
- | \[installId\] | `number` \| `null` | |
15
-
16
- ## Properties and Methods
17
-
18
- * _instance_
19
- * .api : `EnvoyAPI`
20
- * .installId : `number` \| `null`
21
- * .pipeline\(\) ⇒ `EnvoyPluginStoragePipeline`
22
- * .get\(key\) ⇒ `Promise.<(PluginStorageItem|null)>`
23
- * .set\(key, value\) ⇒ `Promise.<PluginStorageItem>`
24
- * .setUnique\(key, options\) ⇒ `Promise.<PluginStorageItem>`
25
- * .unset\(key\) ⇒ `Promise.<(PluginStorageItem|null)>`
26
-
27
- #### envoyPluginStorage.pipeline\(\) ⇒ `EnvoyPluginStoragePipeline`
28
-
29
- Creates a new pipeline instance.
30
-
31
- **Kind**: instance method of `EnvoyPluginStorage`
32
-
33
-
34
- #### envoyPluginStorage.get\(key\) ⇒ `Promise.<(PluginStorageItem|null)>`
35
-
36
- Wrapper for single pipeline get.
37
-
38
- **Kind**: instance method of `EnvoyPluginStorage`
39
-
40
- | Param | Type |
41
- | :--- | :--- |
42
- | key | `string` |
43
-
44
- #### envoyPluginStorage.set\(key, value\) ⇒ `Promise.<PluginStorageItem>`
45
-
46
- Wrapper for single pipeline set.
47
-
48
- **Kind**: instance method of `EnvoyPluginStorage`
49
-
50
- | Param | Type |
51
- | :--- | :--- |
52
- | key | `string` |
53
- | value | `*` |
54
-
55
- #### envoyPluginStorage.setUnique\(key, \[options\]\) ⇒ `Promise.<PluginStorageItem>`
56
-
57
- Wrapper for single pipeline setUnique.
58
-
59
- **Kind**: instance method of `EnvoyPluginStorage`
60
-
61
- | Param | Type |
62
- | :--- | :--- |
63
- | key | `string` |
64
- | \[options\] | `UniqueOptions` |
65
-
66
- #### envoyPluginStorage.unset\(key\) ⇒ `Promise.<(PluginStorageItem|null)>`
67
-
68
- Wrapper for single pipeline unset. Returns null if the item did not previously exist.
69
-
70
- **Kind**: instance method of `EnvoyPluginStorage`
71
-
72
- | Param | Type |
73
- | :--- | :--- |
74
- | key | `string` |
75
-
76
- ## Related Classes
77
-
78
- ### PluginStorageItem : `Object`
79
-
80
- **Properties**
81
-
82
- | Name | Type |
83
- | :--- | :--- |
84
- | key | `string` |
85
- | value | |
86
-
87
- ### UniqueOptions : `Object`
88
-
89
- **Properties**
90
-
91
- | Name | Type | Default | Description |
92
- | :--- | :--- | :--- | :--- |
93
- | chars | `string` | `"0123456789"` | the possible characters to pick from |
94
- | size | `number` | `12` | the length of the value |
95
-
@@ -1,125 +0,0 @@
1
- ---
2
- description: Interacts with the storage pipeline system.
3
- ---
4
-
5
- # EnvoyPluginStoragePipeline
6
-
7
- ## Constructor
8
-
9
- #### const storagePipeline = new EnvoyPluginStoragePipeline\(pluginAPI, \[installId\]\)
10
-
11
- | Param | Type | Default |
12
- | :--- | :--- | :--- |
13
- | pluginAPI | `EnvoyAPI` | |
14
- | \[installId\] | `number` \| `null` | |
15
-
16
- ## Properties and Methods
17
-
18
- * _instance_
19
- * .api : `EnvoyAPI`
20
- * .installId : `number` \| `null`
21
- * .commands : `Array.<Command>`
22
- * .execute\(\) ⇒ `Promise.<Array.<(Command|null)>>`
23
- * .executeSingle\(\) ⇒ `Promise.<PluginStorageItem>`
24
- * .addCommand\(command\) ⇒ `EnvoyPluginStoragePipeline`
25
- * .get\(key\) ⇒ `EnvoyPluginStoragePipeline`
26
- * .set\(key, value\) ⇒ `EnvoyPluginStoragePipeline`
27
- * .setUnique\(key, \[options\]\) ⇒ `EnvoyPluginStoragePipeline`
28
- * .unset\(key\) ⇒ `EnvoyPluginStoragePipeline`
29
-
30
- #### envoyPluginStoragePipeline.execute\(\) ⇒ `Promise.<Array.<(Command|null)>>`
31
-
32
- Executes all the commands in the pipeline.
33
-
34
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
35
-
36
-
37
- #### envoyPluginStoragePipeline.executeSingle\(\) ⇒ `Promise.<PluginStorageItem>`
38
-
39
- Executes the pipeline and returns the first result.
40
-
41
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
42
-
43
-
44
- #### envoyPluginStoragePipeline.addCommand\(command\) ⇒ `EnvoyPluginStoragePipeline`
45
-
46
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
47
-
48
- | Param | Type |
49
- | :--- | :--- |
50
- | command | `Command` |
51
-
52
- #### envoyPluginStoragePipeline.get\(key\) ⇒ `EnvoyPluginStoragePipeline`
53
-
54
- Gets a storage item.
55
-
56
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
57
-
58
- | Param | Type |
59
- | :--- | :--- |
60
- | key | `string` |
61
-
62
- #### envoyPluginStoragePipeline.set\(key, value\) ⇒ `EnvoyPluginStoragePipeline`
63
-
64
- Sets a value for a storage item, and returns that item.
65
-
66
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
67
-
68
- | Param | Type |
69
- | :--- | :--- |
70
- | key | `string` |
71
- | value | |
72
-
73
- #### envoyPluginStoragePipeline.setUnique\(key, \[options\]\) ⇒ `EnvoyPluginStoragePipeline`
74
-
75
- Sets a unique value for a storage item, and returns that item.
76
-
77
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
78
-
79
- | Param | Type |
80
- | :--- | :--- |
81
- | key | `string` |
82
- | \[options\] | `UniqueOptions` |
83
-
84
- #### envoyPluginStoragePipeline.unset\(key\) ⇒ `EnvoyPluginStoragePipeline`
85
-
86
- Unsets a storage item.
87
-
88
- **Kind**: instance method of `EnvoyPluginStoragePipeline`
89
-
90
- | Param | Type |
91
- | :--- | :--- |
92
- | key | `string` |
93
-
94
- ## Related Classes
95
-
96
- ### PluginStorageItem : `Object`
97
-
98
- **Kind**: global typedef
99
- **Properties**
100
-
101
- | Name | Type |
102
- | :--- | :--- |
103
- | key | `string` |
104
- | value | |
105
-
106
- ### Command : `Object`
107
-
108
- **Kind**: global typedef
109
- **Properties**
110
-
111
- | Name | Type | Description |
112
- | :--- | :--- | :--- |
113
- | action | `string` | the type of command to run |
114
- | key | `string` | the key to operate on |
115
-
116
- ### UniqueOptions : `Object`
117
-
118
- **Kind**: global typedef
119
- **Properties**
120
-
121
- | Name | Type | Default | Description |
122
- | :--- | :--- | :--- | :--- |
123
- | chars | `string` | `"\"0123456789\""` | the possible characters to pick from |
124
- | size | `number` | `12` | the length of the value |
125
-
@@ -1,43 +0,0 @@
1
- ---
2
- description: Verifies that request bodies are from Envoy and are meant for your plugin.
3
- ---
4
-
5
- # EnvoySignatureVerifier
6
-
7
- ## Constructor
8
-
9
- #### const signatureVerifier = new EnvoySignatureVerifier\(\[options\]\)
10
-
11
- | Param | Type |
12
- | :--- | :--- |
13
- | \[options\] | `SignatureVerifierOptions` |
14
-
15
- ## Properties and Methods
16
-
17
- * _instance_
18
- * .verify\(req, rawBody\) ⇒ `boolean`
19
-
20
- #### envoySignatureVerifier.verify\(req, rawBody\) ⇒ `boolean`
21
-
22
- Verifies that the signature provided matches the request body.
23
-
24
- **Kind**: instance method of `EnvoySignatureVerifier`
25
-
26
- | Param | Type |
27
- | :--- | :--- |
28
- | req | |
29
- | rawBody | `Buffer` |
30
-
31
- ## Related Classes
32
-
33
- ### SignatureVerifierOptions : `Object`
34
-
35
- **Properties**
36
-
37
- | Name | Type | Default |
38
- | :--- | :--- | :--- |
39
- | algorithm | `string` | `"sha256"` |
40
- | encoding | `string` | `"base64"` |
41
- | secret | `string` | `process.env.ENVOY_CLIENT_SECRET` |
42
- | header | `string` | `"x-envoy-signature"` |
43
-
@@ -1,41 +0,0 @@
1
- ---
2
- description: Use this middleware to safely catch and serialize unexpected errors.
3
- ---
4
-
5
- # errorMiddleware
6
-
7
- ## Example
8
-
9
- ```javascript
10
- const express = require('express');
11
- const { middleware, errorMiddleware } = require('envoy-integrations-sdk-nodejs');
12
-
13
- const app = express();
14
- app.use(middleware());
15
- // define endpoints here
16
- app.use(errorMiddleware());
17
- ```
18
-
19
- ## Functions
20
-
21
- ### errorMiddleware\(\) ⇒ `expressErrorMiddleware`
22
-
23
- Returns an [Express.js error middleware](http://expressjs.com/en/guide/error-handling.html#writing-error-handlers), which serializes unexpected errors.
24
-
25
- **Kind**: global function
26
-
27
- ### Related Functions and Classes
28
-
29
- ### `expressErrorMiddleware` : `function`
30
-
31
- Express/connect middleware.
32
-
33
- **Kind**: global typedef
34
-
35
- | Param | Type |
36
- | :--- | :--- |
37
- | err | `Error` |
38
- | req | [http://expressjs.com/en/4x/api.html\#req](http://expressjs.com/en/4x/api.html#req) |
39
- | res | [http://expressjs.com/en/4x/api.html\#res](http://expressjs.com/en/4x/api.html#res) |
40
- | next | `function` |
41
-