@domino-sdk/relay 0.4.0 → 0.6.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/index.js CHANGED
@@ -35,6 +35,9 @@ import {
35
35
  questTypeVersionSchema,
36
36
  questViewSchema,
37
37
  reconcileQuestDraft,
38
+ resourceId,
39
+ rewardDeliveriesSchema,
40
+ rewardDeliverySchema,
38
41
  saveQuestDraftSchema,
39
42
  solanaAddressSchema,
40
43
  solanaBalanceSchema,
@@ -42,7 +45,7 @@ import {
42
45
  walletChallengeSchema,
43
46
  walletConnectionSchema,
44
47
  walletProofSchema
45
- } from "./chunk-KQVL6MOH.js";
48
+ } from "./chunk-CCLIDCUU.js";
46
49
  import {
47
50
  defineLeaderboard,
48
51
  defineReferral,
@@ -70,14 +73,14 @@ import {
70
73
  referralManagementSchema,
71
74
  referralRelationshipSchema,
72
75
  referralSummarySchema
73
- } from "./chunk-TXL43HL3.js";
76
+ } from "./chunk-UIC6OF3C.js";
74
77
  import {
75
78
  authScopeSchema,
76
79
  exchangeResultSchema,
77
80
  exchangeSchema,
78
81
  principalSchema,
79
82
  sessionSchema
80
- } from "./chunk-QWRSUSNB.js";
83
+ } from "./chunk-PLO5PPLU.js";
81
84
  import {
82
85
  accountConnectionSchema,
83
86
  artifactSchema,
@@ -85,12 +88,20 @@ import {
85
88
  authProviderSchema,
86
89
  batchReleaseSchema,
87
90
  beginHandoverSchema,
91
+ budgetSchema,
92
+ compatibleSettingKinds,
93
+ completionKeySchema,
94
+ completionPolicySchema,
88
95
  completionRecordSchema,
89
96
  configurePickupSchema,
90
97
  confirmHandoverSchema,
91
98
  decisionSchema,
99
+ discord,
92
100
  discordMemberInputSchema,
93
101
  discordMemberSchema,
102
+ discordMessageInputSchema,
103
+ discordMessageSchema,
104
+ discordReactionSchema,
94
105
  discordServerSchema,
95
106
  entitlementSchema,
96
107
  errorSchema,
@@ -98,10 +109,16 @@ import {
98
109
  evidenceSchema,
99
110
  identifier,
100
111
  integrationProviderSchema,
112
+ integrationRewardSchema,
101
113
  mediaUrlSchema,
102
114
  memberListSchema,
103
115
  memberPageSchema,
104
116
  memberProgressSchema,
117
+ missingResourceSettings,
118
+ observationInputSchema,
119
+ observationReceiptSchema,
120
+ observationSchema,
121
+ observationTriggerSchema,
105
122
  parseSettings,
106
123
  photoResultSchema,
107
124
  pickupAllocationSchema,
@@ -125,6 +142,9 @@ import {
125
142
  quizQuestionsSchema,
126
143
  releaseSchema,
127
144
  reservationSchema,
145
+ resourceOptionsSchema,
146
+ resourceRequestSchema,
147
+ resourceSourceSchema,
128
148
  reviewItemSchema,
129
149
  reviewListSchema,
130
150
  reviewModeSchema,
@@ -144,7 +164,7 @@ import {
144
164
  tierRewardSchema,
145
165
  tieredRewardDefinitionSchema,
146
166
  triggerSchema
147
- } from "./chunk-3IQ4KUKF.js";
167
+ } from "./chunk-MXK7KEDA.js";
148
168
  export {
149
169
  QuestUpdatedError,
150
170
  RelayError,
@@ -155,6 +175,7 @@ export {
155
175
  authScopeSchema,
156
176
  batchReleaseSchema,
157
177
  beginHandoverSchema,
178
+ budgetSchema,
158
179
  catalogDeploymentPreviewSchema,
159
180
  catalogDeploymentSchema,
160
181
  collectionBeginSchema,
@@ -164,6 +185,9 @@ export {
164
185
  collectionResolveSchema,
165
186
  collectionSlotSchema,
166
187
  collectionViewSchema,
188
+ compatibleSettingKinds,
189
+ completionKeySchema,
190
+ completionPolicySchema,
167
191
  completionRecordSchema,
168
192
  configurePickupSchema,
169
193
  confirmHandoverSchema,
@@ -173,8 +197,12 @@ export {
173
197
  defineReferral,
174
198
  deploymentPreviewSchema,
175
199
  deploymentResultSchema,
200
+ discord,
176
201
  discordMemberInputSchema,
177
202
  discordMemberSchema,
203
+ discordMessageInputSchema,
204
+ discordMessageSchema,
205
+ discordReactionSchema,
178
206
  discordServerSchema,
179
207
  entitlementSchema,
180
208
  errorSchema,
@@ -187,6 +215,7 @@ export {
187
215
  identityIntegrationSchema,
188
216
  identityIntegrationSecretSchema,
189
217
  integrationProviderSchema,
218
+ integrationRewardSchema,
190
219
  interactionSchema,
191
220
  leaderboardArtifactSchema,
192
221
  leaderboardDefinitionSchema,
@@ -201,6 +230,11 @@ export {
201
230
  memberListSchema,
202
231
  memberPageSchema,
203
232
  memberProgressSchema,
233
+ missingResourceSettings,
234
+ observationInputSchema,
235
+ observationReceiptSchema,
236
+ observationSchema,
237
+ observationTriggerSchema,
204
238
  parseSettings,
205
239
  participantExchangeSchema,
206
240
  photoResultSchema,
@@ -258,11 +292,17 @@ export {
258
292
  referralSummarySchema,
259
293
  releaseSchema,
260
294
  reservationSchema,
295
+ resourceId,
296
+ resourceOptionsSchema,
297
+ resourceRequestSchema,
298
+ resourceSourceSchema,
261
299
  reviewItemSchema,
262
300
  reviewListSchema,
263
301
  reviewModeSchema,
264
302
  reviewPageSchema,
265
303
  rewardBundleSchema,
304
+ rewardDeliveriesSchema,
305
+ rewardDeliverySchema,
266
306
  rewardKey,
267
307
  rewardSchema,
268
308
  saveQuestDraftSchema,
@@ -2,11 +2,13 @@
2
2
  * Server-only proxy: browser cookies stay on the participant origin.
3
3
  * Point upstream at a participant deployment with trusted server scope configured.
4
4
  * Browser Authorization and organization/project/environment selectors are discarded.
5
- * This does not provide backend identity exchange or configure upstream scope.
5
+ * Set hosted: true for the shared API to resolve a registered preview/staging origin.
6
+ * This does not provide backend identity exchange.
6
7
  */
7
8
  declare function proxyParticipant(request: Request, upstream: {
8
9
  baseUrl: string;
9
10
  fetch: typeof fetch;
11
+ hosted?: boolean;
10
12
  }): Promise<Response>;
11
13
  /** Use only in an app server route. authenticate must verify the app's own session. */
12
14
  declare function createParticipantBackend(options: {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  exchangeResultSchema
3
- } from "./chunk-QWRSUSNB.js";
4
- import "./chunk-3IQ4KUKF.js";
3
+ } from "./chunk-PLO5PPLU.js";
4
+ import "./chunk-MXK7KEDA.js";
5
5
 
6
6
  // src/portal-proxy.ts
7
7
  async function proxyParticipant(request, upstream) {
@@ -11,7 +11,7 @@ async function proxyParticipant(request, upstream) {
11
11
  path
12
12
  ) || /^\/v1\/me\/(progress|experience|attempts|evidence|pass|collection-pass|wallet(?:\/challenge|\/verify)?)$/.test(
13
13
  path
14
- ) || /^\/v1\/attempts\/[\w-]+(?:\/retry)?$/.test(path) || /^\/v1\/referrals(?:\/(me|history))?$/.test(path) && request.method === "GET" || path === "/v1/referrals/accept" && request.method === "POST" || request.method === "GET" && /^\/v1\/leaderboards(?:\/[\w-]+)?$/.test(path));
14
+ ) || /^\/v1\/attempts\/[\w-]+(?:\/retry)?$/.test(path) || /^\/v1\/referrals(?:\/(me|history))?$/.test(path) && request.method === "GET" || path === "/v1/reward-deliveries" && request.method === "GET" || path === "/v1/referrals/accept" && request.method === "POST" || request.method === "GET" && /^\/v1\/leaderboards(?:\/[\w-]+)?$/.test(path));
15
15
  if (!allowed || !["GET", "POST"].includes(request.method))
16
16
  return Response.json({ error: "Route not found" }, { status: 404 });
17
17
  const target = new URL(upstream.baseUrl);
@@ -35,7 +35,9 @@ async function proxyParticipant(request, upstream) {
35
35
  const value = request.headers.get(name);
36
36
  if (value) headers.set(name, value);
37
37
  }
38
- const response = await upstream.fetch(target, {
38
+ if (upstream.hosted) headers.set("X-Relay-App-Origin", incoming.origin);
39
+ const send = upstream.fetch;
40
+ const response = await send(target, {
39
41
  method: request.method,
40
42
  headers,
41
43
  body: request.method === "GET" ? void 0 : await request.arrayBuffer(),