@domino-sdk/relay 0.14.0 → 0.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/dist/authoring.d.ts +2 -2
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +4 -55
- package/dist/chunk-CQ5YSQQE.js +61 -0
- package/dist/index.d.ts +2 -2
- package/dist/portal-proxy.d.ts +26 -1
- package/dist/portal-proxy.js +43 -0
- package/dist/react/index.d.ts +3847 -0
- package/dist/react/index.js +833 -0
- package/dist/{settings-CU2y-wUM.d.ts → settings-e0nHA0JA.d.ts} +1 -1
- package/dist/vite.d.ts +32 -0
- package/dist/vite.js +42 -0
- package/package.json +22 -2
|
@@ -2765,4 +2765,4 @@ declare function parseSettings(fields: Record<string, SettingField>, input: unkn
|
|
|
2765
2765
|
declare function missingResourceSettings(fields: Record<string, SettingField>, values: SettingsValues): string[];
|
|
2766
2766
|
declare function compatibleSettingKinds(previous: SettingField, next: SettingField): boolean;
|
|
2767
2767
|
|
|
2768
|
-
export {
|
|
2768
|
+
export { discordMessageInputSchema as $, type AuthoringIdentity as A, type Budget as B, type TrackerPreview as C, type DiscordMember as D, type TrackerPreviewInput as E, type TrackerQuery as F, type TrackerRecord as G, type TrackerStatus as H, type IntegrationProvider as I, accountConnectionSchema as J, authProviderSchema as K, type LeaderboardQuery as L, budgetSchema as M, communityTimeZoneSchema as N, type Observation as O, type ProjectIntegration as P, type QuizContent as Q, type ReferralDefinition as R, type SolanaBalance as S, type TrackerReader as T, compatibleSettingKinds as U, completionKeySchema as V, type WalletConnection as W, type XTweet as X, completionPolicySchema as Y, discordMemberInputSchema as Z, discordMemberSchema as _, type DiscordMessage as a, trackerSummarySchema as a$, discordMessageSchema as a0, discordReactionSchema as a1, discordServerSchema as a2, integrationProviderSchema as a3, leaderboardArtifactSchema as a4, leaderboardAuthoringSchema as a5, leaderboardDefinitionSchema as a6, leaderboardExclusionSchema as a7, leaderboardGroupSchema as a8, leaderboardPageSchema as a9, referralHistorySchema as aA, referralManagementSchema as aB, referralRelationshipSchema as aC, resourceOptionsSchema as aD, resourceRequestSchema as aE, resourceSourceSchema as aF, settingFieldSchema as aG, settingsFieldsSchema as aH, settingsValuesSchema as aI, solanaAddressSchema as aJ, solanaBalanceSchema as aK, streakPolicySchema as aL, streakProgressSchema as aM, trackerArtifactSchema as aN, trackerControlSchema as aO, trackerDefinitionSchema as aP, trackerIngestResultSchema as aQ, trackerIngestSchema as aR, trackerPageSchema as aS, trackerPreviewInputSchema as aT, trackerPreviewLimits as aU, trackerPreviewSchema as aV, trackerQuerySchema as aW, trackerRecordInputSchema as aX, trackerRecordSchema as aY, trackerSourceSchema as aZ, trackerStatusSchema as a_, leaderboardPreviewSchema as aa, leaderboardQuerySchema as ab, leaderboardRowSchema as ac, leaderboardWindowSchema as ad, missingResourceSettings as ae, observationInputSchema as af, observationReceiptSchema as ag, observationSchema as ah, parseSettings as ai, pointsAccountSchema as aj, pointsEntrySchema as ak, pointsMutationSchema as al, pointsResultSchema as am, projectIntegrationSchema as an, publishedLeaderboardSchema as ao, publishedReferralSchema as ap, publishedTrackerSchema as aq, quizChoiceSchema as ar, quizContentSchema as as, quizQuestionSchema as at, quizQuestionsSchema as au, referralAccountSchema as av, referralArtifactSchema as aw, referralAuthoringSchema as ax, referralControlSchema as ay, referralDefinitionSchema as az, type StreakPolicy as b, walletChallengeSchema as b0, walletConnectionSchema as b1, xTweetSchema as b2, customSource as c, defineLeaderboard as d, defineReferral as e, defineTracker as f, discord as g, streak as h, walletProofSchema as i, type AuthProvider as j, type AccountConnection as k, referralSummarySchema as l, type LeaderboardPage as m, type LeaderboardDefinition as n, observationTriggerSchema as o, pointLedgers as p, type ResourceOption as q, referralAcceptSchema as r, settings as s, type ResourceSource as t, type SettingField as u, type SettingsValues as v, walletChallengeInputSchema as w, x, type StreakProgress as y, type TrackerDefinition as z };
|
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** The parts of Vite's plugin context this plugin uses. */
|
|
2
|
+
type ResolveContext = {
|
|
3
|
+
environment?: {
|
|
4
|
+
name: string;
|
|
5
|
+
};
|
|
6
|
+
resolve(source: string, importer: string | undefined, options: Record<string, unknown>): Promise<{
|
|
7
|
+
id: string;
|
|
8
|
+
} | null>;
|
|
9
|
+
error(message: string): never;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Fails the build when browser code imports server-only code: the management
|
|
13
|
+
* client (`@domino-sdk/relay-cli`), the participant proxy, or anything under
|
|
14
|
+
* the app's `server/` directory. Management credentials and app secrets live
|
|
15
|
+
* in the Worker; this keeps them from ever reaching a browser bundle.
|
|
16
|
+
*
|
|
17
|
+
* Type-only imports (`import type { Api } from "../server/api"`) are erased
|
|
18
|
+
* before bundling and stay allowed, so a typed API client keeps working.
|
|
19
|
+
*/
|
|
20
|
+
declare function serverBoundary(options?: {
|
|
21
|
+
server?: string;
|
|
22
|
+
clientEnvironment?: string;
|
|
23
|
+
}): {
|
|
24
|
+
name: string;
|
|
25
|
+
enforce: "pre";
|
|
26
|
+
configResolved(config: {
|
|
27
|
+
root: string;
|
|
28
|
+
}): void;
|
|
29
|
+
resolveId(this: ResolveContext, source: string, importer: string | undefined, resolveOptions: Record<string, unknown>): Promise<null>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { serverBoundary };
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// src/vite.ts
|
|
2
|
+
var SERVER_ONLY = [
|
|
3
|
+
/^@domino-sdk\/relay-cli(?:\/|$)/,
|
|
4
|
+
/^@domino-sdk\/relay\/portal-proxy$/
|
|
5
|
+
];
|
|
6
|
+
function serverBoundary(options = {}) {
|
|
7
|
+
let server = "";
|
|
8
|
+
return {
|
|
9
|
+
name: "domino:server-boundary",
|
|
10
|
+
enforce: "pre",
|
|
11
|
+
configResolved(config) {
|
|
12
|
+
server = `${config.root.replace(/\/+$/, "")}/${options.server ?? "server"}/`;
|
|
13
|
+
},
|
|
14
|
+
async resolveId(source, importer, resolveOptions) {
|
|
15
|
+
if (!importer || (this.environment?.name ?? "client") !== (options.clientEnvironment ?? "client")) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const importerPath = importer.split("?")[0];
|
|
19
|
+
if (importerPath.startsWith(server)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
if (SERVER_ONLY.some((pattern) => pattern.test(source))) {
|
|
23
|
+
this.error(
|
|
24
|
+
`${source} is server-only but ${importerPath} runs in the browser. Call it from a route in server/ instead.`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const resolved = await this.resolve(source, importer, {
|
|
28
|
+
...resolveOptions,
|
|
29
|
+
skipSelf: true
|
|
30
|
+
});
|
|
31
|
+
if (resolved?.id.split("?")[0].startsWith(server)) {
|
|
32
|
+
this.error(
|
|
33
|
+
`${importerPath} runs in the browser and imports ${source} from server/. Call the route over HTTP instead, or use \`import type\` for its types.`
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
serverBoundary
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domino-sdk/relay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,6 +23,14 @@
|
|
|
23
23
|
"types": "./dist/browser.d.ts",
|
|
24
24
|
"default": "./dist/browser.js"
|
|
25
25
|
},
|
|
26
|
+
"./react": {
|
|
27
|
+
"types": "./dist/react/index.d.ts",
|
|
28
|
+
"default": "./dist/react/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./vite": {
|
|
31
|
+
"types": "./dist/vite.d.ts",
|
|
32
|
+
"default": "./dist/vite.js"
|
|
33
|
+
},
|
|
26
34
|
"./portal-proxy": {
|
|
27
35
|
"types": "./dist/portal-proxy.d.ts",
|
|
28
36
|
"default": "./dist/portal-proxy.js"
|
|
@@ -32,6 +40,18 @@
|
|
|
32
40
|
"zod": "4.3.6",
|
|
33
41
|
"esbuild": "0.25.12"
|
|
34
42
|
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": ">=19"
|
|
45
|
+
},
|
|
46
|
+
"peerDependenciesMeta": {
|
|
47
|
+
"react": {
|
|
48
|
+
"optional": true
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/react": "19.3.0",
|
|
53
|
+
"react": "19.3.0"
|
|
54
|
+
},
|
|
35
55
|
"license": "UNLICENSED",
|
|
36
56
|
"repository": {
|
|
37
57
|
"type": "git",
|
|
@@ -52,6 +72,6 @@
|
|
|
52
72
|
"description": "SDK for authoring quests and integrating Domino Relay",
|
|
53
73
|
"scripts": {
|
|
54
74
|
"typecheck": "tsc --noEmit",
|
|
55
|
-
"build": "tsup src/index.ts src/schema.ts src/authoring.ts src/browser.ts src/portal-proxy.ts --format esm --dts --clean"
|
|
75
|
+
"build": "tsup src/index.ts src/schema.ts src/authoring.ts src/browser.ts src/portal-proxy.ts src/react/index.ts src/vite.ts --format esm --dts --clean"
|
|
56
76
|
}
|
|
57
77
|
}
|