@domino-sdk/relay 1.11.1 → 1.15.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.
Files changed (53) hide show
  1. package/README.md +1 -0
  2. package/build.mjs +15 -0
  3. package/dist/accounts-5ciAkCMP.d.ts +147 -0
  4. package/dist/{request-error-D_dUPLwo.d.ts → action-DBzILFx9.d.ts} +31 -1
  5. package/dist/attempt-captures-DHwIVoRP.d.ts +285 -0
  6. package/dist/authoring.d.ts +12 -10
  7. package/dist/authoring.js +6 -4
  8. package/dist/{automatic-outcomes-kPIDv6X_.d.ts → automatic-outcomes-BcEn_L46.d.ts} +1 -1
  9. package/dist/browser.d.ts +9 -9
  10. package/dist/browser.js +7 -6
  11. package/dist/capability-error-oTd3eYFH.d.ts +151 -0
  12. package/dist/chunk-2UAVZCMH.js +314 -0
  13. package/dist/{chunk-AGFUDCNM.js → chunk-3PPEXDWR.js} +1 -1
  14. package/dist/chunk-CHD6HHWG.js +485 -0
  15. package/dist/{chunk-T657WO56.js → chunk-LLMJ2SUT.js} +6 -2
  16. package/dist/chunk-NIYCAW2I.js +79 -0
  17. package/dist/{chunk-XK5E4HAS.js → chunk-PJXBW754.js} +80 -28
  18. package/dist/{chunk-PUDL4JBY.js → chunk-PUY35TH3.js} +2 -2
  19. package/dist/chunk-UJACD6K2.js +987 -0
  20. package/dist/chunk-W335CWYJ.js +53 -0
  21. package/dist/{chunk-X7ECZ3AK.js → chunk-XMBM2XD5.js} +1 -1
  22. package/dist/{chunk-2K2QBPAD.js → chunk-ZLYBUM7K.js} +6 -4
  23. package/dist/{client-fUSERMAC.d.ts → client-DFSCmf3H.d.ts} +27 -8
  24. package/dist/{activity-CNiPDPK6.d.ts → deployments-Ci6GyANg.d.ts} +15 -15
  25. package/dist/{groups-BK8ts2yK.d.ts → groups-Bi7lc54m.d.ts} +1 -1
  26. package/dist/{images-aw6W7vFZ.d.ts → images-Cb8QHGjn.d.ts} +1 -1
  27. package/dist/index.d.ts +10 -10
  28. package/dist/index.js +8 -6
  29. package/dist/{capability-error-ty3SqD_b.d.ts → integrations-Cr9EhGI_.d.ts} +1 -149
  30. package/dist/internal.d.ts +11 -4
  31. package/dist/internal.js +8 -3
  32. package/dist/{offers-C2FANzrG.d.ts → offers-Catj06u7.d.ts} +2 -2
  33. package/dist/{pages-Chb6OZSB.d.ts → pages-CpYt56Km.d.ts} +1 -1
  34. package/dist/{participant-activity-DkL3nY5a.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -0
  35. package/dist/portal-proxy.js +1 -1
  36. package/dist/react/index.d.ts +247 -179
  37. package/dist/react/index.js +954 -383
  38. package/dist/{schema-DEM8y8Fm.d.ts → schema-BaVl2VBS.d.ts} +1 -1
  39. package/dist/schema.d.ts +15 -13
  40. package/dist/schema.js +16 -14
  41. package/dist/server/index.d.ts +12 -70916
  42. package/dist/server/index.js +594 -841
  43. package/dist/{sign-in-options-iWOp9puZ.d.ts → sign-in-options-CU1ND6-y.d.ts} +2 -2
  44. package/dist/submission-input-Bi4HipqI.d.ts +146 -0
  45. package/dist/testing.d.ts +641 -0
  46. package/dist/testing.js +1282 -0
  47. package/dist/transport-0ttRwUat.d.ts +73361 -0
  48. package/package.json +6 -2
  49. package/dist/action-9Xl0StBg.d.ts +0 -33
  50. package/dist/chunk-OCXGG75K.js +0 -171
  51. package/dist/chunk-ZFABFKIY.js +0 -1295
  52. package/dist/referral-reward-kinds-M3f0PdiR.d.ts +0 -171
  53. package/dist/submission-input-BbBJTVlT.d.ts +0 -290
@@ -0,0 +1,53 @@
1
+ import {
2
+ imageComparisonSchema,
3
+ imageExtractionSchema,
4
+ imageFieldsSchema,
5
+ imageInspectionSchema,
6
+ imageSightingsSchema
7
+ } from "./chunk-ZGH6NEG6.js";
8
+ import {
9
+ photoResultSchema
10
+ } from "./chunk-46C33ASD.js";
11
+
12
+ // src/image-results.ts
13
+ import { z } from "zod";
14
+ var invalid = (message, path) => new z.ZodError([{ code: "custom", message, path, input: void 0 }]);
15
+ function parseImageExtraction(raw, value) {
16
+ const result = imageExtractionSchema.parse(value);
17
+ const fields = imageFieldsSchema.parse(raw);
18
+ for (const [key, field] of Object.entries(fields)) {
19
+ const extracted = result.values[key];
20
+ if (extracted === void 0) {
21
+ throw invalid("Image extraction omitted " + key, ["values", key]);
22
+ }
23
+ if (extracted !== null && typeof extracted !== field.type) {
24
+ throw invalid("Image extraction returned the wrong type for " + key, [
25
+ "values",
26
+ key
27
+ ]);
28
+ }
29
+ }
30
+ if (Object.keys(result.values).some((key) => !Object.hasOwn(fields, key))) {
31
+ throw invalid("Image extraction returned an undeclared field", ["values"]);
32
+ }
33
+ return result;
34
+ }
35
+ function parseImageResult(request, value) {
36
+ switch (request.operation) {
37
+ case "inspect":
38
+ return imageInspectionSchema.parse(value);
39
+ case "compare":
40
+ return imageComparisonSchema.parse(value);
41
+ case "review":
42
+ return photoResultSchema.parse(value);
43
+ case "extract":
44
+ return parseImageExtraction(request.fields, value);
45
+ case "seen":
46
+ return imageSightingsSchema.parse(value);
47
+ }
48
+ }
49
+
50
+ export {
51
+ parseImageExtraction,
52
+ parseImageResult
53
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  RelayErrorCode,
3
3
  clientError
4
- } from "./chunk-ZFABFKIY.js";
4
+ } from "./chunk-2UAVZCMH.js";
5
5
  import {
6
6
  isRequestError
7
7
  } from "./chunk-NPGENI7K.js";
@@ -24,7 +24,7 @@ import {
24
24
  questTypeVersionSchema,
25
25
  questViewSchema,
26
26
  rewardDeliveriesSchema
27
- } from "./chunk-T657WO56.js";
27
+ } from "./chunk-LLMJ2SUT.js";
28
28
  import {
29
29
  engagementArtifactSchema,
30
30
  engagementBoundaryPageSchema,
@@ -35,7 +35,6 @@ import {
35
35
  leaderboardPageSchema,
36
36
  leaderboardPlacementSchema,
37
37
  leaderboardPreviewSchema,
38
- linkedWalletSchema,
39
38
  offerArtifactSchema,
40
39
  offerDefinitionSchema,
41
40
  offerSchema,
@@ -53,11 +52,14 @@ import {
53
52
  referralArtifactSchema,
54
53
  referralDefinitionSchema,
55
54
  referralHistorySchema,
56
- referralSummarySchema,
55
+ referralSummarySchema
56
+ } from "./chunk-UJACD6K2.js";
57
+ import {
58
+ linkedWalletSchema,
57
59
  walletBalanceSchema,
58
60
  walletMessageChallengeSchema,
59
61
  walletSignInNetworksSchema
60
- } from "./chunk-ZFABFKIY.js";
62
+ } from "./chunk-2UAVZCMH.js";
61
63
  import {
62
64
  exchangeResultSchema,
63
65
  memberSummarySchema,
@@ -1,11 +1,11 @@
1
- import { aZ as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, a6 as engagementPageQuerySchema } from './groups-BK8ts2yK.js';
2
- import { j as QuestView, k as ResponseSchema, a as PageQuery, c as QuestEnrollmentInput, Q as QuestClaimInput, g as QuestOutcomeQuery, _ as questExperienceSchema, l as RewardDeliveryAction, F as contentQualificationQuerySchema } from './pages-Chb6OZSB.js';
3
- import { M as MissingPrerequisite, V as ValueEvidence, a as AuthProvider } from './submission-input-BbBJTVlT.js';
4
- import { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind } from './request-error-D_dUPLwo.js';
5
- import { f as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, h as TrackerSkipCode, c6 as submitSchema, b8 as contentPerformanceQuerySchema } from './schema-DEM8y8Fm.js';
6
- import { b as ParticipantSession, d as exchangeSchema, R as RelayEvent, P as ParticipantActivity } from './participant-activity-DkL3nY5a.js';
1
+ import { aZ as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, a6 as engagementPageQuerySchema } from './groups-Bi7lc54m.js';
2
+ import { j as QuestView, k as ResponseSchema, a as PageQuery, c as QuestEnrollmentInput, Q as QuestClaimInput, g as QuestOutcomeQuery, _ as questExperienceSchema, l as RewardDeliveryAction, F as contentQualificationQuerySchema } from './pages-CpYt56Km.js';
3
+ import { M as MissingPrerequisite, V as ValueEvidence } from './submission-input-Bi4HipqI.js';
4
+ import { a as RequestError, b as RequestErrorDetails, c as RequestErrorKind, e as createRelayAction, O as OptionalActionId } from './action-DBzILFx9.js';
5
+ import { f as QuizEvidence, A as Attempt, M as MemberProgress, a as AttemptStatus, h as TrackerSkipCode, c6 as submitSchema, b8 as contentPerformanceQuerySchema } from './schema-BaVl2VBS.js';
6
+ import { b as ParticipantSession, d as exchangeSchema, R as RelayEvent, P as ParticipantActivity } from './participant-activity-DYdUUhw2.js';
7
7
  import { z } from 'zod';
8
- import { c as createRelayAction, O as OptionalActionId } from './action-9Xl0StBg.js';
8
+ import { a as AuthProvider } from './accounts-5ciAkCMP.js';
9
9
  import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-BHMVj0kM.js';
10
10
  import { y as walletAddressInputSchema, I as walletSignatureSchema, L as LinkedWallet, f as WalletSigner } from './wallet-CDyo-U4n.js';
11
11
 
@@ -3174,6 +3174,8 @@ declare function relayClient(options: RelayClientOptions): {
3174
3174
  observe: (listener: (value: ProgressObservation<z.infer<typeof questExperienceSchema>>) => void, observeOptions?: {
3175
3175
  intervalMs?: number;
3176
3176
  maxBackoffMs?: number;
3177
+ /** The wait after a first failure, doubling up to `maxBackoffMs`. */
3178
+ retryMs?: number;
3177
3179
  }) => ProgressObserver;
3178
3180
  };
3179
3181
  campaigns: {
@@ -3392,6 +3394,7 @@ declare function relayClient(options: RelayClientOptions): {
3392
3394
  activity: {
3393
3395
  list: (query?: {
3394
3396
  cursor?: string;
3397
+ start?: "latest";
3395
3398
  limit?: number;
3396
3399
  }, options?: RelayRequestOptions) => Promise<{
3397
3400
  member: string;
@@ -3460,6 +3463,14 @@ declare function relayClient(options: RelayClientOptions): {
3460
3463
  }>;
3461
3464
  observe: (listener: (event: RelayEvent) => void, options?: {
3462
3465
  cursor?: string;
3466
+ /**
3467
+ * Where to begin without a `cursor`, including after the session changes (the cursor
3468
+ * resets then): from the first event (the default), or `latest` to receive only events
3469
+ * that happen from now on.
3470
+ */
3471
+ start?: "latest";
3472
+ /** The member's session, already read: the first poll reads the feed straight away. */
3473
+ session?: ParticipantSession;
3463
3474
  intervalMs?: number;
3464
3475
  maxBackoffMs?: number;
3465
3476
  onState?: (state: ProgressObservation<ParticipantActivity>) => void;
@@ -3473,6 +3484,8 @@ declare function relayClient(options: RelayClientOptions): {
3473
3484
  observeProgress: (listener: (value: ProgressObservation) => void, observeOptions?: {
3474
3485
  intervalMs?: number;
3475
3486
  maxBackoffMs?: number;
3487
+ /** The wait after a first failure, doubling up to `maxBackoffMs`. */
3488
+ retryMs?: number;
3476
3489
  }) => ProgressObserver;
3477
3490
  submission: {
3478
3491
  (quest: string, options?: {
@@ -3483,7 +3496,13 @@ declare function relayClient(options: RelayClientOptions): {
3483
3496
  }): Promise<PhotoSubmission>;
3484
3497
  (quest: string, options: {
3485
3498
  input: "quiz";
3486
- release?: string;
3499
+ release
3500
+ /**
3501
+ * Options every participant client method takes as its last argument.
3502
+ *
3503
+ * @compat input
3504
+ */
3505
+ ?: string;
3487
3506
  recoverPrevious?: boolean;
3488
3507
  repeatable?: boolean;
3489
3508
  }): Promise<QuizSubmission>;
@@ -1,5 +1,19 @@
1
1
  import { z } from 'zod';
2
- import { ac as OpenIdentityKind, a7 as TrackerDataSchema } from './schema-DEM8y8Fm.js';
2
+ import { O as OpenIdentityKind, a8 as TrackerDataSchema } from './schema-BaVl2VBS.js';
3
+
4
+ /** Shared with participant activity. Types remain open to future event kinds. */
5
+ declare const activityTypes: {
6
+ readonly attemptRejected: "attempt.rejected";
7
+ readonly entitlementGranted: "entitlement.granted";
8
+ readonly rewardDeliveryUpdated: "reward.delivery.updated";
9
+ readonly completionCreated: "completion.created";
10
+ readonly pointsAwarded: "points.awarded";
11
+ readonly reviewPending: "review.pending";
12
+ readonly rewardDeliveryFailed: "reward.delivery.failed";
13
+ readonly entitlementCollected: "entitlement.collected";
14
+ readonly referralQualified: "referral.qualified";
15
+ };
16
+ declare const activityTypeSchema: z.ZodString;
3
17
 
4
18
  /**
5
19
  * The canonical name of a named IANA timezone, or null for an unknown name or a fixed offset.
@@ -9126,18 +9140,4 @@ declare const rollbackDeploymentSchema: z.ZodObject<{
9126
9140
  type DeploymentPreview = z.infer<typeof deploymentPreviewSchema>;
9127
9141
  type DeploymentRecord = z.infer<typeof deploymentRecordSchema>;
9128
9142
 
9129
- /** Shared with participant activity. Types remain open to future event kinds. */
9130
- declare const activityTypes: {
9131
- readonly attemptRejected: "attempt.rejected";
9132
- readonly entitlementGranted: "entitlement.granted";
9133
- readonly rewardDeliveryUpdated: "reward.delivery.updated";
9134
- readonly completionCreated: "completion.created";
9135
- readonly pointsAwarded: "points.awarded";
9136
- readonly reviewPending: "review.pending";
9137
- readonly rewardDeliveryFailed: "reward.delivery.failed";
9138
- readonly entitlementCollected: "entitlement.collected";
9139
- readonly referralQualified: "referral.qualified";
9140
- };
9141
- declare const activityTypeSchema: z.ZodString;
9142
-
9143
9143
  export { type CalendarPeriod as C, type DeploymentPreview as D, type ProjectCalendar as P, type DeploymentRecord as a, type ProjectCalendarInput as b, activityTypeSchema as c, activityTypes as d, calendarPeriodSchema as e, canonicalTimeZone as f, deploymentActionSchema as g, deploymentPreviewSchema as h, deploymentRecordSchema as i, deploymentRejectionSchema as j, deploymentResultSchema as k, deploymentSourceSchema as l, projectCalendarInputSchema as m, projectCalendarSchema as n, projectCatalogArtifactSchema as o, projectCalendarDeclarationSchema as p, projectDeploymentSchema as q, promoteDeploymentSchema as r, publishDeploymentSchema as s, refuseStreakTimeZone as t, refuseWindowTimeZone as u, rejectDeploymentSchema as v, rollbackDeploymentSchema as w, submitDeploymentSchema as x, timeZoneNameSchema as y, timeZoneSchema as z };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { n as ResourceHandle, G as GroupHandle } from './schema-DEM8y8Fm.js';
2
+ import { n as ResourceHandle, G as GroupHandle } from './schema-BaVl2VBS.js';
3
3
 
4
4
  declare const pointLedgerPropertiesSchema: z.ZodObject<{
5
5
  name: z.ZodString;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { P as PhotoResult } from './schema-DEM8y8Fm.js';
2
+ import { P as PhotoResult } from './schema-BaVl2VBS.js';
3
3
 
4
4
  /**
5
5
  * Quest code names an image; the platform fetches, decodes and pins it. No bytes or URLs cross the
package/dist/index.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- export { R as RelayAction, c as createRelayAction } from './action-9Xl0StBg.js';
2
- export { C as ClaimSubmission, K as KnownRelayErrorCode, P as PhotoSubmission, a as ProgressObservation, b as ProgressObserver, Q as QuestActionResult, c as QuestController, d as QuestUpdatedError, e as QuizSubmission, R as RelayClient, f as RelayClientOptions, g as RelayError, h as RelayErrorCode, i as RelayErrorDetails, j as RelayErrorKind, k as RelayRequestOptions, l as RelayResponseOptions, S as SubmissionDraft, m as SubmissionStatus, n as SubmissionStore, V as ValueSubmission, o as createRelayClient, p as isRelayError } from './client-fUSERMAC.js';
3
- export { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind, c as RequestRecovery, i as isRequestError } from './request-error-D_dUPLwo.js';
4
- export { A as Attempt, a as AttemptStatus, E as Entitlement, b as EvaluatorProgress, K as KnownAttemptStatus, c as KnownTrackerSkipCode, M as MemberProgress, Q as QuestBudgetView, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, R as Reward, S as SubmissionEvidence, g as SubmitInput, T as TieredRewardReference, h as TrackerSkipCode } from './schema-DEM8y8Fm.js';
1
+ export { R as RelayAction, a as RequestError, b as RequestErrorDetails, c as RequestErrorKind, d as RequestRecovery, e as createRelayAction, i as isRequestError } from './action-DBzILFx9.js';
2
+ export { C as ClaimSubmission, K as KnownRelayErrorCode, P as PhotoSubmission, a as ProgressObservation, b as ProgressObserver, Q as QuestActionResult, c as QuestController, d as QuestUpdatedError, e as QuizSubmission, R as RelayClient, f as RelayClientOptions, g as RelayError, h as RelayErrorCode, i as RelayErrorDetails, j as RelayErrorKind, k as RelayRequestOptions, l as RelayResponseOptions, S as SubmissionDraft, m as SubmissionStatus, n as SubmissionStore, V as ValueSubmission, o as createRelayClient, p as isRelayError } from './client-DFSCmf3H.js';
3
+ export { A as Attempt, a as AttemptStatus, E as Entitlement, b as EvaluatorProgress, K as KnownAttemptStatus, c as KnownTrackerSkipCode, M as MemberProgress, Q as QuestBudgetView, d as QuestPresentation, e as QuestProfile, f as QuizEvidence, R as Reward, S as SubmissionEvidence, g as SubmitInput, T as TieredRewardReference, h as TrackerSkipCode } from './schema-BaVl2VBS.js';
5
4
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
6
- export { A as AccountConnection, a as AuthProvider, M as MissingPrerequisite, P as Prerequisite, T as TextEvidence, b as TextOptions, U as UrlEvidence, c as UrlOptions, V as ValueEvidence } from './submission-input-BbBJTVlT.js';
7
- export { E as ExchangeInput, M as MemberSummary, P as ParticipantActivity, a as ParticipantPrincipal, b as ParticipantSession, R as RelayEvent, S as Session, s as sessionMember } from './participant-activity-DkL3nY5a.js';
8
- export { P as Page, a as PageQuery, Q as QuestClaimInput, b as QuestEnrollment, c as QuestEnrollmentInput, d as QuestInteraction, e as QuestOutcome, f as QuestOutcomePage, g as QuestOutcomeQuery, h as QuestOutcomeState, i as QuestRewardView, j as QuestView, R as ResponseResult, U as UnsupportedResponse } from './pages-Chb6OZSB.js';
9
- export { A as AvailabilityWindow, C as CampaignDefinition, a as CampaignEnrollment, b as CampaignEnrollmentInput, c as CampaignView, d as CampaignWithdrawalInput, K as KnownPointEntryKind, L as LeaderboardDefinition, e as LeaderboardPage, f as LeaderboardPlacement, g as LeaderboardQuery, M as MemberCampaignEnrollmentInput, h as MemberCampaignWithdrawalInput, P as PointBalance, i as PointBalances, j as PointEntry, k as PointEntryKind, l as PointHistoryPage, m as PointHistoryQuery, n as PointLedgerReference, o as ProjectGroup, p as ProjectGroupReference, R as ReferralDefinition } from './groups-BK8ts2yK.js';
10
- export { A as AutomaticCatchUpPreview, a as AutomaticEvent, b as AutomaticOutcome, C as CollectionPass, c as CounterAchievement, d as CounterPolicy, e as CounterProgress } from './automatic-outcomes-kPIDv6X_.js';
11
- export { O as Offer, a as OfferDefinition, b as OfferPrice, R as RedeemOfferInput, c as Redemption } from './offers-C2FANzrG.js';
5
+ export { A as AccountConnection, a as AuthProvider } from './accounts-5ciAkCMP.js';
6
+ export { E as ExchangeInput, M as MemberSummary, P as ParticipantActivity, a as ParticipantPrincipal, b as ParticipantSession, R as RelayEvent, S as Session, s as sessionMember } from './participant-activity-DYdUUhw2.js';
7
+ export { P as Page, a as PageQuery, Q as QuestClaimInput, b as QuestEnrollment, c as QuestEnrollmentInput, d as QuestInteraction, e as QuestOutcome, f as QuestOutcomePage, g as QuestOutcomeQuery, h as QuestOutcomeState, i as QuestRewardView, j as QuestView, R as ResponseResult, U as UnsupportedResponse } from './pages-CpYt56Km.js';
8
+ export { A as AvailabilityWindow, C as CampaignDefinition, a as CampaignEnrollment, b as CampaignEnrollmentInput, c as CampaignView, d as CampaignWithdrawalInput, K as KnownPointEntryKind, L as LeaderboardDefinition, e as LeaderboardPage, f as LeaderboardPlacement, g as LeaderboardQuery, M as MemberCampaignEnrollmentInput, h as MemberCampaignWithdrawalInput, P as PointBalance, i as PointBalances, j as PointEntry, k as PointEntryKind, l as PointHistoryPage, m as PointHistoryQuery, n as PointLedgerReference, o as ProjectGroup, p as ProjectGroupReference, R as ReferralDefinition } from './groups-Bi7lc54m.js';
9
+ export { A as AutomaticCatchUpPreview, a as AutomaticEvent, b as AutomaticOutcome, C as CollectionPass, c as CounterAchievement, d as CounterPolicy, e as CounterProgress } from './automatic-outcomes-BcEn_L46.js';
10
+ export { O as Offer, a as OfferDefinition, b as OfferPrice, R as RedeemOfferInput, c as Redemption } from './offers-Catj06u7.js';
11
+ export { M as MissingPrerequisite, P as Prerequisite, T as TextEvidence, a as TextOptions, U as UrlEvidence, b as UrlOptions, V as ValueEvidence } from './submission-input-Bi4HipqI.js';
12
12
  export { A as AvatarProvider, O as OwnProfile, P as ProfileAvatar, a as ProfileCompletion, b as ProfileCompletionPage, c as ProfileCompletionQuery, d as ProfileReferral, e as ProfileSummary, f as ProfileUpdate, g as ProfileVisibility } from './profiles-BHMVj0kM.js';
13
13
  export { Q as QuizContent, S as StreakProgress } from './streaks-CWyq8Px5.js';
14
14
  export { C as CosmosChain, a as CosmosNetwork, L as LinkedWallet, W as WalletAddressInput, b as WalletChain, c as WalletMessageChallenge, d as WalletSignInNetwork, e as WalletSignature, f as WalletSigner, g as WalletUnlinkInput } from './wallet-CDyo-U4n.js';
package/dist/index.js CHANGED
@@ -5,25 +5,27 @@ import {
5
5
  import {
6
6
  QuestUpdatedError,
7
7
  createRelayClient
8
- } from "./chunk-XK5E4HAS.js";
8
+ } from "./chunk-PJXBW754.js";
9
9
  import {
10
10
  createRelayAction
11
- } from "./chunk-X7ECZ3AK.js";
11
+ } from "./chunk-XMBM2XD5.js";
12
12
  import {
13
13
  QuestOutcomeState
14
- } from "./chunk-T657WO56.js";
14
+ } from "./chunk-LLMJ2SUT.js";
15
+ import {
16
+ PointEntryKind
17
+ } from "./chunk-UJACD6K2.js";
15
18
  import {
16
- PointEntryKind,
17
19
  RelayError,
18
20
  RelayErrorCode,
19
21
  isRelayError
20
- } from "./chunk-ZFABFKIY.js";
22
+ } from "./chunk-2UAVZCMH.js";
21
23
  import "./chunk-6QJ3LADK.js";
22
24
  import {
23
25
  RequestError,
24
26
  isRequestError
25
27
  } from "./chunk-NPGENI7K.js";
26
- import "./chunk-AGFUDCNM.js";
28
+ import "./chunk-3PPEXDWR.js";
27
29
  import {
28
30
  sessionMember
29
31
  } from "./chunk-PT5STHFH.js";
@@ -218,86 +218,6 @@ declare function parseSettings(fields: Record<string, SettingField>, input: unkn
218
218
  declare function missingResourceSettings(fields: Record<string, SettingField>, values: SettingsValues): string[];
219
219
  declare function compatibleSettingKinds(previous: SettingField, next: SettingField): boolean;
220
220
 
221
- declare const xIdSchema: z.ZodString;
222
- declare const xConnectionSchema: z.ZodObject<{
223
- userId: z.ZodString;
224
- }, z.core.$strip>;
225
- declare const xProfileSchema: z.ZodObject<{
226
- id: z.ZodString;
227
- username: z.ZodString;
228
- name: z.ZodString;
229
- bio: z.ZodNullable<z.ZodString>;
230
- profileImageUrl: z.ZodNullable<z.ZodString>;
231
- followersCount: z.ZodNullable<z.ZodNumber>;
232
- verified: z.ZodNullable<z.ZodBoolean>;
233
- }, z.core.$strip>;
234
- declare const xPostSchema: z.ZodObject<{
235
- id: z.ZodString;
236
- userId: z.ZodString;
237
- content: z.ZodString;
238
- createdAt: z.ZodISODateTime;
239
- author: z.ZodObject<{
240
- id: z.ZodString;
241
- username: z.ZodString;
242
- name: z.ZodString;
243
- verified: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
244
- }, z.core.$loose>;
245
- likeCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
246
- replyCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
247
- retweetCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
248
- quoteCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
249
- viewCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
250
- bookmarkCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
251
- isReply: z.ZodBoolean;
252
- isRetweet: z.ZodBoolean;
253
- isQuoteTweet: z.ZodBoolean;
254
- quotedTweetId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
255
- inReplyToUserId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
256
- inReplyToStatusId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
257
- retweetedTweetId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string | null, string | null | undefined>>;
258
- media: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
259
- type: string;
260
- url: string;
261
- }[], unknown>>;
262
- }, z.core.$loose>;
263
- declare const xRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
264
- operation: z.ZodLiteral<"connection">;
265
- }, z.core.$strict>, z.ZodObject<{
266
- operation: z.ZodLiteral<"profile">;
267
- }, z.core.$strict>, z.ZodObject<{
268
- operation: z.ZodLiteral<"post">;
269
- postId: z.ZodString;
270
- }, z.core.$strict>, z.ZodObject<{
271
- operation: z.ZodLiteral<"follows">;
272
- userId: z.ZodString;
273
- }, z.core.$strict>, z.ZodObject<{
274
- operation: z.ZodLiteral<"reposted">;
275
- postId: z.ZodString;
276
- }, z.core.$strict>], "operation">;
277
- type XConnection = z.infer<typeof xConnectionSchema>;
278
- type XProfile = z.infer<typeof xProfileSchema>;
279
- type XPost = z.infer<typeof xPostSchema>;
280
- /**
281
- * Reads the member's linked X account and public X data. The account is pinned at the attempt's
282
- * first X read: later links and unlinks do not change the attempt. `connection()`, `profile()`,
283
- * `follows()` and `reposted()` resolve to `null` when the member has no linked X account;
284
- * `post()` reads any public post and resolves to `null` when it does not exist. Provider failures
285
- * throw `CapabilityError` with code `"provider-unavailable"`.
286
- */
287
- interface XReader {
288
- connection(): Promise<XConnection | null>;
289
- profile(): Promise<XProfile | null>;
290
- post(input: {
291
- postId: string;
292
- }): Promise<XPost | null>;
293
- follows(input: {
294
- userId: string;
295
- }): Promise<boolean | null>;
296
- reposted(input: {
297
- postId: string;
298
- }): Promise<boolean | null>;
299
- }
300
-
301
221
  declare const completionPolicySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
302
222
  kind: z.ZodLiteral<"streak">;
303
223
  days: z.ZodNumber;
@@ -389,72 +309,4 @@ declare const projectIntegrationSchema: z.ZodObject<{
389
309
  }, z.core.$strip>;
390
310
  type ProjectIntegration = z.infer<typeof projectIntegrationSchema>;
391
311
 
392
- /**
393
- * Why an evaluator capability could not answer:
394
- *
395
- * - `not-linked`: the call needs a member account that is not linked, and its result cannot be
396
- * null, such as an image check of the member's X profile picture. Readers of the member's own
397
- * accounts return `null` instead.
398
- * - `provider-unavailable`: the provider (X, Discord, a chain RPC, AI review) did not answer, or
399
- * the project's integration cannot reach it.
400
- * - `author-error`: the call cannot be answered as written: invalid input, an undeclared
401
- * integration, an unknown tracker, a chain Relay does not read, a wallet the member never
402
- * linked, or an image that does not exist.
403
- *
404
- * Later versions can add codes. Treat an unknown code as a failure its `message` explains.
405
- */
406
- declare const capabilityErrorCodes: readonly ["not-linked", "provider-unavailable", "author-error"];
407
- /** @compat open */
408
- type KnownCapabilityErrorCode = (typeof capabilityErrorCodes)[number];
409
- /** A known code, or one a newer Relay added. */
410
- type CapabilityErrorCode = KnownCapabilityErrorCode | (string & {});
411
- /**
412
- * A capability failure as it crosses the sandbox boundary and as Relay captures it. Open, so a
413
- * newer Relay can add codes and fields without breaking an older evaluator or Worker.
414
- */
415
- declare const capabilityFailureSchema: z.ZodObject<{
416
- code: z.ZodString;
417
- message: z.ZodString;
418
- /**
419
- * True when Relay retries the attempt if the error reaches it uncaught, and calls the provider
420
- * again. A failure that is not retryable is captured (or follows from the attempt's pinned
421
- * inputs), so every run of the attempt sees it again. A retryable failure that quest code
422
- * handles and moves past is final for the attempt; one that escapes the evaluation is retried.
423
- */
424
- retryable: z.ZodBoolean;
425
- }, z.core.$loose>;
426
- type CapabilityFailure = z.infer<typeof capabilityFailureSchema>;
427
- /**
428
- * Thrown by an evaluator capability (`ctx.x`, `ctx.discord`, `ctx.wallet`, `ctx.trackers`,
429
- * `ctx.images`, `ctx.review`) that could not answer. A capability whose subject is missing (an
430
- * account the member has not linked, a deleted post or message) returns `null` instead of
431
- * throwing.
432
- *
433
- * Catch it to decide yourself; rethrow anything else. An uncaught retryable error makes Relay
434
- * retry the attempt later; an uncaught one that is not retryable fails it.
435
- *
436
- * ```ts
437
- * try {
438
- * return (await ctx.x.follows({ userId })) ? decision.accept() : decision.reject({ reason })
439
- * } catch (error) {
440
- * if (error instanceof CapabilityError && error.code === "provider-unavailable")
441
- * return decision.review({ reason: "X is unavailable" })
442
- * throw error
443
- * }
444
- * ```
445
- */
446
- declare class CapabilityError extends Error {
447
- readonly code: CapabilityErrorCode;
448
- readonly retryable: boolean;
449
- constructor(code: CapabilityErrorCode, message: string, options?: {
450
- retryable?: boolean;
451
- });
452
- static [Symbol.hasInstance](value: unknown): boolean;
453
- /**
454
- * The error for a captured or transported failure. A code this SDK does not know is never
455
- * retryable: nothing tells it a retry would help.
456
- */
457
- static from(failure: CapabilityFailure): CapabilityError;
458
- }
459
-
460
- export { settingsFieldsSchema as A, type Budget as B, CapabilityError as C, settingsValuesSchema as D, type EvaluatorIntegrationProvider as E, xConnectionSchema as F, xIdSchema as G, xPostSchema as H, type IntegrationModule as I, xProfileSchema as J, type KnownCapabilityErrorCode as K, xRequestSchema as L, type ProjectIntegration as P, type ResourceSource as R, type Setting as S, type XReader as X, type IntegerSettings as a, type CapabilityErrorCode as b, capabilityErrorCodes as c, type CapabilityFailure as d, type IntegrationProvider as e, type ResourceOption as f, type SettingField as g, type SettingsValues as h, type XConnection as i, type XPost as j, type XProfile as k, budgetSchema as l, capabilityFailureSchema as m, compatibleSettingKinds as n, completionKeySchema as o, completionPolicySchema as p, discordServerSchema as q, evaluatorIntegrationProviderSchema as r, integrationProviderSchema as s, missingResourceSettings as t, parseSettings as u, projectIntegrationSchema as v, resourceOptionsSchema as w, resourceRequestSchema as x, resourceSourceSchema as y, settingFieldSchema as z };
312
+ export { type Budget as B, type EvaluatorIntegrationProvider as E, type IntegrationModule as I, type ProjectIntegration as P, type ResourceSource as R, type Setting as S, type IntegerSettings as a, type IntegrationProvider as b, type ResourceOption as c, type SettingField as d, type SettingsValues as e, budgetSchema as f, compatibleSettingKinds as g, completionKeySchema as h, completionPolicySchema as i, discordServerSchema as j, evaluatorIntegrationProviderSchema as k, integrationProviderSchema as l, missingResourceSettings as m, projectIntegrationSchema as n, resourceRequestSchema as o, parseSettings as p, resourceSourceSchema as q, resourceOptionsSchema as r, settingFieldSchema as s, settingsFieldsSchema as t, settingsValuesSchema as u };
@@ -1,8 +1,15 @@
1
- export { I as IdentityKindClaim, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, m as sourceRoles, v as validateQuestShape } from './referral-reward-kinds-M3f0PdiR.js';
2
- export { E as Extracted } from './images-aw6W7vFZ.js';
3
- import { b as RequestErrorKind } from './request-error-D_dUPLwo.js';
4
- export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-DEM8y8Fm.js';
1
+ export { I as IdentityKindClaim, M as ManagementTransportOptions, P as ParticipantRoute, R as REFERRAL_INTEGRATION_REWARD_ERROR, c as containsReferralIntegrationReward, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, d as identityKindClaimSchema, e as isIntegrationParticipantPath, f as isParticipantRoute, m as managementTransport, p as parseImageExtraction, g as parseImageResult, h as participantExchangeSchema, j as participantRoutePattern, k as participantRoutes, q as questConfiguration, s as sequenceCursorSchema, l as sourceDataSchema, n as sourceRoles, v as validateQuestShape } from './transport-0ttRwUat.js';
2
+ export { E as Extracted } from './images-Cb8QHGjn.js';
3
+ import { c as RequestErrorKind } from './action-DBzILFx9.js';
4
+ export { i as TrackerDataBudget, s as schemaCheckedReader, t as trackerDataBatchSteps, j as trackerDataIssue, k as trackerDataIssues, l as trackerDataPathTypes, m as trackerDataRecordSteps, w as whereSchemaIssue } from './schema-BaVl2VBS.js';
5
5
  import 'zod';
6
+ import './pages-CpYt56Km.js';
7
+ import './groups-Bi7lc54m.js';
8
+ import './profiles-BHMVj0kM.js';
9
+ import './automatic-outcomes-BcEn_L46.js';
10
+ import './offers-Catj06u7.js';
11
+ import './attempt-captures-DHwIVoRP.js';
12
+ import './deployments-Ci6GyANg.js';
6
13
 
7
14
  /** The management client's and the CLI's default deadline per call. */
8
15
  declare const MANAGEMENT_TIMEOUT = 30000;
package/dist/internal.js CHANGED
@@ -5,12 +5,15 @@ import {
5
5
  identityIntegrationSchema,
6
6
  identityIntegrationSecretSchema,
7
7
  identityKindClaimSchema,
8
- parseImageExtraction,
9
- parseImageResult,
8
+ managementTransport,
10
9
  participantExchangeSchema,
11
10
  questConfiguration,
12
11
  sequenceCursorSchema
13
- } from "./chunk-OCXGG75K.js";
12
+ } from "./chunk-CHD6HHWG.js";
13
+ import {
14
+ parseImageExtraction,
15
+ parseImageResult
16
+ } from "./chunk-W335CWYJ.js";
14
17
  import "./chunk-ZGH6NEG6.js";
15
18
  import {
16
19
  sourceDataSchema,
@@ -30,6 +33,7 @@ import {
30
33
  retrying
31
34
  } from "./chunk-6QJ3LADK.js";
32
35
  import "./chunk-NPGENI7K.js";
36
+ import "./chunk-3PPEXDWR.js";
33
37
  import "./chunk-PT5STHFH.js";
34
38
  import {
35
39
  schemaCheckedReader,
@@ -51,6 +55,7 @@ export {
51
55
  isIntegrationParticipantPath,
52
56
  isParticipantRoute,
53
57
  lifetime,
58
+ managementTransport,
54
59
  parseImageExtraction,
55
60
  parseImageResult,
56
61
  participantExchangeSchema,
@@ -1,5 +1,5 @@
1
- import { n as ResourceHandle } from './schema-DEM8y8Fm.js';
2
- import { q as AuthoringIdentity } from './groups-BK8ts2yK.js';
1
+ import { n as ResourceHandle } from './schema-BaVl2VBS.js';
2
+ import { q as AuthoringIdentity } from './groups-Bi7lc54m.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const offerPriceSchema: z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { a as AttemptStatus, bL as questDescriptionSchema, h as TrackerSkipCode } from './schema-DEM8y8Fm.js';
2
+ import { a as AttemptStatus, bL as questDescriptionSchema, h as TrackerSkipCode } from './schema-BaVl2VBS.js';
3
3
 
4
4
  /**
5
5
  * The delivery actions this SDK knows. `RewardDelivery.action` is an open string: Relay can add
@@ -264,6 +264,7 @@ declare const relayEventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.
264
264
  }>>]>;
265
265
  declare const participantActivityQuerySchema: z.ZodObject<{
266
266
  cursor: z.ZodOptional<z.ZodString>;
267
+ start: z.ZodOptional<z.ZodLiteral<"latest">>;
267
268
  limit: z.ZodDefault<z.ZodNumber>;
268
269
  }, z.core.$strict>;
269
270
  declare const participantActivitySchema: z.ZodObject<{
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-AXRMT33W.js";
4
4
  import {
5
5
  clientIdentity
6
- } from "./chunk-AGFUDCNM.js";
6
+ } from "./chunk-3PPEXDWR.js";
7
7
  import {
8
8
  exchangeResultSchema
9
9
  } from "./chunk-PT5STHFH.js";