@domino-sdk/relay 1.0.0-next.8 → 1.0.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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/activity-DeKJsRry.d.ts +9112 -0
  3. package/dist/authoring.d.ts +1135 -285
  4. package/dist/authoring.js +545 -269
  5. package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser-DFe7sWSN.d.ts +4154 -0
  8. package/dist/browser.d.ts +11 -2528
  9. package/dist/browser.js +8 -6
  10. package/dist/capability-error-DNMwKmlL.d.ts +458 -0
  11. package/dist/{chunk-V7EZUZ3Z.js → chunk-36HTX2BM.js} +389 -169
  12. package/dist/chunk-6QJ3LADK.js +112 -0
  13. package/dist/{chunk-77H7APVD.js → chunk-BGGKNIRP.js} +1 -1
  14. package/dist/chunk-EYH5RDIE.js +496 -0
  15. package/dist/chunk-GQKYAQM6.js +84 -0
  16. package/dist/chunk-GUP7YRR4.js +42 -0
  17. package/dist/{chunk-V5R2DMGY.js → chunk-GZ6FJAXN.js} +380 -128
  18. package/dist/chunk-JON5SESL.js +2986 -0
  19. package/dist/chunk-MC6V6VMG.js +49 -0
  20. package/dist/chunk-NPGENI7K.js +37 -0
  21. package/dist/chunk-VFHHLN6A.js +284 -0
  22. package/dist/chunk-WJSSJ7AF.js +151 -0
  23. package/dist/{chunk-QBOHLT7M.js → chunk-XFMSUPNS.js} +1 -1
  24. package/dist/{chunk-6A6K5RUD.js → chunk-ZVIRG24J.js} +145 -42
  25. package/dist/{client-CK4nwt7V.d.ts → client-XiuFnug_.d.ts} +2193 -562
  26. package/dist/{submission-input-C9qm9ixd.d.ts → groups-Ck-OxzjD.d.ts} +919 -1142
  27. package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
  28. package/dist/{images--vZ9U0kr.d.ts → images-Dv-P5VBw.d.ts} +2 -2
  29. package/dist/index.d.ts +13 -9
  30. package/dist/index.js +17 -6
  31. package/dist/internal.d.ts +82 -43
  32. package/dist/internal.js +58 -90
  33. package/dist/offers-Cy-e4o5x.d.ts +431 -0
  34. package/dist/{pages-BzqJuI69.d.ts → outcomes-kVB-Juzs.d.ts} +2386 -1490
  35. package/dist/pages-BBYD21IE.d.ts +359 -0
  36. package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
  37. package/dist/portal-proxy.js +22 -4
  38. package/dist/{profiles-DDMFBRKe.d.ts → profiles-D2aFcOxu.d.ts} +15 -15
  39. package/dist/react/index.d.ts +3122 -1011
  40. package/dist/react/index.js +1627 -779
  41. package/dist/request-error-DWduJCGV.d.ts +62 -0
  42. package/dist/schema-DfJzH2ci.d.ts +5644 -0
  43. package/dist/schema.d.ts +15 -4216
  44. package/dist/schema.js +322 -81
  45. package/dist/server/index.d.ts +81498 -0
  46. package/dist/server/index.js +2520 -0
  47. package/dist/{streaks-CwGReWGt.d.ts → streaks-CWyq8Px5.d.ts} +2 -4
  48. package/dist/submission-input-BZkm6ohU.d.ts +290 -0
  49. package/dist/vite.d.ts +1 -1
  50. package/dist/vite.js +1 -0
  51. package/dist/{wallet-BGOfFkG9.d.ts → wallet-YssWxGg8.d.ts} +35 -38
  52. package/package.json +8 -2
  53. package/dist/chunk-MRIURJE3.js +0 -257
  54. package/dist/chunk-VARGF4JS.js +0 -1733
  55. package/dist/chunk-ZWY3R6B3.js +0 -26
  56. package/dist/collection-BGneJ6Bk.d.ts +0 -114
  57. package/dist/integrations-C3Sp558f.d.ts +0 -1297
  58. package/dist/point-ledgers-iS00Z_v0.d.ts +0 -37
  59. package/dist/schema-pnuWqvGn.d.ts +0 -3396
@@ -0,0 +1,58 @@
1
+ import { O as OpenIdentityKind } from './schema-DfJzH2ci.js';
2
+ import { z } from 'zod';
3
+
4
+ declare const identityIntegrationInputSchema: z.ZodObject<{
5
+ name: z.ZodString;
6
+ origin: z.ZodString;
7
+ identityKind: z.ZodOptional<z.ZodTemplateLiteral<`app:${string}`>>;
8
+ adoptIdentitiesFrom: z.ZodOptional<z.ZodString>;
9
+ reason: z.ZodOptional<z.ZodString>;
10
+ }, z.core.$strict>;
11
+ /** An integration as responses return it: fields a newer Relay adds are ignored. */
12
+ declare const identityIntegrationSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ name: z.ZodString;
15
+ origin: z.ZodString;
16
+ expiresAt: z.ZodNumber;
17
+ identityKind: z.ZodDefault<z.ZodNullable<z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>>>;
18
+ organization: z.ZodString;
19
+ project: z.ZodString;
20
+ environment: z.ZodEnum<{
21
+ test: "test";
22
+ live: "live";
23
+ }>;
24
+ }, z.core.$strip>;
25
+ declare const identityIntegrationSecretSchema: z.ZodObject<{
26
+ id: z.ZodString;
27
+ name: z.ZodString;
28
+ origin: z.ZodString;
29
+ expiresAt: z.ZodNumber;
30
+ identityKind: z.ZodDefault<z.ZodNullable<z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>>>;
31
+ organization: z.ZodString;
32
+ project: z.ZodString;
33
+ environment: z.ZodEnum<{
34
+ test: "test";
35
+ live: "live";
36
+ }>;
37
+ token: z.ZodString;
38
+ }, z.core.$strip>;
39
+ /**
40
+ * An `app:<name>` kind claimed in the project and environment, and the integration that owns its
41
+ * identities: the live one, or the disconnected one a new integration would adopt them from.
42
+ */
43
+ declare const identityKindClaimSchema: z.ZodObject<{
44
+ kind: z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>;
45
+ integration: z.ZodString;
46
+ integrationName: z.ZodString;
47
+ connected: z.ZodBoolean;
48
+ linked: z.ZodNumber;
49
+ unlinked: z.ZodNumber;
50
+ claimedAt: z.ZodNumber;
51
+ }, z.core.$strip>;
52
+ type IdentityKindClaim = z.infer<typeof identityKindClaimSchema>;
53
+ declare const participantExchangeSchema: z.ZodObject<{
54
+ subject: z.ZodString;
55
+ previousToken: z.ZodOptional<z.ZodString>;
56
+ }, z.core.$strict>;
57
+
58
+ export { type IdentityKindClaim as I, identityIntegrationSchema as a, identityIntegrationSecretSchema as b, identityKindClaimSchema as c, identityIntegrationInputSchema as i, participantExchangeSchema as p };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { P as PhotoResult } from './schema-pnuWqvGn.js';
2
+ import { P as PhotoResult } from './schema-DfJzH2ci.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
@@ -231,4 +231,4 @@ interface ImageReader {
231
231
  }): Promise<ImageSightings>;
232
232
  }
233
233
 
234
- export { type ImageReader as I, type PublishedImage as P, type ImageAssetArtifact as a, type ImageComparison as b, type ImageExtraction as c, type ImageFields as d, type ImageInspection as e, type ImageReference as f, type ImageRequest as g, type ImageSightings as h, imageAssetArtifactSchema as i, imageComparisonSchema as j, imageExtractionSchema as k, imageFieldSchema as l, imageFieldsSchema as m, imageInspectionSchema as n, imageReferenceSchema as o, imageRequestSchema as p, imageSightingsSchema as q, imageUploadRequestSchema as r, imageUploadsSchema as s, publishedImageSchema as t };
234
+ export { type Extracted as E, type ImageAssetArtifact as I, type PublishedImage as P, type ImageComparison as a, type ImageExtraction as b, type ImageFields as c, type ImageInspection as d, type ImageReader as e, type ImageReference as f, type ImageRequest as g, type ImageSightings as h, imageAssetArtifactSchema as i, imageComparisonSchema as j, imageExtractionSchema as k, imageFieldSchema as l, imageFieldsSchema as m, imageInspectionSchema as n, imageReferenceSchema as o, imageRequestSchema as p, imageSightingsSchema as q, imageUploadRequestSchema as r, imageUploadsSchema as s, publishedImageSchema as t };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,15 @@
1
- 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 RequestError, m as RequestErrorDetails, n as RequestErrorKind, o as RequestRecovery, S as SubmissionDraft, p as SubmissionStatus, q as SubmissionStore, V as ValueSubmission, r as createRelayClient, s as isRelayError, t as isRequestError } from './client-CK4nwt7V.js';
1
+ 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, S as SubmissionDraft, l as SubmissionStatus, m as SubmissionStore, V as ValueSubmission, n as createRelayClient, o as isRelayError } from './client-XiuFnug_.js';
2
+ export { R as RequestError, a as RequestErrorDetails, b as RequestErrorKind, c as RequestRecovery, i as isRequestError } from './request-error-DWduJCGV.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-DfJzH2ci.js';
2
4
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
3
- export { A as AccountConnection, a as AuthProvider, L as LeaderboardDefinition, b as LeaderboardPage, c as LeaderboardPlacement, d as LeaderboardQuery, R as ReferralDefinition, T as TextEvidence, e as TextOptions, U as UrlEvidence, f as UrlOptions, V as ValueEvidence } from './submission-input-C9qm9ixd.js';
4
- export { E as ExchangeInput, M as MemberSummary, P as Page, a as PageQuery, b as ParticipantPrincipal, c as ParticipantSession, Q as QuestInteraction, d as QuestRewardView, e as QuestView, S as Session, s as sessionMember } from './pages-BzqJuI69.js';
5
- export { C as CollectionPass } from './collection-BGneJ6Bk.js';
6
- export { P as PointLedgerReference } from './point-ledgers-iS00Z_v0.js';
7
- 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-DDMFBRKe.js';
8
- export { Q as QuizContent, S as StreakProgress } from './streaks-CwGReWGt.js';
9
- export { A as Attempt, E as Entitlement, M as MemberProgress, Q as QuestPresentation, a as QuestProfile, b as QuizEvidence, R as Reward, S as SubmissionEvidence, c as SubmitInput, T as TieredRewardReference } from './schema-pnuWqvGn.js';
10
- 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-BGOfFkG9.js';
5
+ 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-BZkm6ohU.js';
6
+ export { E as ExchangeInput, M as MemberSummary, P as Page, a as PageQuery, b as ParticipantActivity, c as ParticipantPrincipal, d as ParticipantSession, R as RelayEvent, S as Session, s as sessionMember } from './pages-BBYD21IE.js';
7
+ export { Q as QuestClaimInput, a as QuestEnrollment, b as QuestEnrollmentInput, c as QuestInteraction, d as QuestOutcome, e as QuestOutcomePage, f as QuestOutcomeQuery, g as QuestOutcomeState, h as QuestRewardView, i as QuestView } from './outcomes-kVB-Juzs.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-Ck-OxzjD.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-B1xrETxm.js';
10
+ export { O as Offer, a as OfferDefinition, b as OfferPrice, R as RedeemOfferInput, c as Redemption } from './offers-Cy-e4o5x.js';
11
+ 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-D2aFcOxu.js';
12
+ export { Q as QuizContent, S as StreakProgress } from './streaks-CWyq8Px5.js';
13
+ 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-YssWxGg8.js';
14
+ export { P as ParticipantDelivery } from './participant-rewards-3duLb8YJ.js';
11
15
  import 'zod';
package/dist/index.js CHANGED
@@ -5,20 +5,31 @@ import {
5
5
  import {
6
6
  QuestUpdatedError,
7
7
  createRelayClient
8
- } from "./chunk-V5R2DMGY.js";
9
- import "./chunk-MRIURJE3.js";
8
+ } from "./chunk-GZ6FJAXN.js";
10
9
  import {
10
+ QuestOutcomeState
11
+ } from "./chunk-EYH5RDIE.js";
12
+ import {
13
+ PointEntryKind,
11
14
  RelayError,
12
15
  RelayErrorCode,
16
+ isRelayError
17
+ } from "./chunk-36HTX2BM.js";
18
+ import "./chunk-6QJ3LADK.js";
19
+ import {
13
20
  RequestError,
14
- isRelayError,
15
21
  isRequestError
16
- } from "./chunk-V7EZUZ3Z.js";
22
+ } from "./chunk-NPGENI7K.js";
17
23
  import {
18
24
  sessionMember
19
- } from "./chunk-QBOHLT7M.js";
20
- import "./chunk-VARGF4JS.js";
25
+ } from "./chunk-XFMSUPNS.js";
26
+ import {
27
+ AttemptStatus
28
+ } from "./chunk-JON5SESL.js";
21
29
  export {
30
+ AttemptStatus,
31
+ PointEntryKind,
32
+ QuestOutcomeState,
22
33
  QuestUpdatedError,
23
34
  RelayError,
24
35
  RelayErrorCode,
@@ -1,6 +1,10 @@
1
- import { j as PublishedRelease } from './schema-pnuWqvGn.js';
1
+ import { u as PublishedRelease, ad as TrackerSource, a1 as TrackerDataSchema, af as TrackerSourceResponse, w as QuestDescription } from './schema-DfJzH2ci.js';
2
+ export { cM as TrackerDataBudget, cN as schemaCheckedReader, cO as trackerDataBatchSteps, cP as trackerDataIssue, cQ as trackerDataIssues, cR as trackerDataPathTypes, cS as trackerDataRecordSteps, cT as whereSchemaIssue } from './schema-DfJzH2ci.js';
3
+ export { I as IdentityKindClaim, i as identityIntegrationInputSchema, a as identityIntegrationSchema, b as identityIntegrationSecretSchema, c as identityKindClaimSchema, p as participantExchangeSchema } from './identity-integration-GxAHdKR2.js';
4
+ import { c as ImageFields, g as ImageRequest } from './images-Dv-P5VBw.js';
5
+ export { E as Extracted } from './images-Dv-P5VBw.js';
6
+ import { b as RequestErrorKind } from './request-error-DWduJCGV.js';
2
7
  import { z } from 'zod';
3
- import { d as ImageFields, g as ImageRequest } from './images--vZ9U0kr.js';
4
8
 
5
9
  /** Older releases did not record ownership. Preserve every value, including defaults. */
6
10
  declare function questConfiguration(release: PublishedRelease): {
@@ -25,40 +29,6 @@ declare function questConfiguration(release: PublishedRelease): {
25
29
  preserved: string[];
26
30
  };
27
31
 
28
- declare const identityIntegrationInputSchema: z.ZodObject<{
29
- name: z.ZodString;
30
- origin: z.ZodString;
31
- }, z.core.$strict>;
32
- declare const identityIntegrationSchema: z.ZodObject<{
33
- organization: z.ZodString;
34
- project: z.ZodString;
35
- environment: z.ZodEnum<{
36
- test: "test";
37
- live: "live";
38
- }>;
39
- id: z.ZodString;
40
- name: z.ZodString;
41
- origin: z.ZodString;
42
- expiresAt: z.ZodNumber;
43
- }, z.core.$strict>;
44
- declare const identityIntegrationSecretSchema: z.ZodObject<{
45
- organization: z.ZodString;
46
- project: z.ZodString;
47
- environment: z.ZodEnum<{
48
- test: "test";
49
- live: "live";
50
- }>;
51
- id: z.ZodString;
52
- name: z.ZodString;
53
- origin: z.ZodString;
54
- expiresAt: z.ZodNumber;
55
- token: z.ZodString;
56
- }, z.core.$strict>;
57
- declare const participantExchangeSchema: z.ZodObject<{
58
- subject: z.ZodString;
59
- previousToken: z.ZodOptional<z.ZodString>;
60
- }, z.core.$strict>;
61
-
62
32
  /** Every declared field is present with its declared type or null; nothing else is returned. */
63
33
  declare function parseImageExtraction(raw: ImageFields, value: unknown): {
64
34
  values: Record<string, string | number | boolean | null>;
@@ -88,8 +58,19 @@ declare function parseImageResult(request: ImageRequest, value: unknown): {
88
58
  firstSeenAt: number | null;
89
59
  };
90
60
 
91
- /** Content and engagement reads and the content enrollment and claim writes. */
61
+ /** Cursor polling of a participant's own committed activity. */
62
+ declare function isActivityParticipantRoute(path: string, method: string): boolean;
63
+ /** The signed-in participant's earned rewards and delivery states. */
64
+ declare function isRewardsParticipantRoute(path: string, method: string): boolean;
65
+ /** Content stage and engagement reads. */
92
66
  declare function isContentParticipantRoute(path: string, method: string): boolean;
67
+ /**
68
+ * The member's automatic-quest outcomes, campaign and quest enrollment, and historical claims.
69
+ */
70
+ declare function isQuestOutcomeParticipantRoute(path: string, method: string): boolean;
71
+ /** The member's own point balances and the history of one ledger (`me.balances`, `me.pointHistory`). */
72
+ declare function isPointsParticipantRoute(path: string, method: string): boolean;
73
+ declare function isOfferParticipantRoute(path: string, method: string): boolean;
93
74
  /**
94
75
  * The profile routes, with their methods: the member's own profile, and the reads keyed by a
95
76
  * public profile ID.
@@ -100,21 +81,79 @@ declare function isProfileParticipantRoute(path: string, method: string): boolea
100
81
  * another method on a wallet path with 405.
101
82
  */
102
83
  declare function isWalletParticipantRoute(path: string): boolean;
103
- /**
104
- * The single-wallet routes only 0.x clients call (`wallet.*`). The API still admits them for
105
- * those apps' proxies; v1 proxies do not forward them.
106
- */
107
- declare function isLegacyWalletRoute(path: string): boolean;
108
84
  /**
109
85
  * Wallet sign-in (`/v1/auth/wallet/start` and `/verify`). Hosted proxies admit it; identity
110
86
  * integrations do not, because their apps have their own login.
111
87
  */
112
88
  declare function isWalletSignInRoute(path: string): boolean;
113
89
 
90
+ /** The management client's and the CLI's default deadline per call. */
91
+ declare const MANAGEMENT_TIMEOUT = 30000;
92
+ /** One call's deadline and the caller's signal, shared by every attempt and the body read. */
93
+ type Lifetime = {
94
+ /** Aborts when the caller cancels or the deadline passes; pass it to `fetch`. */
95
+ readonly signal: AbortSignal;
96
+ readonly timeout: number;
97
+ /** Why the call ended early, if it did: the caller's signal wins over the deadline. */
98
+ ended(): "aborted" | "timeout" | undefined;
99
+ /** Milliseconds left before the deadline. */
100
+ remaining(): number;
101
+ /** The caller's abort reason, or the deadline's. */
102
+ reason(): unknown;
103
+ /** Stops the deadline once the call has everything it needs. */
104
+ end(): void;
105
+ };
106
+ declare function lifetime(timeout: number, caller?: AbortSignal): Lifetime;
107
+ /**
108
+ * The wait a `Retry-After` header asks for, in milliseconds: delay-seconds or an HTTP date.
109
+ * Undefined when the header is absent or unreadable.
110
+ */
111
+ declare function retryAfter(headers: Pick<Headers, "get">, now?: number): number | undefined;
112
+ /** What a failed attempt tells the retry loop. */
113
+ type AttemptFailure = {
114
+ kind: RequestErrorKind;
115
+ status?: number;
116
+ /** The attempt was a write that may have been applied. */
117
+ uncertain: boolean;
118
+ /** The server's `Retry-After`, in milliseconds. */
119
+ retryAfter?: number;
120
+ };
121
+ type Rules = {
122
+ /** The call is a read, or a write its route applies at most once (`retryDelay`). */
123
+ replaySafe: boolean;
124
+ /** Reads a failed attempt; undefined for an error that is not a request failure. */
125
+ describe?: (error: unknown) => AttemptFailure | undefined;
126
+ /** The error to throw when an earlier attempt may have applied the write. */
127
+ uncertain?: (error: unknown) => unknown;
128
+ };
129
+ /**
130
+ * Runs `attempt` until it succeeds or `retryDelay` says stop. A caller abort during a wait goes
131
+ * straight to the next attempt, which refuses to send and fails as `aborted`.
132
+ */
133
+ declare function retrying<T>(life: Lifetime, rules: Rules, attempt: () => Promise<T>): Promise<T>;
134
+
114
135
  /**
115
136
  * How Relay reads back a cursor it issued over a numeric position. Clients treat cursors as
116
137
  * opaque strings (`pageCursorSchema`); only the server parses them, so the format can change.
117
138
  */
118
139
  declare const sequenceCursorSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>, z.ZodNumber>;
119
140
 
120
- export { identityIntegrationInputSchema, identityIntegrationSchema, identityIntegrationSecretSchema, isContentParticipantRoute, isLegacyWalletRoute, isProfileParticipantRoute, isWalletParticipantRoute, isWalletSignInRoute, parseImageExtraction, parseImageResult, participantExchangeSchema, questConfiguration, sequenceCursorSchema };
141
+ /** The account roles a source's records can name: `author` and any others the source declares. */
142
+ declare function sourceRoles(source: TrackerSourceResponse): readonly string[];
143
+ /**
144
+ * The schema a source's record `data` matches: a custom source's declared schema, a Discord
145
+ * source's fixed one, or undefined for X (provider payloads) and untyped custom trackers.
146
+ */
147
+ declare function sourceDataSchema(source: TrackerSource): TrackerDataSchema | undefined;
148
+
149
+ /** Rules independent of published resources, permissions and another release. */
150
+ type QuestShape = Pick<QuestDescription, "trigger" | "performance"> & {
151
+ completion: Pick<QuestDescription["completion"], "kind">;
152
+ requires: readonly unknown[];
153
+ };
154
+ /** The same trigger/completion matrix for authoring, publication and graph validation. */
155
+ declare function validateQuestShape(description: QuestShape, options?: {
156
+ template?: boolean;
157
+ }): void;
158
+
159
+ export { type AttemptFailure, type Lifetime, MANAGEMENT_TIMEOUT, isActivityParticipantRoute, isContentParticipantRoute, isOfferParticipantRoute, isPointsParticipantRoute, isProfileParticipantRoute, isQuestOutcomeParticipantRoute, isRewardsParticipantRoute, isWalletParticipantRoute, isWalletSignInRoute, lifetime, parseImageExtraction, parseImageResult, questConfiguration, retryAfter, retrying, sequenceCursorSchema, sourceDataSchema, sourceRoles, validateQuestShape };
package/dist/internal.js CHANGED
@@ -1,111 +1,79 @@
1
1
  import {
2
- imageComparisonSchema,
3
- imageExtractionSchema,
4
- imageFieldsSchema,
5
- imageInspectionSchema,
6
- imageSightingsSchema
7
- } from "./chunk-77H7APVD.js";
2
+ identityIntegrationInputSchema,
3
+ identityIntegrationSchema,
4
+ identityIntegrationSecretSchema,
5
+ identityKindClaimSchema,
6
+ parseImageExtraction,
7
+ parseImageResult,
8
+ participantExchangeSchema,
9
+ questConfiguration,
10
+ sequenceCursorSchema
11
+ } from "./chunk-WJSSJ7AF.js";
12
+ import "./chunk-BGGKNIRP.js";
8
13
  import {
14
+ sourceDataSchema,
15
+ sourceRoles,
16
+ validateQuestShape
17
+ } from "./chunk-GQKYAQM6.js";
18
+ import {
19
+ isActivityParticipantRoute,
9
20
  isContentParticipantRoute,
10
- isLegacyWalletRoute,
21
+ isOfferParticipantRoute,
22
+ isPointsParticipantRoute,
11
23
  isProfileParticipantRoute,
24
+ isQuestOutcomeParticipantRoute,
25
+ isRewardsParticipantRoute,
12
26
  isWalletParticipantRoute,
13
27
  isWalletSignInRoute
14
- } from "./chunk-ZWY3R6B3.js";
28
+ } from "./chunk-GUP7YRR4.js";
15
29
  import {
16
- authScopeSchema
17
- } from "./chunk-QBOHLT7M.js";
30
+ MANAGEMENT_TIMEOUT,
31
+ lifetime,
32
+ retryAfter,
33
+ retrying
34
+ } from "./chunk-6QJ3LADK.js";
35
+ import "./chunk-NPGENI7K.js";
36
+ import "./chunk-XFMSUPNS.js";
18
37
  import {
19
- photoResultSchema
20
- } from "./chunk-VARGF4JS.js";
21
-
22
- // src/configuration.ts
23
- function questConfiguration(release) {
24
- return release.configuration ?? {
25
- defaults: Object.fromEntries(
26
- Object.entries(release.fields).map(([key, field]) => [
27
- key,
28
- field.default
29
- ])
30
- ),
31
- overrides: { ...release.values },
32
- preserved: Object.keys(release.values)
33
- };
34
- }
35
-
36
- // src/identity-integration.ts
37
- import { z } from "zod";
38
- var identityIntegrationInputSchema = z.object({
39
- name: z.string().trim().min(1).max(80),
40
- origin: z.string().url().refine((value) => {
41
- const url = new URL(value);
42
- return url.protocol === "https:" && url.origin === value;
43
- }, "Use an exact HTTPS application origin")
44
- }).strict();
45
- var identityIntegrationSchema = authScopeSchema.extend({
46
- id: z.string().uuid(),
47
- name: z.string(),
48
- origin: z.string(),
49
- expiresAt: z.number()
50
- });
51
- var identityIntegrationSecretSchema = identityIntegrationSchema.extend(
52
- {
53
- token: z.string()
54
- }
55
- );
56
- var participantExchangeSchema = z.object({
57
- subject: z.string().min(1).max(200),
58
- previousToken: z.string().max(200).optional()
59
- }).strict();
60
-
61
- // src/image-results.ts
62
- function parseImageExtraction(raw, value) {
63
- const result = imageExtractionSchema.parse(value);
64
- const fields = imageFieldsSchema.parse(raw);
65
- for (const [key, field] of Object.entries(fields)) {
66
- const extracted = result.values[key];
67
- if (extracted === void 0) {
68
- throw new Error("Image extraction omitted " + key);
69
- }
70
- if (extracted !== null && typeof extracted !== field.type) {
71
- throw new Error("Image extraction returned the wrong type for " + key);
72
- }
73
- }
74
- if (Object.keys(result.values).some((key) => !Object.hasOwn(fields, key))) {
75
- throw new Error("Image extraction returned an undeclared field");
76
- }
77
- return result;
78
- }
79
- function parseImageResult(request, value) {
80
- switch (request.operation) {
81
- case "inspect":
82
- return imageInspectionSchema.parse(value);
83
- case "compare":
84
- return imageComparisonSchema.parse(value);
85
- case "review":
86
- return photoResultSchema.parse(value);
87
- case "extract":
88
- return parseImageExtraction(request.fields, value);
89
- case "seen":
90
- return imageSightingsSchema.parse(value);
91
- }
92
- }
93
-
94
- // src/sequence-cursor.ts
95
- import { z as z2 } from "zod";
96
- var sequenceCursorSchema = z2.string().regex(/^[1-9][0-9]{0,15}$/, "Invalid cursor").transform(Number).pipe(z2.number().int().positive().safe());
38
+ schemaCheckedReader,
39
+ trackerDataBatchSteps,
40
+ trackerDataIssue,
41
+ trackerDataIssues,
42
+ trackerDataPathTypes,
43
+ trackerDataRecordSteps,
44
+ whereSchemaIssue
45
+ } from "./chunk-JON5SESL.js";
97
46
  export {
47
+ MANAGEMENT_TIMEOUT,
98
48
  identityIntegrationInputSchema,
99
49
  identityIntegrationSchema,
100
50
  identityIntegrationSecretSchema,
51
+ identityKindClaimSchema,
52
+ isActivityParticipantRoute,
101
53
  isContentParticipantRoute,
102
- isLegacyWalletRoute,
54
+ isOfferParticipantRoute,
55
+ isPointsParticipantRoute,
103
56
  isProfileParticipantRoute,
57
+ isQuestOutcomeParticipantRoute,
58
+ isRewardsParticipantRoute,
104
59
  isWalletParticipantRoute,
105
60
  isWalletSignInRoute,
61
+ lifetime,
106
62
  parseImageExtraction,
107
63
  parseImageResult,
108
64
  participantExchangeSchema,
109
65
  questConfiguration,
110
- sequenceCursorSchema
66
+ retryAfter,
67
+ retrying,
68
+ schemaCheckedReader,
69
+ sequenceCursorSchema,
70
+ sourceDataSchema,
71
+ sourceRoles,
72
+ trackerDataBatchSteps,
73
+ trackerDataIssue,
74
+ trackerDataIssues,
75
+ trackerDataPathTypes,
76
+ trackerDataRecordSteps,
77
+ validateQuestShape,
78
+ whereSchemaIssue
111
79
  };