@domino-sdk/relay 1.0.0-next.8 → 1.0.0-next.9
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/dist/authoring.d.ts +144 -88
- package/dist/authoring.js +119 -44
- package/dist/browser.d.ts +201 -116
- package/dist/browser.js +6 -6
- package/dist/{chunk-77H7APVD.js → chunk-4LBUTHD6.js} +1 -1
- package/dist/{chunk-QBOHLT7M.js → chunk-7Q4BGGT6.js} +1 -1
- package/dist/{chunk-6A6K5RUD.js → chunk-P6FK43GG.js} +2 -2
- package/dist/{chunk-V7EZUZ3Z.js → chunk-PHU5VDLR.js} +1 -1
- package/dist/{chunk-MRIURJE3.js → chunk-QR7ZA2BJ.js} +2 -2
- package/dist/{chunk-V5R2DMGY.js → chunk-X2F2RAR3.js} +4 -4
- package/dist/chunk-YYD4QUBO.js +2348 -0
- package/dist/{client-CK4nwt7V.d.ts → client-CT4-S5vc.d.ts} +101 -16
- package/dist/{integrations-C3Sp558f.d.ts → images-BTgk6OmC.d.ts} +748 -481
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/integrations-Ba5TtqTv.d.ts +410 -0
- package/dist/internal.d.ts +3 -2
- package/dist/internal.js +19 -5
- package/dist/{pages-BzqJuI69.d.ts → pages-D3titw5B.d.ts} +219 -32
- package/dist/portal-proxy.js +2 -2
- package/dist/react/index.d.ts +122 -20
- package/dist/react/index.js +6 -6
- package/dist/{schema-pnuWqvGn.d.ts → schema-Di3aLSiK.d.ts} +159 -23
- package/dist/schema.d.ts +217 -265
- package/dist/schema.js +17 -5
- package/package.json +1 -1
- package/dist/chunk-VARGF4JS.js +0 -1733
- package/dist/images--vZ9U0kr.d.ts +0 -234
- package/dist/{submission-input-C9qm9ixd.d.ts → submission-input-0OOGaq8c.d.ts} +6 -6
package/dist/authoring.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
export { z } from 'zod';
|
|
3
|
+
import { C as ContentPolicy, g as ContentMetric, E as EngagementDefinition, l as leaderboardAuthoringSchema, r as referralAuthoringSchema, h as AdmittedContent, D as DiscordMember, T as TextEvidence, U as UrlEvidence, e as TextOptions, f as UrlOptions } from './submission-input-0OOGaq8c.js';
|
|
3
4
|
import { Q as QuizContent, a as StreakPolicy } from './streaks-CwGReWGt.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { d as TextReviewInput, e as TextResult, P as PhotoResult, r as rewardSchema, t as triggerSchema, Q as QuestPresentation, a as QuestProfile, b as QuizEvidence, D as Decision, f as TieredRewardDefinition } from './schema-
|
|
5
|
+
import { R as ResourceSource, S as Setting, O as Observation, X as XReader, D as DiscordMessage, o as observationTriggerSchema, B as Budget, I as IntegerSettings, a as IntegrationProvider } from './integrations-Ba5TtqTv.js';
|
|
6
|
+
import { T as TrackerDefinition, I as IdentityKind, c as customSourceSchema, W as WithRecordData, a as TrackerSource, t as trackerDefinitionSchema, b as Tracker, d as TrackerData, x as xSearchSourceSchema, X as XTweet, e as TrackerTriggerContext, f as TrackerTriggerPolicy, g as TrackerReader, h as ImageReader, i as Where, j as TrackerTriggerMode, k as WhereSetting } from './images-BTgk6OmC.js';
|
|
7
|
+
export { l as TrackerDataSchema, m as TrackerPage, n as trackerDataSchema, o as trackerTriggerContextSchema } from './images-BTgk6OmC.js';
|
|
8
|
+
import { d as TextReviewInput, e as TextResult, P as PhotoResult, r as rewardSchema, t as triggerSchema, Q as QuestPresentation, a as QuestProfile, b as QuizEvidence, D as Decision, f as TieredRewardDefinition } from './schema-Di3aLSiK.js';
|
|
8
9
|
import { h as WalletConnection, S as SolanaBalance, L as LinkedWallet, i as WalletBalanceQuery, j as WalletBalance } from './wallet-BGOfFkG9.js';
|
|
9
10
|
export { E as EvmChainId, k as isEvmChainId } from './wallet-BGOfFkG9.js';
|
|
10
11
|
export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
|
|
@@ -27,9 +28,9 @@ declare function content(tracker: TrackerDefinition, policy?: Partial<Pick<Conte
|
|
|
27
28
|
start: number;
|
|
28
29
|
end?: number | undefined;
|
|
29
30
|
};
|
|
30
|
-
enrollment: "
|
|
31
|
+
enrollment: "required" | "none";
|
|
31
32
|
posts: "after-enrollment" | "since-start";
|
|
32
|
-
historical: "
|
|
33
|
+
historical: "staff" | "automatic" | "claim";
|
|
33
34
|
};
|
|
34
35
|
};
|
|
35
36
|
declare function perContent(): {
|
|
@@ -179,8 +180,8 @@ declare function defineReferral(input: Omit<z.input<typeof referralAuthoringSche
|
|
|
179
180
|
};
|
|
180
181
|
declare function defineLeaderboard(input: Omit<z.input<typeof leaderboardAuthoringSchema>, "key" | "id"> & AuthoringIdentity): {
|
|
181
182
|
id: string;
|
|
182
|
-
title: string;
|
|
183
183
|
balance: string;
|
|
184
|
+
title: string;
|
|
184
185
|
group?: string | undefined;
|
|
185
186
|
score: {
|
|
186
187
|
kind: "balance";
|
|
@@ -222,30 +223,28 @@ declare function defineLeaderboard(input: Omit<z.input<typeof leaderboardAuthori
|
|
|
222
223
|
key: string;
|
|
223
224
|
};
|
|
224
225
|
declare const x: {
|
|
226
|
+
/** Posts matching an X search. Each record's `data` is the provider's post payload. */
|
|
225
227
|
search: (input: {
|
|
226
228
|
query: string;
|
|
227
|
-
}) =>
|
|
228
|
-
kind: "x-search";
|
|
229
|
-
query: string;
|
|
230
|
-
};
|
|
229
|
+
}) => z.output<typeof xSearchSourceSchema> & WithRecordData<XTweet>;
|
|
231
230
|
};
|
|
232
231
|
/**
|
|
233
|
-
* Records your own code sends with `trackers.ingest`.
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* each
|
|
232
|
+
* Records your own code sends with `trackers.ingest`. `data` is a zod object schema that every
|
|
233
|
+
* record's `data` must match: Relay stores its JSON Schema form with the tracker and rejects
|
|
234
|
+
* records that do not match it, and quests read each record's data with its type. With
|
|
235
|
+
* `identities`, each record's author, and each named account in `accounts`, is a verified identity
|
|
236
|
+
* of one of those kinds, which Relay attributes to the member who verified it, so quests can
|
|
237
|
+
* trigger from the tracker. A record states each account's `kind` unless the source names exactly
|
|
238
|
+
* one.
|
|
237
239
|
*/
|
|
238
|
-
declare
|
|
240
|
+
declare function customSource<S extends z.ZodObject>(namespace: string, options: {
|
|
239
241
|
identities?: IdentityKind[];
|
|
240
242
|
accounts?: string[];
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
authors?: "wallet" | undefined;
|
|
247
|
-
};
|
|
248
|
-
declare function defineTracker(input: z.input<typeof trackerDefinitionSchema>): TrackerDefinition;
|
|
243
|
+
data: S;
|
|
244
|
+
}): z.output<typeof customSourceSchema> & WithRecordData<z.input<S>>;
|
|
245
|
+
declare function defineTracker<S extends TrackerSource>(input: Omit<z.input<typeof trackerDefinitionSchema>, "source"> & {
|
|
246
|
+
source: S;
|
|
247
|
+
}): Tracker<TrackerData<S>>;
|
|
249
248
|
type ChannelTypes = Extract<ResourceSource, {
|
|
250
249
|
resource: "channel";
|
|
251
250
|
}>["types"];
|
|
@@ -265,17 +264,17 @@ type Label = {
|
|
|
265
264
|
declare const settings: {
|
|
266
265
|
pointLedger(options: Label & {
|
|
267
266
|
default: string;
|
|
268
|
-
}): z.ZodDefault<z.ZodString
|
|
267
|
+
}): Setting<"point-ledger", z.ZodDefault<z.ZodString>>;
|
|
269
268
|
datetime(options: Label & {
|
|
270
269
|
default: string;
|
|
271
|
-
}): z.ZodDefault<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<string, string
|
|
270
|
+
}): Setting<"datetime", z.ZodDefault<z.ZodPipe<z.ZodISODateTime, z.ZodTransform<string, string>>>>;
|
|
272
271
|
resource(options: Label & {
|
|
273
272
|
source: ResourceSource;
|
|
274
273
|
default?: string;
|
|
275
|
-
}): z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]
|
|
274
|
+
}): Setting<"resource", z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodString]>>>;
|
|
276
275
|
quiz(options: Label & {
|
|
277
276
|
default: QuizContent;
|
|
278
|
-
}): z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
277
|
+
}): Setting<"quiz", z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
279
278
|
id: z.ZodString;
|
|
280
279
|
prompt: z.ZodString;
|
|
281
280
|
choices: z.ZodArray<z.ZodObject<{
|
|
@@ -283,26 +282,27 @@ declare const settings: {
|
|
|
283
282
|
label: z.ZodString;
|
|
284
283
|
}, z.core.$strict>>;
|
|
285
284
|
correct: z.ZodString;
|
|
286
|
-
}, z.core.$strict
|
|
285
|
+
}, z.core.$strict>>>>;
|
|
287
286
|
text(options: Label & {
|
|
288
287
|
default: string;
|
|
289
288
|
minLength?: number;
|
|
290
289
|
maxLength?: number;
|
|
291
290
|
multiline?: boolean;
|
|
292
|
-
}): z.ZodDefault<z.ZodString
|
|
291
|
+
}): Setting<"text", z.ZodDefault<z.ZodString>>;
|
|
293
292
|
integer(options: Label & {
|
|
294
293
|
default: number;
|
|
295
294
|
min: number;
|
|
296
295
|
max: number;
|
|
297
|
-
}): z.ZodDefault<z.ZodNumber
|
|
296
|
+
}): Setting<"integer", z.ZodDefault<z.ZodNumber>>;
|
|
298
297
|
boolean(options: Label & {
|
|
299
298
|
default: boolean;
|
|
300
|
-
}): z.ZodDefault<z.ZodBoolean
|
|
299
|
+
}): Setting<"boolean", z.ZodDefault<z.ZodBoolean>>;
|
|
301
300
|
choice<const T extends readonly [string, ...string[]]>(options: Label & {
|
|
302
301
|
options: T;
|
|
303
302
|
default: T[number];
|
|
304
|
-
}): z.ZodDefault<z.ZodEnum<{ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never
|
|
305
|
-
|
|
303
|
+
}): Setting<"choice", z.ZodDefault<z.ZodEnum<{ [k_1 in T[number]]: k_1; } extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never>>>;
|
|
304
|
+
/** A quest's settings: every field is built with one of the builders above. */
|
|
305
|
+
object<T extends Record<string, Setting>>(shape: T): z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$strict>;
|
|
306
306
|
};
|
|
307
307
|
|
|
308
308
|
type Reward = z.infer<typeof rewardSchema>;
|
|
@@ -361,8 +361,9 @@ declare function manual(options: {
|
|
|
361
361
|
actor: "staff";
|
|
362
362
|
};
|
|
363
363
|
/** A tracker trigger: which observations of which tracker run the quest, and for whom. */
|
|
364
|
-
type TrackerTriggerInput = {
|
|
365
|
-
tracker
|
|
364
|
+
type TrackerTriggerInput<T extends Tracker = Tracker, W extends Where<TrackerData<T>> | undefined = Where<TrackerData<T>> | undefined> = {
|
|
365
|
+
/** The tracker handle `defineTracker` returns. */
|
|
366
|
+
tracker: T;
|
|
366
367
|
/**
|
|
367
368
|
* Which observations fire. `"new-record"`: each record's first observation (the default for X
|
|
368
369
|
* trackers, where it means each newly collected post). `"new-observation"`: each observation
|
|
@@ -372,9 +373,11 @@ type TrackerTriggerInput = {
|
|
|
372
373
|
on?: TrackerTriggerMode;
|
|
373
374
|
/**
|
|
374
375
|
* Admit only observations whose `data` matches, such as `{ path: "amount", gte: 1000 }` or
|
|
375
|
-
* `{ path: "amount", gte: { setting: "threshold" } }
|
|
376
|
+
* `{ path: "amount", gte: { setting: "threshold" } }`, or a list of at most 10 such conditions
|
|
377
|
+
* that must all hold. Paths and values are checked against the tracker's data type, and a
|
|
378
|
+
* `setting` must name one of the quest's integer settings. Others record no outcome.
|
|
376
379
|
*/
|
|
377
|
-
where?:
|
|
380
|
+
where?: W;
|
|
378
381
|
/**
|
|
379
382
|
* The record account whose member the quest pays: `"author"` (the default), `"inReplyTo"` on
|
|
380
383
|
* an X tracker, or a named account a custom source declares in `accounts`. Skipped when that
|
|
@@ -382,6 +385,24 @@ type TrackerTriggerInput = {
|
|
|
382
385
|
*/
|
|
383
386
|
beneficiary?: string;
|
|
384
387
|
};
|
|
388
|
+
/** Type-only markers a tracker trigger carries into `defineQuest`. They never exist at runtime. */
|
|
389
|
+
declare const triggerData: unique symbol;
|
|
390
|
+
declare const triggerSettings: unique symbol;
|
|
391
|
+
/**
|
|
392
|
+
* A tracker trigger whose records carry `data` of type `D` and whose filter compares with the
|
|
393
|
+
* settings `S`. `defineQuest` types `ctx.tracker` from `D` and checks `S` against its integer
|
|
394
|
+
* settings.
|
|
395
|
+
*/
|
|
396
|
+
type TrackerTrigger<D = unknown, S extends string = never> = {
|
|
397
|
+
kind: "automatic";
|
|
398
|
+
tracker: TrackerTriggerPolicy;
|
|
399
|
+
readonly [triggerData]?: D;
|
|
400
|
+
readonly [triggerSettings]?: S;
|
|
401
|
+
};
|
|
402
|
+
type TriggerData<G> = G extends TrackerTrigger<infer D, string> ? unknown extends D ? unknown : D : unknown;
|
|
403
|
+
type TriggerSettings<G> = G extends {
|
|
404
|
+
readonly [triggerSettings]?: infer S;
|
|
405
|
+
} ? unknown extends S ? never : Exclude<S, undefined> : never;
|
|
385
406
|
/**
|
|
386
407
|
* An automatic quest. With no argument it runs once its prerequisites are complete; with an
|
|
387
408
|
* observation it runs for each matching observation; with a tracker it runs for each observation
|
|
@@ -394,44 +415,46 @@ declare function automatic(observation: z.infer<typeof observationTriggerSchema>
|
|
|
394
415
|
kind: "automatic";
|
|
395
416
|
observation: z.infer<typeof observationTriggerSchema>;
|
|
396
417
|
};
|
|
397
|
-
declare function automatic(input: TrackerTriggerInput):
|
|
398
|
-
|
|
399
|
-
|
|
418
|
+
declare function automatic<T extends Tracker, const W extends Where<TrackerData<T>> | undefined = undefined>(input: TrackerTriggerInput<T, W>): TrackerTrigger<TrackerData<T>, WhereSetting<W>>;
|
|
419
|
+
/**
|
|
420
|
+
* What a trigger `G` supplies under key `K`: `Present` when the trigger has it, null when it cannot,
|
|
421
|
+
* and `Present | null` when `G` is not known.
|
|
422
|
+
*/
|
|
423
|
+
type Supplied<G, K extends string, Present, Base> = unknown extends G ? Base | null : G extends unknown ? K extends keyof G ? [G[K]] extends [object] ? Present : Base | null : null : never;
|
|
424
|
+
/** `ctx.tracker` for a trigger: non-null and typed for a tracker trigger, null for others. */
|
|
425
|
+
type ContextTracker<G> = Supplied<G, "tracker", TrackerTriggerContext<TriggerData<G>>, TrackerTriggerContext>;
|
|
426
|
+
/** `ctx.content` for a trigger: the admitted post for a content trigger, null for others. */
|
|
427
|
+
type ContextContent<G> = Supplied<G, "content", AdmittedContent, AdmittedContent>;
|
|
428
|
+
/** `ctx.observation` for a trigger: the observation for an observation trigger, null for others. */
|
|
429
|
+
type ContextObservation<G> = Supplied<G, "observation", Observation, Observation>;
|
|
430
|
+
/**
|
|
431
|
+
* What a `keyed()` completion key reads. TypeScript cannot carry the trigger into a completion
|
|
432
|
+
* built inline, so `tracker` stays nullable here; the evaluator's `ctx.tracker` is typed.
|
|
433
|
+
*/
|
|
434
|
+
type KeyedContext = {
|
|
435
|
+
member: {
|
|
436
|
+
id: string;
|
|
437
|
+
};
|
|
438
|
+
content?: AdmittedContent | null;
|
|
439
|
+
observation: Observation | null;
|
|
440
|
+
/** The pinned tracker observation of a tracker-triggered quest; null for other triggers. */
|
|
441
|
+
tracker: TrackerTriggerContext | null;
|
|
442
|
+
eligibleAt: number;
|
|
443
|
+
/** The attempt's evaluation time; see {@link EvaluationContext.now}. */
|
|
444
|
+
now: number;
|
|
400
445
|
};
|
|
401
446
|
declare const budget: (definition: Budget) => {
|
|
402
447
|
id: string;
|
|
403
448
|
scope: "member" | "project";
|
|
404
|
-
period: "
|
|
449
|
+
period: "lifetime" | "day" | "week";
|
|
405
450
|
limit: number;
|
|
406
451
|
cost: number | {
|
|
407
452
|
balance: string;
|
|
408
453
|
};
|
|
409
454
|
};
|
|
410
|
-
declare const keyed: (key: (ctx: {
|
|
411
|
-
member: {
|
|
412
|
-
id: string;
|
|
413
|
-
};
|
|
414
|
-
content?: AdmittedContent | null;
|
|
415
|
-
observation: Observation | null;
|
|
416
|
-
/** The pinned tracker observation of a tracker-triggered quest. */
|
|
417
|
-
tracker?: TrackerTriggerContext | null;
|
|
418
|
-
eligibleAt: number;
|
|
419
|
-
/** The attempt's evaluation time; see {@link EvaluationContext.now}. */
|
|
420
|
-
now: number;
|
|
421
|
-
}) => string) => {
|
|
455
|
+
declare const keyed: (key: (ctx: KeyedContext) => string) => {
|
|
422
456
|
kind: "keyed";
|
|
423
|
-
key: (ctx:
|
|
424
|
-
member: {
|
|
425
|
-
id: string;
|
|
426
|
-
};
|
|
427
|
-
content?: AdmittedContent | null;
|
|
428
|
-
observation: Observation | null;
|
|
429
|
-
/** The pinned tracker observation of a tracker-triggered quest. */
|
|
430
|
-
tracker?: TrackerTriggerContext | null;
|
|
431
|
-
eligibleAt: number;
|
|
432
|
-
/** The attempt's evaluation time; see {@link EvaluationContext.now}. */
|
|
433
|
-
now: number;
|
|
434
|
-
}) => string;
|
|
457
|
+
key: (ctx: KeyedContext) => string;
|
|
435
458
|
};
|
|
436
459
|
declare const completed: (quest: AuthoringIdentity | string) => {
|
|
437
460
|
quest: string;
|
|
@@ -521,21 +544,28 @@ declare const decision: {
|
|
|
521
544
|
};
|
|
522
545
|
review: typeof review;
|
|
523
546
|
};
|
|
547
|
+
/**
|
|
548
|
+
* What an evaluator reads. `G` is the quest's trigger: `tracker`, `content` and `observation` are
|
|
549
|
+
* non-null for the trigger that supplies them and null otherwise. `G` defaults to `any`, which
|
|
550
|
+
* leaves them nullable and lets a shared evaluator, such as `evaluators.photo()`, fit every quest.
|
|
551
|
+
*/
|
|
524
552
|
type EvaluationContext<T, I = {
|
|
525
553
|
photo: string;
|
|
526
|
-
}> = {
|
|
554
|
+
}, G = any> = {
|
|
527
555
|
settings: T;
|
|
528
556
|
member: {
|
|
529
557
|
id: string;
|
|
530
558
|
};
|
|
531
559
|
input: I;
|
|
532
|
-
content
|
|
533
|
-
|
|
560
|
+
/** The admitted post of a content quest. */
|
|
561
|
+
content: ContextContent<G>;
|
|
562
|
+
/** The observation of an observation-triggered quest. */
|
|
563
|
+
observation: ContextObservation<G>;
|
|
534
564
|
/**
|
|
535
565
|
* The tracker observation that admitted this attempt, and the member and verified account it
|
|
536
|
-
* was attributed to.
|
|
566
|
+
* was attributed to. Present for a tracker trigger, with `record.data` of the tracker's type.
|
|
537
567
|
*/
|
|
538
|
-
tracker:
|
|
568
|
+
tracker: ContextTracker<G>;
|
|
539
569
|
/**
|
|
540
570
|
* When the activity happened, in epoch milliseconds: the observation's or tracker record's
|
|
541
571
|
* occurrence time, else when the attempt was admitted. Budgets and daily keys use it.
|
|
@@ -582,7 +612,7 @@ type EvaluationContext<T, I = {
|
|
|
582
612
|
};
|
|
583
613
|
type Evaluator<T, I = {
|
|
584
614
|
photo: string;
|
|
585
|
-
}> = (ctx: EvaluationContext<T, I>) => Promise<Outcome>;
|
|
615
|
+
}, G = any> = (ctx: EvaluationContext<T, I, G>) => Promise<Outcome>;
|
|
586
616
|
declare const evaluators: {
|
|
587
617
|
quiz(answerKey: QuizEvidence["answers"], options?: {
|
|
588
618
|
minimumCorrect?: number;
|
|
@@ -606,7 +636,16 @@ type QuestInput<T extends Trigger> = T extends {
|
|
|
606
636
|
} ? TextEvidence : T extends {
|
|
607
637
|
input: "url";
|
|
608
638
|
} ? UrlEvidence : Record<string, never>;
|
|
609
|
-
|
|
639
|
+
/**
|
|
640
|
+
* Rejects a trigger whose filter compares with settings that are not integer settings of the
|
|
641
|
+
* quest, naming them.
|
|
642
|
+
*/
|
|
643
|
+
type IntegerSettingBounds<G, T> = [
|
|
644
|
+
Exclude<TriggerSettings<G>, IntegerSettings<T>>
|
|
645
|
+
] extends [never] ? unknown : {
|
|
646
|
+
readonly "The tracker filter compares with settings that are not integer settings of this quest": Exclude<TriggerSettings<G>, IntegerSettings<T>>;
|
|
647
|
+
};
|
|
648
|
+
declare function defineQuest<T extends Record<string, Setting>, const G extends Trigger, const M extends readonly [ContentMetric, ...ContentMetric[]] = readonly [
|
|
610
649
|
ContentMetric,
|
|
611
650
|
...ContentMetric[]
|
|
612
651
|
]>(definition: AuthoringIdentity & {
|
|
@@ -617,7 +656,7 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
617
656
|
presentation?: (ctx: {
|
|
618
657
|
settings: z.output<z.ZodObject<T>>;
|
|
619
658
|
}) => QuestPresentation;
|
|
620
|
-
trigger: G
|
|
659
|
+
trigger: G & NoInfer<IntegerSettingBounds<G, T>>;
|
|
621
660
|
integrations?: IntegrationProvider[];
|
|
622
661
|
requires?: ReturnType<typeof completed>[];
|
|
623
662
|
completion: ReturnType<typeof once> | ReturnType<typeof keyed> | StreakPolicy;
|
|
@@ -642,7 +681,7 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
642
681
|
rewards: Reward[] | ((ctx: {
|
|
643
682
|
settings: z.output<z.ZodObject<T>>;
|
|
644
683
|
}) => Reward[]);
|
|
645
|
-
evaluate?: Evaluator<z.output<z.ZodObject<T>>, QuestInput<G>>;
|
|
684
|
+
evaluate?: Evaluator<z.output<z.ZodObject<T>>, QuestInput<G>, NoInfer<G>>;
|
|
646
685
|
performance?: G extends {
|
|
647
686
|
content: unknown;
|
|
648
687
|
} ? {
|
|
@@ -701,12 +740,12 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
701
740
|
kind: "resource";
|
|
702
741
|
default: string;
|
|
703
742
|
source: {
|
|
743
|
+
provider: "domino";
|
|
744
|
+
resource: "point-ledger";
|
|
745
|
+
} | {
|
|
704
746
|
provider: "discord";
|
|
705
747
|
resource: "channel";
|
|
706
748
|
types: ("text" | "announcement")[];
|
|
707
|
-
} | {
|
|
708
|
-
provider: "domino";
|
|
709
|
-
resource: "point-ledger";
|
|
710
749
|
} | {
|
|
711
750
|
provider: "discord";
|
|
712
751
|
resource: "role";
|
|
@@ -803,9 +842,9 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
803
842
|
start: number;
|
|
804
843
|
end?: number | undefined;
|
|
805
844
|
};
|
|
806
|
-
enrollment: "
|
|
845
|
+
enrollment: "required" | "none";
|
|
807
846
|
posts: "after-enrollment" | "since-start";
|
|
808
|
-
historical: "
|
|
847
|
+
historical: "staff" | "automatic" | "claim";
|
|
809
848
|
} | undefined;
|
|
810
849
|
tracker?: {
|
|
811
850
|
tracker: string;
|
|
@@ -829,7 +868,24 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
829
868
|
} | {
|
|
830
869
|
path: string;
|
|
831
870
|
equals: string | number | boolean;
|
|
832
|
-
} |
|
|
871
|
+
} | ({
|
|
872
|
+
path: string;
|
|
873
|
+
gt?: number | {
|
|
874
|
+
setting: string;
|
|
875
|
+
} | undefined;
|
|
876
|
+
gte?: number | {
|
|
877
|
+
setting: string;
|
|
878
|
+
} | undefined;
|
|
879
|
+
lt?: number | {
|
|
880
|
+
setting: string;
|
|
881
|
+
} | undefined;
|
|
882
|
+
lte?: number | {
|
|
883
|
+
setting: string;
|
|
884
|
+
} | undefined;
|
|
885
|
+
} | {
|
|
886
|
+
path: string;
|
|
887
|
+
equals: string | number | boolean;
|
|
888
|
+
})[] | undefined;
|
|
833
889
|
} | undefined;
|
|
834
890
|
} | {
|
|
835
891
|
kind: "manual";
|
|
@@ -839,7 +895,7 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
839
895
|
minLength: number;
|
|
840
896
|
maxLength: number;
|
|
841
897
|
};
|
|
842
|
-
actor?: "
|
|
898
|
+
actor?: "staff" | "member" | undefined;
|
|
843
899
|
} | {
|
|
844
900
|
kind: "manual";
|
|
845
901
|
input: "url";
|
|
@@ -847,11 +903,11 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
847
903
|
required: boolean;
|
|
848
904
|
allowedHosts?: string[] | undefined;
|
|
849
905
|
};
|
|
850
|
-
actor?: "
|
|
906
|
+
actor?: "staff" | "member" | undefined;
|
|
851
907
|
} | {
|
|
852
908
|
kind: "manual";
|
|
853
|
-
input: "
|
|
854
|
-
actor?: "
|
|
909
|
+
input: "photo" | "quiz" | "none";
|
|
910
|
+
actor?: "staff" | "member" | undefined;
|
|
855
911
|
};
|
|
856
912
|
requires: {
|
|
857
913
|
quest: string;
|
|
@@ -869,7 +925,7 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
869
925
|
budgets: {
|
|
870
926
|
id: string;
|
|
871
927
|
scope: "member" | "project";
|
|
872
|
-
period: "
|
|
928
|
+
period: "lifetime" | "day" | "week";
|
|
873
929
|
limit: number;
|
|
874
930
|
cost: number | {
|
|
875
931
|
balance: string;
|
|
@@ -893,4 +949,4 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
893
949
|
* Console instances receive independent quest identities and pinned versions. */
|
|
894
950
|
declare const defineQuestType: typeof defineQuest;
|
|
895
951
|
|
|
896
|
-
export { type EvaluationContext, ImageReader, type PerformanceOutcome, TrackerReader, TrackerTriggerContext, type TrackerTriggerInput, WalletBalance, WalletBalanceQuery, XReader, automatic, budget, completed, content, customSource, decision, defineEngagementReward, defineLeaderboard, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, discordRole, evaluators, evidence, keyed, manual, once, perContent, pointLedgers, points, settings, staffHandover, streak, untracked, x };
|
|
952
|
+
export { type EvaluationContext, ImageReader, type KeyedContext, type PerformanceOutcome, Setting, Tracker, TrackerData, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, WalletBalance, WalletBalanceQuery, Where, XReader, automatic, budget, completed, content, customSource, decision, defineEngagementReward, defineLeaderboard, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, discordRole, evaluators, evidence, keyed, manual, once, perContent, pointLedgers, points, settings, staffHandover, streak, untracked, x };
|