@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.
- package/README.md +178 -110
- package/dist/base/EnvoyAPI.d.ts +28 -0
- package/dist/base/EnvoyAPI.d.ts.map +1 -0
- package/dist/base/EnvoyAPI.js +121 -0
- package/dist/base/EnvoyPluginStoragePipeline.d.ts +51 -0
- package/dist/base/EnvoyPluginStoragePipeline.d.ts.map +1 -0
- package/dist/base/EnvoyPluginStoragePipeline.js +140 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +12 -0
- package/dist/factories/entryEventBodyFactory.d.ts +42 -0
- package/dist/factories/entryEventBodyFactory.d.ts.map +1 -0
- package/dist/factories/entryEventBodyFactory.js +105 -0
- package/dist/factories/eventBodyFactory.d.ts +18 -0
- package/dist/factories/eventBodyFactory.d.ts.map +1 -0
- package/dist/factories/eventBodyFactory.js +15 -0
- package/dist/factories/inviteEventBodyFactory.d.ts +38 -0
- package/dist/factories/inviteEventBodyFactory.d.ts.map +1 -0
- package/dist/factories/inviteEventBodyFactory.js +92 -0
- package/dist/factories/metaFactory.d.ts +10 -0
- package/dist/factories/metaFactory.d.ts.map +1 -0
- package/dist/factories/metaFactory.js +90 -0
- package/dist/factories/routeBodyFactory.d.ts +19 -0
- package/dist/factories/routeBodyFactory.d.ts.map +1 -0
- package/dist/factories/routeBodyFactory.js +15 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/internal/EnvoyEntryEvent.d.ts +3 -0
- package/dist/internal/EnvoyEntryEvent.d.ts.map +1 -0
- package/dist/internal/EnvoyEntryEvent.js +2 -0
- package/dist/internal/EnvoyInviteEvent.d.ts +3 -0
- package/dist/internal/EnvoyInviteEvent.d.ts.map +1 -0
- package/dist/internal/EnvoyInviteEvent.js +2 -0
- package/dist/internal/EnvoyLocationEvent.d.ts +3 -0
- package/dist/internal/EnvoyLocationEvent.d.ts.map +1 -0
- package/dist/internal/EnvoyLocationEvent.js +2 -0
- package/dist/internal/EnvoyOption.d.ts +6 -0
- package/dist/internal/EnvoyOption.d.ts.map +1 -0
- package/dist/internal/EnvoyOption.js +2 -0
- package/dist/internal/EnvoyOptionsRouteParams.d.ts +7 -0
- package/dist/internal/EnvoyOptionsRouteParams.d.ts.map +1 -0
- package/dist/internal/EnvoyOptionsRouteParams.js +2 -0
- package/dist/internal/EnvoyOptionsRouteResponseBody.d.ts +4 -0
- package/dist/internal/EnvoyOptionsRouteResponseBody.d.ts.map +1 -0
- package/dist/internal/EnvoyOptionsRouteResponseBody.js +2 -0
- package/dist/internal/EnvoyPluginJobUpdate.d.ts +11 -0
- package/dist/internal/EnvoyPluginJobUpdate.d.ts.map +1 -0
- package/dist/internal/EnvoyPluginJobUpdate.js +2 -0
- package/dist/internal/EnvoyRemoteValueRouteResponseBody.d.ts +5 -0
- package/dist/internal/EnvoyRemoteValueRouteResponseBody.d.ts.map +1 -0
- package/dist/internal/EnvoyRemoteValueRouteResponseBody.js +2 -0
- package/dist/internal/EnvoySelectedValuesRouteParams.d.ts +5 -0
- package/dist/internal/EnvoySelectedValuesRouteParams.d.ts.map +1 -0
- package/dist/internal/EnvoySelectedValuesRouteParams.js +2 -0
- package/dist/internal/EnvoySelectedValuesRouteResponseBody.d.ts +4 -0
- package/dist/internal/EnvoySelectedValuesRouteResponseBody.d.ts.map +1 -0
- package/dist/internal/EnvoySelectedValuesRouteResponseBody.js +2 -0
- package/dist/internal/EnvoyStorageCommand.d.ts +42 -0
- package/dist/internal/EnvoyStorageCommand.d.ts.map +1 -0
- package/dist/internal/EnvoyStorageCommand.js +7 -0
- package/dist/internal/EnvoyStorageResult.d.ts +4 -0
- package/dist/internal/EnvoyStorageResult.d.ts.map +1 -0
- package/dist/internal/EnvoyStorageResult.js +2 -0
- package/dist/internal/HttpStatus.d.ts +13 -0
- package/dist/internal/HttpStatus.d.ts.map +1 -0
- package/dist/internal/HttpStatus.js +15 -0
- package/dist/mocks/EnvoyPluginJobMock.d.ts +12 -0
- package/dist/mocks/EnvoyPluginJobMock.d.ts.map +1 -0
- package/dist/mocks/EnvoyPluginJobMock.js +60 -0
- package/dist/mocks/EnvoyPluginStoragePipelineMock.d.ts +24 -0
- package/dist/mocks/EnvoyPluginStoragePipelineMock.d.ts.map +1 -0
- package/dist/mocks/EnvoyPluginStoragePipelineMock.js +212 -0
- package/dist/payloads/EntryPayload.d.ts +80 -0
- package/dist/payloads/EntryPayload.d.ts.map +1 -0
- package/dist/payloads/EntryPayload.js +28 -0
- package/dist/payloads/InvitePayload.d.ts +66 -0
- package/dist/payloads/InvitePayload.d.ts.map +1 -0
- package/dist/payloads/InvitePayload.js +24 -0
- package/dist/payloads/LocationPayload.d.ts +7 -0
- package/dist/payloads/LocationPayload.d.ts.map +1 -0
- package/dist/payloads/LocationPayload.js +2 -0
- package/dist/payloads/NotificationPayload.d.ts +54 -0
- package/dist/payloads/NotificationPayload.d.ts.map +1 -0
- package/dist/payloads/NotificationPayload.js +2 -0
- package/dist/resources/AgreementPageResource.d.ts +17 -0
- package/dist/resources/AgreementPageResource.d.ts.map +1 -0
- package/dist/resources/AgreementPageResource.js +2 -0
- package/dist/resources/AgreementResource.d.ts +24 -0
- package/dist/resources/AgreementResource.d.ts.map +1 -0
- package/dist/resources/AgreementResource.js +2 -0
- package/dist/resources/CompanyResource.d.ts +19 -0
- package/dist/resources/CompanyResource.d.ts.map +1 -0
- package/dist/resources/CompanyResource.js +2 -0
- package/dist/resources/CompanyRoleResource.d.ts +8 -0
- package/dist/resources/CompanyRoleResource.d.ts.map +1 -0
- package/dist/resources/CompanyRoleResource.js +2 -0
- package/dist/resources/CurrentUserResource.d.ts +8 -0
- package/dist/resources/CurrentUserResource.d.ts.map +1 -0
- package/dist/resources/CurrentUserResource.js +2 -0
- package/dist/resources/EmployeeResource.d.ts +43 -0
- package/dist/resources/EmployeeResource.d.ts.map +1 -0
- package/dist/resources/EmployeeResource.js +2 -0
- package/dist/resources/FlowResource.d.ts +31 -0
- package/dist/resources/FlowResource.d.ts.map +1 -0
- package/dist/resources/FlowResource.js +2 -0
- package/dist/resources/InviteResource.d.ts +86 -0
- package/dist/resources/InviteResource.d.ts.map +1 -0
- package/dist/resources/InviteResource.js +2 -0
- package/dist/resources/LocationResource.d.ts +64 -0
- package/dist/resources/LocationResource.d.ts.map +1 -0
- package/dist/resources/LocationResource.js +2 -0
- package/dist/resources/LocationRoleResource.d.ts +8 -0
- package/dist/resources/LocationRoleResource.d.ts.map +1 -0
- package/dist/resources/LocationRoleResource.js +2 -0
- package/dist/resources/SignInFieldPageResource.d.ts +17 -0
- package/dist/resources/SignInFieldPageResource.d.ts.map +1 -0
- package/dist/resources/SignInFieldPageResource.js +2 -0
- package/dist/resources/SignInFieldResource.d.ts +33 -0
- package/dist/resources/SignInFieldResource.d.ts.map +1 -0
- package/dist/resources/SignInFieldResource.js +2 -0
- package/dist/resources/UserResource.d.ts +13 -0
- package/dist/resources/UserResource.d.ts.map +1 -0
- package/dist/resources/UserResource.js +2 -0
- package/dist/sdk/EnvoyMeta.d.ts +96 -0
- package/dist/sdk/EnvoyMeta.d.ts.map +1 -0
- package/dist/sdk/EnvoyMeta.js +2 -0
- package/dist/sdk/EnvoyPluginAPI.d.ts +31 -0
- package/dist/sdk/EnvoyPluginAPI.d.ts.map +1 -0
- package/dist/sdk/EnvoyPluginAPI.js +205 -0
- package/dist/sdk/EnvoyPluginJob.d.ts +49 -0
- package/dist/sdk/EnvoyPluginJob.d.ts.map +1 -0
- package/dist/sdk/EnvoyPluginJob.js +99 -0
- package/dist/sdk/EnvoyPluginJobAttachment.d.ts +43 -0
- package/dist/sdk/EnvoyPluginJobAttachment.d.ts.map +1 -0
- package/dist/sdk/EnvoyPluginJobAttachment.js +2 -0
- package/dist/sdk/EnvoyPluginSDK.d.ts +100 -0
- package/dist/sdk/EnvoyPluginSDK.d.ts.map +1 -0
- package/dist/sdk/EnvoyPluginSDK.js +204 -0
- package/dist/sdk/EnvoyPluginStorage.d.ts +69 -0
- package/dist/sdk/EnvoyPluginStorage.d.ts.map +1 -0
- package/dist/sdk/EnvoyPluginStorage.js +78 -0
- package/dist/sdk/EnvoyRequest.d.ts +116 -0
- package/dist/sdk/EnvoyRequest.d.ts.map +1 -0
- package/dist/sdk/EnvoyRequest.js +7 -0
- package/dist/sdk/EnvoyResponse.d.ts +42 -0
- package/dist/sdk/EnvoyResponse.d.ts.map +1 -0
- package/dist/sdk/EnvoyResponse.js +2 -0
- package/dist/sdk/EnvoyStorageItem.d.ts +9 -0
- package/dist/sdk/EnvoyStorageItem.d.ts.map +1 -0
- package/dist/sdk/EnvoyStorageItem.js +2 -0
- package/dist/sdk/EnvoyUserAPI.d.ts +119 -0
- package/dist/sdk/EnvoyUserAPI.d.ts.map +1 -0
- package/dist/sdk/EnvoyUserAPI.js +493 -0
- package/dist/sdk/filters.d.ts +30 -0
- package/dist/sdk/filters.d.ts.map +1 -0
- package/dist/sdk/filters.js +72 -0
- package/dist/sdk/handlers.d.ts +125 -0
- package/dist/sdk/handlers.d.ts.map +1 -0
- package/dist/sdk/handlers.js +108 -0
- package/dist/sdk/loggers.d.ts +6 -0
- package/dist/sdk/loggers.d.ts.map +1 -0
- package/dist/sdk/loggers.js +161 -0
- package/dist/sdk/middleware.d.ts +19 -0
- package/dist/sdk/middleware.d.ts.map +1 -0
- package/dist/sdk/middleware.js +159 -0
- package/dist/util/EnvoyJWT.d.ts +17 -0
- package/dist/util/EnvoyJWT.d.ts.map +1 -0
- package/dist/util/EnvoyJWT.js +54 -0
- package/dist/util/EnvoySignatureVerifier.d.ts +26 -0
- package/dist/util/EnvoySignatureVerifier.d.ts.map +1 -0
- package/dist/util/EnvoySignatureVerifier.js +53 -0
- package/dist/util/axiosConstructor.d.ts +4 -0
- package/dist/util/axiosConstructor.d.ts.map +1 -0
- package/dist/util/axiosConstructor.js +58 -0
- package/dist/util/errorHandling.d.ts +2 -0
- package/dist/util/errorHandling.d.ts.map +1 -0
- package/dist/util/errorHandling.js +18 -0
- package/dist/util/json-api/JSONAPIData.d.ts +5 -0
- package/dist/util/json-api/JSONAPIData.d.ts.map +1 -0
- package/dist/util/json-api/JSONAPIData.js +2 -0
- package/dist/util/json-api/JSONAPIFilterParams.d.ts +5 -0
- package/dist/util/json-api/JSONAPIFilterParams.d.ts.map +1 -0
- package/dist/util/json-api/JSONAPIFilterParams.js +2 -0
- package/dist/util/json-api/JSONAPIModel.d.ts +10 -0
- package/dist/util/json-api/JSONAPIModel.d.ts.map +1 -0
- package/dist/util/json-api/JSONAPIModel.js +2 -0
- package/dist/util/json-api/JSONAPIPaginationParams.d.ts +9 -0
- package/dist/util/json-api/JSONAPIPaginationParams.d.ts.map +1 -0
- package/dist/util/json-api/JSONAPIPaginationParams.js +2 -0
- package/dist/util/json-api/JSONAPIParams.d.ts +4 -0
- package/dist/util/json-api/JSONAPIParams.d.ts.map +1 -0
- package/dist/util/json-api/JSONAPIParams.js +2 -0
- package/dist/util/json-api/JSONAPIResponse.d.ts +6 -0
- package/dist/util/json-api/JSONAPIResponse.d.ts.map +1 -0
- package/dist/util/json-api/JSONAPIResponse.js +2 -0
- package/package.json +48 -13
- package/src/base/EnvoyAPI.ts +87 -0
- package/src/base/EnvoyPluginStoragePipeline.ts +99 -0
- package/src/constants.ts +7 -0
- package/src/factories/entryEventBodyFactory.ts +124 -0
- package/src/factories/eventBodyFactory.ts +35 -0
- package/src/factories/inviteEventBodyFactory.ts +107 -0
- package/src/factories/metaFactory.ts +109 -0
- package/src/factories/routeBodyFactory.ts +37 -0
- package/src/index.ts +86 -0
- package/src/internal/EnvoyEntryEvent.ts +10 -0
- package/src/internal/EnvoyInviteEvent.ts +13 -0
- package/src/internal/EnvoyLocationEvent.ts +3 -0
- package/src/internal/EnvoyOption.ts +6 -0
- package/src/internal/EnvoyOptionsRouteParams.ts +7 -0
- package/src/internal/EnvoyOptionsRouteResponseBody.ts +4 -0
- package/src/internal/EnvoyPluginJobUpdate.ts +11 -0
- package/src/internal/EnvoyRemoteValueRouteResponseBody.ts +4 -0
- package/src/internal/EnvoySelectedValuesRouteParams.ts +5 -0
- package/src/internal/EnvoySelectedValuesRouteResponseBody.ts +4 -0
- package/src/internal/EnvoyStorageCommand.ts +60 -0
- package/src/internal/EnvoyStorageResult.ts +5 -0
- package/src/internal/HttpStatus.ts +12 -0
- package/src/mocks/EnvoyPluginJobMock.ts +33 -0
- package/src/mocks/EnvoyPluginStoragePipelineMock.ts +204 -0
- package/src/payloads/EntryPayload.ts +101 -0
- package/src/payloads/InvitePayload.ts +79 -0
- package/src/payloads/LocationPayload.ts +8 -0
- package/src/payloads/NotificationPayload.ts +54 -0
- package/src/resources/AgreementPageResource.ts +19 -0
- package/src/resources/AgreementResource.ts +26 -0
- package/src/resources/CompanyResource.ts +21 -0
- package/src/resources/CompanyRoleResource.ts +10 -0
- package/src/resources/CurrentUserResource.ts +10 -0
- package/src/resources/EmployeeResource.ts +47 -0
- package/src/resources/FlowResource.ts +35 -0
- package/src/resources/InviteResource.ts +92 -0
- package/src/resources/LocationResource.ts +68 -0
- package/src/resources/LocationRoleResource.ts +10 -0
- package/src/resources/SignInFieldPageResource.ts +23 -0
- package/src/resources/SignInFieldResource.ts +35 -0
- package/src/resources/UserResource.ts +14 -0
- package/src/sdk/EnvoyMeta.ts +101 -0
- package/src/sdk/EnvoyPluginAPI.ts +95 -0
- package/src/sdk/EnvoyPluginJob.ts +90 -0
- package/src/sdk/EnvoyPluginJobAttachment.ts +48 -0
- package/src/sdk/EnvoyPluginSDK.ts +185 -0
- package/src/sdk/EnvoyPluginStorage.ts +83 -0
- package/src/sdk/EnvoyRequest.ts +145 -0
- package/src/sdk/EnvoyResponse.ts +46 -0
- package/src/sdk/EnvoyStorageItem.ts +9 -0
- package/src/sdk/EnvoyUserAPI.ts +339 -0
- package/src/sdk/filters.ts +96 -0
- package/src/sdk/handlers.ts +234 -0
- package/src/sdk/loggers.ts +165 -0
- package/src/sdk/middleware.ts +101 -0
- package/src/util/EnvoyJWT.ts +51 -0
- package/src/util/EnvoySignatureVerifier.ts +61 -0
- package/src/util/axiosConstructor.ts +46 -0
- package/src/util/errorHandling.ts +15 -0
- package/src/util/json-api/JSONAPIData.ts +4 -0
- package/src/util/json-api/JSONAPIFilterParams.ts +5 -0
- package/src/util/json-api/JSONAPIModel.ts +10 -0
- package/src/util/json-api/JSONAPIPaginationParams.ts +12 -0
- package/src/util/json-api/JSONAPIParams.ts +3 -0
- package/src/util/json-api/JSONAPIResponse.ts +5 -0
- package/.eslintrc.js +0 -46
- package/.github/workflows/package.yaml +0 -43
- package/.github/workflows/test.yaml +0 -15
- package/asynchandler.md +0 -46
- package/envoyapi.md +0 -150
- package/envoyjwt.md +0 -46
- package/envoypluginjob.md +0 -106
- package/envoypluginsdk.md +0 -87
- package/envoypluginstorage.md +0 -95
- package/envoypluginstoragepipeline.md +0 -125
- package/envoysignatureverifier.md +0 -43
- package/errormiddleware.md +0 -41
- package/index.js +0 -49
- package/lib/EnvoyAPI.js +0 -564
- package/lib/EnvoyJWT.js +0 -72
- package/lib/EnvoyPluginJob.js +0 -124
- package/lib/EnvoyPluginSDK.js +0 -192
- package/lib/EnvoyPluginStorage.js +0 -121
- package/lib/EnvoyPluginStoragePipeline.js +0 -155
- package/lib/EnvoyResponseError.js +0 -18
- package/lib/EnvoySignatureVerifier.js +0 -67
- package/lib/HttpStatus.js +0 -20
- package/lib/asyncHandler.js +0 -17
- package/lib/axios.js +0 -34
- package/lib/errorMiddleware.js +0 -27
- package/lib/middleware.js +0 -110
- package/middleware.md +0 -53
- package/test/axios.test.js +0 -57
- package/test/promises.test.js +0 -82
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import JSONAPIModel from '../util/json-api/JSONAPIModel';
|
|
2
|
+
/**
|
|
3
|
+
* @category API Resource
|
|
4
|
+
*/
|
|
5
|
+
export declare type LocationSortFields = 'name' | 'created_at' | '-name' | '-created_at';
|
|
6
|
+
/**
|
|
7
|
+
* @category API Resource
|
|
8
|
+
*/
|
|
9
|
+
export interface LocationFilterFields {
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
company?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @category API Resource
|
|
15
|
+
*/
|
|
16
|
+
export interface LocationAttributes {
|
|
17
|
+
name: string;
|
|
18
|
+
address: string;
|
|
19
|
+
'address-line-1': string | null;
|
|
20
|
+
'address-line-2': string | null;
|
|
21
|
+
city: string | null;
|
|
22
|
+
state: string | null;
|
|
23
|
+
country: string | null;
|
|
24
|
+
zip: string | null;
|
|
25
|
+
latitude: number | null;
|
|
26
|
+
longitude: number | null;
|
|
27
|
+
locale: string | null;
|
|
28
|
+
timezone: string;
|
|
29
|
+
'company-name-override': string | null;
|
|
30
|
+
'logo-small-url': string | null;
|
|
31
|
+
'logo-thumb-url': string | null;
|
|
32
|
+
'logo-url': string | null;
|
|
33
|
+
disabled: boolean | null;
|
|
34
|
+
'visitors-onboarding-complete': boolean | null;
|
|
35
|
+
'registration-eligibility-end-offset': number | null;
|
|
36
|
+
'registration-eligibility-start-offset': number | null;
|
|
37
|
+
'visitor-registration-eligibility-start-offset': number | null;
|
|
38
|
+
'welcome-email-preference': string | null;
|
|
39
|
+
'average-monthly-visitors': number | null;
|
|
40
|
+
'capacity-limit': number | null;
|
|
41
|
+
'auto-sign-out-at-midnight': boolean | null;
|
|
42
|
+
'employee-screening-enabled': boolean | null;
|
|
43
|
+
'pre-registration-enabled': boolean | null;
|
|
44
|
+
'pre-registration-required-enabled': boolean | null;
|
|
45
|
+
'host-approval-enabled': boolean | null;
|
|
46
|
+
'multiple-languages-enabled': boolean | null;
|
|
47
|
+
'near-visit-screening-enabled': boolean | null;
|
|
48
|
+
'printer-notifications-enabled': boolean | null;
|
|
49
|
+
'security-desk-link-enabled': boolean | null;
|
|
50
|
+
'touchless-signin-enabled': boolean | null;
|
|
51
|
+
'visitor-survey-enabled': boolean | null;
|
|
52
|
+
'visual-compliance-enabled': boolean | null;
|
|
53
|
+
'created-at': string;
|
|
54
|
+
'updated-at': string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @category API Resource
|
|
58
|
+
*/
|
|
59
|
+
export declare type LocationRelationships = 'company' | 'employees' | 'flows' | 'employee-screening-flow';
|
|
60
|
+
/**
|
|
61
|
+
* @category API Resource
|
|
62
|
+
*/
|
|
63
|
+
export declare type LocationModel = JSONAPIModel<LocationAttributes, LocationRelationships>;
|
|
64
|
+
//# sourceMappingURL=LocationResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationResource.d.ts","sourceRoot":"","sources":["../../src/resources/LocationResource.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAEzD;;GAEG;AACH,oBAAY,kBAAkB,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,aAAa,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,8BAA8B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,qCAAqC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,uCAAuC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvD,+CAA+C,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/D,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,2BAA2B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,4BAA4B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,0BAA0B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C,mCAAmC,EAAE,OAAO,GAAG,IAAI,CAAC;IACpD,uBAAuB,EAAE,OAAO,GAAG,IAAI,CAAC;IACxC,4BAA4B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,8BAA8B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,+BAA+B,EAAE,OAAO,GAAG,IAAI,CAAC;IAChD,4BAA4B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC7C,0BAA0B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3C,wBAAwB,EAAE,OAAO,GAAG,IAAI,CAAC;IACzC,2BAA2B,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5C,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,oBAAY,qBAAqB,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,yBAAyB,CAAC;AAElG;;GAEG;AACH,oBAAY,aAAa,GAAG,YAAY,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import JSONAPIModel from '../util/json-api/JSONAPIModel';
|
|
2
|
+
export interface LocationRoleAttributes {
|
|
3
|
+
'role-name': string;
|
|
4
|
+
'confirmed-at': string;
|
|
5
|
+
}
|
|
6
|
+
export declare type LocationRoleRelationships = 'location';
|
|
7
|
+
export declare type LocationRoleModel = JSONAPIModel<LocationRoleAttributes, LocationRoleRelationships>;
|
|
8
|
+
//# sourceMappingURL=LocationRoleResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocationRoleResource.d.ts","sourceRoot":"","sources":["../../src/resources/LocationRoleResource.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAEzD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,oBAAY,yBAAyB,GAAG,UAAU,CAAC;AAEnD,oBAAY,iBAAiB,GAAG,YAAY,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import JSONAPIModel from '../util/json-api/JSONAPIModel';
|
|
2
|
+
/**
|
|
3
|
+
* @category API Resource
|
|
4
|
+
*/
|
|
5
|
+
export declare type SignInFieldPageAttributes = {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
position?: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @category API Resource
|
|
11
|
+
*/
|
|
12
|
+
export declare type SignInFieldPageRelationships = 'flow' | 'actionable-sign-in-field-actions' | 'actionable-sign-in-fields' | 'sign-in-field-actions' | 'sign-in-fields';
|
|
13
|
+
/**
|
|
14
|
+
* @category API Resource
|
|
15
|
+
*/
|
|
16
|
+
export declare type SignInFieldPageModel = JSONAPIModel<SignInFieldPageAttributes, SignInFieldPageRelationships>;
|
|
17
|
+
//# sourceMappingURL=SignInFieldPageResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignInFieldPageResource.d.ts","sourceRoot":"","sources":["../../src/resources/SignInFieldPageResource.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAEzD;;GAEG;AACH,oBAAY,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,4BAA4B,GAAG,MAAM,GAC/C,kCAAkC,GAClC,2BAA2B,GAC3B,uBAAuB,GACvB,gBAAgB,CAAC;AAEnB;;GAEG;AACH,oBAAY,oBAAoB,GAAG,YAAY,CAAC,yBAAyB,EAAE,4BAA4B,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import JSONAPIModel from '../util/json-api/JSONAPIModel';
|
|
2
|
+
/**
|
|
3
|
+
* @category API Resource
|
|
4
|
+
*/
|
|
5
|
+
export interface SignInFieldAttributes {
|
|
6
|
+
name: string;
|
|
7
|
+
kind: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
identifier?: string;
|
|
10
|
+
localized?: string;
|
|
11
|
+
'ipad-localized-names': Array<{
|
|
12
|
+
'language-code': string;
|
|
13
|
+
'region-code'?: string;
|
|
14
|
+
'display-name': string;
|
|
15
|
+
}>;
|
|
16
|
+
options?: Array<{
|
|
17
|
+
value: string;
|
|
18
|
+
position: number;
|
|
19
|
+
}>;
|
|
20
|
+
position?: number;
|
|
21
|
+
'store-response'?: boolean;
|
|
22
|
+
'created-at'?: string;
|
|
23
|
+
'updated-at'?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @category API Resource
|
|
27
|
+
*/
|
|
28
|
+
export declare type SignInFieldRelationships = 'sign-in-field-page';
|
|
29
|
+
/**
|
|
30
|
+
* @category API Resource
|
|
31
|
+
*/
|
|
32
|
+
export declare type SignInFieldModel = JSONAPIModel<SignInFieldAttributes, SignInFieldRelationships>;
|
|
33
|
+
//# sourceMappingURL=SignInFieldResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignInFieldResource.d.ts","sourceRoot":"","sources":["../../src/resources/SignInFieldResource.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,KAAK,CAAC;QAC5B,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC,CAAC;IACH,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,oBAAY,wBAAwB,GAAG,oBAAoB,CAAC;AAE5D;;GAEG;AACH,oBAAY,gBAAgB,GAAG,YAAY,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import JSONAPIModel from '../util/json-api/JSONAPIModel';
|
|
2
|
+
/**
|
|
3
|
+
* @category API Resource
|
|
4
|
+
*/
|
|
5
|
+
export declare type UserAttributes = {
|
|
6
|
+
name: string;
|
|
7
|
+
email: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @category API Resource
|
|
11
|
+
*/
|
|
12
|
+
export declare type UserModel = JSONAPIModel<UserAttributes, ''>;
|
|
13
|
+
//# sourceMappingURL=UserResource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserResource.d.ts","sourceRoot":"","sources":["../../src/resources/UserResource.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,+BAA+B,CAAC;AAEzD;;GAEG;AACH,oBAAY,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS,GAAG,YAAY,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Meta
|
|
3
|
+
*/
|
|
4
|
+
export declare type EnvoyMetaJob<Event extends string = string> = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: Event;
|
|
7
|
+
identifier: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* @category Meta
|
|
11
|
+
*/
|
|
12
|
+
export declare type EnvoyMetaLocation = {
|
|
13
|
+
id: string;
|
|
14
|
+
type: 'locations';
|
|
15
|
+
attributes: {
|
|
16
|
+
name: string;
|
|
17
|
+
'company-name-override': string | null;
|
|
18
|
+
timezone: string;
|
|
19
|
+
locale: string | null;
|
|
20
|
+
address: string;
|
|
21
|
+
'address-line-one': string | null;
|
|
22
|
+
'address-line-two': string | null;
|
|
23
|
+
city: string | null;
|
|
24
|
+
state: string | null;
|
|
25
|
+
country: string | null;
|
|
26
|
+
zip: string | null;
|
|
27
|
+
longitude: number | null;
|
|
28
|
+
latitude: number | null;
|
|
29
|
+
'created-at': string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* @category Meta
|
|
34
|
+
*/
|
|
35
|
+
export declare type EnvoyMetaCompany = {
|
|
36
|
+
id: string;
|
|
37
|
+
type: 'companies';
|
|
38
|
+
attributes: {
|
|
39
|
+
name: string;
|
|
40
|
+
active: boolean;
|
|
41
|
+
'created-at': string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A short-lived `userAPI` token.
|
|
46
|
+
* Will be used to construct the `userAPI` property found in `req.envoy.userAPI`.
|
|
47
|
+
*
|
|
48
|
+
* @category Meta
|
|
49
|
+
*/
|
|
50
|
+
export declare type EnvoyMetaAuth = {
|
|
51
|
+
token_type: 'Bearer';
|
|
52
|
+
access_token: string;
|
|
53
|
+
expires_in: number;
|
|
54
|
+
refresh_token: string | null;
|
|
55
|
+
refresh_token_expires_in: number | null;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Metadata that will be included in the request body for events.
|
|
59
|
+
*
|
|
60
|
+
* @category Meta
|
|
61
|
+
*/
|
|
62
|
+
export declare type EnvoyEventMeta<Event extends string = string, Config = Record<string, unknown>> = {
|
|
63
|
+
event: Event;
|
|
64
|
+
plugin_id: string;
|
|
65
|
+
install_id: string;
|
|
66
|
+
config: Config;
|
|
67
|
+
job: EnvoyMetaJob<Event>;
|
|
68
|
+
location: EnvoyMetaLocation;
|
|
69
|
+
company: EnvoyMetaCompany;
|
|
70
|
+
auth: EnvoyMetaAuth | null;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Metadata that will be included in the request body for setup routes,
|
|
74
|
+
* like validation URLs or options URLs.
|
|
75
|
+
*
|
|
76
|
+
* @category Meta
|
|
77
|
+
*/
|
|
78
|
+
export declare type EnvoyRouteMeta<Config = Record<string, unknown>, Params = Record<string, unknown>> = {
|
|
79
|
+
route: string;
|
|
80
|
+
plugin_id: string;
|
|
81
|
+
install_id: string;
|
|
82
|
+
config: Config;
|
|
83
|
+
params: Params;
|
|
84
|
+
location: EnvoyMetaLocation;
|
|
85
|
+
company: EnvoyMetaCompany;
|
|
86
|
+
auth: EnvoyMetaAuth | null;
|
|
87
|
+
forwarded_bearer_token?: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Metadata that will be included in every request Envoy sends to your plugin.
|
|
91
|
+
*
|
|
92
|
+
* @category Meta
|
|
93
|
+
*/
|
|
94
|
+
declare type EnvoyMeta = EnvoyEventMeta | EnvoyRouteMeta;
|
|
95
|
+
export default EnvoyMeta;
|
|
96
|
+
//# sourceMappingURL=EnvoyMeta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvoyMeta.d.ts","sourceRoot":"","sources":["../../src/sdk/EnvoyMeta.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;QACvC,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;QAClC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;QAClC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAA;CACF,CAAC;AAEF;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,OAAO,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAA;CACF,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,aAAa,GAAG;IAC1B,UAAU,EAAE,QAAQ,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC,CAAC;AAEF;;;;GAIG;AACH,oBAAY,cAAc,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC5F,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IACzB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,oBAAY,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI;IAC/F,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,aAAK,SAAS,GAAG,cAAc,GAAG,cAAc,CAAC;AACjD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import EnvoyAPI from '../base/EnvoyAPI';
|
|
2
|
+
import EnvoyPluginJobUpdate from '../internal/EnvoyPluginJobUpdate';
|
|
3
|
+
import EnvoyStorageCommand from '../internal/EnvoyStorageCommand';
|
|
4
|
+
import EnvoyStorageResult from '../internal/EnvoyStorageResult';
|
|
5
|
+
import { EnvoyMetaAuth } from './EnvoyMeta';
|
|
6
|
+
/**
|
|
7
|
+
* API endpoints for *plugin-scoped* tokens.
|
|
8
|
+
*
|
|
9
|
+
* @category API
|
|
10
|
+
* @category Request Object
|
|
11
|
+
*/
|
|
12
|
+
export default class EnvoyPluginAPI extends EnvoyAPI {
|
|
13
|
+
updateJob(jobId: string, update: EnvoyPluginJobUpdate): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Fetches the current `config` saved for this install during setup by the customer.
|
|
16
|
+
*/
|
|
17
|
+
getPluginInstallConfig(installId: string): Promise<Record<string, unknown>>;
|
|
18
|
+
/**
|
|
19
|
+
* Merges changes with the current `config` saved for this install during setup by the customer.
|
|
20
|
+
*
|
|
21
|
+
* To remove an item from the saved `config`, set the item's key to `null`.
|
|
22
|
+
*/
|
|
23
|
+
setPluginInstallConfig(installId: string, config: Record<string, unknown>): Promise<void>;
|
|
24
|
+
storagePipeline<Result extends EnvoyStorageResult = EnvoyStorageResult>(commands: Array<EnvoyStorageCommand>, installId?: string): Promise<Array<Result>>;
|
|
25
|
+
createNotification(installId: string, params?: {}): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Gets a plugin access token using `client_credentials` as the grant type.
|
|
28
|
+
*/
|
|
29
|
+
static loginAsPlugin(id?: string, secret?: string, scope?: string[]): Promise<EnvoyMetaAuth>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=EnvoyPluginAPI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvoyPluginAPI.d.ts","sourceRoot":"","sources":["../../src/sdk/EnvoyPluginAPI.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,mBAAmB,MAAM,iCAAiC,CAAC;AAClE,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,QAAQ;IAC5C,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3E;;OAEG;IACG,sBAAsB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAKjF;;;;OAIG;IACG,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAQzF,eAAe,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,EAC1E,QAAQ,EAAE,KAAK,CAAC,mBAAmB,CAAC,EACpC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAanB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvE;;OAEG;WACU,aAAa,CAAC,EAAE,SAAgB,EAAE,MAAM,SAAoB,EAAE,KAAK,GAAE,MAAM,EAAgC,GAAG,OAAO,CAAC,aAAa,CAAC;CAsBlJ"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
var axios_1 = __importDefault(require("axios"));
|
|
58
|
+
var EnvoyAPI_1 = __importDefault(require("../base/EnvoyAPI"));
|
|
59
|
+
var constants_1 = require("../constants");
|
|
60
|
+
var axiosConstructor_1 = require("../util/axiosConstructor");
|
|
61
|
+
/**
|
|
62
|
+
* API endpoints for *plugin-scoped* tokens.
|
|
63
|
+
*
|
|
64
|
+
* @category API
|
|
65
|
+
* @category Request Object
|
|
66
|
+
*/
|
|
67
|
+
var EnvoyPluginAPI = /** @class */ (function (_super) {
|
|
68
|
+
__extends(EnvoyPluginAPI, _super);
|
|
69
|
+
function EnvoyPluginAPI() {
|
|
70
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
71
|
+
}
|
|
72
|
+
EnvoyPluginAPI.prototype.updateJob = function (jobId, update) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
switch (_a.label) {
|
|
76
|
+
case 0: return [4 /*yield*/, this.axios({
|
|
77
|
+
method: 'PATCH',
|
|
78
|
+
url: "/api/v2/plugin-services/jobs/" + jobId,
|
|
79
|
+
data: update,
|
|
80
|
+
})];
|
|
81
|
+
case 1:
|
|
82
|
+
_a.sent();
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Fetches the current `config` saved for this install during setup by the customer.
|
|
90
|
+
*/
|
|
91
|
+
EnvoyPluginAPI.prototype.getPluginInstallConfig = function (installId) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
+
var data;
|
|
94
|
+
return __generator(this, function (_a) {
|
|
95
|
+
switch (_a.label) {
|
|
96
|
+
case 0: return [4 /*yield*/, this.axios.get("/api/v2/plugin-services/installs/" + installId + "/config")];
|
|
97
|
+
case 1:
|
|
98
|
+
data = (_a.sent()).data;
|
|
99
|
+
return [2 /*return*/, data.data];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Merges changes with the current `config` saved for this install during setup by the customer.
|
|
106
|
+
*
|
|
107
|
+
* To remove an item from the saved `config`, set the item's key to `null`.
|
|
108
|
+
*/
|
|
109
|
+
EnvoyPluginAPI.prototype.setPluginInstallConfig = function (installId, config) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
+
return __generator(this, function (_a) {
|
|
112
|
+
switch (_a.label) {
|
|
113
|
+
case 0: return [4 /*yield*/, this.axios({
|
|
114
|
+
method: 'PUT',
|
|
115
|
+
url: "/api/v2/plugin-services/installs/" + installId + "/config",
|
|
116
|
+
data: config,
|
|
117
|
+
})];
|
|
118
|
+
case 1:
|
|
119
|
+
_a.sent();
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
EnvoyPluginAPI.prototype.storagePipeline = function (commands, installId) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
var request, data;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0:
|
|
131
|
+
request = { commands: commands };
|
|
132
|
+
if (installId) {
|
|
133
|
+
request.install_id = installId;
|
|
134
|
+
}
|
|
135
|
+
return [4 /*yield*/, this.axios({
|
|
136
|
+
method: 'POST',
|
|
137
|
+
url: '/api/v2/plugin-services/storage',
|
|
138
|
+
data: request,
|
|
139
|
+
})];
|
|
140
|
+
case 1:
|
|
141
|
+
data = (_a.sent()).data;
|
|
142
|
+
return [2 /*return*/, data.data];
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
EnvoyPluginAPI.prototype.createNotification = function (installId, params) {
|
|
148
|
+
if (params === void 0) { params = {}; }
|
|
149
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
150
|
+
return __generator(this, function (_a) {
|
|
151
|
+
switch (_a.label) {
|
|
152
|
+
case 0: return [4 /*yield*/, this.axios({
|
|
153
|
+
method: 'POST',
|
|
154
|
+
url: "/api/v2/plugin-services/installs/" + installId + "/notifications",
|
|
155
|
+
data: params,
|
|
156
|
+
})];
|
|
157
|
+
case 1:
|
|
158
|
+
_a.sent();
|
|
159
|
+
return [2 /*return*/];
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Gets a plugin access token using `client_credentials` as the grant type.
|
|
166
|
+
*/
|
|
167
|
+
EnvoyPluginAPI.loginAsPlugin = function (id, secret, scope) {
|
|
168
|
+
if (id === void 0) { id = constants_1.envoyClientId; }
|
|
169
|
+
if (secret === void 0) { secret = constants_1.envoyClientSecret; }
|
|
170
|
+
if (scope === void 0) { scope = ['plugin', 'token.refresh']; }
|
|
171
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
172
|
+
var data, error_1;
|
|
173
|
+
return __generator(this, function (_a) {
|
|
174
|
+
switch (_a.label) {
|
|
175
|
+
case 0:
|
|
176
|
+
_a.trys.push([0, 2, , 3]);
|
|
177
|
+
return [4 /*yield*/, axios_1.default({
|
|
178
|
+
auth: {
|
|
179
|
+
username: id,
|
|
180
|
+
password: secret,
|
|
181
|
+
},
|
|
182
|
+
method: 'POST',
|
|
183
|
+
data: {
|
|
184
|
+
grant_type: 'client_credentials',
|
|
185
|
+
client_id: id,
|
|
186
|
+
client_secret: secret,
|
|
187
|
+
scope: scope.join(','),
|
|
188
|
+
},
|
|
189
|
+
url: '/a/auth/v0/token',
|
|
190
|
+
baseURL: constants_1.envoyBaseURL,
|
|
191
|
+
})];
|
|
192
|
+
case 1:
|
|
193
|
+
data = (_a.sent()).data;
|
|
194
|
+
return [2 /*return*/, data];
|
|
195
|
+
case 2:
|
|
196
|
+
error_1 = _a.sent();
|
|
197
|
+
throw axiosConstructor_1.sanitizeAxiosError(error_1);
|
|
198
|
+
case 3: return [2 /*return*/];
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
return EnvoyPluginAPI;
|
|
204
|
+
}(EnvoyAPI_1.default));
|
|
205
|
+
exports.default = EnvoyPluginAPI;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import EnvoyPluginJobAttachment from './EnvoyPluginJobAttachment';
|
|
2
|
+
import EnvoyPluginAPI from './EnvoyPluginAPI';
|
|
3
|
+
/**
|
|
4
|
+
* A "job" is an event, like `entry_sign_in`.
|
|
5
|
+
* When your plugin handles the event, you can use this job concept
|
|
6
|
+
* to update the status (e.g. complete, failed, ignored)
|
|
7
|
+
* as well as attach extra data to the event's subject
|
|
8
|
+
* (e.g. showing a generated card number in the dashboard for a visitor on `entry_sign_in`).
|
|
9
|
+
*
|
|
10
|
+
* @category Request Object
|
|
11
|
+
*/
|
|
12
|
+
export default class EnvoyPluginJob {
|
|
13
|
+
protected readonly api: EnvoyPluginAPI;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
constructor(pluginAPI: EnvoyPluginAPI, jobId: string);
|
|
16
|
+
private execute;
|
|
17
|
+
/**
|
|
18
|
+
* Add attachments to this job.
|
|
19
|
+
*/
|
|
20
|
+
attach(...attachments: Array<EnvoyPluginJobAttachment>): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Reports that the job is complete.
|
|
23
|
+
*
|
|
24
|
+
* Instead of calling this directly, you can return a 200 response from the job's event handler,
|
|
25
|
+
* using {@link EnvoyRequest.send}.
|
|
26
|
+
*/
|
|
27
|
+
complete(message: string, ...attachments: Array<EnvoyPluginJobAttachment>): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Reports that the job is ignored.
|
|
30
|
+
*
|
|
31
|
+
* Instead of calling this directly, you can return a 400 response from the job's event handler,
|
|
32
|
+
* using {@link EnvoyRequest.sendIgnored}.
|
|
33
|
+
*/
|
|
34
|
+
ignore(message: string, reason: string): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Reports that the job is ignored.
|
|
37
|
+
*
|
|
38
|
+
* Instead of calling this directly, you can return a 400 response from the job's event handler,
|
|
39
|
+
* using {@link EnvoyRequest.sendFailed}.
|
|
40
|
+
*/
|
|
41
|
+
fail(message: string, reason: string): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Updates the job with a new message and attachments.
|
|
44
|
+
*
|
|
45
|
+
* Can be used to periodically update long-running jobs.
|
|
46
|
+
*/
|
|
47
|
+
update(message: string, ...attachments: Array<EnvoyPluginJobAttachment>): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=EnvoyPluginJob.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnvoyPluginJob.d.ts","sourceRoot":"","sources":["../../src/sdk/EnvoyPluginJob.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC;IAEvC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;gBAER,SAAS,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM;IAKpD,OAAO,CAAC,OAAO;IAqBf;;OAEG;IACH,MAAM,CAAC,GAAG,WAAW,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAItE;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzF;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,KAAK,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxF"}
|