@domino-sdk/relay 0.10.0 → 0.11.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/dist/authoring.d.ts +8 -4
- package/dist/authoring.js +7 -3
- package/dist/browser.d.ts +277 -53
- package/dist/browser.js +4 -4
- package/dist/chunk-3UOTI4IU.js +904 -0
- package/dist/{chunk-Q5VDZVVO.js → chunk-CE5XVIJQ.js} +1 -1
- package/dist/{chunk-ATLYA27Y.js → chunk-ONDPW77O.js} +3 -3
- package/dist/{chunk-MVDE7WKB.js → chunk-VDWQL6HV.js} +1 -1
- package/dist/index.d.ts +521 -105
- package/dist/index.js +12 -4
- package/dist/portal-proxy.js +2 -2
- package/dist/schema.d.ts +71 -8
- package/dist/schema.js +1 -1
- package/dist/{settings-BA8XjT4m.d.ts → settings-B61jIDDA.d.ts} +49 -4
- package/package.json +1 -1
- package/dist/chunk-XTFCKK2Y.js +0 -863
package/dist/authoring.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Observation, D as DiscordMember, a as DiscordMessage, W as WalletConnection, S as SolanaBalance, o as observationTriggerSchema, B as Budget, A as AuthoringIdentity, I as IntegrationProvider } from './settings-
|
|
2
|
-
export { d as defineLeaderboard,
|
|
1
|
+
import { O as Observation, D as DiscordMember, a as DiscordMessage, W as WalletConnection, S as SolanaBalance, o as observationTriggerSchema, B as Budget, A as AuthoringIdentity, I as IntegrationProvider, b as StreakPolicy } from './settings-B61jIDDA.js';
|
|
2
|
+
export { d as defineLeaderboard, c as defineReferral, e as discord, p as pointLedgers, s as settings, f as streak } from './settings-B61jIDDA.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { PhotoResult, rewardSchema, triggerSchema, QuestPresentation, QuizEvidence, Decision, TieredRewardDefinition } from './schema.js';
|
|
5
5
|
|
|
@@ -188,7 +188,7 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
188
188
|
trigger: G;
|
|
189
189
|
integrations?: IntegrationProvider[];
|
|
190
190
|
requires?: ReturnType<typeof completed>[];
|
|
191
|
-
completion: ReturnType<typeof once> | ReturnType<typeof keyed
|
|
191
|
+
completion: ReturnType<typeof once> | ReturnType<typeof keyed> | StreakPolicy;
|
|
192
192
|
visibility?: "visible" | "hidden";
|
|
193
193
|
budgets?: Budget[];
|
|
194
194
|
review?: (ctx: {
|
|
@@ -336,7 +336,7 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
336
336
|
trigger: {
|
|
337
337
|
kind: "manual";
|
|
338
338
|
input: "photo" | "quiz" | "none";
|
|
339
|
-
actor?: "
|
|
339
|
+
actor?: "member" | "staff" | undefined;
|
|
340
340
|
} | {
|
|
341
341
|
kind: "automatic";
|
|
342
342
|
observation?: {
|
|
@@ -349,6 +349,10 @@ declare function defineQuest<T extends Record<string, z.ZodType>, const G extend
|
|
|
349
349
|
scope: "ever";
|
|
350
350
|
}[];
|
|
351
351
|
completion: {
|
|
352
|
+
kind: "streak";
|
|
353
|
+
days: number;
|
|
354
|
+
timeZone: string;
|
|
355
|
+
} | {
|
|
352
356
|
kind: "once";
|
|
353
357
|
} | {
|
|
354
358
|
kind: "keyed";
|
package/dist/authoring.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
authoringKey,
|
|
3
3
|
defineLeaderboard,
|
|
4
4
|
defineReferral
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CE5XVIJQ.js";
|
|
6
6
|
import {
|
|
7
7
|
budgetSchema,
|
|
8
8
|
decisionSchema,
|
|
@@ -16,9 +16,10 @@ import {
|
|
|
16
16
|
rewardBundleSchema,
|
|
17
17
|
settingFieldSchema,
|
|
18
18
|
settings,
|
|
19
|
+
streak,
|
|
19
20
|
tierRewardSchema,
|
|
20
21
|
tieredRewardDefinitionSchema
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-3UOTI4IU.js";
|
|
22
23
|
|
|
23
24
|
// src/authoring.ts
|
|
24
25
|
import { z } from "zod";
|
|
@@ -106,6 +107,8 @@ var evaluators = {
|
|
|
106
107
|
};
|
|
107
108
|
function defineQuest(definition) {
|
|
108
109
|
const key = authoringKey(definition);
|
|
110
|
+
if (definition.completion.kind === "streak" && (definition.trigger.kind !== "automatic" || !definition.trigger.observation))
|
|
111
|
+
throw new Error("Streaks require an automatic observation trigger");
|
|
109
112
|
if (definition.trigger.kind === "manual" && definition.trigger.input !== "none" && !definition.evaluate)
|
|
110
113
|
throw new Error("Evidence quests require an evaluator");
|
|
111
114
|
const fields = Object.fromEntries(
|
|
@@ -141,7 +144,7 @@ function defineQuest(definition) {
|
|
|
141
144
|
)
|
|
142
145
|
])
|
|
143
146
|
],
|
|
144
|
-
completion: { kind: definition.completion.kind },
|
|
147
|
+
completion: definition.completion.kind === "streak" ? definition.completion : { kind: definition.completion.kind },
|
|
145
148
|
visibility: definition.visibility ?? "visible",
|
|
146
149
|
budgets: definition.budgets ?? [],
|
|
147
150
|
requires: definition.requires ?? []
|
|
@@ -199,5 +202,6 @@ export {
|
|
|
199
202
|
points,
|
|
200
203
|
settings,
|
|
201
204
|
staffHandover,
|
|
205
|
+
streak,
|
|
202
206
|
untracked
|
|
203
207
|
};
|