@spoketech/hub-client 0.1.29 → 0.2.0
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 +53 -1
- package/dist/index.d.ts +1472 -159
- package/dist/index.js +1934 -1642
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -326,9 +326,33 @@ All routes below are relative to `/api/v1`. The promise client and the Effect cl
|
|
|
326
326
|
| `client.vouchers.getOrganizationVoucherProvider({ params })` | `GET /organizations/:organizationId/voucher-provider` | `params.organizationId` | `OrganizationVoucherProvider \| null` |
|
|
327
327
|
| `client.vouchers.upsertOrganizationVoucherProvider({ params, payload })` | `PUT /organizations/:organizationId/voucher-provider` | `params.organizationId`, `UpsertOrganizationVoucherProviderInput` | `OrganizationVoucherProvider` |
|
|
328
328
|
| `client.vouchers.requestVoucherIssue({ params, payload })` | `POST /organizations/:organizationId/vouchers/issue` | `params.organizationId`, `RequestVoucherIssueInput` | `OrganizationVoucherCommand` |
|
|
329
|
+
| `client.vouchers.listOrganizationVoucherCommands({ params, query })` | `GET /organizations/:organizationId/voucher-commands` | `params.organizationId`, optional `query.page`, `query.pageSize` | `PaginatedOrganizationVoucherCommands` |
|
|
330
|
+
| `client.vouchers.retryVoucherCommand({ params, payload })` | `POST /organizations/:organizationId/voucher-commands/:commandId/retry` | `params.organizationId`, `params.commandId`, `{ confirmedDuplicateRisk: true }` | `OrganizationVoucherCommand` |
|
|
329
331
|
| `client.vouchers.pollOnsiteVoucherCommand({ params })` | `POST /organizations/:organizationId/onsite-voucher-commands/poll` | `params.organizationId` | `OnsiteVoucherCommand \| null` |
|
|
330
332
|
| `client.vouchers.completeOnsiteVoucherCommand({ params, payload })` | `POST /organizations/:organizationId/onsite-voucher-commands/:commandId/complete` | `params.organizationId`, `params.commandId`, `CompleteOnsiteVoucherCommandInput` | `OrganizationVoucherCommand` |
|
|
331
333
|
|
|
334
|
+
History requires `vouchers:read`; retry requires `vouchers:write` and organization access.
|
|
335
|
+
Failed commands and accepted commands without completion for at least 15 minutes can be retried.
|
|
336
|
+
`accepted` means dispatched, not confirmed onsite receipt. Older accepted commands are held for
|
|
337
|
+
manual recovery instead of being automatically delivered again. Late completion is still accepted
|
|
338
|
+
until recovery retires the original request.
|
|
339
|
+
A retry queues a new command for agent polling, preserves the original command, and links both
|
|
340
|
+
through `payload.retryOfCommandId` / `payload.retryCommandId`. Recovering an accepted command
|
|
341
|
+
marks the original failed with an explicit unknown-outcome message so it cannot remain eligible
|
|
342
|
+
for delivery alongside its retry.
|
|
343
|
+
Submitting the same retry again returns the existing retry; if that attempt fails, retry its ID.
|
|
344
|
+
Successful retries and recoveries send `voucher.created` with the original request ID in both
|
|
345
|
+
`voucher.commandId` and `command.id`, so an external job can match the ID returned by its initial
|
|
346
|
+
request. This remains the original ID across multiple retries. `voucher.attemptCommandId` identifies
|
|
347
|
+
the attempt that completed, while the result and preserved caller metadata describe that completion.
|
|
348
|
+
Command reads and history retain their separate attempt IDs. New retries persist
|
|
349
|
+
`payload.originalCommandId`; existing retry chains are traced back through their stored history,
|
|
350
|
+
including soft-deleted ancestors. Normal completions retain their existing webhook IDs and shape.
|
|
351
|
+
SENPOS may already have issued a voucher despite a failed response. Check the member's vouchers
|
|
352
|
+
before confirming a retry to avoid duplicates.
|
|
353
|
+
For bootstrapped installations, MQTT, polling and completion use the onsite agent ID consistently;
|
|
354
|
+
existing service-client ownership for the same installation is also recognized.
|
|
355
|
+
|
|
332
356
|
### POS Points
|
|
333
357
|
|
|
334
358
|
| Client method | Route | Request | Returns |
|
|
@@ -545,9 +569,37 @@ Do not treat an unsettled/timed-out response as completed registration; follow t
|
|
|
545
569
|
existing command to completion. The workflow records `gaming_permissions_pending_retry`
|
|
546
570
|
when permission verification is incomplete.
|
|
547
571
|
|
|
548
|
-
|
|
572
|
+
New Odyssey members default to `isGamingEnabled: false` when that flag is omitted,
|
|
573
|
+
including when other gaming permissions are supplied. Explicit `true` enables
|
|
574
|
+
gaming. The onsite agent applies and verifies this default after creation; deploying
|
|
575
|
+
the updated agent is required for physical venues. Demo creation uses the same default.
|
|
576
|
+
Existing active matches
|
|
549
577
|
retain Ensure Active Membership's existing no-mutation behaviour; use
|
|
550
578
|
`onsite.members.update` to change those members. Renewal-required matches apply
|
|
551
579
|
requested permissions as part of profile preparation before renewal. Demo creation
|
|
552
580
|
supports the same object. Nexus creation and the permission update remain separate
|
|
553
581
|
calls, not an atomic operation.
|
|
582
|
+
|
|
583
|
+
## Display-only offer catalogue (0.2.0)
|
|
584
|
+
|
|
585
|
+
Use `client.offers.catalogue.list({ organizationId })` or
|
|
586
|
+
`client.offers.catalogue.get({ organizationId, offerId })` with an
|
|
587
|
+
organization-bound `offers:read` service credential. Only currently active offers
|
|
588
|
+
are returned; hidden, expired and foreign IDs return 404. The returned `CatalogueOffer`
|
|
589
|
+
is a definition, with no eligibility, claim or payout capability.
|
|
590
|
+
|
|
591
|
+
Version 0.2.0 replaces the old constant `fulfilmentKind` with a typed `benefit`:
|
|
592
|
+
physical item (`itemName`, `quantity`), points (`pointTypeId`, `amount`), or SenPOS
|
|
593
|
+
voucher (`rewardId`, `quantity`, nullable `faceValue` in cents/currency). Create and
|
|
594
|
+
update require a full valid benefit. Existing unconfigured management records have
|
|
595
|
+
`benefit: null` and are excluded from the app catalogue. Catalogue voucher benefits
|
|
596
|
+
omit the internal provider and reward/template reference. All kinds remain display-only.
|
|
597
|
+
|
|
598
|
+
Management uses `client.offers.list/get/create/update` and `offers:manage`.
|
|
599
|
+
Create produces a draft; update supplies the full editable definition, desired
|
|
600
|
+
status and `expectedUpdatedAt` from the previous management read. Retired offers
|
|
601
|
+
cannot be edited. All Promise methods return `[data, error]` tuples.
|
|
602
|
+
|
|
603
|
+
The generated equivalents are under `hubClient.offers`. See the repository's
|
|
604
|
+
[`docs/offers-catalogue.md`](../../docs/offers-catalogue.md) for exact contracts,
|
|
605
|
+
a create → activate → fetch example and Venue App gateway/CMS integration.
|