@wix/auto_sdk_arrivals_arrivals 1.0.3 → 1.0.4

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.
@@ -100,7 +100,9 @@ interface ArrivalGrantedByOneOf {
100
100
  * The person who arrived: their contact ID, and their name and picture as the Contacts API held them when the
101
101
  * arrival was written. The name and picture are a snapshot — for history and live lists without a Contacts
102
102
  * read; a later change in Contacts does not update them. A contact merge moves `contactId` to the surviving
103
- * contact and leaves the snapshot as it was. Named as Bookings names the same thing on a booking.
103
+ * contact and leaves the snapshot as it was. Named as Bookings names the same thing on a booking. The name and
104
+ * picture are absent when the contact has none, or when Contacts did not answer (`CONTACTS_UNAVAILABLE` in
105
+ * `eligibilityDetails.issues`).
104
106
  */
105
107
  interface ContactDetails {
106
108
  /**
@@ -254,8 +256,9 @@ interface EligibilityDetails {
254
256
  * The issues of the entry as a whole. The issues decide the status the evaluation gives: `GRANTED` when there are none, or only
255
257
  * `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. When staff let the person in —
256
258
  * afterwards with Override Arrival as Granted, or beforehand with `denialOverride` on Create Arrival — the status is
257
- * `GRANTED` whatever the issues, and the issues show what was overridden. `PRICING_PLANS_UNAVAILABLE` is found
258
- * only that way, with `denialOverride`, since otherwise the call fails with `UNAVAILABLE`. A `DENIED` arrival always has at
259
+ * `GRANTED` whatever the issues, and the issues show what was overridden. On an arrival, `PRICING_PLANS_UNAVAILABLE`
260
+ * and `CONTACTS_UNAVAILABLE` are found only that way, with `denialOverride`, since otherwise Create Arrival fails with
261
+ * `UNAVAILABLE`; Check Eligibility reports them without failing. A `DENIED` arrival always has at
259
262
  * least one. Empty when nothing stood in the way.
260
263
  * @maxSize 3
261
264
  */
@@ -268,8 +271,10 @@ interface EligibilityDetails {
268
271
  /**
269
272
  * The person's Pricing Plans benefits allowed into this area, each a `planBenefit` with its own `issues`: empty
270
273
  * means the benefit admits. Listed on a `DENIED` arrival too, admitting ones included, so an override can take one
271
- * later. The grant picks one by the rule on the arrival's `planBenefit` and records it there. Empty when the person
272
- * holds no benefit for this area.
274
+ * later. The grant picks one by the rule on the arrival's `planBenefit` and records it there. Listed in the order of
275
+ * that rule, so the first is the one a grant takes; at most 20 are listed, the first 20 in that order. Empty when the
276
+ * person holds no benefit for this area, and when the status of the contact's site member (`memberInfo.status` in
277
+ * Contacts) is `BLOCKED`, `DELETED` or `OFFLINE`, since such a member holds no plans here.
273
278
  * @maxSize 20
274
279
  */
275
280
  planBenefits?: PlanBenefitEligibility[];
@@ -288,8 +293,9 @@ interface EligibilityDetails {
288
293
  * An issue of the entry as a whole. The issues decide the status the evaluation gives: `GRANTED` when there are none, or only
289
294
  * `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. When staff let the person in —
290
295
  * afterwards with Override Arrival as Granted, or beforehand with `denialOverride` on Create Arrival — the status is
291
- * `GRANTED` whatever the issues, and the issues show what was overridden. `PRICING_PLANS_UNAVAILABLE` is found
292
- * only that way, with `denialOverride`, since otherwise the call fails with `UNAVAILABLE`. Why a single benefit or event does not admit is on
296
+ * `GRANTED` whatever the issues, and the issues show what was overridden. On an arrival, `PRICING_PLANS_UNAVAILABLE`
297
+ * and `CONTACTS_UNAVAILABLE` are found only that way, with `denialOverride`, since otherwise Create Arrival fails with
298
+ * `UNAVAILABLE`; Check Eligibility reports them without failing. Why a single benefit or event does not admit is on
293
299
  * that item (`PlanBenefitIssue`, `ScheduledEventIssue`), not here.
294
300
  */
295
301
  declare enum EntryIssue {
@@ -297,22 +303,27 @@ declare enum EntryIssue {
297
303
  * No grant the person holds admits them into this area now. A grant is what can grant entry — a plan benefit
298
304
  * (`planBenefits`) or a scheduled event they are booked on (`scheduledEvents`) — the same two kinds an arrival
299
305
  * records in `planBenefit` or `scheduledEvent` once granted. Either nothing was found — `planBenefits` and
300
- * `scheduledEvents` are empty — or everything found has an issue of its own, which says why. Also reported when a
306
+ * `scheduledEvents` are empty — or everything found has an issue of its own, which says why. A contact whose site
307
+ * member's status (`memberInfo.status` in Contacts) is `BLOCKED`, `DELETED` or `OFFLINE` holds no plans here, so it
308
+ * finds none. Also reported when a
301
309
  * credit pack would admit but the person is booked on an event here and now that still waits for approval: no
302
310
  * credit is spent while the booking may be approved moments later (the event carries `PENDING_CONFIRMATION`).
303
311
  * Declines at creation; staff override, or sell a plan, approve the booking or renew the plan and create a new
304
- * arrival. Not reported when Pricing Plans did not answer: `PRICING_PLANS_UNAVAILABLE` takes its place.
312
+ * arrival. Not reported when Pricing Plans or Contacts did not answer: `PRICING_PLANS_UNAVAILABLE` or
313
+ * `CONTACTS_UNAVAILABLE` takes its place.
305
314
  */
306
315
  NO_ELIGIBLE_GRANT = "NO_ELIGIBLE_GRANT",
307
316
  /** The person has no valid submission for at least one intake form the area's policy requires: never submitted, expired, canceled or pending approval. The forms are listed in `missingIntakeForms`. Declines at creation when a missing form has `blocksEntry`; otherwise grants, with the issue kept on the arrival so staff can chase the paperwork. */
308
317
  INTAKE_FORM_MISSING = "INTAKE_FORM_MISSING",
309
318
  /** The person was already granted entry into this area within the last 15 minutes and a credit would be spent again: a retried scan, a re-entry, or a guest on the same credential. Declines at creation; the override spends a credit. Not reported when nothing would be spent twice (an unlimited plan, a scheduled event). */
310
319
  RECENT_ENTRY = "RECENT_ENTRY",
311
- /** Pricing Plans did not answer, so plan benefits were not checked. Only on an arrival let in by Create Arrival with `denialOverride`, since without a staff decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Override Arrival as Granted does not call Pricing Plans. `planBenefits` is empty, no `planBenefit` is recorded and nothing is redeemed; scheduled events and intake forms are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT`, never with it: plan benefits were not checked, so the person may hold one that admits. An issue a scheduled event has of its own stays on that event in `eligibilityDetails`. */
312
- PRICING_PLANS_UNAVAILABLE = "PRICING_PLANS_UNAVAILABLE"
320
+ /** Pricing Plans did not answer — it could not be reached, did not answer in time, or failed on its side; any of these is an outage — so plan benefits were not checked. On an arrival, only on one let in by Create Arrival with `denialOverride`, since without a staff decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Check Eligibility reports it without failing; Override Arrival as Granted does not call Pricing Plans. `planBenefits` is empty, no `planBenefit` is recorded and nothing is redeemed; scheduled events and intake forms are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT`, never with it: plan benefits were not checked, so the person may hold one that admits. An issue a scheduled event has of its own stays on that event in `eligibilityDetails`. */
321
+ PRICING_PLANS_UNAVAILABLE = "PRICING_PLANS_UNAVAILABLE",
322
+ /** Contacts did not answer — it could not be reached, did not answer in time, or failed on its side; any of these is an outage — so the person's member is unknown and plan benefits were not checked. On an arrival, only on one let in by Create Arrival with `denialOverride`, since without a staff decision the call fails with `UNAVAILABLE` instead and no denied arrival is written; Check Eligibility reports it without failing. `planBenefits` is empty, no `planBenefit` is recorded, nothing is redeemed, and `contactDetails` has the contact ID alone, with no name or picture; scheduled events, read by contact, are still evaluated. Reported instead of `NO_ELIGIBLE_GRANT` and `PRICING_PLANS_UNAVAILABLE`, never with them: Pricing Plans is not read without the member. */
323
+ CONTACTS_UNAVAILABLE = "CONTACTS_UNAVAILABLE"
313
324
  }
314
325
  /** @enumType */
315
- type EntryIssueWithLiterals = EntryIssue | 'NO_ELIGIBLE_GRANT' | 'INTAKE_FORM_MISSING' | 'RECENT_ENTRY' | 'PRICING_PLANS_UNAVAILABLE';
326
+ type EntryIssueWithLiterals = EntryIssue | 'NO_ELIGIBLE_GRANT' | 'INTAKE_FORM_MISSING' | 'RECENT_ENTRY' | 'PRICING_PLANS_UNAVAILABLE' | 'CONTACTS_UNAVAILABLE';
316
327
  /** An intake form the area's policy requires that the person has no valid submission for. */
317
328
  interface MissingIntakeForm {
318
329
  /**
@@ -384,11 +395,11 @@ declare enum PlanBenefitType {
384
395
  type PlanBenefitTypeWithLiterals = PlanBenefitType | 'CREDIT' | 'UNLIMITED';
385
396
  /** Why a Pricing Plans benefit does not admit. Where Pricing Plans has a word for a finding, the value uses it. */
386
397
  declare enum PlanBenefitIssue {
387
- /** The benefit's plan is not active — ended, cancelled or paused — as Pricing Plans reports. Staff override, or renew the plan and create a new arrival. */
398
+ /** The benefit's plan is not active at the time of the entry — ended, cancelled, paused, not started yet, or for a moment while it is being renewed — as Pricing Plans reports. Staff override, or renew the plan and create a new arrival. */
388
399
  PLAN_NOT_ACTIVE = "PLAN_NOT_ACTIVE",
389
400
  /** A credit pack with no credits left, as Pricing Plans reports. Staff override, or sell credits and create a new arrival. */
390
401
  NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
391
- /** The plan's usage policy does not allow entry at this hour or on this day, as Pricing Plans reports. */
402
+ /** The plan's usage policy does not allow entry at this hour or on this day, or another rule of the plan refuses entry, as Pricing Plans reports. A used-up limit on its own is `USAGE_LIMIT_REACHED`. */
392
403
  OUTSIDE_ACCESS_HOURS = "OUTSIDE_ACCESS_HOURS",
393
404
  /** The plan's usage policy limits how often it can be used, such as three entries a week, and that limit is used up for the current period, as Pricing Plans reports. Staff override, or the client comes back in the next period. */
394
405
  USAGE_LIMIT_REACHED = "USAGE_LIMIT_REACHED"
@@ -551,9 +562,9 @@ interface ScheduledEventSearchWindow {
551
562
  * returns the same fields.
552
563
  */
553
564
  interface CheckEligibilityResponse {
554
- /** The contact given: their contact ID, name and picture as Contacts holds them now. When creating an arrival, send `arrival.contactDetails.contactId`; the server fills in the rest. */
565
+ /** The contact given: their contact ID, name and picture as Contacts holds them now. When Contacts did not answer (`CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`), only `contactId` is set. When creating an arrival, send `arrival.contactDetails.contactId`; the server fills in the rest. */
555
566
  contactDetails?: ContactDetails;
556
- /** The status Create Arrival would write now, derived from `eligibilityDetails.issues`: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. */
567
+ /** The status Create Arrival would write now, derived from `eligibilityDetails.issues`: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. Also `DENIED` when Pricing Plans or Contacts did not answer and nothing else admits the contact (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`): the engine could not decide, so show that the check failed and can be tried again, not a denial. */
557
568
  status?: StatusWithLiterals;
558
569
  /**
559
570
  * What the engine found — the same message Create Arrival records on the arrival: the entry's `issues`, the
@@ -895,9 +906,9 @@ type TypeWithLiterals = Type | 'NFC_CARD';
895
906
  * area's own entry window.
896
907
  */
897
908
  interface CheckEligibilityByCredentialResponse {
898
- /** The holder of the presented credential: their contact ID, name and picture as Contacts holds them now. */
909
+ /** The holder of the presented credential: their contact ID, name and picture as Contacts holds them now. When Contacts did not answer (`CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`), only `contactId` is set. */
899
910
  contactDetails?: ContactDetails;
900
- /** The status Create Arrival would write now, derived from `eligibilityDetails.issues`: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. */
911
+ /** The status Create Arrival would write now, derived from `eligibilityDetails.issues`: `GRANTED` when there are none, or only `INTAKE_FORM_MISSING` for forms that do not block entry; `DENIED` otherwise. Also `DENIED` when Pricing Plans or Contacts did not answer and nothing else admits the contact (`PRICING_PLANS_UNAVAILABLE` or `CONTACTS_UNAVAILABLE` in `eligibilityDetails.issues`): the engine could not decide, so show that the check failed and can be tried again, not a denial. */
901
912
  status?: StatusWithLiterals;
902
913
  /**
903
914
  * What the engine found — the same message Create Arrival records on the arrival: the entry's `issues`, the
@@ -964,6 +975,10 @@ type CreateArrivalApplicationErrors = {
964
975
  code?: 'PRICING_PLANS_UNAVAILABLE';
965
976
  description?: string;
966
977
  data?: Record<string, any>;
978
+ } | {
979
+ code?: 'CONTACTS_UNAVAILABLE';
980
+ description?: string;
981
+ data?: Record<string, any>;
967
982
  };
968
983
  /** @docsIgnore */
969
984
  type OverrideArrivalAsGrantedApplicationErrors = {
@@ -992,10 +1007,6 @@ type CheckEligibilityApplicationErrors = {
992
1007
  code?: 'AREA_ARCHIVED';
993
1008
  description?: string;
994
1009
  data?: Record<string, any>;
995
- } | {
996
- code?: 'PRICING_PLANS_UNAVAILABLE';
997
- description?: string;
998
- data?: Record<string, any>;
999
1010
  };
1000
1011
  /** @docsIgnore */
1001
1012
  type CountArrivalsApplicationErrors = {
@@ -1024,10 +1035,6 @@ type CheckEligibilityByCredentialApplicationErrors = {
1024
1035
  code?: 'ENTRANCE_NOT_FOUND';
1025
1036
  description?: string;
1026
1037
  data?: Record<string, any>;
1027
- } | {
1028
- code?: 'PRICING_PLANS_UNAVAILABLE';
1029
- description?: string;
1030
- data?: Record<string, any>;
1031
1038
  };
1032
1039
  /** @docsIgnore */
1033
1040
  type CreateArrivalByCredentialApplicationErrors = {
@@ -1054,6 +1061,10 @@ type CreateArrivalByCredentialApplicationErrors = {
1054
1061
  code?: 'PRICING_PLANS_UNAVAILABLE';
1055
1062
  description?: string;
1056
1063
  data?: Record<string, any>;
1064
+ } | {
1065
+ code?: 'CONTACTS_UNAVAILABLE';
1066
+ description?: string;
1067
+ data?: Record<string, any>;
1057
1068
  };
1058
1069
  interface CreateArrivalOptions {
1059
1070
  /**
@@ -363,6 +363,7 @@ var EntryIssue = /* @__PURE__ */ ((EntryIssue2) => {
363
363
  EntryIssue2["INTAKE_FORM_MISSING"] = "INTAKE_FORM_MISSING";
364
364
  EntryIssue2["RECENT_ENTRY"] = "RECENT_ENTRY";
365
365
  EntryIssue2["PRICING_PLANS_UNAVAILABLE"] = "PRICING_PLANS_UNAVAILABLE";
366
+ EntryIssue2["CONTACTS_UNAVAILABLE"] = "CONTACTS_UNAVAILABLE";
366
367
  return EntryIssue2;
367
368
  })(EntryIssue || {});
368
369
  var PlanBenefitType = /* @__PURE__ */ ((PlanBenefitType2) => {