@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.
- package/README.md +1 -1
- package/dist/activity-DeKJsRry.d.ts +9112 -0
- package/dist/authoring.d.ts +1135 -285
- package/dist/authoring.js +545 -269
- package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
- package/dist/avatar.d.ts +2 -2
- package/dist/browser-DFe7sWSN.d.ts +4154 -0
- package/dist/browser.d.ts +11 -2528
- package/dist/browser.js +8 -6
- package/dist/capability-error-DNMwKmlL.d.ts +458 -0
- package/dist/{chunk-V7EZUZ3Z.js → chunk-36HTX2BM.js} +389 -169
- package/dist/chunk-6QJ3LADK.js +112 -0
- package/dist/{chunk-77H7APVD.js → chunk-BGGKNIRP.js} +1 -1
- package/dist/chunk-EYH5RDIE.js +496 -0
- package/dist/chunk-GQKYAQM6.js +84 -0
- package/dist/chunk-GUP7YRR4.js +42 -0
- package/dist/{chunk-V5R2DMGY.js → chunk-GZ6FJAXN.js} +380 -128
- package/dist/chunk-JON5SESL.js +2986 -0
- package/dist/chunk-MC6V6VMG.js +49 -0
- package/dist/chunk-NPGENI7K.js +37 -0
- package/dist/chunk-VFHHLN6A.js +284 -0
- package/dist/chunk-WJSSJ7AF.js +151 -0
- package/dist/{chunk-QBOHLT7M.js → chunk-XFMSUPNS.js} +1 -1
- package/dist/{chunk-6A6K5RUD.js → chunk-ZVIRG24J.js} +145 -42
- package/dist/{client-CK4nwt7V.d.ts → client-XiuFnug_.d.ts} +2193 -562
- package/dist/{submission-input-C9qm9ixd.d.ts → groups-Ck-OxzjD.d.ts} +919 -1142
- package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
- package/dist/{images--vZ9U0kr.d.ts → images-Dv-P5VBw.d.ts} +2 -2
- package/dist/index.d.ts +13 -9
- package/dist/index.js +17 -6
- package/dist/internal.d.ts +82 -43
- package/dist/internal.js +58 -90
- package/dist/offers-Cy-e4o5x.d.ts +431 -0
- package/dist/{pages-BzqJuI69.d.ts → outcomes-kVB-Juzs.d.ts} +2386 -1490
- package/dist/pages-BBYD21IE.d.ts +359 -0
- package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
- package/dist/portal-proxy.js +22 -4
- package/dist/{profiles-DDMFBRKe.d.ts → profiles-D2aFcOxu.d.ts} +15 -15
- package/dist/react/index.d.ts +3122 -1011
- package/dist/react/index.js +1627 -779
- package/dist/request-error-DWduJCGV.d.ts +62 -0
- package/dist/schema-DfJzH2ci.d.ts +5644 -0
- package/dist/schema.d.ts +15 -4216
- package/dist/schema.js +322 -81
- package/dist/server/index.d.ts +81498 -0
- package/dist/server/index.js +2520 -0
- package/dist/{streaks-CwGReWGt.d.ts → streaks-CWyq8Px5.d.ts} +2 -4
- package/dist/submission-input-BZkm6ohU.d.ts +290 -0
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +1 -0
- package/dist/{wallet-BGOfFkG9.d.ts → wallet-YssWxGg8.d.ts} +35 -38
- package/package.json +8 -2
- package/dist/chunk-MRIURJE3.js +0 -257
- package/dist/chunk-VARGF4JS.js +0 -1733
- package/dist/chunk-ZWY3R6B3.js +0 -26
- package/dist/collection-BGneJ6Bk.d.ts +0 -114
- package/dist/integrations-C3Sp558f.d.ts +0 -1297
- package/dist/point-ledgers-iS00Z_v0.d.ts +0 -37
- 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-
|
|
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
|
|
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,
|
|
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,
|
|
4
|
-
export { E as ExchangeInput, M as MemberSummary, P as Page, a as PageQuery, b as
|
|
5
|
-
export {
|
|
6
|
-
export { P as PointLedgerReference } from './
|
|
7
|
-
export { A as
|
|
8
|
-
export {
|
|
9
|
-
export { A as
|
|
10
|
-
export {
|
|
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-
|
|
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-
|
|
22
|
+
} from "./chunk-NPGENI7K.js";
|
|
17
23
|
import {
|
|
18
24
|
sessionMember
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import
|
|
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,
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
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
|
-
/**
|
|
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
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
|
|
21
|
+
isOfferParticipantRoute,
|
|
22
|
+
isPointsParticipantRoute,
|
|
11
23
|
isProfileParticipantRoute,
|
|
24
|
+
isQuestOutcomeParticipantRoute,
|
|
25
|
+
isRewardsParticipantRoute,
|
|
12
26
|
isWalletParticipantRoute,
|
|
13
27
|
isWalletSignInRoute
|
|
14
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-GUP7YRR4.js";
|
|
15
29
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|