@wix/auto_sdk_arrivals_arrivals 1.0.18 → 1.0.20
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/build/cjs/index.d.ts +209 -4
- package/build/cjs/index.js +78 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +352 -34
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +5 -25
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +209 -4
- package/build/es/index.mjs +75 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +352 -34
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +5 -25
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +24 -25
- package/build/internal/cjs/index.typings.d.ts +168 -38
- package/build/internal/cjs/meta.d.ts +30 -18
- package/build/internal/es/index.d.mts +24 -25
- package/build/internal/es/index.typings.d.mts +168 -38
- package/build/internal/es/meta.d.mts +30 -18
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,11 +1,216 @@
|
|
|
1
|
-
import { MaybeContext, BuildRESTFunction,
|
|
2
|
-
import { ArrivalsQueryBuilder, ArrivalQuery, typedQueryArrivals } from './index.typings.js';
|
|
3
|
-
export { AccountInfo, ActionEvent, AreaInfo,
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Arrival, CreateArrivalOptions, CreateArrivalApplicationErrors, OverrideArrivalAsGrantedOptions, OverrideArrivalAsGrantedResponse, OverrideArrivalAsGrantedApplicationErrors, CheckEligibilityOptions, CheckEligibilityResponse, CheckEligibilityApplicationErrors, CountArrivalsOptions, CountArrivalsResponse, CountArrivalsApplicationErrors, CheckEligibilityByCredentialOptions, CheckEligibilityByCredentialResponse, CheckEligibilityByCredentialApplicationErrors, CreateArrivalByCredentialOptions, CreateArrivalByCredentialResponse, CreateArrivalByCredentialApplicationErrors, ArrivalCreatedEnvelope, ArrivalDeletedEnvelope, ArrivalUpdatedEnvelope, ArrivalsQueryBuilder, ArrivalQuery, typedQueryArrivals } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, AccountInfoMetadata, ActionEvent, AreaInfo, ArrivalGrantedByOneOf, ArrivalQuerySpec, ArrivalSource, ArrivalsQueryResult, BaseEventMetadata, CheckEligibilityByCredentialOptionsCredentialOneOf, CheckEligibilityByCredentialRequest, CheckEligibilityByCredentialRequestCredentialOneOf, CheckEligibilityRequest, CommonIdentificationData, CommonIdentificationDataIdOneOf, CommonQueryWithEntityContext, ContactDetails, CountArrivalsRequest, CreateArrivalByCredentialOptionsCredentialOneOf, CreateArrivalByCredentialRequest, CreateArrivalByCredentialRequestCredentialOneOf, CreateArrivalRequest, CreateArrivalResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DenialOverride, DomainEvent, DomainEventBodyOneOf, EligibilityDetails, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EntryIssue, EntryIssueWithLiterals, EventMetadata, GetArrivalRequest, GetArrivalResponse, IdentificationData, IdentificationDataIdOneOf, IdentificationMethod, IdentificationMethodWithLiterals, IdentityType, IdentityTypeWithLiterals, MessageEnvelope, MissingIntakeForm, OverrideArrivalAsGrantedRequest, PlanBenefit, PlanBenefitEligibility, PlanBenefitIssue, PlanBenefitIssueWithLiterals, PlanBenefitType, PlanBenefitTypeWithLiterals, PresentedIdentifier, QueryArrivalsApplicationErrors, QueryArrivalsRequest, QueryArrivalsResponse, RecentArrival, RestoreInfo, ScheduledEvent, ScheduledEventEligibility, ScheduledEventIssue, ScheduledEventIssueWithLiterals, ScheduledEventSearchWindow, SortOrder, SortOrderWithLiterals, Sorting, Status, StatusWithLiterals, Type, TypeWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function createArrival$1(httpClient: HttpClient): CreateArrivalSignature;
|
|
6
|
+
interface CreateArrivalSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Evaluates a person for an area and writes one arrival, whatever it finds about them. For the flows that call
|
|
9
|
+
* it (scans, the dashboard, readers), see About the Arrivals API.
|
|
10
|
+
*
|
|
11
|
+
* Only `arrival.contactDetails.contactId`, `arrival.area.entranceId` and `denialOverride` are read; the
|
|
12
|
+
* area is the one the entrance belongs to. Everything else is set by the server: the contact's name and picture,
|
|
13
|
+
* `eligibilityDetails`, `status`, `source`, the area's ID, name and location, the
|
|
14
|
+
* entrance's name, and what granted the entry. `status` follows from the entry's issues:
|
|
15
|
+
* - none, or only `INTAKE_FORM_MISSING` for forms that do not block entry: **`GRANTED`**, with `planBenefit` or
|
|
16
|
+
* `scheduledEvent` naming what admitted the person; the server picks it by the rule on `planBenefit`: an admitting item, free before finite.
|
|
17
|
+
* - `NO_ELIGIBLE_GRANT`, `RECENT_ENTRY`, or `INTAKE_FORM_MISSING` for a form that blocks entry: **`DENIED`**.
|
|
18
|
+
* Nothing is redeemed; a site user may let the person in with Override Arrival as Granted.
|
|
19
|
+
*
|
|
20
|
+
* *Override at creation.** With `denialOverride`, a denial is written `GRANTED` at once, with its issues and
|
|
21
|
+
* `overrideReason`; Arrival Created fires with that `GRANTED` arrival. Only a site user may send it,
|
|
22
|
+
* a Wix user acting through an app (a call that carries the user's identity beside the app's) included; any other
|
|
23
|
+
* caller fails with `OVERRIDE_NOT_ALLOWED` and nothing is recorded.
|
|
24
|
+
*
|
|
25
|
+
* *Redemption.** A granted benefit is redeemed asynchronously after the response, with the arrival ID as the
|
|
26
|
+
* idempotency key: usually within seconds, and retried for several minutes while Pricing Plans is unavailable. If
|
|
27
|
+
* Pricing Plans refuses the redemption, for example a credit pack with no credits left after an override, the
|
|
28
|
+
* arrival stays `GRANTED` and nothing is recorded on it; the balance is read from Pricing Plans.
|
|
29
|
+
*
|
|
30
|
+
* *Repeats within 5 seconds.** A call for the same contact and entrance by the same caller within 5 seconds of an
|
|
31
|
+
* arrival returns that arrival unchanged. The caller is the Wix user when the call carries one, through an app
|
|
32
|
+
* included, so two site collaborators on one scanner app are two callers; otherwise it is the app. A repeat that
|
|
33
|
+
* carries `denialOverride` onto a `DENIED` arrival is the exception: the override is applied to that arrival exactly
|
|
34
|
+
* as Override Arrival as Granted applies it, from its stored evaluation, and Arrival Updated fires instead of
|
|
35
|
+
* Arrival Created. On a `GRANTED` arrival `denialOverride` is ignored. See About the Arrivals API for
|
|
36
|
+
* retries.
|
|
37
|
+
*
|
|
38
|
+
* *Errors and outages.** `CONTACT_NOT_FOUND` and `ENTRANCE_NOT_FOUND` record nothing. When Pricing Plans or
|
|
39
|
+
* Contacts can't be reached and nothing else admits the person, the call fails with `UNAVAILABLE`
|
|
40
|
+
* (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE`) and records nothing, unless it carries `denialOverride`:
|
|
41
|
+
* a site user has decided, so the arrival is written `GRANTED` with that outage in its issues, no plan benefit, and
|
|
42
|
+
* nothing redeemed. Without Contacts the arrival also has no name or picture.
|
|
43
|
+
* @param - Arrival to create. Only `contactDetails.contactId` and `area.entranceId` are read; every other field
|
|
44
|
+
* (the rest of `contactDetails`, `eligibilityDetails`, `status`, `source`, the area's ID, name and location, the
|
|
45
|
+
* entrance's name, what granted the entry) is set by the server.
|
|
46
|
+
* @returns The arrival as written, with the status its issues imply, or `GRANTED` despite them when `denialOverride` let the person in. On a repeat within 5 seconds, the existing arrival: unchanged, or now `GRANTED` when the repeat carried `denialOverride` onto a `DENIED` one.
|
|
47
|
+
*/
|
|
48
|
+
(arrival: NonNullablePaths<Arrival, `area` | `area.entranceId` | `contactDetails` | `contactDetails.contactId`, 1>, options?: CreateArrivalOptions): Promise<NonNullablePaths<Arrival, `planBenefit.poolId` | `planBenefit.benefitKey` | `planBenefit.displayName` | `planBenefit.type` | `scheduledEvent.eventId` | `scheduledEvent.displayName` | `scheduledEvent.appId` | `contactDetails.contactId` | `source.identifiedBy` | `source.createdBy.anonymousVisitorId` | `source.createdBy.memberId` | `source.createdBy.wixUserId` | `source.createdBy.appId` | `area._id` | `area.locationId` | `area.name` | `area.entranceId` | `area.entranceName` | `eligibilityDetails.issues` | `eligibilityDetails.missingIntakeForms` | `eligibilityDetails.missingIntakeForms.${number}.formId` | `eligibilityDetails.missingIntakeForms.${number}.blocksEntry` | `eligibilityDetails.planBenefits` | `eligibilityDetails.scheduledEvents` | `status`, 3> & {
|
|
49
|
+
__applicationErrorsType?: CreateArrivalApplicationErrors;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
|
52
|
+
declare function overrideArrivalAsGranted$1(httpClient: HttpClient): OverrideArrivalAsGrantedSignature;
|
|
53
|
+
interface OverrideArrivalAsGrantedSignature {
|
|
54
|
+
/**
|
|
55
|
+
* Grants a `DENIED` arrival as a site user's override, from the evaluation it was denied with, and redeems the plan
|
|
56
|
+
* benefit that evaluation found, once, after the response. Not a record correction: calling it can spend a
|
|
57
|
+
* Pricing Plans credit. It is a site user's decision and does not check `RECENT_ENTRY`: it spends the picked credit even when
|
|
58
|
+
* the person was let in a moment ago, for example by a new arrival written at the desk after this denial. Before
|
|
59
|
+
* offering "Let in", show the person's recent entry (Check Eligibility's `recentArrival`) and ask the site user to confirm. `overrideReason` holds the site user's own words when they give one. This is the one
|
|
60
|
+
* change an arrival receives through this API.
|
|
61
|
+
*
|
|
62
|
+
* Only a site user may call it, a Wix user acting through an app (a call that carries the user's identity beside the
|
|
63
|
+
* app's) included: a caller that isn't a site user (a reader at an entrance, or an app with no Wix user on the
|
|
64
|
+
* call) fails with `OVERRIDE_NOT_ALLOWED`, checked before the arrival is read, and nothing changes. Any `DENIED`
|
|
65
|
+
* arrival may be overridden, whoever wrote it: a site user may let in a person a reader denied instead of writing a new
|
|
66
|
+
* arrival at the desk, not in addition to it, since each of the two would admit the person. The caller is recorded in
|
|
67
|
+
* `overriddenBy`; who wrote the arrival stays in `source.createdBy`. The person is not evaluated again: `eligibilityDetails` stays as it
|
|
68
|
+
* was written at the denial, so its `issues` hold what was overridden, and the benefit or scheduled event that
|
|
69
|
+
* evaluation found, if any, is recorded in `planBenefit` or `scheduledEvent`, picked by the rule on `planBenefit`: one that
|
|
70
|
+
* admitted on its own first (the person was denied only for a blocking intake form or `RECENT_ENTRY`), free before
|
|
71
|
+
* finite. It's the same record `denialOverride`
|
|
72
|
+
* on Create Arrival leaves. Idempotent: on a `DENIED` arrival the status turns `GRANTED`, `revision` moves, and
|
|
73
|
+
* Arrival Updated fires; an arrival that is already `GRANTED` is returned as it is (its
|
|
74
|
+
* `overrideReason` is not changed) and nothing is redeemed twice. An `arrivalId` that names no arrival fails with `ARRIVAL_NOT_FOUND`. To decide before the
|
|
75
|
+
* evaluation, send `denialOverride` on Create Arrival instead; a repeat of that Create Arrival within 5 seconds
|
|
76
|
+
* with `denialOverride` applies this same override to the denied arrival.
|
|
77
|
+
* @param - ID of the denied arrival to let the person in on.
|
|
78
|
+
*/
|
|
79
|
+
(arrivalId: string, options?: OverrideArrivalAsGrantedOptions): Promise<NonNullablePaths<OverrideArrivalAsGrantedResponse, `arrival.planBenefit.poolId` | `arrival.planBenefit.benefitKey` | `arrival.planBenefit.displayName` | `arrival.planBenefit.type` | `arrival.scheduledEvent.eventId` | `arrival.scheduledEvent.displayName` | `arrival.scheduledEvent.appId` | `arrival.contactDetails.contactId` | `arrival.source.identifiedBy` | `arrival.source.createdBy.anonymousVisitorId` | `arrival.source.createdBy.memberId` | `arrival.source.createdBy.wixUserId` | `arrival.source.createdBy.appId` | `arrival.area._id` | `arrival.area.locationId` | `arrival.area.name` | `arrival.area.entranceId` | `arrival.area.entranceName` | `arrival.eligibilityDetails.issues` | `arrival.eligibilityDetails.missingIntakeForms` | `arrival.eligibilityDetails.missingIntakeForms.${number}.formId` | `arrival.eligibilityDetails.missingIntakeForms.${number}.blocksEntry` | `arrival.eligibilityDetails.planBenefits` | `arrival.eligibilityDetails.scheduledEvents` | `arrival.status`, 4> & {
|
|
80
|
+
__applicationErrorsType?: OverrideArrivalAsGrantedApplicationErrors;
|
|
81
|
+
}>;
|
|
82
|
+
}
|
|
83
|
+
declare function checkEligibility$1(httpClient: HttpClient): CheckEligibilitySignature;
|
|
84
|
+
interface CheckEligibilitySignature {
|
|
85
|
+
/**
|
|
86
|
+
* Checks whether a contact would be granted entry at an entrance, into the area it belongs to, without recording
|
|
87
|
+
* or redeeming anything. It takes the same `entranceId` as Create Arrival.
|
|
88
|
+
*
|
|
89
|
+
* The response is `eligibilityDetails` as Create Arrival would record it, with the `status` Create Arrival would
|
|
90
|
+
* derive from it, and the contact's `contactDetails` (name and picture) as Contacts holds them now. With
|
|
91
|
+
* `scheduledEventSearchWindow`, events found only in that window are also listed, with `OUTSIDE_ENTRY_WINDOW`.
|
|
92
|
+
* Scheduled events are read only while the area's `policy.scheduledEventsPolicy.entryGrantingAppIds` is not
|
|
93
|
+
* empty. The person is checked for now, the time of the call. When they were let into this area within the last
|
|
94
|
+
* 15 minutes and this entry would spend a credit, the status is `DENIED` with `RECENT_ENTRY`, and `recentArrival`
|
|
95
|
+
* names that arrival. A `contactId` that is not a contact of the site fails with `CONTACT_NOT_FOUND`, including a contact that was
|
|
96
|
+
* merged into another, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; an entrance of an archived
|
|
97
|
+
* area fails with `AREA_ARCHIVED`, and a `scheduledEventSearchWindow` whose `endDate` is not after its `startDate` with
|
|
98
|
+
* `SEARCH_WINDOW_INVALID`, checked before anything is read. When Pricing Plans or
|
|
99
|
+
* Contacts can't be reached the call does not fail: the outage is reported in `eligibilityDetails.issues`
|
|
100
|
+
* (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE`). The status is then `DENIED`, unless something else admits
|
|
101
|
+
* the person. Create Arrival, in the same case, fails with `UNAVAILABLE` unless it carries `denialOverride`. Without Contacts,
|
|
102
|
+
* `contactDetails` has the contact ID alone.
|
|
103
|
+
* Nothing is stored. This method reveals plan state, so it has its own permission rather than the read
|
|
104
|
+
* permission of arrivals.
|
|
105
|
+
* @param - ID of the contact whose eligibility to check.
|
|
106
|
+
* @returns What the engine would find for the contact in this area, and the status Create Arrival would
|
|
107
|
+
* derive from it. Nothing was recorded. It is the finding, not the outcome; what happened is on the arrival, once one
|
|
108
|
+
* is written. No balance is reported: credits left are read from Pricing Plans. Check Eligibility By Credential
|
|
109
|
+
* returns the same fields.
|
|
110
|
+
*/
|
|
111
|
+
(contactId: string, options?: NonNullablePaths<CheckEligibilityOptions, `entranceId` | `scheduledEventSearchWindow.endDate` | `scheduledEventSearchWindow.startDate`, 1>): Promise<NonNullablePaths<CheckEligibilityResponse, `contactDetails.contactId` | `status` | `eligibilityDetails.issues` | `eligibilityDetails.missingIntakeForms` | `eligibilityDetails.missingIntakeForms.${number}.formId` | `eligibilityDetails.missingIntakeForms.${number}.blocksEntry` | `eligibilityDetails.planBenefits` | `eligibilityDetails.planBenefits.${number}.planBenefit.poolId` | `eligibilityDetails.planBenefits.${number}.planBenefit.benefitKey` | `eligibilityDetails.planBenefits.${number}.planBenefit.displayName` | `eligibilityDetails.planBenefits.${number}.planBenefit.type` | `eligibilityDetails.scheduledEvents` | `eligibilityDetails.scheduledEvents.${number}.scheduledEvent.eventId` | `eligibilityDetails.scheduledEvents.${number}.scheduledEvent.displayName` | `eligibilityDetails.scheduledEvents.${number}.scheduledEvent.appId` | `recentArrival.arrivalId`, 4> & {
|
|
112
|
+
__applicationErrorsType?: CheckEligibilityApplicationErrors;
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
declare function getArrival$1(httpClient: HttpClient): GetArrivalSignature;
|
|
116
|
+
interface GetArrivalSignature {
|
|
117
|
+
/**
|
|
118
|
+
* Retrieves an arrival.
|
|
119
|
+
* @param - ID of the arrival to retrieve.
|
|
120
|
+
* @returns Requested arrival.
|
|
121
|
+
*/
|
|
122
|
+
(arrivalId: string): Promise<NonNullablePaths<Arrival, `planBenefit.poolId` | `planBenefit.benefitKey` | `planBenefit.displayName` | `planBenefit.type` | `scheduledEvent.eventId` | `scheduledEvent.displayName` | `scheduledEvent.appId` | `contactDetails.contactId` | `source.identifiedBy` | `source.createdBy.anonymousVisitorId` | `source.createdBy.memberId` | `source.createdBy.wixUserId` | `source.createdBy.appId` | `area._id` | `area.locationId` | `area.name` | `area.entranceId` | `area.entranceName` | `eligibilityDetails.issues` | `eligibilityDetails.missingIntakeForms` | `eligibilityDetails.missingIntakeForms.${number}.formId` | `eligibilityDetails.missingIntakeForms.${number}.blocksEntry` | `eligibilityDetails.planBenefits` | `eligibilityDetails.scheduledEvents` | `status`, 3>>;
|
|
123
|
+
}
|
|
124
|
+
declare function countArrivals$1(httpClient: HttpClient): CountArrivalsSignature;
|
|
125
|
+
interface CountArrivalsSignature {
|
|
126
|
+
/**
|
|
127
|
+
* Counts arrivals matching a filter, for dashboard tiles such as "granted today" and "denied today".
|
|
128
|
+
*
|
|
129
|
+
* The filter accepts the same fields as Query Arrivals. To count denials, filter `status` `DENIED` with a `createdDate` lower bound; an
|
|
130
|
+
* arrival that a site collaborator overrode is `GRANTED`, since its status moved, and is counted with the grants. To count
|
|
131
|
+
* overrides, filter `{ "overriddenBy.wixUserId": { "$exists": true } }` with a `createdDate` lower bound.
|
|
132
|
+
* A filter on `status`, `source.identifiedBy`, `eligibilityDetails.issues`, `planBenefit.poolId`, `planBenefit.benefitKey`,
|
|
133
|
+
* `planBenefit.type` or `overriddenBy.wixUserId`, fields with no index, must also have a lower bound on `createdDate`
|
|
134
|
+
* (`$gt` or `$gte`) no more than 400 days ago, as on Query Arrivals; otherwise the call fails with `CREATED_DATE_LOWER_BOUND_REQUIRED`.
|
|
135
|
+
* Counting more than 100,000 arrivals fails with `TOO_MANY_TO_COUNT`; narrow the filter, for example by
|
|
136
|
+
* `createdDate`.
|
|
137
|
+
*/
|
|
138
|
+
(options?: CountArrivalsOptions): Promise<NonNullablePaths<CountArrivalsResponse, `count`, 0> & {
|
|
139
|
+
__applicationErrorsType?: CountArrivalsApplicationErrors;
|
|
140
|
+
}>;
|
|
141
|
+
}
|
|
142
|
+
declare function checkEligibilityByCredential$1(httpClient: HttpClient): CheckEligibilityByCredentialSignature;
|
|
143
|
+
interface CheckEligibilityByCredentialSignature {
|
|
144
|
+
/**
|
|
145
|
+
* Checks whether the holder of a presented credential would be granted entry at an entrance, into the area it
|
|
146
|
+
* belongs to, without recording anything or redeeming anything.
|
|
147
|
+
*
|
|
148
|
+
* This is Check Eligibility in the Arrivals Service with the person identified by what they present instead
|
|
149
|
+
* of by `contactId`: the token is resolved to its credential and holder, then the same
|
|
150
|
+
* evaluation runs. A scanner app uses it to show a client their standing without admitting them: their benefits
|
|
151
|
+
* for this area and their scheduled events, each with its own issue, the forms they are missing, and the
|
|
152
|
+
* status a scan would get. It takes the same `entranceId` as Create Arrival By Credential, so a scanner checks
|
|
153
|
+
* and records at the one position it holds. The response has the same fields Check Eligibility returns, always
|
|
154
|
+
* against the area's own entry window, so that it predicts the Create Arrival that follows the scan. A token that does not
|
|
155
|
+
* resolve to a live credential fails with `BAD_SIGNATURE` or `TOKEN_REVOKED`, and an `entranceId` that names no entrance with `ENTRANCE_NOT_FOUND`; when
|
|
156
|
+
* Pricing Plans or Contacts can't be reached the call does not fail and reports the outage in
|
|
157
|
+
* `eligibilityDetails.issues`, as Check Eligibility does. This method
|
|
158
|
+
* reveals plan state, so it has its own permission rather
|
|
159
|
+
* than the read permission of arrivals.
|
|
160
|
+
* @returns What the engine would find for the credential's holder in this area, and the status Create
|
|
161
|
+
* Arrival would derive from it. Nothing was recorded. The same fields Check Eligibility returns, always against the
|
|
162
|
+
* area's own entry window.
|
|
163
|
+
*/
|
|
164
|
+
(options: NonNullablePaths<CheckEligibilityByCredentialOptions, `entranceId`, 0>): Promise<NonNullablePaths<CheckEligibilityByCredentialResponse, `contactDetails.contactId` | `status` | `eligibilityDetails.issues` | `eligibilityDetails.missingIntakeForms` | `eligibilityDetails.missingIntakeForms.${number}.formId` | `eligibilityDetails.missingIntakeForms.${number}.blocksEntry` | `eligibilityDetails.planBenefits` | `eligibilityDetails.planBenefits.${number}.planBenefit.poolId` | `eligibilityDetails.planBenefits.${number}.planBenefit.benefitKey` | `eligibilityDetails.planBenefits.${number}.planBenefit.displayName` | `eligibilityDetails.planBenefits.${number}.planBenefit.type` | `eligibilityDetails.scheduledEvents` | `eligibilityDetails.scheduledEvents.${number}.scheduledEvent.eventId` | `eligibilityDetails.scheduledEvents.${number}.scheduledEvent.displayName` | `eligibilityDetails.scheduledEvents.${number}.scheduledEvent.appId` | `recentArrival.arrivalId`, 4> & {
|
|
165
|
+
__applicationErrorsType?: CheckEligibilityByCredentialApplicationErrors;
|
|
166
|
+
}>;
|
|
167
|
+
}
|
|
168
|
+
declare function createArrivalByCredential$1(httpClient: HttpClient): CreateArrivalByCredentialSignature;
|
|
169
|
+
interface CreateArrivalByCredentialSignature {
|
|
170
|
+
/**
|
|
171
|
+
* Writes an arrival for the holder of a presented credential: resolves the token to its credential
|
|
172
|
+
* and holder and calls Create Arrival for them. The outcome is Create Arrival's contract. It carries no override:
|
|
173
|
+
* letting the person in after a denial is Override Arrival as Granted with the denied arrival's ID.
|
|
174
|
+
*
|
|
175
|
+
* A token that does not resolve to a live credential fails with `BAD_SIGNATURE` or `TOKEN_REVOKED`, and an `entranceId` that names no entrance with
|
|
176
|
+
* `ENTRANCE_NOT_FOUND`; nothing is recorded. The arrival is recorded at the entrance, in the area it belongs to,
|
|
177
|
+
* with `source.identifiedBy` `BY_TOKEN` and
|
|
178
|
+
* `source.createdBy` naming the Wix user, or the app that called (a reader or a partner app). When Pricing Plans or Contacts can't be reached and
|
|
179
|
+
* nothing else admits the person, the call fails with `UNAVAILABLE` (`PRICING_PLANS_UNAVAILABLE` or
|
|
180
|
+
* `CONTACTS_UNAVAILABLE`) and records nothing. A repeat within 5 seconds by the same caller, for the same holder and
|
|
181
|
+
* entrance, returns the arrival already written, whether it came from a scan or from Create Arrival.
|
|
182
|
+
*/
|
|
183
|
+
(options: NonNullablePaths<CreateArrivalByCredentialOptions, `entranceId`, 0>): Promise<NonNullablePaths<CreateArrivalByCredentialResponse, `arrival.planBenefit.poolId` | `arrival.planBenefit.benefitKey` | `arrival.planBenefit.displayName` | `arrival.planBenefit.type` | `arrival.scheduledEvent.eventId` | `arrival.scheduledEvent.displayName` | `arrival.scheduledEvent.appId` | `arrival.contactDetails.contactId` | `arrival.source.identifiedBy` | `arrival.source.createdBy.anonymousVisitorId` | `arrival.source.createdBy.memberId` | `arrival.source.createdBy.wixUserId` | `arrival.source.createdBy.appId` | `arrival.area._id` | `arrival.area.locationId` | `arrival.area.name` | `arrival.area.entranceId` | `arrival.area.entranceName` | `arrival.eligibilityDetails.issues` | `arrival.eligibilityDetails.missingIntakeForms` | `arrival.eligibilityDetails.missingIntakeForms.${number}.formId` | `arrival.eligibilityDetails.missingIntakeForms.${number}.blocksEntry` | `arrival.eligibilityDetails.planBenefits` | `arrival.eligibilityDetails.scheduledEvents` | `arrival.status`, 4> & {
|
|
184
|
+
__applicationErrorsType?: CreateArrivalByCredentialApplicationErrors;
|
|
185
|
+
}>;
|
|
186
|
+
}
|
|
187
|
+
declare const onArrivalCreated$1: EventDefinition<ArrivalCreatedEnvelope, "wix.arrivals.v1.arrival_created">;
|
|
188
|
+
declare const onArrivalDeleted$1: EventDefinition<ArrivalDeletedEnvelope, "wix.arrivals.v1.arrival_deleted">;
|
|
189
|
+
declare const onArrivalUpdated$1: EventDefinition<ArrivalUpdatedEnvelope, "wix.arrivals.v1.arrival_updated">;
|
|
4
190
|
|
|
5
191
|
declare function customQueryArrivals(httpClient: HttpClient): {
|
|
6
192
|
(): ArrivalsQueryBuilder;
|
|
7
193
|
(query: ArrivalQuery): ReturnType<typeof typedQueryArrivals>;
|
|
8
194
|
};
|
|
195
|
+
declare const createArrival: MaybeContext<BuildRESTFunction<typeof createArrival$1> & typeof createArrival$1>;
|
|
196
|
+
declare const overrideArrivalAsGranted: MaybeContext<BuildRESTFunction<typeof overrideArrivalAsGranted$1> & typeof overrideArrivalAsGranted$1>;
|
|
197
|
+
declare const checkEligibility: MaybeContext<BuildRESTFunction<typeof checkEligibility$1> & typeof checkEligibility$1>;
|
|
198
|
+
declare const getArrival: MaybeContext<BuildRESTFunction<typeof getArrival$1> & typeof getArrival$1>;
|
|
199
|
+
declare const countArrivals: MaybeContext<BuildRESTFunction<typeof countArrivals$1> & typeof countArrivals$1>;
|
|
200
|
+
declare const checkEligibilityByCredential: MaybeContext<BuildRESTFunction<typeof checkEligibilityByCredential$1> & typeof checkEligibilityByCredential$1>;
|
|
201
|
+
declare const createArrivalByCredential: MaybeContext<BuildRESTFunction<typeof createArrivalByCredential$1> & typeof createArrivalByCredential$1>;
|
|
9
202
|
declare const queryArrivals: MaybeContext<BuildRESTFunction<typeof customQueryArrivals> & typeof customQueryArrivals>;
|
|
203
|
+
/**
|
|
204
|
+
* Triggered when an arrival is created, granted or denied; its `status` says which. Use it for feeds, reporting and reacting to an entry. In Wix Automations, the "Client arrives" trigger reports every arrival, granted or denied, and an override.
|
|
205
|
+
*/
|
|
206
|
+
declare const onArrivalCreated: BuildEventDefinition<typeof onArrivalCreated$1> & typeof onArrivalCreated$1;
|
|
207
|
+
/**
|
|
208
|
+
* Triggered when an arrival is deleted, which happens only when its site is deleted. Arrivals are never deleted through this API; a contact's privacy deletion anonymizes their arrivals instead (Arrival Updated).
|
|
209
|
+
*/
|
|
210
|
+
declare const onArrivalDeleted: BuildEventDefinition<typeof onArrivalDeleted$1> & typeof onArrivalDeleted$1;
|
|
211
|
+
/**
|
|
212
|
+
* Triggered when an arrival is updated: when a site user overrides a denied arrival (with Override Arrival as Granted, or with a repeat of Create Arrival within 5 seconds that carries `denialOverride` onto that `DENIED` arrival). `status` moves from `DENIED` to `GRANTED`, `overrideReason`, `overriddenBy` and `overriddenDate` are written and what granted the entry (`planBenefit` or `scheduledEvent`) is filled in from the evaluation the arrival was denied with; `eligibilityDetails` stays as it was. Also triggered when two contacts are merged in CRM and the arrival's `contactDetails.contactId` moves to the surviving contact; the name and picture snapshot stays as it was. Also triggered when a contact's personal data is deleted for privacy: the arrival is kept, `contactDetails.firstName`, `contactDetails.lastName` and `overrideReason` become `****` and the picture is removed; `triggeredByAnonymizeRequest` is `true`. Nothing else about an arrival changes. An arrival is overridden at most once, so a consumer that reacts to the override acts once per arrival ID: a later Arrival Updated of an overridden arrival is a contact merge, or a privacy deletion when `triggeredByAnonymizeRequest` is `true`.
|
|
213
|
+
*/
|
|
214
|
+
declare const onArrivalUpdated: BuildEventDefinition<typeof onArrivalUpdated$1> & typeof onArrivalUpdated$1;
|
|
10
215
|
|
|
11
|
-
export { ArrivalQuery, ArrivalsQueryBuilder, queryArrivals };
|
|
216
|
+
export { Arrival, ArrivalCreatedEnvelope, ArrivalDeletedEnvelope, ArrivalQuery, ArrivalUpdatedEnvelope, ArrivalsQueryBuilder, CheckEligibilityApplicationErrors, CheckEligibilityByCredentialApplicationErrors, CheckEligibilityByCredentialOptions, CheckEligibilityByCredentialResponse, CheckEligibilityOptions, CheckEligibilityResponse, CountArrivalsApplicationErrors, CountArrivalsOptions, CountArrivalsResponse, CreateArrivalApplicationErrors, CreateArrivalByCredentialApplicationErrors, CreateArrivalByCredentialOptions, CreateArrivalByCredentialResponse, CreateArrivalOptions, OverrideArrivalAsGrantedApplicationErrors, OverrideArrivalAsGrantedOptions, OverrideArrivalAsGrantedResponse, checkEligibility, checkEligibilityByCredential, countArrivals, createArrival, createArrivalByCredential, getArrival, onArrivalCreated, onArrivalDeleted, onArrivalUpdated, overrideArrivalAsGranted, queryArrivals };
|
package/build/cjs/index.js
CHANGED
|
@@ -36,12 +36,22 @@ __export(index_exports, {
|
|
|
36
36
|
createArrival: () => createArrival4,
|
|
37
37
|
createArrivalByCredential: () => createArrivalByCredential4,
|
|
38
38
|
getArrival: () => getArrival4,
|
|
39
|
+
onArrivalCreated: () => onArrivalCreated2,
|
|
40
|
+
onArrivalDeleted: () => onArrivalDeleted2,
|
|
41
|
+
onArrivalUpdated: () => onArrivalUpdated2,
|
|
39
42
|
overrideArrivalAsGranted: () => overrideArrivalAsGranted4,
|
|
40
43
|
queryArrivals: () => queryArrivals4,
|
|
41
44
|
utils: () => utils
|
|
42
45
|
});
|
|
43
46
|
module.exports = __toCommonJS(index_exports);
|
|
44
47
|
|
|
48
|
+
// src/arrivals-v1-arrival-arrivals.public.ts
|
|
49
|
+
var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
50
|
+
var import_image3 = require("@wix/sdk-runtime/transformations/image");
|
|
51
|
+
var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
52
|
+
var import_transform_paths3 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
53
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
54
|
+
|
|
45
55
|
// src/arrivals-v1-arrival-arrivals.universal.ts
|
|
46
56
|
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
47
57
|
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
@@ -752,6 +762,13 @@ async function createArrivalByCredential2(options) {
|
|
|
752
762
|
}
|
|
753
763
|
|
|
754
764
|
// src/arrivals-v1-arrival-arrivals.public.ts
|
|
765
|
+
var TRANSFORM_PATHS_03 = [
|
|
766
|
+
{ path: "entity.createdDate" },
|
|
767
|
+
{ path: "entity.updatedDate" },
|
|
768
|
+
{ path: "entity.overriddenDate" },
|
|
769
|
+
{ path: "metadata.eventTime" }
|
|
770
|
+
];
|
|
771
|
+
var TRANSFORM_PATHS_13 = [{ path: "entity.contactDetails.picture" }];
|
|
755
772
|
function createArrival3(httpClient) {
|
|
756
773
|
return (arrival, options) => createArrival2(
|
|
757
774
|
arrival,
|
|
@@ -817,9 +834,58 @@ function createArrivalByCredential3(httpClient) {
|
|
|
817
834
|
{ httpClient }
|
|
818
835
|
);
|
|
819
836
|
}
|
|
837
|
+
var onArrivalCreated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
|
|
838
|
+
"wix.arrivals.v1.arrival_created",
|
|
839
|
+
true,
|
|
840
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
841
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
842
|
+
{
|
|
843
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
844
|
+
paths: TRANSFORM_PATHS_03
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
transformFn: import_image3.transformRESTImageToSDKImage,
|
|
848
|
+
paths: TRANSFORM_PATHS_13
|
|
849
|
+
}
|
|
850
|
+
])
|
|
851
|
+
)
|
|
852
|
+
)();
|
|
853
|
+
var onArrivalDeleted = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
|
|
854
|
+
"wix.arrivals.v1.arrival_deleted",
|
|
855
|
+
true,
|
|
856
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
857
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
858
|
+
{
|
|
859
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
860
|
+
paths: TRANSFORM_PATHS_03
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
transformFn: import_image3.transformRESTImageToSDKImage,
|
|
864
|
+
paths: TRANSFORM_PATHS_13
|
|
865
|
+
}
|
|
866
|
+
])
|
|
867
|
+
)
|
|
868
|
+
)();
|
|
869
|
+
var onArrivalUpdated = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
|
|
870
|
+
"wix.arrivals.v1.arrival_updated",
|
|
871
|
+
true,
|
|
872
|
+
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
873
|
+
(0, import_transform_paths3.transformPaths)(event, [
|
|
874
|
+
{
|
|
875
|
+
transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
|
|
876
|
+
paths: TRANSFORM_PATHS_03
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
transformFn: import_image3.transformRESTImageToSDKImage,
|
|
880
|
+
paths: TRANSFORM_PATHS_13
|
|
881
|
+
}
|
|
882
|
+
])
|
|
883
|
+
)
|
|
884
|
+
)();
|
|
820
885
|
|
|
821
886
|
// src/arrivals-v1-arrival-arrivals.context.ts
|
|
822
887
|
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
888
|
+
var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
|
|
823
889
|
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
824
890
|
function customQueryArrivals(httpClient) {
|
|
825
891
|
const router = /* @__PURE__ */ (0, import_query_method_router.createQueryOverloadRouter)({
|
|
@@ -840,6 +906,15 @@ var countArrivals4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(
|
|
|
840
906
|
var checkEligibilityByCredential4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(checkEligibilityByCredential3);
|
|
841
907
|
var createArrivalByCredential4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createArrivalByCredential3);
|
|
842
908
|
var queryArrivals4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryArrivals);
|
|
909
|
+
var onArrivalCreated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
|
|
910
|
+
onArrivalCreated
|
|
911
|
+
);
|
|
912
|
+
var onArrivalDeleted2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
|
|
913
|
+
onArrivalDeleted
|
|
914
|
+
);
|
|
915
|
+
var onArrivalUpdated2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
|
|
916
|
+
onArrivalUpdated
|
|
917
|
+
);
|
|
843
918
|
// Annotate the CommonJS export names for ESM import in node:
|
|
844
919
|
0 && (module.exports = {
|
|
845
920
|
EntryIssue,
|
|
@@ -858,6 +933,9 @@ var queryArrivals4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(
|
|
|
858
933
|
createArrival,
|
|
859
934
|
createArrivalByCredential,
|
|
860
935
|
getArrival,
|
|
936
|
+
onArrivalCreated,
|
|
937
|
+
onArrivalDeleted,
|
|
938
|
+
onArrivalUpdated,
|
|
861
939
|
overrideArrivalAsGranted,
|
|
862
940
|
queryArrivals,
|
|
863
941
|
utils
|