@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.
- package/README.md +1 -0
- package/build.mjs +15 -0
- package/dist/accounts-5ciAkCMP.d.ts +147 -0
- package/dist/{request-error-D_dUPLwo.d.ts → action-DBzILFx9.d.ts} +31 -1
- package/dist/attempt-captures-DHwIVoRP.d.ts +285 -0
- package/dist/authoring.d.ts +12 -10
- package/dist/authoring.js +6 -4
- package/dist/{automatic-outcomes-kPIDv6X_.d.ts → automatic-outcomes-BcEn_L46.d.ts} +1 -1
- package/dist/browser.d.ts +9 -9
- package/dist/browser.js +7 -6
- package/dist/capability-error-oTd3eYFH.d.ts +151 -0
- package/dist/chunk-2UAVZCMH.js +314 -0
- package/dist/{chunk-AGFUDCNM.js → chunk-3PPEXDWR.js} +1 -1
- package/dist/chunk-CHD6HHWG.js +485 -0
- package/dist/{chunk-T657WO56.js → chunk-LLMJ2SUT.js} +6 -2
- package/dist/chunk-NIYCAW2I.js +79 -0
- package/dist/{chunk-XK5E4HAS.js → chunk-PJXBW754.js} +80 -28
- package/dist/{chunk-PUDL4JBY.js → chunk-PUY35TH3.js} +2 -2
- package/dist/chunk-UJACD6K2.js +987 -0
- package/dist/chunk-W335CWYJ.js +53 -0
- package/dist/{chunk-X7ECZ3AK.js → chunk-XMBM2XD5.js} +1 -1
- package/dist/{chunk-2K2QBPAD.js → chunk-ZLYBUM7K.js} +6 -4
- package/dist/{client-fUSERMAC.d.ts → client-DFSCmf3H.d.ts} +27 -8
- package/dist/{activity-CNiPDPK6.d.ts → deployments-Ci6GyANg.d.ts} +15 -15
- package/dist/{groups-BK8ts2yK.d.ts → groups-Bi7lc54m.d.ts} +1 -1
- package/dist/{images-aw6W7vFZ.d.ts → images-Cb8QHGjn.d.ts} +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +8 -6
- package/dist/{capability-error-ty3SqD_b.d.ts → integrations-Cr9EhGI_.d.ts} +1 -149
- package/dist/internal.d.ts +11 -4
- package/dist/internal.js +8 -3
- package/dist/{offers-C2FANzrG.d.ts → offers-Catj06u7.d.ts} +2 -2
- package/dist/{pages-Chb6OZSB.d.ts → pages-CpYt56Km.d.ts} +1 -1
- package/dist/{participant-activity-DkL3nY5a.d.ts → participant-activity-DYdUUhw2.d.ts} +1 -0
- package/dist/portal-proxy.js +1 -1
- package/dist/react/index.d.ts +247 -179
- package/dist/react/index.js +954 -383
- package/dist/{schema-DEM8y8Fm.d.ts → schema-BaVl2VBS.d.ts} +1 -1
- package/dist/schema.d.ts +15 -13
- package/dist/schema.js +16 -14
- package/dist/server/index.d.ts +12 -70916
- package/dist/server/index.js +594 -841
- package/dist/{sign-in-options-iWOp9puZ.d.ts → sign-in-options-CU1ND6-y.d.ts} +2 -2
- package/dist/submission-input-Bi4HipqI.d.ts +146 -0
- package/dist/testing.d.ts +641 -0
- package/dist/testing.js +1282 -0
- package/dist/transport-0ttRwUat.d.ts +73361 -0
- package/package.json +6 -2
- package/dist/action-9Xl0StBg.d.ts +0 -33
- package/dist/chunk-OCXGG75K.js +0 -171
- package/dist/chunk-ZFABFKIY.js +0 -1295
- package/dist/referral-reward-kinds-M3f0PdiR.d.ts +0 -171
- package/dist/submission-input-BbBJTVlT.d.ts +0 -290
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { ar as PublishedRelease, ac as OpenIdentityKind, u as TrackerSource, a7 as TrackerDataSchema, aO as TrackerSourceResponse, at as QuestDescription } from './schema-DEM8y8Fm.js';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import { d as ImageFields, g as ImageRequest } from './images-aw6W7vFZ.js';
|
|
4
|
-
|
|
5
|
-
/** Older releases did not record ownership. Preserve every value, including defaults. */
|
|
6
|
-
declare function questConfiguration(release: PublishedRelease): {
|
|
7
|
-
defaults: Record<string, string | number | boolean | {
|
|
8
|
-
id: string;
|
|
9
|
-
prompt: string;
|
|
10
|
-
choices: {
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}[];
|
|
14
|
-
correct: string;
|
|
15
|
-
}[]>;
|
|
16
|
-
overrides: Record<string, string | number | boolean | {
|
|
17
|
-
id: string;
|
|
18
|
-
prompt: string;
|
|
19
|
-
choices: {
|
|
20
|
-
id: string;
|
|
21
|
-
label: string;
|
|
22
|
-
}[];
|
|
23
|
-
correct: string;
|
|
24
|
-
}[]>;
|
|
25
|
-
preserved: string[];
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
declare const identityIntegrationInputSchema: z.ZodObject<{
|
|
29
|
-
name: z.ZodString;
|
|
30
|
-
origin: z.ZodString;
|
|
31
|
-
identityKind: z.ZodOptional<z.ZodTemplateLiteral<`app:${string}`>>;
|
|
32
|
-
adoptIdentitiesFrom: z.ZodOptional<z.ZodString>;
|
|
33
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, z.core.$strict>;
|
|
35
|
-
/** An integration as responses return it: fields a newer Relay adds are ignored. */
|
|
36
|
-
declare const identityIntegrationSchema: z.ZodObject<{
|
|
37
|
-
id: z.ZodString;
|
|
38
|
-
name: z.ZodString;
|
|
39
|
-
origin: z.ZodString;
|
|
40
|
-
expiresAt: z.ZodNumber;
|
|
41
|
-
identityKind: z.ZodDefault<z.ZodNullable<z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>>>;
|
|
42
|
-
organization: z.ZodString;
|
|
43
|
-
project: z.ZodString;
|
|
44
|
-
environment: z.ZodEnum<{
|
|
45
|
-
test: "test";
|
|
46
|
-
live: "live";
|
|
47
|
-
}>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
declare const identityIntegrationSecretSchema: z.ZodObject<{
|
|
50
|
-
id: z.ZodString;
|
|
51
|
-
name: z.ZodString;
|
|
52
|
-
origin: z.ZodString;
|
|
53
|
-
expiresAt: z.ZodNumber;
|
|
54
|
-
identityKind: z.ZodDefault<z.ZodNullable<z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>>>;
|
|
55
|
-
organization: z.ZodString;
|
|
56
|
-
project: z.ZodString;
|
|
57
|
-
environment: z.ZodEnum<{
|
|
58
|
-
test: "test";
|
|
59
|
-
live: "live";
|
|
60
|
-
}>;
|
|
61
|
-
token: z.ZodString;
|
|
62
|
-
}, z.core.$strip>;
|
|
63
|
-
/**
|
|
64
|
-
* An `app:<name>` kind claimed in the project and environment, and the integration that owns its
|
|
65
|
-
* identities: the live one, or the disconnected one a new integration would adopt them from.
|
|
66
|
-
*/
|
|
67
|
-
declare const identityKindClaimSchema: z.ZodObject<{
|
|
68
|
-
kind: z.ZodType<OpenIdentityKind, unknown, z.core.$ZodTypeInternals<OpenIdentityKind, unknown>>;
|
|
69
|
-
integration: z.ZodString;
|
|
70
|
-
integrationName: z.ZodString;
|
|
71
|
-
connected: z.ZodBoolean;
|
|
72
|
-
linked: z.ZodNumber;
|
|
73
|
-
unlinked: z.ZodNumber;
|
|
74
|
-
claimedAt: z.ZodNumber;
|
|
75
|
-
}, z.core.$strip>;
|
|
76
|
-
type IdentityKindClaim = z.infer<typeof identityKindClaimSchema>;
|
|
77
|
-
declare const participantExchangeSchema: z.ZodObject<{
|
|
78
|
-
subject: z.ZodString;
|
|
79
|
-
previousToken: z.ZodOptional<z.ZodString>;
|
|
80
|
-
}, z.core.$strict>;
|
|
81
|
-
|
|
82
|
-
/** Every declared field is present with its declared type or null; nothing else is returned. */
|
|
83
|
-
declare function parseImageExtraction(raw: ImageFields, value: unknown): {
|
|
84
|
-
values: Record<string, string | number | boolean | null>;
|
|
85
|
-
reason: string;
|
|
86
|
-
};
|
|
87
|
-
declare function parseImageResult(request: ImageRequest, value: unknown): {
|
|
88
|
-
kind: "pass" | "fail" | "unclear";
|
|
89
|
-
reason: string;
|
|
90
|
-
} | {
|
|
91
|
-
width: number;
|
|
92
|
-
height: number;
|
|
93
|
-
format: "jpeg" | "png" | "webp" | "gif" | "avif";
|
|
94
|
-
bytes: number;
|
|
95
|
-
sha256: string;
|
|
96
|
-
phash: string;
|
|
97
|
-
dhash: string;
|
|
98
|
-
} | {
|
|
99
|
-
identical: boolean;
|
|
100
|
-
phashDistance: number;
|
|
101
|
-
dhashDistance: number;
|
|
102
|
-
} | {
|
|
103
|
-
values: Record<string, string | number | boolean | null>;
|
|
104
|
-
reason: string;
|
|
105
|
-
} | {
|
|
106
|
-
matches: number;
|
|
107
|
-
closestDistance: number | null;
|
|
108
|
-
firstSeenAt: number | null;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* One participant route. `path` uses the API's route syntax: every parameter is `:name{pattern}`,
|
|
113
|
-
* one path segment matched by `pattern`.
|
|
114
|
-
*/
|
|
115
|
-
type ParticipantRoute = {
|
|
116
|
-
method: "GET" | "POST";
|
|
117
|
-
path: `/v1/${string}`;
|
|
118
|
-
/**
|
|
119
|
-
* Sign-in routes only hosted apps reach: identity integrations' apps have their own login. They
|
|
120
|
-
* still connect accounts through /v1/auth/start and /v1/auth/complete.
|
|
121
|
-
*/
|
|
122
|
-
hostedOnly?: true;
|
|
123
|
-
};
|
|
124
|
-
declare const participantRoutes: readonly ParticipantRoute[];
|
|
125
|
-
/**
|
|
126
|
-
* The expression a route path matches: its literal parts exactly, each `:name{pattern}` one path
|
|
127
|
-
* segment. A parameter whose pattern can match "/" would span segments, so it is refused, as is a
|
|
128
|
-
* parameter without a pattern.
|
|
129
|
-
*/
|
|
130
|
-
declare function participantRoutePattern(path: string): RegExp;
|
|
131
|
-
/**
|
|
132
|
-
* A route a hosted app reaches through `proxyParticipant`: exactly a listed method and path.
|
|
133
|
-
* Another method on a listed path is not a participant route either.
|
|
134
|
-
*/
|
|
135
|
-
declare function isParticipantRoute(path: string, method: string): boolean;
|
|
136
|
-
/**
|
|
137
|
-
* A path an identity integration reaches, with any method: the API answers a method its route
|
|
138
|
-
* does not register with 405, and OPTIONS with the route's `Allow` header. Sign-in routes are
|
|
139
|
-
* hosted-only.
|
|
140
|
-
*/
|
|
141
|
-
declare function isIntegrationParticipantPath(path: string): boolean;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* How Relay reads back a cursor it issued over a numeric position. Clients treat cursors as
|
|
145
|
-
* opaque strings (`pageCursorSchema`); only the server parses them, so the format can change.
|
|
146
|
-
*/
|
|
147
|
-
declare const sequenceCursorSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>, z.ZodNumber>;
|
|
148
|
-
|
|
149
|
-
/** The account roles a source's records can name: `author` and any others the source declares. */
|
|
150
|
-
declare function sourceRoles(source: TrackerSourceResponse): readonly string[];
|
|
151
|
-
/**
|
|
152
|
-
* The schema a source's record `data` matches: a custom source's declared schema, a Discord
|
|
153
|
-
* source's fixed one, or undefined for X (provider payloads) and untyped custom trackers.
|
|
154
|
-
*/
|
|
155
|
-
declare function sourceDataSchema(source: TrackerSource): TrackerDataSchema | undefined;
|
|
156
|
-
|
|
157
|
-
/** Rules independent of published resources, permissions and another release. */
|
|
158
|
-
type QuestShape = Pick<QuestDescription, "trigger" | "performance"> & {
|
|
159
|
-
completion: Pick<QuestDescription["completion"], "kind">;
|
|
160
|
-
requires: readonly unknown[];
|
|
161
|
-
};
|
|
162
|
-
/** The same trigger/completion matrix for authoring, publication and graph validation. */
|
|
163
|
-
declare function validateQuestShape(description: QuestShape, options?: {
|
|
164
|
-
template?: boolean;
|
|
165
|
-
}): void;
|
|
166
|
-
|
|
167
|
-
declare const REFERRAL_INTEGRATION_REWARD_ERROR = "Referral programs can grant points and tiered rewards; Discord roles need a quest";
|
|
168
|
-
/** Detect the unsupported reward in loose authoring, published, or reward-list shapes. */
|
|
169
|
-
declare function containsReferralIntegrationReward(value: unknown): boolean;
|
|
170
|
-
|
|
171
|
-
export { type IdentityKindClaim as I, type ParticipantRoute as P, REFERRAL_INTEGRATION_REWARD_ERROR as R, identityIntegrationSchema as a, identityIntegrationSecretSchema as b, containsReferralIntegrationReward as c, identityKindClaimSchema as d, isIntegrationParticipantPath as e, isParticipantRoute as f, parseImageResult as g, participantExchangeSchema as h, identityIntegrationInputSchema as i, participantRoutePattern as j, participantRoutes as k, sourceDataSchema as l, sourceRoles as m, parseImageExtraction as p, questConfiguration as q, sequenceCursorSchema as s, validateQuestShape as v };
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { L as LedgerReference, r as QuestHandle } from './schema-DEM8y8Fm.js';
|
|
3
|
-
import { p as ProjectGroupReference } from './groups-BK8ts2yK.js';
|
|
4
|
-
|
|
5
|
-
/** A Discord message as `ctx.discord.message()` reads it, from the project's Discord server. */
|
|
6
|
-
declare const discordMessageSchema: z.ZodObject<{
|
|
7
|
-
guildId: z.ZodString;
|
|
8
|
-
channelId: z.ZodString;
|
|
9
|
-
messageId: z.ZodString;
|
|
10
|
-
userId: z.ZodString;
|
|
11
|
-
content: z.ZodNullable<z.ZodString>;
|
|
12
|
-
replyTo: z.ZodNullable<z.ZodString>;
|
|
13
|
-
publishedAt: z.ZodNumber;
|
|
14
|
-
}, z.core.$strict>;
|
|
15
|
-
type DiscordMessage = z.infer<typeof discordMessageSchema>;
|
|
16
|
-
/**
|
|
17
|
-
* Messages posted in the project's Discord server, written by the Discord gateway. The record's
|
|
18
|
-
* `author` is the message author's Discord account. Message text is stored only with `text: true`.
|
|
19
|
-
* Edits update stored text. Deleting a message, or turning text off, removes retained text.
|
|
20
|
-
*/
|
|
21
|
-
declare const discordMessagesSourceSchema: z.ZodObject<{
|
|
22
|
-
kind: z.ZodLiteral<"discord-messages">;
|
|
23
|
-
/** Store each message's text in `data.text`. Off unless set. */
|
|
24
|
-
text: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
-
}, z.core.$strict>;
|
|
26
|
-
/**
|
|
27
|
-
* Reactions added in the project's Discord server, written by the Discord gateway. The record's
|
|
28
|
-
* `author` is the reactor's Discord account and its `messageAuthor` account is the message's
|
|
29
|
-
* author, when Discord could name it.
|
|
30
|
-
*/
|
|
31
|
-
declare const discordReactionsSourceSchema: z.ZodObject<{
|
|
32
|
-
kind: z.ZodLiteral<"discord-reactions">;
|
|
33
|
-
}, z.core.$strict>;
|
|
34
|
-
/** The `data` of a `discord.messages()` record. IDs are Discord snowflakes. */
|
|
35
|
-
declare const discordMessageDataSchema: z.ZodObject<{
|
|
36
|
-
guildId: z.ZodString;
|
|
37
|
-
channelId: z.ZodString;
|
|
38
|
-
messageId: z.ZodString;
|
|
39
|
-
replyTo: z.ZodNullable<z.ZodString>;
|
|
40
|
-
publishedAt: z.ZodNumber;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
type DiscordMessageData = z.infer<typeof discordMessageDataSchema>;
|
|
43
|
-
/**
|
|
44
|
-
* The `data` of a `discord.messages({ text: true })` record. `text` is null when the platform's
|
|
45
|
-
* bot does not receive message content.
|
|
46
|
-
*/
|
|
47
|
-
declare const discordMessageTextDataSchema: z.ZodObject<{
|
|
48
|
-
guildId: z.ZodString;
|
|
49
|
-
channelId: z.ZodString;
|
|
50
|
-
messageId: z.ZodString;
|
|
51
|
-
replyTo: z.ZodNullable<z.ZodString>;
|
|
52
|
-
publishedAt: z.ZodNumber;
|
|
53
|
-
text: z.ZodNullable<z.ZodString>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
type DiscordMessageTextData = z.infer<typeof discordMessageTextDataSchema>;
|
|
56
|
-
/** The `data` of a `discord.reactions()` record. IDs are Discord snowflakes. */
|
|
57
|
-
declare const discordReactionDataSchema: z.ZodObject<{
|
|
58
|
-
guildId: z.ZodString;
|
|
59
|
-
channelId: z.ZodString;
|
|
60
|
-
messageId: z.ZodString;
|
|
61
|
-
emoji: z.ZodObject<{
|
|
62
|
-
id: z.ZodNullable<z.ZodString>;
|
|
63
|
-
name: z.ZodString;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
reactorRoles: z.ZodArray<z.ZodString>;
|
|
66
|
-
messagePublishedAt: z.ZodNumber;
|
|
67
|
-
}, z.core.$strip>;
|
|
68
|
-
type DiscordReactionData = z.infer<typeof discordReactionDataSchema>;
|
|
69
|
-
/** Rewards and resource selectors supported by the Discord integration. */
|
|
70
|
-
declare const discordRewardSchema: z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"integration">;
|
|
72
|
-
provider: z.ZodLiteral<"discord">;
|
|
73
|
-
action: z.ZodLiteral<"grant-role">;
|
|
74
|
-
roleId: z.ZodString;
|
|
75
|
-
}, z.core.$strict>;
|
|
76
|
-
declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
77
|
-
provider: z.ZodLiteral<"discord">;
|
|
78
|
-
resource: z.ZodLiteral<"channel">;
|
|
79
|
-
types: z.ZodArray<z.ZodEnum<{
|
|
80
|
-
text: "text";
|
|
81
|
-
announcement: "announcement";
|
|
82
|
-
}>>;
|
|
83
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
84
|
-
provider: z.ZodLiteral<"discord">;
|
|
85
|
-
resource: z.ZodLiteral<"role">;
|
|
86
|
-
assignable: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
-
}, z.core.$strict>]>;
|
|
88
|
-
|
|
89
|
-
declare const completionPrerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
-
kind: z.ZodLiteral<"completion">;
|
|
91
|
-
quest: z.ZodString;
|
|
92
|
-
scope: z.ZodLiteral<"ever">;
|
|
93
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
-
kind: z.ZodLiteral<"completion">;
|
|
95
|
-
quest: z.ZodString;
|
|
96
|
-
scope: z.ZodLiteral<"period">;
|
|
97
|
-
period: z.ZodEnum<{
|
|
98
|
-
day: "day";
|
|
99
|
-
week: "week";
|
|
100
|
-
month: "month";
|
|
101
|
-
}>;
|
|
102
|
-
}, z.core.$strict>], "scope">;
|
|
103
|
-
declare const balancePrerequisiteSchema: z.ZodObject<{
|
|
104
|
-
kind: z.ZodLiteral<"balance">;
|
|
105
|
-
balance: z.ZodString;
|
|
106
|
-
minimum: z.ZodNumber;
|
|
107
|
-
}, z.core.$strict>;
|
|
108
|
-
declare const groupPrerequisiteSchema: z.ZodObject<{
|
|
109
|
-
kind: z.ZodLiteral<"group">;
|
|
110
|
-
group: z.ZodString;
|
|
111
|
-
title: z.ZodString;
|
|
112
|
-
}, z.core.$strict>;
|
|
113
|
-
declare const prerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
114
|
-
kind: z.ZodLiteral<"completion">;
|
|
115
|
-
quest: z.ZodString;
|
|
116
|
-
scope: z.ZodLiteral<"ever">;
|
|
117
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
118
|
-
kind: z.ZodLiteral<"completion">;
|
|
119
|
-
quest: z.ZodString;
|
|
120
|
-
scope: z.ZodLiteral<"period">;
|
|
121
|
-
period: z.ZodEnum<{
|
|
122
|
-
day: "day";
|
|
123
|
-
week: "week";
|
|
124
|
-
month: "month";
|
|
125
|
-
}>;
|
|
126
|
-
}, z.core.$strict>], "scope">, z.ZodObject<{
|
|
127
|
-
kind: z.ZodLiteral<"balance">;
|
|
128
|
-
balance: z.ZodString;
|
|
129
|
-
minimum: z.ZodNumber;
|
|
130
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
-
kind: z.ZodLiteral<"group">;
|
|
132
|
-
group: z.ZodString;
|
|
133
|
-
title: z.ZodString;
|
|
134
|
-
}, z.core.$strict>], "kind">;
|
|
135
|
-
type Prerequisite = z.infer<typeof prerequisiteSchema>;
|
|
136
|
-
declare const missingPrerequisiteSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
137
|
-
kind: z.ZodLiteral<"completion">;
|
|
138
|
-
quest: z.ZodString;
|
|
139
|
-
title: z.ZodString;
|
|
140
|
-
scope: z.ZodLiteral<"ever">;
|
|
141
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
-
kind: z.ZodLiteral<"completion">;
|
|
143
|
-
quest: z.ZodString;
|
|
144
|
-
title: z.ZodString;
|
|
145
|
-
scope: z.ZodLiteral<"period">;
|
|
146
|
-
period: z.ZodEnum<{
|
|
147
|
-
day: "day";
|
|
148
|
-
week: "week";
|
|
149
|
-
month: "month";
|
|
150
|
-
}>;
|
|
151
|
-
resetsAt: z.ZodNumber;
|
|
152
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
153
|
-
kind: z.ZodLiteral<"balance">;
|
|
154
|
-
balance: z.ZodString;
|
|
155
|
-
title: z.ZodString;
|
|
156
|
-
minimum: z.ZodNumber;
|
|
157
|
-
current: z.ZodNumber;
|
|
158
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
159
|
-
kind: z.ZodLiteral<"group">;
|
|
160
|
-
group: z.ZodString;
|
|
161
|
-
title: z.ZodString;
|
|
162
|
-
}, z.core.$strip>]>;
|
|
163
|
-
type MissingPrerequisite = z.infer<typeof missingPrerequisiteSchema>;
|
|
164
|
-
declare function completed(quest: QuestHandle, options?: {
|
|
165
|
-
scope?: "ever";
|
|
166
|
-
} | {
|
|
167
|
-
scope: "period";
|
|
168
|
-
period: "day" | "week" | "month";
|
|
169
|
-
}): {
|
|
170
|
-
kind: "completion";
|
|
171
|
-
quest: string;
|
|
172
|
-
scope: "ever";
|
|
173
|
-
} | {
|
|
174
|
-
kind: "completion";
|
|
175
|
-
quest: string;
|
|
176
|
-
scope: "period";
|
|
177
|
-
period: "day" | "week" | "month";
|
|
178
|
-
};
|
|
179
|
-
declare function balanceAtLeast(balance: LedgerReference, minimum: number): {
|
|
180
|
-
kind: "balance";
|
|
181
|
-
balance: string;
|
|
182
|
-
minimum: number;
|
|
183
|
-
};
|
|
184
|
-
declare function inGroup(group: ProjectGroupReference): {
|
|
185
|
-
kind: "group";
|
|
186
|
-
group: string;
|
|
187
|
-
title: string;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
declare const authProviderSchema: z.ZodEnum<{
|
|
191
|
-
discord: "discord";
|
|
192
|
-
google: "google";
|
|
193
|
-
apple: "apple";
|
|
194
|
-
x: "x";
|
|
195
|
-
}>;
|
|
196
|
-
type AuthProvider = z.infer<typeof authProviderSchema>;
|
|
197
|
-
declare const accountConnectionSchema: z.ZodObject<{
|
|
198
|
-
provider: z.ZodEnum<{
|
|
199
|
-
discord: "discord";
|
|
200
|
-
google: "google";
|
|
201
|
-
apple: "apple";
|
|
202
|
-
x: "x";
|
|
203
|
-
}>;
|
|
204
|
-
configured: z.ZodBoolean;
|
|
205
|
-
status: z.ZodEnum<{
|
|
206
|
-
disconnected: "disconnected";
|
|
207
|
-
connected: "connected";
|
|
208
|
-
reconnect: "reconnect";
|
|
209
|
-
}>;
|
|
210
|
-
subject: z.ZodNullable<z.ZodString>;
|
|
211
|
-
revision: z.ZodNumber;
|
|
212
|
-
}, z.core.$strip>;
|
|
213
|
-
type AccountConnection = z.infer<typeof accountConnectionSchema>;
|
|
214
|
-
declare const discordMemberInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
215
|
-
declare const discordMessageInputSchema: z.ZodObject<{
|
|
216
|
-
channelId: z.ZodString;
|
|
217
|
-
messageId: z.ZodString;
|
|
218
|
-
}, z.core.$strict>;
|
|
219
|
-
declare const discordMemberSchema: z.ZodObject<{
|
|
220
|
-
userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
221
|
-
nickname: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
222
|
-
displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
223
|
-
boostingSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
224
|
-
roles: z.ZodArray<z.ZodString>;
|
|
225
|
-
joinedAt: z.ZodNullable<z.ZodString>;
|
|
226
|
-
pending: z.ZodBoolean;
|
|
227
|
-
}, z.core.$strip>;
|
|
228
|
-
type DiscordMember = z.infer<typeof discordMemberSchema>;
|
|
229
|
-
/**
|
|
230
|
-
* Reads the project's connected Discord server for the member's linked Discord account. The
|
|
231
|
-
* account and the integration are pinned at the attempt's first Discord read: later links and
|
|
232
|
-
* unlinks do not change the attempt. Provider failures, and an integration that is not ready,
|
|
233
|
-
* throw `CapabilityError` with code `"provider-unavailable"`.
|
|
234
|
-
*/
|
|
235
|
-
interface DiscordReader {
|
|
236
|
-
/** The member's server membership; null when they are not in the server or have not linked Discord. */
|
|
237
|
-
member(): Promise<DiscordMember | null>;
|
|
238
|
-
/**
|
|
239
|
-
* A message in the connected server; null when it does not exist. The bot reads it, so the
|
|
240
|
-
* member needs no linked Discord account. A channel outside the connected server, or one the
|
|
241
|
-
* bot cannot see, throws
|
|
242
|
-
* `CapabilityError` with code `"author-error"`.
|
|
243
|
-
*/
|
|
244
|
-
message(input: {
|
|
245
|
-
channelId: string;
|
|
246
|
-
messageId: string;
|
|
247
|
-
}): Promise<DiscordMessage | null>;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
declare const textOptionsSchema: z.ZodObject<{
|
|
251
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
252
|
-
minLength: z.ZodDefault<z.ZodNumber>;
|
|
253
|
-
maxLength: z.ZodDefault<z.ZodNumber>;
|
|
254
|
-
}, z.core.$strict>;
|
|
255
|
-
declare const urlOptionsSchema: z.ZodObject<{
|
|
256
|
-
required: z.ZodDefault<z.ZodBoolean>;
|
|
257
|
-
allowedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
258
|
-
}, z.core.$strict>;
|
|
259
|
-
type TextOptions = z.input<typeof textOptionsSchema>;
|
|
260
|
-
type UrlOptions = z.input<typeof urlOptionsSchema>;
|
|
261
|
-
declare const textEvidenceSchema: z.ZodObject<{
|
|
262
|
-
kind: z.ZodLiteral<"text">;
|
|
263
|
-
value: z.ZodString;
|
|
264
|
-
}, z.core.$strict>;
|
|
265
|
-
declare const urlEvidenceSchema: z.ZodObject<{
|
|
266
|
-
kind: z.ZodLiteral<"url">;
|
|
267
|
-
value: z.ZodString;
|
|
268
|
-
}, z.core.$strict>;
|
|
269
|
-
declare const valueEvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
270
|
-
kind: z.ZodLiteral<"text">;
|
|
271
|
-
value: z.ZodString;
|
|
272
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
273
|
-
kind: z.ZodLiteral<"url">;
|
|
274
|
-
value: z.ZodString;
|
|
275
|
-
}, z.core.$strict>], "kind">;
|
|
276
|
-
type TextEvidence = z.infer<typeof textEvidenceSchema>;
|
|
277
|
-
type UrlEvidence = z.infer<typeof urlEvidenceSchema>;
|
|
278
|
-
type ValueEvidence = z.infer<typeof valueEvidenceSchema>;
|
|
279
|
-
/** Validates a claim without fetching it or changing the captured value. */
|
|
280
|
-
declare function validateSubmissionValue(input: ValueEvidence, contract: {
|
|
281
|
-
input: "text";
|
|
282
|
-
constraints: z.output<typeof textOptionsSchema>;
|
|
283
|
-
} | {
|
|
284
|
-
input: "url";
|
|
285
|
-
constraints: z.output<typeof urlOptionsSchema>;
|
|
286
|
-
}): string | null;
|
|
287
|
-
/** Extract an ID only. The URL and its author name are untrusted claims. */
|
|
288
|
-
declare function xPostId(value: string): string | null;
|
|
289
|
-
|
|
290
|
-
export { type AccountConnection as A, groupPrerequisiteSchema as B, missingPrerequisiteSchema as C, type DiscordMessageData as D, prerequisiteSchema as E, textEvidenceSchema as F, textOptionsSchema as G, urlEvidenceSchema as H, urlOptionsSchema as I, validateSubmissionValue as J, valueEvidenceSchema as K, xPostId as L, type MissingPrerequisite as M, type Prerequisite as P, type TextEvidence as T, type UrlEvidence as U, type ValueEvidence as V, type AuthProvider as a, type TextOptions as b, type UrlOptions as c, discordMessagesSourceSchema as d, type DiscordMessageTextData as e, discordReactionsSourceSchema as f, type DiscordReactionData as g, type DiscordReader as h, balanceAtLeast as i, completed as j, inGroup as k, type DiscordMember as l, type DiscordMessage as m, accountConnectionSchema as n, authProviderSchema as o, balancePrerequisiteSchema as p, completionPrerequisiteSchema as q, discordMemberInputSchema as r, discordMemberSchema as s, discordMessageDataSchema as t, discordMessageInputSchema as u, discordMessageSchema as v, discordMessageTextDataSchema as w, discordReactionDataSchema as x, discordResourceSourceSchema as y, discordRewardSchema as z };
|